The code below can help you locate on the new window.
def new_window
# get a handle if one exists
aa = Win32API.new(user32, GetForegroundWindow,[] , 'L')
hwnd = aa.call
if (hwnd) # yes there is a popup
return Watir::IE.attach(:hwnd, hwnd)
else
About the dialog-pop up, the code from Watir.com is easy and well enough to
deal with most of the issues.
In our project, if we can avoid the popup by our extra code, we'd better
avoid it, watir code is not steady enough to deal with it.
Watir::Waiter.wait_until is not good enough to deal with the
Hi Wesley,
Very many thanks for the prompt reply.
However, on adding the same code, following error is displayed:
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1202:in `attach_browser_window':
ArgumentError (ArgumentError)
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1186:in `each'
from
We are happy to announce that the first version of ChromeWatir has
been released today. The API follows a similar convention to Watir for
Google Chrome browser. Please visit the ChromeWatir Google code
website for more details
http://code.google.com/p/chrome-watir
We are in the process of making
You said:
The HTML code for the button does not have any href or any other information
that can be used for the pupose of grabbing the new browser window.
May we have a try? I think anything can be grab.
if(ie2=new_window)
ie2
end
In fact, ie2 is the new window, then you can practice in the
Hi Tiffany, thanks for the ideas!!
The first two I have tried, both with and without specifying the div.
In both cases, I can flash it, but when i tell it to click it, i get
back an error code, different everytime. As an example
irb(main):006:0 $ie.frame($mf).div(:id, ext-gen13).link(:text,
This is what the IE developer toolbar shows me.
- HTML
+ HEAD
- FRAMESET
+ FRAME
- FRAME
- #document
- HTML
+ HEAD
- BODY class = ext-ie ext-ie7 ext-border-box id=ext-
gen16
+ FORM
Gem,
for 1. try
my_value = $ie.frame(:index, 3).frame(:index, 3).form(:name,
'configSnmpAccess').text_field(:name, 'accessIpAddress?3').value
- now your value is stored in my_value variable
for 2. try
if ( my_value.text == What you want to comapare it with) then
do something.
btw. to
Hi,
I am using Firewatir with rspec framework. I just need to click on a
simple AJ popup window's OK button. I have done enough search but I
could not find anything that wouls work for me. I have tried this code
$ff.startClicker(ok, 1, '', Press a button)
$ff.clickJavaScriptDialog(OK)
In this
anyone have any idea why this isnt working? (or should I be making a
new topic for this?)
for x in 0..2 do
for y in 0..9 do
numstring = x.to_s + y.to_s
puts numstring
if (browser.span(:id, Regexp.new
If you go to download v 1.6.2, you will see instructions how to install it.
The best is uninstall your existing version.
- Original Message
From: Darin Duphorn dduph...@redbrickhealth.com
To: watir-general@googlegroups.com
Sent: Friday, January 9, 2009 9:28:55 AM
Subject:
Hi. I have several forms that have a checkbox below a submit button.
The change being made is putting the checkbox ABOVE the submit button
now.
What would be the best way to check positioning of the checkbox BEFORE/
ABOVE the submit button?
I've been trying several things, but no luck. I
You can have a look at the unittest code.
Also the following line:
$ff.startClicker(ok, 1, '', Press a button)
clicks OK button for a javascript dialog whose text is Press a button.
So i think you need to replace it with the text of your javascript alert
dialog.
Let me know if this works.
-
You could try using XPath's following and preceding (or
following-sibling and preceding-sibling) axes. If that's not enough
detail to get you going, post the HTML, and I'll give you more
specific help.
Richard
--
Richard Lawrence
Certified Scrum Coach
Founder and Principal Consultant, Humanizing
if (browser.span(:id, Regexp.new(rptCourses_ctl00_rptItems_ctl + numstring
+_lblItemTxtTitle)).exists?)
otherwise calling text will throw an exception trying to locate the element.
-c
On Fri, Jan 9, 2009 at 10:38 AM, Bissquitt bissqu...@gmail.com wrote:
anyone have any idea why this isnt
I've got a test case that enters a value in a text_field. I then
click next and I'm expecting a message to appear.
The problem is that when I populate the test and click the button it
puts the focus back on the text field and the message never appears.
I talked to a developer and he said it
One Watir script to run them all..
Borrowed some code I found on this board and then simplified it a bit.
So far, seems to work!
require 'watir'
require 'firewatir'
#Set the Test Suite root dir.
TOPDIR = File.join(File.dirname(__FILE__))
#Setup an array and fill it with all file names found
I've figured out a solution.
I'm just keeping focus on the button after I click it so it doesn't
return
to the text_field.
Button.click
Button.focus()
If there is a better solution, please post.
Thanks,
-Original Message-
From: watir-general@googlegroups.com
Nope, that doesn't work.
If the button brings me to another page it will bomb out when I try to
put focus on the button.
ick
-Original Message-
From: watir-general@googlegroups.com
[mailto:watir-gene...@googlegroups.com] On Behalf Of Darin Duphorn
Sent: Friday, January 09, 2009 3:18 PM
Ok, this $ie.focus() worked
-Original Message-
From: watir-general@googlegroups.com
[mailto:watir-gene...@googlegroups.com] On Behalf Of Darin Duphorn
Sent: Friday, January 09, 2009 3:24 PM
To: watir-general@googlegroups.com
Subject: [wtr-general] Re: blur
Nope, that doesn't work.
Below is code that is an attempt to reveal a text string in a table. I
have identified the filed correctly as I can flash it.
I'm using the to_s method but how do I reveal the string.
I need to do this to validate that the string is correct
thank you very much, you are awesome
On Jan 9, 4:04 pm, Charley Baker charley.ba...@gmail.com wrote:
if (browser.span(:id, Regexp.new(rptCourses_ctl00_rptItems_ctl + numstring
+_lblItemTxtTitle)).exists?)
otherwise calling text will throw an exception trying to locate the element.
-c
Thanks. That might be what I am after. I'll give an update once I
finish this test.
On Jan 9, 11:27 am, Richard Lawrence rslawre...@gmail.com wrote:
You could try using XPath's following and preceding (or
following-sibling and preceding-sibling) axes. If that's not enough
detail to get you
You can use autoitx to close the javascript pup up box.Refer to the
following sample code
javascriptPopup.rb
#code start#
require 'win32ole'
autoit = WIN32OLE.new('AutoItX3.Control')
IETitle = autoit.WinGetTitle(The page at)
puts IETitle
autoit.WinActivate(IETitle)
ret = autoit.WinWait(IETitle, ,
Darin - thanks for your reply.
Carl - thanks again for your reply
Thanks to everyone!
Below is the final solution to my questions:
///
$ie.goto test_site
#Reveal text on the support page - System
Bissquitt,
Thank you for poking the proverbial 'beehive'. I am a Watir/Ruby
newbie too.
I've posted some really basic questions here questions on this group
as well.
My background is mainly in hardware test automation, BASIC, and VB
Script.
Kudos to all the responses to this post. I too am
26 matches
Mail list logo