[wtr-general] Re: How to select heading[s]

2014-10-20 Thread c w
This is the err I get

C:\workruby tmp.rb
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.9/lib/watir-webdriver/locators/element_locator.rb:242:in
`assert_valid_as_attribute':
 invalid attribute: :name
(Watir::Exception::MissingWayOfFindingObjectException)
from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.9/lib/watir-webdriver/locators/element_locator.rb:223:in
`normalize_sele
ctor'
from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.9/lib/watir-webdriver/locators/element_locator.rb:202:in
`block in norma
lized_selector'

On Mon, Oct 20, 2014 at 3:13 PM, c w cristina.wa...@gmail.com wrote:

 Hi,

 please can one advise me on what I am doing wrong.

 I try to click on any header elements[I want to select one for instance].
 I have asked the dev to add for me name= “header2” for instance for span

 But it looks like it doesn’t work. Can we click spans using the name?

 This is a screen snapshot:


 https://s3.amazonaws.com/uploads.hipchat.com/54839/774688/efrYkROYGYSqfk6/upload.png

 This is the quick source code:

 require 'watir-webdriver'
 b = Watir::Browser.new

 b.goto 
 http://dev-next-app01.vfmltech.com/cube/dms-angular/src/public/vizlly/#/components
 
 sleep 1
 d = b.driver
 d.switch_to.frame uiTinymce0_ifr

 d.switch_to.active_element.send_keys [:control, a], :backspace
 d.switch_to.active_element.click
 d.switch_to.active_element.send_keys(Hello Testing RTE is
 fun.!)
 sleep 6

 #-
 # click editor's 'bullist' button
 d.switch_to.active_element.send_keys [:control, a]
 b.button(:name = 'format').click
 sleep 6


 b.span(:name = 'header2').click

 I have try using index as well.


 #b.span(:index , 2).click


-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How to select heading[s]

2014-10-20 Thread c w
Using the xpath works:

b.element(:xpath =
//div[@id='mceu_41']/div[@id='mceu_41-body']/div[@id='mceu_43']/span[@name='header2']).click


but I don't want to use the xpath.


On Mon, Oct 20, 2014 at 3:13 PM, c w cristina.wa...@gmail.com wrote:

 Hi,

 please can one advise me on what I am doing wrong.

 I try to click on any header elements[I want to select one for instance].
 I have asked the dev to add for me name= “header2” for instance for span

 But it looks like it doesn’t work. Can we click spans using the name?

 This is a screen snapshot:


 https://s3.amazonaws.com/uploads.hipchat.com/54839/774688/efrYkROYGYSqfk6/upload.png

 This is the quick source code:

 require 'watir-webdriver'
 b = Watir::Browser.new

 b.goto 
 http://dev-next-app01.vfmltech.com/cube/dms-angular/src/public/vizlly/#/components
 
 sleep 1
 d = b.driver
 d.switch_to.frame uiTinymce0_ifr

 d.switch_to.active_element.send_keys [:control, a], :backspace
 d.switch_to.active_element.click
 d.switch_to.active_element.send_keys(Hello Testing RTE is
 fun.!)
 sleep 6

 #-
 # click editor's 'bullist' button
 d.switch_to.active_element.send_keys [:control, a]
 b.button(:name = 'format').click
 sleep 6


 b.span(:name = 'header2').click

 I have try using index as well.


 #b.span(:index , 2).click


-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: How to select heading[s]

2014-10-20 Thread Derek W
What is the reason you don't want to use xpath?  If it's just because of
the length/cryptic names used, is it possible that this would work for the
xpath:
//span[@name='header2']

If not, what about the text or other properties within that span?  Can you
take a screenshot of the span node expanded?

On Mon, Oct 20, 2014 at 1:06 PM, c w cristina.wa...@gmail.com wrote:

 Using the xpath works:

 b.element(:xpath =
 //div[@id='mceu_41']/div[@id='mceu_41-body']/div[@id='mceu_43']/span[@name='header2']).click


 but I don't want to use the xpath.


 On Mon, Oct 20, 2014 at 3:13 PM, c w cristina.wa...@gmail.com wrote:

 Hi,

 please can one advise me on what I am doing wrong.

 I try to click on any header elements[I want to select one for instance].
 I have asked the dev to add for me name= “header2” for instance for span

 But it looks like it doesn’t work. Can we click spans using the name?

 This is a screen snapshot:


 https://s3.amazonaws.com/uploads.hipchat.com/54839/774688/efrYkROYGYSqfk6/upload.png

 This is the quick source code:

 require 'watir-webdriver'
 b = Watir::Browser.new

 b.goto 
 http://dev-next-app01.vfmltech.com/cube/dms-angular/src/public/vizlly/#/components
 
 sleep 1
 d = b.driver
 d.switch_to.frame uiTinymce0_ifr

 d.switch_to.active_element.send_keys [:control, a], :backspace
 d.switch_to.active_element.click
 d.switch_to.active_element.send_keys(Hello Testing RTE is
 fun.!)
 sleep 6

 #-
 # click editor's 'bullist' button
 d.switch_to.active_element.send_keys [:control, a]
 b.button(:name = 'format').click
 sleep 6


 b.span(:name = 'header2').click

 I have try using index as well.


 #b.span(:index , 2).click


  --
 --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com

 ---
 You received this message because you are subscribed to the Google Groups
 Watir General group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to watir-general+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
Derek Wrobel
425-243-3355

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: How to select heading[s]

2014-10-20 Thread c w
Hi Derek!
Thank you so much. This works just run it:

b.element(:xpath = //span[@name='header2']).click

I just thought that maybe a simple way and not to use the entire full path.




div id=mceu_41 class=mce-container mce-panel mce-floatpanel mce-menu
mce-menu-align role=application tabindex=-1 hidefocus=1
style=border-width: 1px; z-index: 65535; left: 33px; top: 206.433px;
width: 1391px; display: none;

div id=mceu_41-body class=mce-container-body mce-stack-layout
role=menu style=width: 1391px;
div id=mceu_42 class=mce-menu-item mce-menu-item-normal
mce-first mce-stack-layout-item tabindex=-1 role=menuitem
aria-checked=false aria-pressed=false/div
div id=mceu_43 class=mce-menu-item mce-menu-item-normal
mce-stack-layout-item mce-active tabindex=-1 role=menuitem
aria-checked=true aria-pressed=true
i class=mce-ico mce-i-none/i
span id=mceu_43-text class=mce-text
style=font-family:serif;font-size:24px;font-weight:700;font-style:…ransparent;border:;border-radius:;outline:;text-shadow:none;
name=header2

Header 2

/span
/div
div id=mceu_44 class=mce-menu-item mce-menu-item-normal
mce-stack-layout-item tabindex=-1 role=menuitem aria-checked=false
aria-pressed=false/div
div id=mceu_45 class=mce-menu-item mce-menu-item-normal
mce-stack-layout-item tabindex=-1 role=menuitem aria-checked=false
aria-pressed=false/div
div id=mceu_46 class=mce-menu-item mce-menu-item-normal
mce-stack-layout-item tabindex=-1 role=menuitem aria-checked=false
aria-pressed=false/div





On Mon, Oct 20, 2014 at 4:18 PM, Derek W derekwro...@gmail.com wrote:

 What is the reason you don't want to use xpath?  If it's just because of
 the length/cryptic names used, is it possible that this would work for the
 xpath:
 //span[@name='header2']

 If not, what about the text or other properties within that span?  Can you
 take a screenshot of the span node expanded?

 On Mon, Oct 20, 2014 at 1:06 PM, c w cristina.wa...@gmail.com wrote:

 Using the xpath works:

 b.element(:xpath =
 //div[@id='mceu_41']/div[@id='mceu_41-body']/div[@id='mceu_43']/span[@name='header2']).click


 but I don't want to use the xpath.


 On Mon, Oct 20, 2014 at 3:13 PM, c w cristina.wa...@gmail.com wrote:

 Hi,

 please can one advise me on what I am doing wrong.

 I try to click on any header elements[I want to select one for
 instance]. I have asked the dev to add for me name= “header2” for instance
 for span

 But it looks like it doesn’t work. Can we click spans using the name?

 This is a screen snapshot:


 https://s3.amazonaws.com/uploads.hipchat.com/54839/774688/efrYkROYGYSqfk6/upload.png

 This is the quick source code:

 require 'watir-webdriver'
 b = Watir::Browser.new

 b.goto 
 http://dev-next-app01.vfmltech.com/cube/dms-angular/src/public/vizlly/#/components
 
 sleep 1
 d = b.driver
 d.switch_to.frame uiTinymce0_ifr

 d.switch_to.active_element.send_keys [:control, a], :backspace
 d.switch_to.active_element.click
 d.switch_to.active_element.send_keys(Hello Testing RTE is
 fun.!)
 sleep 6

 #-
 # click editor's 'bullist' button
 d.switch_to.active_element.send_keys [:control, a]
 b.button(:name = 'format').click
 sleep 6


 b.span(:name = 'header2').click

 I have try using index as well.


 #b.span(:index , 2).click


  --
 --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com

 ---
 You received this message because you are subscribed to the Google Groups
 Watir General group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to watir-general+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




 --
 Derek Wrobel
 425-243-3355

 --
 --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.com

 ---
 You received this message because you are subscribed to the Google Groups
 Watir General group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to watir-general+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit