[wtr-general] Re: Cannot access New Browser window generated through Javascript code executed on Click of a Button.

2009-01-09 Thread wesley chen
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

[wtr-general] Re: About Javascript Popups/Dialogue Box

2009-01-09 Thread wesley chen
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

[wtr-general] Re: Cannot access New Browser window generated through Javascript code executed on Click of a Button.

2009-01-09 Thread asheesh misra
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

[wtr-general] Announcing the release of ChromeWatir

2009-01-09 Thread sai
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

[wtr-general] Re: Cannot access New Browser window generated through Javascript code executed on Click of a Button.

2009-01-09 Thread wesley chen
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

[wtr-general] Re: Can not figure out how to move between tabs

2009-01-09 Thread Daca
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,

[wtr-general] Re: Can not figure out how to move between tabs

2009-01-09 Thread Daca
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                

[wtr-general] Re: Read text from a text_field

2009-01-09 Thread Daca
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

[wtr-general] FIrewatir Popup

2009-01-09 Thread Sur
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

[wtr-general] Re: Pulling hair out on screen scraping

2009-01-09 Thread Bissquitt
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

[wtr-general] Re: Multiple Attributes Issue

2009-01-09 Thread Michael Hwee
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:

[wtr-general] Positioning of a Checkbox before a Submit button

2009-01-09 Thread rob
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

[wtr-general] Re: FIrewatir Popup

2009-01-09 Thread Angrez Singh
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. -

[wtr-general] Re: Positioning of a Checkbox before a Submit button

2009-01-09 Thread Richard Lawrence
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

[wtr-general] Re: Pulling hair out on screen scraping

2009-01-09 Thread Charley Baker
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

[wtr-general] blur

2009-01-09 Thread Moochie
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

[wtr-general] Re: Watir Script Integration with javaCruiseControl - Testing Java App.

2009-01-09 Thread watirpuppy
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

[wtr-general] Re: blur

2009-01-09 Thread Darin Duphorn
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

[wtr-general] Re: blur

2009-01-09 Thread Darin Duphorn
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

[wtr-general] Re: blur

2009-01-09 Thread Darin Duphorn
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.

[wtr-general] Need to reveal a string from a in a table so that it can be validated

2009-01-09 Thread gem dandy
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

[wtr-general] Re: Pulling hair out on screen scraping

2009-01-09 Thread Bissquitt
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

[wtr-general] Re: Positioning of a Checkbox before a Submit button

2009-01-09 Thread rob
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

[wtr-general] Re: FIrewatir Popup

2009-01-09 Thread Wilson Xu
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, ,

[wtr-general] Re: Read text from a text_field

2009-01-09 Thread gem dandy
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

[wtr-general] Re: Pulling hair out on screen scraping

2009-01-09 Thread gem dandy
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