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//EN"><META http-
equiv="Content-Type" content="text/html; charset=windows-1252">
<HTML><HEAD><FORM 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 [email protected]
Before posting, please read the following guidelines:
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/watir-general