Re: [wtr-general] Access to dojopopupmenu2

2010-03-09 Thread Željko Filipin
On Mon, Mar 8, 2010 at 9:56 PM, barb bfwork2h...@yahoo.com wrote:
 4. Right click and select Save

My guess would be that you have to fire a javascript event. Something like
this:

browser(how, what).fire_event(onrightclick)

Ask a developer which event should be fired. Event Spy Firefox add-on could
help too:

https://addons.mozilla.org/en-US/firefox/addon/1100

Željko
--
watir.com - community manager
pledgie.com/campaigns/2982 - donate to Watir
watirpodcast.com - host
testingpodcast.com - audio podcasts on software testing. all of them

-- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


Re: [wtr-general] Access to dojopopupmenu2

2010-03-09 Thread Rajiv Nanduani
try to use

browser.TD(:xpath,//d...@dojomenuitem2label='Save']).click



On Tue, Mar 9, 2010 at 2:26 AM, barb bfwork2h...@yahoo.com wrote:

 Hi,
  I will start by saying I am very new to this concept of Watir and
 Ruby.  I am attempting to write a beginning test script to do the
 following:
 1. Login to the web application
 2. Navigate to the new project page
 3. Enter the required data
 4. Right click and select Save

 It is the the 4th step that is kicking me around. The issue I believe
 is the application is using a dojo menu within a table within a
 frame.  I have included the script thus far and the components to the
 item.

 I did try the element_by_xpath solution I found here but received the
 following in my irb session
  ).form(:id, 'ipbObject').text_field(:name,
 'value(name)').set('webmet test')
 = 
 ement_by_xpath(//d...@dojomenuitem2label='Save']).click
 NoMethodError: undefined method `click' for nil:NilClass
  from (irb):23
from C:/Ruby19/bin/irb:12:in `main'

 The maddening part is I can see what I want to access in the IE
 Developer toolbar..I just do not know how. I am sure it is rather
 simple but I am not seeing the solution.

 Also thanks for maintaining a group on this topic.

 Thanks in Advance.
 Barb

 Here is the script thus far it all works.

 require 'watir'
 browser = Watir::Browser.start  http://##.##.#.##/foo/;
 browser.text_field(:name, j_username).set(name1)
 browser.text_field(:name, j_password).set(Pwd!)
 browser.button(:value,Sign-In).click

 Watir::Waiter::wait_until {browser.div(:text, Produce).exists? }

 #click on the Produce blue bar
 browser.div(:text, Produce).click

 #Click on New to expose the choices
 browser.div(:text,New).click

 #Click on Project to get the new project
 browser.link(:text,Project).click

 #Enter the required data
 browser.frame(:name, foobIFrame).form(:id,
 'ipbObject').text_field(:name, 'value(name)').set('webmet test')

 #right click and select save
 browser.element_by_xpath(//d...@dojomenuitem2label='Save']).click


 The last line above is what generate the error posted above.


 Here is the Element source from within the IE Developer tool

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML Strict//ENMETA http-
 equiv=Content-Type content=text/html; charset=windows-1252
 HTMLHEADFORM id=ipbObject action=/ipb/IpbItemAction.do
 method=post
 BODY class=turbo-ie style=CURSOR: default __doClobber__
 TABLE class=dojoPopupMenu2 style=Z-INDEX: 1001; LEFT: 280px; TOP:
 145px cellSpacing=0 cellPadding=0 border=0
 TBODY dojoAttachPoint=containerNode
 TR class=dojoMenuItem2  __doClobber__ dojoAttachEvent=onMouseOver:
 onHover; onMouseOut: onUnhover; onClick: _onClick; onKey:onKey;
 unselectable=on dojoinsertionindex=1
 TD class=dojoMenuItem2Label Save /TD
 /TR/TBODY/TABLE/BODY/FORM/HEAD/HTML

 --
 You received this message because you are subscribed to the Google Groups
 Watir General group.
 To post to this group, send email to watir-general@googlegroups.com
 Before posting, please read the following guidelines:
 http://wiki.openqa.org/display/WTR/Support
 To unsubscribe from this group, send email to
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/watir-general




-- 
RAJIV KUMAR

http://rajivkumarnandvani.wordpress.com/
http://learnqtphelp.blogspot.com/

-- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Access to dojopopupmenu2

2010-03-08 Thread barb
Hi,
 I will start by saying I am very new to this concept of Watir and
Ruby.  I am attempting to write a beginning test script to do the
following:
1. Login to the web application
2. Navigate to the new project page
3. Enter the required data
4. Right click and select Save

It is the the 4th step that is kicking me around. The issue I believe
is the application is using a dojo menu within a table within a
frame.  I have included the script thus far and the components to the
item.

I did try the element_by_xpath solution I found here but received the
following in my irb session
 ).form(:id, 'ipbObject').text_field(:name,
'value(name)').set('webmet test')
= 
ement_by_xpath(//d...@dojomenuitem2label='Save']).click
NoMethodError: undefined method `click' for nil:NilClass
  from (irb):23
from C:/Ruby19/bin/irb:12:in `main'

The maddening part is I can see what I want to access in the IE
Developer toolbar..I just do not know how. I am sure it is rather
simple but I am not seeing the solution.

Also thanks for maintaining a group on this topic.

Thanks in Advance.
Barb

Here is the script thus far it all works.

require 'watir'
browser = Watir::Browser.start  http://##.##.#.##/foo/;
browser.text_field(:name, j_username).set(name1)
browser.text_field(:name, j_password).set(Pwd!)
browser.button(:value,Sign-In).click

Watir::Waiter::wait_until {browser.div(:text, Produce).exists? }

#click on the Produce blue bar
browser.div(:text, Produce).click

#Click on New to expose the choices
browser.div(:text,New).click

#Click on Project to get the new project
browser.link(:text,Project).click

#Enter the required data
browser.frame(:name, foobIFrame).form(:id,
'ipbObject').text_field(:name, 'value(name)').set('webmet test')

#right click and select save
browser.element_by_xpath(//d...@dojomenuitem2label='Save']).click


The last line above is what generate the error posted above.


Here is the Element source from within the IE Developer tool

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML Strict//ENMETA http-
equiv=Content-Type content=text/html; charset=windows-1252
HTMLHEADFORM id=ipbObject action=/ipb/IpbItemAction.do
method=post
BODY class=turbo-ie style=CURSOR: default __doClobber__
TABLE class=dojoPopupMenu2 style=Z-INDEX: 1001; LEFT: 280px; TOP:
145px cellSpacing=0 cellPadding=0 border=0
TBODY dojoAttachPoint=containerNode
TR class=dojoMenuItem2  __doClobber__ dojoAttachEvent=onMouseOver:
onHover; onMouseOut: onUnhover; onClick: _onClick; onKey:onKey;
unselectable=on dojoinsertionindex=1
TD class=dojoMenuItem2Label Save /TD
/TR/TBODY/TABLE/BODY/FORM/HEAD/HTML

-- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


Re: [wtr-general] Access to dojopopupmenu2

2010-03-08 Thread Wesley Chen
For the HTML you provide, we can't do anything.

Do you want a right click? Why?
element_by_xpath is not a good method to locate an element.

Wesley.
For life, the easier, the better.


On Tue, Mar 9, 2010 at 4:56 AM, barb bfwork2h...@yahoo.com wrote:

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML Strict//ENMETA http-
 equiv=Content-Type content=text/html; charset=windows-1252
 HTMLHEADFORM id=ipbObject action=/ipb/IpbItemAction.do
 method=post
 BODY class=turbo-ie style=CURSOR: default __doClobber__
 TABLE class=dojoPopupMenu2 style=Z-INDEX: 1001; LEFT: 280px; TOP:
 145px cellSpacing=0 cellPadding=0 border=0
 TBODY dojoAttachPoint=containerNode
 TR class=dojoMenuItem2  __doClobber__ dojoAttachEvent=onMouseOver:
 onHover; onMouseOut: onUnhover; onClick: _onClick; onKey:onKey;
 unselectable=on dojoinsertionindex=1
 TD class=dojoMenuItem2Label Save /TD
 /TR/TBODY/TABLE/BODY/FORM/HEAD/HTML


-- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general