[wtr-general] Re: About Javascript Popups/Dialogue Box
Hello Aami.., I was not able to reach the site - ('http://www.irctc.co.in/'). However, here is a method that works for me at the Google site: *** require 'test/unit' require 'watir/ie' require 'win32ole' require 'watir\contrib\enabled_popup' def jsClick( a, button, user_input=nil) waitTime=30 hwnd = $ie.enabled_popup(waitTime) puts("wait time = 30") if (hwnd) puts("if = hwnd") w = WinClicker.new if ( user_input ) puts("if = user input") w.setTextValueForFileNameField(hwnd, "#{user_input}") end sleep 3 puts ("CLICK THE BUTTON") w.clickWindowsButton_hwnd(hwnd, "#{button}") w=nil end end test_site = "http://www.google.com/preferences?hl=en"; $ie = Watir::IE.new $ie.goto test_site $ie.maximize() $ie.radio(:id,"slc").set $ie.button(:name,"submit2").click_no_wait sleep 5 jsClick( $ie, "OK") jsClick( $ie, "OK") # The popup click works when jsClick is called twice, the first click # just highlights the popup box. The second click does the trick # *** Regards, Darryl On Dec 31, 12:21 am, aami...@gmail.com wrote: > I am trying to run the below script but getting an error. Can anyone > help me on this? I want to bypass the javascript popup. Thanks in > advance. > The script below: > require 'watir' > include 'watir' > #require 'watir/contrib/enabled_popup' > require 'test/unit' > class TC_recorded < Test::Unit::TestCase > def test_recorded > ie = Watir::IE.new > ie.goto('http://www.irctc.co.in/') > ie.text_field(:name, 'userName').set('aamittt') > ie.button(:id, 'Button1').click > hwnd = browser.enabled_popup(5) > if (hwnd) #yeah! a popup > popup = WinClicker.new > popup.makeWindowActive(hwnd) > popup.clickWindowsButton("Windows Internet Explorer", "OK", "30") > end > end > end > > Iam getting following error: > 1) Error: > test_recorded(TC_recorded): > NameError: undefined local variable or method `browser' for > # > exam1.rb:10:in `test_recorded' On Dec 31 2008, 12:21 am, aami...@gmail.com wrote: > I am trying to run the below script but getting an error. Can anyone > help me on this? I want to bypass the javascript popup. Thanks in > advance. > The script below: > require 'watir' > include 'watir' > #require 'watir/contrib/enabled_popup' > require 'test/unit' > class TC_recorded < Test::Unit::TestCase > def test_recorded > ie = Watir::IE.new > ie.goto('http://www.irctc.co.in/') > ie.text_field(:name, 'userName').set('aamittt') > ie.button(:id, 'Button1').click > hwnd = browser.enabled_popup(5) > if (hwnd) #yeah! a popup > popup = WinClicker.new > popup.makeWindowActive(hwnd) > popup.clickWindowsButton("Windows Internet Explorer", "OK", "30") > end > end > end > > Iam getting following error: > 1) Error: > test_recorded(TC_recorded): > NameError: undefined local variable or method `browser' for > # > exam1.rb:10:in `test_recorded' --~--~-~--~~~---~--~~ 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] Re: Frame, nested frame
Hello, You might want to try the Webmetrics watir recorder. Very useful for creating scripts. http://www.webmetrics.com/products/script_recorder.html I'm working on projects that have objects nested inside of frames that are 3 levels deep. The downside is that it can't do anything with pop ups - but hey there are several methods already available. Gem Dandy On Jan 5, 12:21 am, Jagdeep Jain wrote: > Index can also be used to differentiate b/w the similar objects/ > components. > > On Jan 4, 6:29 am, "Wilson Xu" wrote: > > > Please ignore 'iframe' element in your script code, you can try it again and > > can you post your html source code. > > Wilson > > > On Wed, Dec 31, 2008 at 6:35 PM, rr wrote: > > > > Hi all, > > > I want to know how to write script for nested frame. I want to click > > > on object which is a link and it is in nested frame (means frame > > > inside frame) but there are 4 items in those frames. This situation > > > arises when I open my mailbox. Those 4 items are "Compose", "inbox", > > > "Folder", "Search". Only thing which differ all 4 items is 'href'. I > > > am not getting how to write script for particular item. I have used > > > ie.frame(:name, "name").frame(:name, "name") but it was not usefull as > > > number of items are there inside those frame. Please provide solution. --~--~-~--~~~---~--~~ 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] Read text from a text_field
Ok - I realize that this is a simple question...but I'm a newbie. I can write strings to text fields with no problem. I'm now trying to read text from specific text fields and then do a compare that results in a true or false result. I don't want to search the entire page, I just want to focus on the exact index that I wrote to. # This is the text that I want to read: $ie.frame(:index, 3).frame(:index, 3).form(:name, 'configSnmpAccess').text_field(:name, 'accessIpAddress?3').set ('126.4.100.102') Thanks, Gem Dandy --~--~-~--~~~---~--~~ 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] Re: Read text from a text_field
OK - Next dumb questions - 1) where should the value appear? I though that it would show up in the command window 2) Once I can get hold of the value, what is the simple syntax for the compare. Again thanks, Gem On Jan 8, 10:01 pm, Jason wrote: > Try: > > $ie.frame(:index, 3).frame(:index, 3).form(:name, > 'configSnmpAccess').text_field(:name, 'accessIpAddress?3').value > > - J --~--~-~--~~~---~--~~ 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] Need to reveal a string from a in a table so that it can be validated
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 ** $ie.goto test_site #Reveal text on the support page - System name # Go to the Support tab ## Image HTML: $ie.frame(:index, 2).image(:id, 'imgSupport').flash $ie.frame(:index, 2).image(:id, 'imgSupport').click # Flash the table cell "System Name" text" $ie.frame(:index, 3).frame(:index, 3).table(:index, 2)[2][2].flash # Reveal the System Text name $ie.frame(:index, 3).frame(:index, 3).table(:index, 2)[2][2].to_s sleep 5 $ie.close ** When I execute via irb it reveals the string as shown below: irb(main):004:0> ie.frame(:index, 2).image(:id, 'imgSupport').click => 1.093 irb(main):005:0> $ie.frame(:index, 3).frame(:index, 3).table(:index, 2) [2][2].to_s NoMethodError: undefined method `frame' for nil:NilClass from (irb):5 irb(main):006:0> $ie.frame(:index, 3).frame(:index, 3).table(:index, 2) [2][2].to_s NoMethodError: undefined method `frame' for nil:NilClass from (irb):6 irb(main):007:0> ie.frame(:index, 3).frame(:index, 3).table(:index, 2) [2][2].to_s => "GXT Demo" Thanks, Gem Dandy --~--~-~--~~~---~--~~ 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] Re: Need to reveal a string from a in a table so that it can be validated
Darin - thanks for your reply. Carl - thanks again for your reply Below is the solution to my question: * On Jan 9, 4:40 pm, "Darin Duphorn" wrote: > Can you replace .flash with .text? > > # Flash the table cell "System Name" text" > $ie.frame(:index, 3).frame(:index, > 3).table(:index, 2)[2][2].text > > -Original Message- > From: watir-general@googlegroups.com > > [mailto:watir-gene...@googlegroups.com] On Behalf Of gem dandy > Sent: Friday, January 09, 2009 3:37 PM > To: Watir General > Subject: [wtr-general] Need to reveal a string from a in a table so that > it can be validated > > 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 > > $ie.goto test_site #Reveal text on the support page - System name # Go to the Support tab ## Image HTML: $ie.frame(:index, 2).image(:id, 'imgSupport').flash $ie.frame(:index, 2).image(:id, 'imgSupport').click # Flash the table cell "System Name" text" $ie.frame(:index, 3).frame(:index, 3).table(:index, 2)[2][2].flash # Reveal the System Text name myValue = $ie.frame(:index, 3).frame(:index, 3).table(:index, 2)[2] [2].to_s puts "My value is " + myValue sleep 5 $ie.close > ** > $ie.goto test_site > > #Reveal text on the support page - System name > > # Go to the Support tab > ## Image HTML: name=imgSupport> > $ie.frame(:index, 2).image(:id, > 'imgSupport').flash > $ie.frame(:index, 2).image(:id, > 'imgSupport').click > > # Flash the table cell "System Name" text" > $ie.frame(:index, 3).frame(:index, > 3).table(:index, 2)[2][2].flash > > # Reveal the System Text name > $ie.frame(:index, 3).frame(:index, > 3).table(:index, 2)[2][2].to_s > > sleep 5 > > $ie.close > > ** > > When I execute via irb it reveals the string as shown below: > > irb(main):004:0> ie.frame(:index, 2).image(:id, 'imgSupport').click > => 1.093 > irb(main):005:0> $ie.frame(:index, 3).frame(:index, 3).table(:index, 2) > [2][2].to_s > NoMethodError: undefined method `frame' for nil:NilClass > from (irb):5 > irb(main):006:0> $ie.frame(:index, 3).frame(:index, 3).table(:index, 2) > [2][2].to_s > NoMethodError: undefined method `frame' for nil:NilClass > from (irb):6 > irb(main):007:0> ie.frame(:index, 3).frame(:index, 3).table(:index, 2) > [2][2].to_s > => "GXT Demo" > > Thanks, > Gem Dandy --~--~-~--~~~---~--~~ 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] Re: Read text from a text_field
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 name # Go to the Support tab ## Image HTML: $ie.frame(:index, 2).image(:id, 'imgSupport').flash $ie.frame(:index, 2).image(:id, 'imgSupport').click # Flash the table cell System Name text $ie.frame(:index, 3).frame(:index, 3).table(:index, 2)[2][2].flash # Reveal the System Name text myValue = $ie.frame(:index, 3).frame(:index, 3).table(:index, 2)[2] [2].to_s puts "My value is " + myValue sleep 1 if (myValue == "GXT Demo") puts "Test passed" else puts "Test failed" end $ie.close \\\ \\\ * On Jan 9, 4:40 pm, "Darin Duphorn" wrote: - Hide quoted text - - Show quoted text - > Can you replace .flash with .text? > # Flash the table cell "System Name" text" > $ie.frame(:index, 3).frame(:index, > 3).table(:index, 2)[2][2].text > -Original Message----- > From: watir-general@googlegroups.com > [mailto:watir-gene...@googlegroups.com] On Behalf Of gem dandy > Sent: Friday, January 09, 2009 3:37 PM > To: Watir General > Subject: [wtr-general] Need to reveal a string from a in a table so that > it can be validated > 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 > $ie.goto test_site #Reveal text on the support page - System name # Go to the Support tab ## Image HTML: $ie.frame(:index, 2).image(:id, 'imgSupport').flash $ie.frame(:index, 2).image(:id, 'imgSupport').click # Flash the table cell "System Name" text" $ie.frame(:index, 3).frame(:index, 3).table (:index, 2)[2][2].flash # Reveal the System Text name myValue = $ie.frame(:index, 3).frame(:index, 3).table(:index, 2)[2] [2].to_s puts "My value is " + myValue sleep 5 $ie.close On Jan 9, 10:37 am, Daca wrote: > 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 make the value appear in the command window, u have to use 1. > above...followed by > puts my_value > On Jan 8, 10:25 pm, gem dandy wrote: > > > OK - Next dumb questions - > > > 1) where should the value appear? I though that it would show up in > > the command window > > > 2) Once I can get hold of the value, what is the simple syntax for the > > compare. > > > Again thanks, > > > Gem > > > On Jan 8, 10:01 pm, Jason wrote: > > > > Try: > > > > $ie.frame(:index, 3).frame(:index, 3).form(:name, > > > 'configSnmpAccess').text_field(:name, 'accessIpAddress?3').value > > > > - J- Hide quoted text - > > > - Show quoted text - --~--~-~--~~~---~--~~ 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] Re: Read text from a text_field
Daca and Jason..Thanks for your replies also Gem (newbie) Dandy On Jan 9, 10:02 pm, gem dandy wrote: > 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 name > > # Go to the Support tab > ## Image HTML: name=imgSupport> > $ie.frame(:index, 2).image(:id, 'imgSupport').flash > $ie.frame(:index, 2).image(:id, 'imgSupport').click > > # Flash the table cell System Name text > $ie.frame(:index, 3).frame(:index, 3).table(:index, > 2)[2][2].flash > > # Reveal the System Name text > myValue = $ie.frame(:index, 3).frame(:index, > 3).table(:index, 2)[2] > [2].to_s > > puts "My value is " + myValue > sleep 1 > > if (myValue == "GXT Demo") > puts "Test passed" > else > puts "Test failed" > end > > $ie.close > \\\ > \\\ > > * > > On Jan 9, 4:40 pm, "Darin Duphorn" > wrote: > > - Hide quoted text - > - Show quoted text - > > > > > Can you replace .flash with .text? > > # Flash the table cell "System Name" text" > > $ie.frame(:index, 3).frame(:index, > > 3).table(:index, 2)[2][2].text > > -Original Message- > > From: watir-general@googlegroups.com > > [mailto:watir-gene...@googlegroups.com] On Behalf Of gem dandy > > Sent: Friday, January 09, 2009 3:37 PM > > To: Watir General > > Subject: [wtr-general] Need to reveal a string from a in a table so that > > it can be validated > > 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 > > > > $ie.goto test_site > > #Reveal text on the support page - System name > > # Go to the Support tab > ## Image HTML: name=imgSupport> > $ie.frame(:index, 2).image(:id, > 'imgSupport').flash > $ie.frame(:index, 2).image(:id, > 'imgSupport').click > > # Flash the table cell "System Name" text" > $ie.frame(:index, 3).frame(:index, 3).table > (:index, 2)[2][2].flash > > # Reveal the System Text name > myValue = $ie.frame(:index, 3).frame(:index, > 3).table(:index, 2)[2] > [2].to_s > > puts "My value is " + myValue > sleep 5 > > $ie.close > > > On Jan 9, 10:37 am, Daca wrote: > > > 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 make the value appear in the command window, u have to use 1. > > above...followed by > > puts my_value > > On Jan 8, 10:25 pm, gem dandy wrote: > > > > OK - Next dumb questions - > > > > 1) where should the value appear? I though that it would show up in > > > the command window > > > > 2) Once I can get hold of the value, what is the simple syntax for the > > > compare. > > > > Again thanks, > > > > Gem > > > > On Jan 8, 10:01 pm, Jason wrote: > > > > > Try: > > > > > $ie.frame(:index, 3).frame(:index, 3).form(:name, > > > > 'configSnmpAccess').text_field(:name, 'accessIpAddress?3').value > > > > > - J- Hide quoted text - > > > > - Show quoted text - --~--~-~--~~~---~--~~ 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] Re: Pulling hair out on screen scraping
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 trying to run before walking. I'm just so excited about the potential of Watir that I can sit still. After one month of tinkering, with what little I know, I've already automated 30% of our web configuration tests at my job. The links included here will keep me busy for awhile. Thanks again to all, Gem (newbie) Dandy On Jan 9, 4:53 pm, Bissquitt wrote: > thank you very much, you are awesome > > On Jan 9, 4:04 pm, "Charley Baker" 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 > > > On Fri, Jan 9, 2009 at 10:38 AM, Bissquitt wrote: > > > > 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 > > > ("rptCourses_ctl00_rptItems_ctl" + numstring + > > > "_lblItemTxtTitle")).text) then > > > var = browser.span(:id, Regexp.new > > > ("rptCourses_ctl00_rptItems_ctl" + numstring + > > > "_lblItemTxtTitle")).text > > > > in theory (assuming 2 books on the page) when it reaches the 3rd book > > > the if will evaluate as false and the var = statement never gets > > > executed. > > > Im getting the first 2 books returning fine, then on the 3rd time > > > around puts numstring executes and then the program ends exit code 1 > > > (it should go to the next page after uneventfully finishing the 2 for > > > loops. > > > > The only thing I can think of is that its trying to call the above > > > with numstring = to 03, not finding it on the page and crashing. > > > however thats what the If is there to prevent. Any ideas or tips? > > > > On Jan 4, 10:06 am, Bissquitt wrote: > > > > ok thank you all so much. I got the majority of the code working. This > > > > is what I have so far. > > > > > while contLoop do colVal = worksheet.Cells(row, 'a').Value > > > > if (colVal) then > > > > browser.goto("http://bookstore.umbc.edu/SelectCourses.aspx? > > > > src=2&type=2&stoid=9&trm=Spring%2009&cid=" + colVal) > > > > > var = browser.span(:id, / > > > > rptCourses_ctl00_rptItems_ctl\d\d_lblItemTxtTitle/).text > > > > worksheet.Cells(row, 'b').value = var > > > > > else > > > > contLoop = false > > > > end > > > > > row += 1 > > > > sleep 1 > > > > end > > > > > Do you know of an easy way to itterate through each span that watches > > > > the above regex and only ones that match or do I need to go through > > > > all and parse each individualy? > > > > > I was trying something like this but i couldnt get it to work. (are > > > > span and spans the same? I only saw documentation for spans) > > > > browser.spans.each(:id, / > > > > rptCourses_ctl00_rptItems_ctl\d\d_lblItemTxtTitle/).text > > > > > if that can't be done I guess I will just be storing each span into a > > > > string, look for the regex and go to next. > > > > > Thanks again guys > > > > > On Jan 3, 3:41 pm, "Charley Baker" wrote: > > > > > > It can be a bit overwhelming to learn Ruby and various libraries at > > > > > the > > > same > > > > > time. I'd recommend taking a look at the Pickaxe book: > > >http://whytheluckystiff.net/ruby/pickaxe/justto get some general > > > > > familiarity. There are other Ruby tutorials online as well as some > > > > > good > > > > > books - The Ruby Way, Everyday Scripting, OReilly's Ruby book. > > > > > succ! as you mention below is a Ruby core method. Gotapi also has a > > > good > > > > > searchable reference to Ruby standard api.http://www.gotapi.com/html > > > click > > > > > on the Ruby Standard Packages. The pickaxe book from the link above > > > also has > > > > > an index of the core api, many with examples. > > > > > Here's a link to the Watir rdocs in case you might find that useful. > > >http://wtr.rubyforge.org/rdoc/andalinkto supported elements(though > > > > > openqa is down right now): > > >http://wiki.openqa.org/display/WTR/Methods+supported+by+Element > > > > > > Strange that the hpricot site is down now as well. > > > > > > Another useful way to learn how to use libraries in Ruby is by taking > > > > > a > > > look > > > > > at their unit tests. Watir has a large number of unit tests, hpricot > > > has > > > > > some too. They're located under your ruby install directory in gems. > > > > > > Ruby comes with a few documentation systems: ri and rdoc. For the gems > >
[wtr-general] Re: Please help - getting error 'Unable to locate element'
Hello H2006, If you can't identify the element with the IE Developer toolbar or Firebug (my favorite), Give Webmetrics a try. It's basically a Watir recorder /helper and will get you started. The tool download - http://www.webmetrics.com/products/script_recorder.html You will also need to apply this patch after installing the tool - http://www.webmetrics.com/scriptrecorder/vs_piaredist.exe I feel your pain. I was a Watir virgin 6 weeks ago. Take a look at this post for some links to some very good material for newbies- http://groups.google.com/group/watir-general/browse_thread/thread/811e926d26a36c95?hl=en Regards, Gem (newbie) Dandy --Walk before you run On Jan 10, 2:42 am, Anna Gabutero wrote: > Hi, > > > > On Fri, Jan 09, 2009 at 06:23:32PM -0800, H2006 wrote: > > > Hello, > > > I am newbie to Waitr & Ruby. I am testing windows application that > > works only on IE. I am exploring some front end automation tool and > > found Watir might be the great choice. I have followed the tutorial > > and simple google search test and it works fine. I am so excited to > > use this tool for my web application > > But the problem I am facing is when i tried to create simple search > > for my test application, i am getting ' Unable to locate' error.. > > Same error appears with all possible methods that i tried > > ( ex: .click, .flash, .set etc..) Only ".exists? " and > > " .include" command works in my script. > > > Can anyone help me? Am I missing anything for installation? Do I need > > to add anything else other than " require 'watir' "in the beginning > > of my script? > > > Watir version: 1.6.2 > > Ruby version 1.8.6 > > > Error: " c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ > > element.rb:52:in `assert_exists': Unable to locate element, > > using :id, /txtSegSearch/ (Watir::Exception::UnknownObjectException) > > "" > > Watir simply can't find the element based on the criteria you gave it. > The .exists? method works because it only checks for the existence of > the element, but it's probably returning "false". Maybe this text field > isn't in the frMain frame? > > If you're having trouble with the structure of the document you're > testing, you can use the IE developer toolbar to help you understand it. > > HTH, > Anna --~--~-~--~~~---~--~~ 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] Re: Best Way for Checking Name Fields?
Rob, Give the below script a try. It puts 'whatever ' (with trailing space) into a text box in this thread and then checks to see if it contains 'whatever' (no trailing space). *** =begin ## This is a short test to reveal the text in a entry box what is expected (or not expected). ## =end require 'watir/ie' require 'watir/WindowHelper' require 'test/unit' require 'win32ole' # open a browser $ie = Watir::IE.new $ie.goto("http://groups.google.com/group/watir-general/browse_thread/ thread/2751583d3eb37e50") $ie.form(:name, 'gs2').text_field(:name, 'q').set('\'whatever \'') # Flash the table cell System Name text $ie.form(:name, 'gs2').text_field(:name, 'q').flash # Reveal the System Name text myValue = $ie.form(:name, 'gs2').text_field(:name, 'q').value puts "My value is " + myValue sleep 1 if (myValue == "whatever") puts "Test passed" else puts "Test failed" end sleep 5 $ie.close *** Let me know if you have any problems. good luck, Gem Dandy On Jan 11, 9:26 pm, rob wrote: > I have several forms that have > > name='whatever ' > > within the tag. Notice the trailing [space] after the word whatever. > What would be the best way to check every tag on the page that has > name='whatever ' to ensure there is no trailing space. If there is a > space, I will throw an error message. > > Any help is appreciated. Thanks. --~--~-~--~~~---~--~~ 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] Re: Best Way for Checking Name Fields?
Hold the presses - I just ran another test on this and it doesn't pass when checking for the correct text. I'll post another update soon. gem dandy On Jan 12, 7:05 pm, gem dandy wrote: > Rob, > > Give the below script a try. It puts 'whatever ' (with trailing > space) > into a text box in this thread and then checks to see if it contains > 'whatever' (no trailing space). > > *** > > =begin > ## > This is a short test to reveal the text in a entry > box what is expected (or not expected). > ## > =end > > require 'watir/ie' > require 'watir/WindowHelper' > require 'test/unit' > require 'win32ole' > > # open a browser > $ie = Watir::IE.new > > $ie.goto("http://groups.google.com/group/watir-general/browse_thread/ > thread/2751583d3eb37e50") > $ie.form(:name, 'gs2').text_field(:name, 'q').set('\'whatever \'') > > # Flash the table cell System Name text > $ie.form(:name, 'gs2').text_field(:name, 'q').flash > > # Reveal the System Name text > myValue = $ie.form(:name, 'gs2').text_field(:name, 'q').value > > puts "My value is " + myValue > sleep 1 > > if (myValue == "whatever") > puts "Test passed" > else > puts "Test failed" > end > sleep 5 > > $ie.close > > *** > Let me know if you have any problems. good luck, > Gem Dandy > > On Jan 11, 9:26 pm, rob wrote: > > > I have several forms that have > > > name='whatever ' > > > within the tag. Notice the trailing [space] after the word whatever. > > What would be the best way to check every tag on the page that has > > name='whatever ' to ensure there is no trailing space. If there is a > > space, I will throw an error message. > > > Any help is appreciated. Thanks. --~--~-~--~~~---~--~~ 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] Re: Best Way for Checking Name Fields?
Here ya go rob, *** =begin ## This is a short test to reveal the text in a entry box what is expected (or not expected). ## =end require 'watir/ie' require 'watir/WindowHelper' require 'test/unit' require 'win32ole' # open a browser $ie = Watir::IE.new $ie.goto("http://groups.google.com/group/watir-general/browse_thread/ thread/2751583d3eb37e50") $ie.form(:name, 'gs2').text_field(:name, 'q').set('\'whatever \'') # Flash the table cell System Name text $ie.form(:name, 'gs2').text_field(:name, 'q').flash # Reveal the text myValue = $ie.form(:name, 'gs2').text_field(:name, 'q').value puts "My value is " + myValue sleep 1 # If whatever has a trailing space, the test will fail. # If whatever has no trailing space, the test will pass. # Remove the trailing space from set('\'whatever \'') below # to make the test pass if (myValue == '\'whatever\'') puts "Test passed" else puts "Test failed" end sleep 5 $ie.close *** gem dandy On Jan 12, 7:21 pm, gem dandy wrote: > Hold the presses - > > I just ran another test on this and it doesn't pass when > checking for the correct text. I'll post another update soon. > > gem dandy > > On Jan 12, 7:05 pm, gem dandy wrote: > > > Rob, > > > Give the below script a try. It puts 'whatever ' (with trailing > > space) > > into a text box in this thread and then checks to see if it contains > > 'whatever' (no trailing space). > > > *** > > > =begin > > ## > > This is a short test to reveal the text in a entry > > box what is expected (or not expected). > > ## > > =end > > > require 'watir/ie' > > require 'watir/WindowHelper' > > require 'test/unit' > > require 'win32ole' > > > # open a browser > > $ie = Watir::IE.new > > > $ie.goto("http://groups.google.com/group/watir-general/browse_thread/ > > thread/2751583d3eb37e50") > > $ie.form(:name, 'gs2').text_field(:name, 'q').set('\'whatever \'') > > > # Flash the table cell System Name text > > $ie.form(:name, 'gs2').text_field(:name, 'q').flash > > > # Reveal the System Name text > > myValue = $ie.form(:name, 'gs2').text_field(:name, 'q').value > > > puts "My value is " + myValue > > sleep 1 > > > if (myValue == "whatever") > > puts "Test passed" > > else > > puts "Test failed" > > end > > sleep 5 > > > $ie.close > > > *** > > Let me know if you have any problems. good luck, > > Gem Dandy > > > On Jan 11, 9:26 pm, rob wrote: > > > > I have several forms that have > > > > name='whatever ' > > > > within the tag. Notice the trailing [space] after the word whatever. > > > What would be the best way to check every tag on the page that has > > > name='whatever ' to ensure there is no trailing space. If there is a > > > space, I will throw an error message. > > > > Any help is appreciated. Thanks. --~--~-~--~~~---~--~~ 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] Re: Please help - getting error 'Unable to locate element'
Here a sample of a working script - Watir 1.6.2 This sample is a quick test to see if the word in the text box has a trailing space (it does). The test will fail if the trailing space is detected. *** =begin ## This is a short test to reveal the text in a entry box what is expected (or not expected). ## =end require 'watir/ie' require 'watir/WindowHelper' require 'test/unit' require 'win32ole' # open a browser $ie = Watir::IE.new $ie.goto("http://groups.google.com/group/watir-general/browse_thread/ thread/2751583d3eb37e50") $ie.form(:name, 'gs2').text_field(:name, 'q').set('\'whatever \'') # Flash the table cell System Name text $ie.form(:name, 'gs2').text_field(:name, 'q').flash # Reveal the text myValue = $ie.form(:name, 'gs2').text_field(:name, 'q').value puts "My value is " + myValue sleep 1 # If whatever has a trailing space, the test will fail. # If whatever has no trailing space, the test will pass. # Remove the trailing space from set('\'whatever \'') # to make the test pass if (myValue == '\'whatever\'') puts "Test passed" else puts "Test failed" end sleep 5 $ie.close *** gem dandy On Jan 13, 2:54 am, Alex Collins wrote: > That means that your $ie variable is nil. Which in turn means that you > haven't successfully started a browser. > > You should have a line like: > $ie = Watir::Browser.new > > This line starts the browser and connects it to $ie variable for you > to use. The open() method may be used instead, I believe. > > If the webmetrics recorder has not been updated to Watir 1.6 then the > line might read: > $ie = Watir::IE.new > > If this is the case you will either need to downgrade Watir or modify > the script. > > If you are still having difficulties, it would be helpful to see your > script code. > > Alex > > On 13 Jan 2009, at 02:01, H2006 wrote: > > > > > Actually adding 'require 'rubygems' , solved the above problem but > > then I am getting error, > > > "" undefined method `frame' for nil:NilClass (NoMethodError)"" I also > > tried to run from irb and got the same error. > > > $ie.frame(:index, 4).link(:text, 'My').flash > > $ie.frame(:index, 4).link(:text, 'My').click > > > Can someone help, pls?? > > > On Jan 12, 5:42 pm, H2006 wrote: > >> I tried to use web metrics but now I am getting different error > >> message, > > >> "C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in > >> `gem_original_require': no such file to load" > > >> Can someone help?? > > >> On Jan 12, 3:34 pm, "Darryl L. Brown" > >> wrote: > > >>> Hello, > > >>> Glad that I could help. > > >>> Gem Dandy > > >>> H2006 wrote: > >>>> Hi Dandy, > > >>>> first, Thank you so much for the information. I am currently > >>>> using IE > >>>> developer toolbar. when I click on find element and click on the > >>>> text > >>>> field, it is highlighted but script does not recognize it. my > >>>> application only works on IE so fire bug will not help. Let me > >>>> try out > >>>> the Webmetrics, if that helps.. I really appreciate the information > >>>> that you have provided. > > >>>> -H2006 > > >>>> On Sat, Jan 10, 2009 at 6:04 AM, gem dandy >>>> br...@roadrunner.com > >>>> <mailto:d-l-br...@roadrunner.com>> wrote: > > >>>> Hello H2006, > > >>>> If you can't identify the element with the IE Developer toolbar > >>>> or Firebug (my favorite), Give Webmetrics a try. It's basically > >>>> a Watir recorder /helper and will get you started. > > >>>> The tool download - > >>>> http://www.webmetrics.com/products/script_recorder.html > > >>>> You will also need to apply this patch after installing the > >>>> tool - > >>>> http://www.webmetrics.com/scriptrecorder/vs_piaredist.exe > > >>>> I feel your pain. I was a Watir virgin 6 weeks ago. >
[wtr-general] Re: Authentication Popups
Amit, This is the method that works for me: *** require 'watir/ie' require 'watir/WindowHelper' require 'test/unit' require 'win32ole' require 'watir\contrib\enabled_popup' # open a browser $ie = Watir::IE.new puts " Step 1: go to the YourUrlt" $ie.goto YourUrl.com # Use the click_no_wait method immediately proceeding the popup. # Below is an example $ie.frame(:index, 3).frame(:index, 2).link(:text, 'Access').click_no_wait puts " Step 2: handle authentication/login popup using 'AutoIt' " # On one of my slower PC, the sleeps were needed to make this work. # You may or may not need them Watir.autoit.WinWait('Connect to YourPopupName') Watir.autoit.Send('YourUsername') sleep 2 Watir.autoit.Send('{TAB}') sleep 1 Watir.autoit.Send('YourPassword') sleep 1 Watir.autoit.Send('{ENTER}') sleep 3 $ie.close ** Darryl (gem dandy) Brown On Jan 14, 2:02 pm, aami...@gmail.com wrote: > Is there any way through which i can handle the Authentication popups? > The Solution mentioned at the following link doesn't seem to work for > me:http://wiki.openqa.org/display/WTR/Basic+Authentication > > Thanks in Advance. > > Regards, > Amit --~--~-~--~~~---~--~~ 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] Re: will watir-1.6.2 support pop-up message
Hello Malar, Here is an example of what works for me. I've added '.flash' to the button clicks make it easy follow. As infoDrone mentioned, click_no_wait must be used on the button that precedes the popup. You may need to adjust 'waitTime = 30'. It takes a while for the popup to appear - just be patient I'm using the same environment as yours - Ruby-186.26 and Watir-1.6.2 Can someone comment on why it takes the popup so long to appear? ### require 'watir/ie' require 'win32ole' require 'watir\contrib\enabled_popup' def jsClick( a, button, user_input=nil) waitTime=30 hwnd = $ie.enabled_popup(waitTime) if (hwnd) w = WinClicker.new if ( user_input ) puts("if = user input") w.setTextValueForFileNameField(hwnd, "#{user_input}") end sleep 3 w.clickWindowsButton_hwnd(hwnd, "#{button}") w=nil end end test_site = "http://www.google.com"; $ie = Watir::IE.new $ie.goto test_site $ie.maximize() $ie.link(:text, 'Preferences').flash $ie.link(:text, 'Preferences').click $ie.radio(:id,"slc").flash $ie.radio(:id,"slc").set $ie.button(:name,"submit2").focus $ie.button(:name,"submit2").flash $ie.button(:name,"submit2").click_no_wait jsClick( $ie, "OK") sleep 5 $ie.close ### Darryl (gem dandy) Brown On Jan 30, 11:04 pm, infoDrone wrote: > I think you need to use the click_no_wait method on your button > > try > ie.button(:value,"Add").click_no_wait > > and see if that helps :) > > On Jan 30, 6:43 am, malar wrote: > > > Hi, > > i am having Ruby-186.26 and watir-1.6.2 in my system. > > will watir-1.6.2 support pop-up message? > > > require 'watir/IE' > > require 'watir/winclicker' > > require 'watir/contrib/enabled_popup' > > > ie.button(:value,"Add").click > > hwnd = ie.enabled_popup(10) > > if(hwnd) > > w = WinClicker.new > > w.makeWindowActive(hwnd) > > w.clickWindowsButton_hwnd(hwnd, "ok") > > end > > > i tried with this code > > But its not working... --~--~-~--~~~---~--~~ 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] Watir::Waiter.wait_until not working with nested frames
Hello all, I'm having trouble with Watir::Waiter.wait_until. My goal is to wait until a button is present before clicking it. I'm trying replace the sleeps with wait_until. 1) This works: sleep 5 $ie.frame(:index, 3).frame(:index, 3).frame(:index, 1).button(:id, 'editButton').click 2) This doesn't work: Watir::Waiter.wait_until{$ie.frame(:index, 3).frame(:index, 3).frame (:index, 1).button(:id, 'editButton').exists?} $ie.frame(:index, 3).frame(:index, 3).frame(:index, 1).button(:id, 'editButton').click cmd line errors: c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/frame.rb:40:in `locate': Unable to locate a frame with index 1 (Watir::Exception::UnknownFrameException) from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/frame.rb: 47:in `initialize' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/container.rb: 102:in `new' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/container.rb: 102:in `frame' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ MPX_LowCrntAlm.rb:77 3) This tests indicates that the "wait_until" works, but using a sleep ahead of it defeats my purpose. sleep 5 Watir::Waiter.wait_until{$ie.frame(:index, 3).frame(:index, 3).frame (:index, 1).button(:id, 'editAButton').exists?} $ie.frame(:index, 3).frame(:index, 3).frame(:index, 1).button(:id, 'editButton').click Here I have changed the "button id" and the "wait_until" times out at 60.x seconds as expected. Does anyone have any ideas on this? Thanks, Darryl (gem dandy) Brown --~--~-~--~~~---~--~~ 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] Re: need help in popup
Hello Venkat, Please see this thread - Gem Recall Notice: win32-api http://groups.google.com/group/watir-general/browse_thread/thread/e18b8fa2c0e7b1bd/7cbbd05ad71c5a89?hl=en&lnk=gst&q=bad+gem#7cbbd05ad71c5a89 A bad gem was introduced momentarily. Regards, Darryl(gem dandy)Brown On Feb 16, 9:05 am, venky wrote: > hallo, > > I could't require enabled_popup (require 'watir/contrib/ > enabled_popup') > > I am getting an error message > < > d:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/contrib/ > enabled_popup.rb:5: uninitialized constant Watir::PageContainer::Win32 > (NameError) > from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require' > from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require' > from popup.rb:4 > > whats wrong here. i am using "Watir 1.6.2". kindly throw some light on > it > > Thanks, > Venkat --~--~-~--~~~---~--~~ 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] Help......trouble with Watir::Waiter.wait_until
Hello all, Help...I'm having trouble with "Watir::Waiter.wait_until". My goal is to wait until a button is present before clicking it. I'm trying replace the sleeps with wait_until. 1) This works: sleep 5 $ie.frame(:index, 3).frame(:index, 3).frame(:index, 1).button(:id, 'editButton').click 2) This doesn't work: Watir::Waiter.wait_until{$ie.frame(:index, 3).frame(:index, 3).frame (:index, 1).button(:id, 'editButton').exists?} $ie.frame(:index, 3).frame(:index, 3).frame(:index, 1).button(:id, 'editButton').click Do anyone have any suggestions? Is there a trick to making it work with a nested button? The portion of the page that contains the button loads slow sometimes. Thanks, Darryl --~--~-~--~~~---~--~~ 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] Re: Help......trouble with Watir::Waiter.wait_until
Hi Jam, The code goes into a loop and never comes out. Any other thoughts ? until($ie.frame(:index, 3).frame(:index, 3).frame(:index, 1).button (:id, 'editbutton').exist?) $ie.wait(5) puts "loop" end $ie.frame(:index, 3).frame(:index, 3).frame(:index, 1).button(:id, 'editButton').click Shouldn't it exit the wait after 5 seconds? Thanks, Darryl On Feb 18, 7:03 am, jam wrote: > Hi Darryl, > > I dont know wait_until. But > > try this > > until(button.Exists?) > ie.wait(5) > end > button.click > > Let me know whether this meets ur requirement? > > Thanks, > Jam > > On Feb 18, 6:03 am, "Darryl (gem dandy) Brown" > br...@roadrunner.com> wrote: > > Hello all, > > > Help...I'm having trouble with "Watir::Waiter.wait_until". My goal is > > to wait > > until a button is present before clicking it. > > > I'm trying replace the sleeps with wait_until. > > > 1) This works: > > sleep 5 > > $ie.frame(:index, 3).frame(:index, 3).frame(:index, 1).button(:id, > > 'editButton').click > > > 2) This doesn't work: > > Watir::Waiter.wait_until{$ie.frame(:index, 3).frame(:index, 3).frame > > (:index, 1).button(:id, 'editButton').exists?} > > $ie.frame(:index, 3).frame(:index, 3).frame(:index, 1).button(:id, > > 'editButton').click > > > Do anyone have any suggestions? Is there a trick to making it work > > with a nested button? The portion of the page that contains the button > > loads slow sometimes. > > > Thanks, > > Darryl --~--~-~--~~~---~--~~ 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] Re: Help......trouble with Watir::Waiter.wait_until
Hello Jam and Everyone else, The "Watir::Waiter.wait_until" and the "until" methods work just fine. I was using id: 'editbutton' in my wait function. Should have used id:'editButton' The old big "B"-vs- little "b" issue. Thanks again, Darryl On Feb 19, 5:13 pm, "Darryl (gem dandy) Brown" wrote: > Hi Jam, > > The code goes into a loop and never comes out. Any other thoughts ? > > until($ie.frame(:index, 3).frame(:index, 3).frame(:index, 1).button > (:id, 'editbutton').exist?) > $ie.wait(5) > puts "loop" > end > $ie.frame(:index, 3).frame(:index, 3).frame(:index, 1).button(:id, > 'editButton').click > > Shouldn't it exit the wait after 5 seconds? > > Thanks, > > Darryl > > On Feb 18, 7:03 am, jam wrote: > > > Hi Darryl, > > > I dont know wait_until. But > > > try this > > > until(button.Exists?) > > ie.wait(5) > > end > > button.click > > > Let me know whether this meets ur requirement? > > > Thanks, > > Jam > > > On Feb 18, 6:03 am, "Darryl (gem dandy) Brown" > > br...@roadrunner.com> wrote: > > > Hello all, > > > > Help...I'm having trouble with "Watir::Waiter.wait_until". My goal is > > > to wait > > > until a button is present before clicking it. > > > > I'm trying replace the sleeps with wait_until. > > > > 1) This works: > > > sleep 5 > > > $ie.frame(:index, 3).frame(:index, 3).frame(:index, 1).button(:id, > > > 'editButton').click > > > > 2) This doesn't work: > > > Watir::Waiter.wait_until{$ie.frame(:index, 3).frame(:index, 3).frame > > > (:index, 1).button(:id, 'editButton').exists?} > > > $ie.frame(:index, 3).frame(:index, 3).frame(:index, 1).button(:id, > > > 'editButton').click > > > > Do anyone have any suggestions? Is there a trick to making it work > > > with a nested button? The portion of the page that contains the button > > > loads slow sometimes. > > > > Thanks, > > > Darryl --~--~-~--~~~---~--~~ 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] Re: ie.test_field(name,"man").value.to_s / Passing result to a parameter
maximore, Here is a simple example for "to_s" usage - require 'watir/ie' $ie = Watir::IE.new $ie.goto("www.google.com") example = $ie.link(:text, 'Preferences').text.to_s puts example sleep 2 $ie.close You may want to change your statement to: result=ie.test_field(name,"dayOfBirth").name.to_s Change "value" to "name" Regards, Darryl(gem dandy)Brown On Mar 5, 6:09 pm, maximore wrote: > Hi > > Assume we have result define ; > > is it possible to pass a value from ie.test_field > (name,"man").value.to_s to a variable ? let say i have this > expression. > > result=ie.test_field(name,"dayOfBirth").value.to_s > I get dynamic error message . any idea how to go about > passing? > Thanks I take my ans off the board --~--~-~--~~~---~--~~ 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] Re: No Method Error
Hello Chandu80, The 'No Method Error' error is due to fact that the method name called << jsclick($ie,"OK")#Error shown here >>. Does not match the method name that is defined << def jsClick(a,button,k,user_input=nil) >> Also, the << jsclick($ie,"OK")#Error shown here >> call has one less argument than the actual method defined. Regards, Darryl For future posts, it is advisable to reduce the script down to On May 4, 2:43 am, Chandu80 wrote: > Hi, > The code that I have written is as shown below.When I try to run this > script,No Method Error is shown at the line where '#Error shown here' > is written.I have gone through various posts but am not able to figure > out the exact cause for this error.Please can anybody help me with > this.It is not able to figure out the 'jsclick' function when in fact > I have defined the function in the program itself. > > =begin > This script is used to configure traps > =end > require 'watir/ie' > require 'watir/WindowHelper' > require 'test/unit' > require 'win32ole' > require 'watir\contrib\enabled_popup' > require 'watir/assertions' > > #include Watir::Assertions > > $path='C:\Documents and Settings\chandrika.shenoy\Desktop\one.xls' > > def elapsed(f,s) > time = (f-s).to_i > hours = time/3600.to_i > minutes = (time/60 - hours * 60).to_i > seconds = (time - (hours * 3600 + minutes * 60)).to_i > puts "Test Start "< puts "Test Finish "< puts "Test Time << #{hours}hr#{minutes}min#{seconds}sec" > end > > s=Time.now #System Time > > def jsClick(a,button,k,user_input=nil) > puts"function is called" > waitTime=30 > hwnd1 = $ie.enabled_popup(waitTime) # wait up to 30 seconds for a > popup to appear > puts "hwnd=#{hwnd1}" > if (hwnd1) > w = WinClicker.new > popup_text = w.getStaticText_hWnd(hwnd1) > puts "\n\nPOP TEXT =#{popup_text}\n\n" > > excel = WIN32OLE::new('excel.Application') > workbook = excel.Workbooks.Open($path) > worksheet = workbook.Worksheets(1) #get hold of the third worksheet > > puts popup_text > worksheet.Range("i#{k}")['Value']=popup_text.to_s > puts"pop_text is in field" > workbook.save > puts"workbook is saved" > workbook.close #Close the worksheet > puts"workbook is clsoed" > excel.quit #Close Excel > puts"Excel quit" > > if ( user_input ) > w.setTextValueForFileNameField(hwnd1, "#{user_input}") > end > sleep 3 > w.clickWindowsButton_hwnd(hwnd1, "#{button}") > w=nil > end > end > > #Define a variable > test_site = "mpxwebdemo.liebert.com" > > #Open a browser > $ie=Watir::IE.new > > #increase the speed of execution > $ie.speed = :zippy > > #Start of GXT Webcard testing > puts "Start of GXT Webcard Testing" > > #Navigate to the website > puts "Step 1: Navigate to the website" > $ie.goto test_site > > #Click on configure tab > puts "Step 2:Click on Configure Tab" > $ie.frame(:index, 2).image(:id, 'imgConfigure').click > > #Click on Access link > puts "Step 4:Click on Access tab" > $ie.frame(:index, 3).frame(:index, 2).link(:text, > 'Access').click_no_wait > > #=begin > #Start login > puts " Step 3: Begin Login" > # The "Sleep's below are here to slow down the > authentication/login > just visibility > Watir.autoit.WinWait('Connect to > mpxwebdemo.liebert.com') > Watir.autoit.Send('Liebert') > #sleep 3 > Watir.autoit.Send('{TAB}') > sleep 1 > Watir.autoit.Send('Liebert') > sleep 1 > Watir.autoit.Send('{ENTER}') > sleep 3 > > sleep 3 > #$ie.frame(:index, 2).image(:id, 'imgConfigure').click > > puts " Step 4: Login complete" > #=end > > jsclick($ie,"OK") #Error shown here. > > #Click on Edit Button > puts "Step 5:Click on Edit button" > $ie.frame(:index, 3).frame(:index, 3).button(:id, 'editButton').click > > #Click on Clear Button > puts "Step 6:Click on Clear Button1" > #$ie.frame(:index, 3).frame(:index, 3).button(:name, 'tC?1').click > $ie.frame(:index, 3).frame(:index, 3).button(:name, 'accessClear? > 1').click > > #Enter value in the 1st row 2nd column > puts "Step 7 :Enter the Network Name" > #$ie.frame(:index, 3).frame(:index, 3).form(:name, > 'configSnmpTraps').text_field(:name, 'tIpA?1').set('10.130.92.25') > $ie.frame(:index, 3).frame(:index, 3).form(:name, > 'configSnmpAccess').text_field(:name, 'accessIpAddress?1').set('') > $ie.frame(:index, 3).frame(:index, 3).form(:name, > 'configSnmpAccess').text_field(:name, 'accessIpAddress?1').set > ('10.130.92.25') > > =begin > Enter value in 1st row 3rd column > puts "Step 8 :Enter the Port" > $ie.frame(:index, 3).frame(:index, 3).form(:name, > 'configSnmpTraps').text_field(:name, 'tP?1').set('162') > =end > > #Enter value in 1st row 4th column > puts "Step 9 :Enter the Community String" > #$ie.frame(:index, 3).frame(:in
[wtr-general] Re: Issue with Running the Unit Tests
Hello Satish, Unit test will currently not run properly 'out of the box' with Watir ver 1.6. Please follow this link: http://wiki.openqa.org/display/WTR/Run+the+Watir+Unit+Tests Best regards, Darryl On May 4, 1:06 pm, satish wrote: > I got following error when I try to run unit tests from location "C: > \ruby\lib\ruby\gems\1.8\gems\watir-1.6.2\unittests\core_tests.rb" > ==>ruby core_tests.rb > > C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require': no such file to load -- unittests/setup/lib > (LoadError) > from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require' > from ./../unittests/setup.rb:21 > from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require' > from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require' > from core_tests.rb:8>Exit code: 1 > > > I did following too.. > 1). gem update > 2). Under Security, check Allow active content to run in files on My > Computer > > Can some one help me why I am not able to run these tests. I am > working on Windows XP, SP-3. > > Appreciate your help. > Thank you very much in advance. > Satish --~--~-~--~~~---~--~~ 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] Re: No Method Error
Hello Chandu, Sorry, I didn't finish my thoughts at the end of the earlier reply - For future posts, it is advisable to reduce the script down to the problem area if possible. In this case, perhaps leave off the lines after the jsclick call. Regards, Darryl On May 4, 1:12 pm, "Darryl (gem dandy) Brown" wrote: > Hello Chandu80, > > The 'No Method Error' error is due to fact that the method name > called > << jsclick($ie,"OK") #Error shown here >>. Does not match the > method name that is defined << def jsClick(a,button,k,user_input=nil) > > > > Also, the << jsclick($ie,"OK") #Error shown here >> call has one > less > argument than the actual method defined. > > Regards, > Darryl > > For future posts, it is advisable to reduce the script down to > > On May 4, 2:43 am, Chandu80 wrote: > > > Hi, > > The code that I have written is as shown below.When I try to run this > > script,No Method Error is shown at the line where '#Error shown here' > > is written.I have gone through various posts but am not able to figure > > out the exact cause for this error.Please can anybody help me with > > this.It is not able to figure out the 'jsclick' function when in fact > > I have defined the function in the program itself. > > > =begin > > This script is used to configure traps > > =end > > require 'watir/ie' > > require 'watir/WindowHelper' > > require 'test/unit' > > require 'win32ole' > > require 'watir\contrib\enabled_popup' > > require 'watir/assertions' > > > #include Watir::Assertions > > > $path='C:\Documents and Settings\chandrika.shenoy\Desktop\one.xls' > > > def elapsed(f,s) > > time = (f-s).to_i > > hours = time/3600.to_i > > minutes = (time/60 - hours * 60).to_i > > seconds = (time - (hours * 3600 + minutes * 60)).to_i > > puts "Test Start "< > puts "Test Finish "< > puts "Test Time << #{hours}hr#{minutes}min#{seconds}sec" > > end > > > s=Time.now #System Time > > > def jsClick(a,button,k,user_input=nil) > > puts"function is called" > > waitTime=30 > > hwnd1 = $ie.enabled_popup(waitTime) # wait up to 30 seconds for a > > popup to appear > > puts "hwnd=#{hwnd1}" > > if (hwnd1) > > w = WinClicker.new > > popup_text = w.getStaticText_hWnd(hwnd1) > > puts "\n\nPOP TEXT =#{popup_text}\n\n" > > > excel = WIN32OLE::new('excel.Application') > > workbook = excel.Workbooks.Open($path) > > worksheet = workbook.Worksheets(1) #get hold of the third worksheet > > > puts popup_text > > worksheet.Range("i#{k}")['Value']=popup_text.to_s > > puts"pop_text is in field" > > workbook.save > > puts"workbook is saved" > > workbook.close #Close the worksheet > > puts"workbook is clsoed" > > excel.quit #Close Excel > > puts"Excel quit" > > > if ( user_input ) > > w.setTextValueForFileNameField(hwnd1, "#{user_input}") > > end > > sleep 3 > > w.clickWindowsButton_hwnd(hwnd1, "#{button}") > > w=nil > > end > > end > > > #Define a variable > > test_site = "mpxwebdemo.liebert.com" > > > #Open a browser > > $ie=Watir::IE.new > > > #increase the speed of execution > > $ie.speed = :zippy > > > #Start of GXT Webcard testing > > puts "Start of GXT Webcard Testing" > > > #Navigate to the website > > puts "Step 1: Navigate to the website" > > $ie.goto test_site > > > #Click on configure tab > > puts "Step 2:Click on Configure Tab" > > $ie.frame(:index, 2).image(:id, 'imgConfigure').click > > > #Click on Access link > > puts "Step 4:Click on Access tab" > > $ie.frame(:index, 3).frame(:index, 2).link(:text, > > 'Access').click_no_wait > > > #=begin > > #Start login > > puts " Step 3: Begin Login" > > # The "Sleep's below are here to slow down the > > authentication/login > > just visibility > > Watir.autoit.WinWait('Connect to > > mpxwebdemo.liebert.com') > > Watir.autoit.Send('Liebert') > > #sleep
[wtr-general] Re: Issue with Running the Unit Tests
Hello Satish, I have not attempted to run the Unit tests. I just recalled reading that page when I started with Watir several months ago. I'll update again if I can help more. Regards, Darryl On May 4, 1:38 pm, satish wrote: > Hi Darryl, > > I followed all the instructions in that page. > Still I could not do it. > > Please help me. > > Thanks > Satish. > > On May 4, 1:20 pm, "Darryl (gem dandy) Brown" > br...@roadrunner.com> wrote: > > Hello Satish, > > > Unit test will currently not run properly 'out of the box' with Watir > > ver 1.6. Please > > follow this link:http://wiki.openqa.org/display/WTR/Run+the+Watir+Unit+Tests > > > Best regards, > > Darryl > > > On May 4, 1:06 pm, satish wrote: > > > > I got following error when I try to run unit tests from location "C: > > > \ruby\lib\ruby\gems\1.8\gems\watir-1.6.2\unittests\core_tests.rb" > > > ==>ruby core_tests.rb > > > > C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > > `gem_original_require': no such file to load -- unittests/setup/lib > > > (LoadError) > > > from > > > C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > > `require' > > > from ./../unittests/setup.rb:21 > > > from > > > C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > > `gem_original_require' > > > from > > > C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > > `require' > > > from core_tests.rb:8>Exit code: 1 > > > > > > > I did following too.. > > > 1). gem update > > > 2). Under Security, check Allow active content to run in files on My > > > Computer > > > > Can some one help me why I am not able to run these tests. I am > > > working on Windows XP, SP-3. > > > > Appreciate your help. > > > Thank you very much in advance. > > > Satish- Hide quoted text - > > > - Show quoted text - --~--~-~--~~~---~--~~ 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] Re: WatirCraft LLC is closing
Hello Bret and Pete, I'm fairly new to Watir...only 8 months in but I've got my scuba gear on now. I'd like to personally thank you guys for everything. Myself like so many others...saying I'll wait until WatirCraft takes more shape before I call. Best of luck, Darryl Brown On Jun 3, 11:45 pm, Bret Pettichord wrote: > Pete Dignan and I have decided to shut down WatirCraft LLC. > > I will begin working full time for Convio in July. Convio has made a big > commitment to using Watir. I will continue to be involved in the Watir > community, but Convio is a software company that uses Watir internally > to test its software -- just like many of you. Convio has not made any > commitment to sponsor contributions to Watir, except when they also > serve their internal needs. I'm actually looking forward to going back > to being mainly a tester, instead of a framework developer. > > It will take some time to figure out what this transition will mean for > my involvement with Watir. For one, it means we will need more help > running the Watir project. Getting the Watir 1.7 release out has been > delayed due to this transition (and a sprained knee), but all that is > behind me now, so that should be able to move out shortly. > > Some people have asked about the WatirCraft framework. Convio currently > uses the Rasta framework, and I expect to get more involved with that > framework, which Hugh McGowan (at Convio) has been working on quite > diligently lately. Some time ago, I sketched out a plan to integrate > Rasta into WatirCraft. I expect to take a second look at those plans. > > The WatirCraft framework itself is open-source and will continue to be > hosted on Github and available for use. > > Bret > > -- > Bret Pettichord > CTO, WatirCraft LLC,www.watircraft.com > Lead Developer, Watir,www.watir.com > Blog,www.io.com/~wazmo/blog > Twitter,www.twitter.com/bpettichord > > Ask me about Watir trainingwww.watircraft.com/training --~--~-~--~~~---~--~~ 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] Office 2007 - Excel
We have developed several data driven Watir tests using Excel in Office 2003 as the data store. Has anyone else migrated to Office 2007? I'm about to upgrade but thought I'd try to get some feedback from other people who have done this already (?? I hope) Thanks, Darryl Brown --~--~-~--~~~---~--~~ 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] Re: Office 2007 - Excel
Hello to all, Thanks for replies - just wanted to make sure Excel for Watir would still be OK. Regards, Darryl On Jun 8, 11:31 am, Loft_Tester wrote: > we have been running in compatibility mode on for office 2003 on our > test machines that seems to working fine --~--~-~--~~~---~--~~ 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] Re: How to click on text on a cell which locate inside undefined tables
Hello Shiran, There is not a way of clicking on text within a table. However, you can read the text from a table. Example: mytext = $ie.frame(:index, 3).frame(:index, 3).table(index, 2)[1] [1].text puts mytext Regards, Darryl On Jun 12, 8:52 am, Shiran Gunarathna wrote: > I am having an issue with clicking on cell. This cell is located in a four > nested tables which are not having unique properties like id or name. But > these tables have properties like source index, inner text, inner HTML, etc. > I was not able to read the text in this cell as well To overcome with this > issue I used the following code. Here I guess the index. > > l_objFrame.table(:id =>"", :index =>8).row(:id,"Shiran > Gunarathna").fire_event("ondblclick") --~--~-~--~~~---~--~~ 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] Re: Time to learn Watir
Hello Swapnal, If you have a curiosity for computers in general and like to learn if you enjoy 'chasing the 'rabbit', you will do well. Prior experience with automation and programming will make the journey shorter - approx. 3 months. No experience - 6 -9 months to be productive. I'm not saying that it's easy, but I can say that it's fun. Try the best you can.then post questions here. Good luck, Darryl On Jul 10, 2:55 pm, Chuck van der Linden wrote: > On Jul 10, 9:06 am, karim rayani wrote: > > > if one has knowledge of automation then learning watir should only > > take around 1 month. > > However if automation/programming background then it can take a fair bit of > > time > > I could not agree more. > > A lot also has to do with aptitude. > > Automation is a type of programming, some people have a nack for that, > others do not. If you are someone to whom programming makes 'sense' > then you will probably pick things up quickly no matter the language > or tool. A great book to help you learn some of the basic of > programming in RUBY is "Everyday Scripting with Ruby" by Brian Marick > > Test automation is in many ways an art, there's a lot of tricks of the > trade as it were. some of them you can find here and there in books > etc, but much of it is stuff you learn by doing. little things like > always starting off a large batch of tests with both a test you expect > to pass, but also one that will intentionally FAIL, and making sure > that you in fact detect that it DID fail.. (so you know your stuff can > actually properly detect and report when something fails, because well > if that's broken then it can look like everthing is working, when in > fact main tests are failing and it's just not being properly > reported) > > Web based testing also requires that you have at least a basic > understanding of both the HTTP protocol (at least understanding how > things pass back and forth between the browser and the server), and > the HTML language used for web-pages, and how it can call javascript > to enable dynamic functionality at the client side (which doesn't hit > the webserver in many cases). > > Because watir interacts with the browser, you need to have at least a > basic understanding of what makes up a web page, and what the types of > elements on the page are etc. > > But really it all depends on you, and your background, aptitude, and > experience. Some people are going to be able to pick this stuff up > really quickly, for others it may take a lot longer, and for still > others it's time to find a different line or work. > > I recently trained a co-worker who understands the basics of web > pages, and has tested for years, but had zero experience with > programming, or automation. and in a week he was starting to write > watir automation on his own. not terribly fast, and with a bunch of > questions, but he was producing tests.. (we utilize a combination of > Watir, the Watircraft framework, and Cucumber for our stuff) a few > months down the road and he's still learning about stuff as needed, > but is largely able to work on his own, and a majority of the > questions are not 'how do I write the watir code for this" but more > related to how the actual tested app is supposed to behave, or details > of the user actions we are emulating. --~--~-~--~~~---~--~~ 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] Re: Error while retrieving an integer from spreadsheet
Hello Balbao, $regno = oo.cell(row,6).to_i will do what you're looking for. Darryl Dylan wrote: > Add ".to_i" in the middle there, because like you said you aren't > getting an integer back, so you have to make it one. So you end up > with: > > $regno = oo.cell(row,6).to_i.to_s > > -Dylan > > On Aug 3, 8:52 am, balbao wrote: > > HI, > > > > Am a novice in Watir and have a problem in retrieving an integer from > > spreadsheet. > > > > require "watir" > > require "rubygems" > > require 'win32ole' > > require 'Win32API' > > require 'roo' > > > > $ie = Watir::IE.new > > url = "https://qaenv:7001/login"; > > $ie.goto(url) > > > > def value(file, sheet) > > > > oo = Openoffice.new(file) > > oo.default_sheet = sheet > > header_row = oo.first_row > > row = header_row+1 > > column = oo.first_column > > $service_name = oo.cell(row,2) > > $first_name = oo.cell(row,3) > > $last_name = oo.cell(row,4) > > $company_name = oo.cell(row,5) > > $regno = oo.cell(row,6). # I need to feed in an integer in this > > field. > > > > end > > > > filename = "D:\\Ruby\\Data File\\datafile.ods" > > sheetname = "Data" > > > > I get " C:/RUBY/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ > > input_elements.rb:390:in `limit_to_maxlength': undefined method > > `length' for 51835430479.0:Float (NoMethodError) > > from C:/RUBY/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ > > input_elements.rb:367:in `type_by_character' > > from C:/RUBY/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ > > input_elements.rb:334:in `set' > > from order_flow.rb:75:in `customer_creation' > > from order_flow.rb:94 ". > > > > If i try converting it to string, like this $regno = oo.cell(row, > > 6).to_s > > it returns a float, i.e 12345 will get converted to 12345.0 which is > > an invalid input to the company field. > > > > Balbao --~--~-~--~~~---~--~~ 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] Re: Testing Email
Hello Bret, I'm doing email testing on our web based monitoring cards. Currently using a tweaked version of the Python mock SMTP server - mailsink.py. It displays the emails in the console and you can save them to a log file as well. I'm reading the log file with Ruby to validate the message content. The tweak adds message count and time stamp Using it with Python 2.5.2 Usage: C:\>Python25\Python.exe C:\Python_SMTP_Server\mailsink.py test 1.2.3.2 Where: "test" is a log file that will contains the transactions. 1.2.3.2 = Host PC (Put your PC IP here) C:\Python_SMTP is the location of the script I can email the tweaked mailsink.py if you'd like. Darryl On Aug 7, 6:24 pm, George wrote: > Hey Bret, it's been a long time! > > I found a couple of different approaches to this. I'm leaning towards > Tmail (http://tmail.rubyforge.org/), > but I haven't spent too much time on this. It appears that you can > send and read emails. > > On Aug 7, 2:37 pm, "b...@pettichord.com" > wrote: > > > Hi there. I've been away for a while, but am now back. > > > I would like to automate email testing. Mainly make sure the right > > emails were sent. > > > I guess what I want is to set up an email server in our lab, configure > > our app to send emails to it, and then my scripts can access it to > > make sure that the right email was delivered. > > > I've done this before with Rails, and with that you can just put the > > email sender in test mode and validate it against directly. It works > > great, but is not an option for me right now. > > > Is any one else doing something like this? What are you using? Is > > there an open-source testing-email-server I could use? Obviously, I > > want to be able to access it from Ruby. > > > Bret > > --~--~-~--~~~---~--~~ 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] How to determine frame indexing
Hello All, All of the web pages that I test use nested frames. I have used webmetrics quite a bit to identify nested elements. I've also used the irb / flash method to identify the elements. Our newer webserver is using ajax and webmetrics is no longer effective. I've been trying to use Firebug to identify the elements and am not successful determining the nesting. Does anyone use Firebug or any other tool for this? An example is: ie.frame(:index, 3).frame(:index, 3).checkbox(:id, 'enableWebCfgCtrl').set(set_or_clear=true) Thx, Darryl --~--~-~--~~~---~--~~ 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] Re: Script hangs while trying to close pop up
Hello Namit, Please see the google example in my response to the following post - "will watir-1.6.2 support pop-up message" http://groups.google.com/group/watir-general/browse_thread/thread/eeb37d3a8562936/e9ec1258c2aa547f?hl=en&q=#e9ec1258c2aa547f You must use click_no_wait Good luck, Darryl On Aug 26, 3:05 am, Namit wrote: > Hi Rohan > > Thanks for your reply > > I am using 1.8.6.26 version and also I used sleep after this command > but in vain. > > I am working on it further, will reply with my observations > > Thanks > Namit > > On Aug 26, 11:37 am, "Rohan Ojha" wrote: > > > I have found that one important thing that people miss out on is that Ruby > > 1.8.6.27 doesn’t support click_no_wait. > > > So I hope you are not using this version of Ruby. If yes then try with > > Ruby 1.8.6.26 > > > Also always use sleep after click_no_wait and the pop-up handler method > > > Thanks, > > Rohan Ojha > > > -Original Message- > > From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] > > > On Behalf Of Namit > > Sent: Wednesday, August 26, 2009 11:35 AM > > To: Watir General > > Subject: [wtr-general] Re: Script hangs while trying to close pop up > > > Thanks a lot Tiffany for your reply, I tried other things too too > > like dialog.button('Cancel').click , click_no_wait and I tried Auto it > > etc but of no use. I am working on in further, will get back to you if > > I find something useful. > > By the way do you think that the script that I have posted above is > > incorrect or I need to modify it. > > > Thanks > > Namit > > > On Aug 25, 8:30 pm, tcfodor wrote: > > > Hi Namit, > > > > You may have already looked here, but the bulk of the knowledge on > > > Watir and popups can be found here: > > > >http://wiki.openqa.org/display/WTR/Pop+Ups > > > > Off the top of my head, it seems like there were cases where we needed > > > to use click_no_wait instead of just click to avoid hanging. > > > > Hope this helps! > > > > -Tiffany > > > > On Aug 25, 7:05 am, Namit wrote: > > > > > Hi All, > > > > > My scenario is to click a image that results in a pop up. I want to > > > > click OK button of this Pop up. This is a straight scenario without > > > > much complexity still the script is not working and the pop up remains > > > > as it is. > > > > > Here is my sample script > > > > require 'watir' > > > > require 'win32ole' > > > > require 'watir/ie' > > > > require 'watir\contrib\enabled_popup' > > > > > $ie = Watir::IE.new > > > > $ie.goto 'some url/' > > > > $ie.button(:src, 'http://img1.yatra.com/yatra_blue-theme/images/common/ > > > > spacer.gif').click > > > > sleep 10 > > > > if $ie.enabled_popup > > > > puts 'inside if loop' > > > > hwnd =$ie.enabled_popup(10) > > > > puts hwnd > > > > w = WinClicker.new > > > > w.makeWindowActive(hwnd) > > > > w.clickWindowsButton_hwnd(hwnd,"OK") > > > > end > > > > > This script after clicking the image hangs and after this there is no > > > > action performed. The pop is a simple pop up with an OK button. > > > > > Guys please tell me where I am going wrong. Any help will be highly > > > > appreciated > > > > > Thanks > > > > Namit > > --~--~-~--~~~---~--~~ 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] how to handle an immediate popup
Our test team is facing an interesting challenge with a popup. The web server that we are testing has a password protected mode wherein when the url is accessed, there is an immediate login popup. There is no opportunity to use a "click_no_wait" as there are no buttons to click - the first thing that appears is the popup. It's like we need a "ie.goto 'test_site'.no_wait" command. Thanks in advance for any insight on this. Darryl --~--~-~--~~~---~--~~ 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] Re: Watir -Ajax Application working in IE6 but not in IE7
Hello Amudha, 1) Can you post the exact line of code that you're having a problem with? 2) Can you try this on a XP setup with IE7? 3) Are you getting a "object not found error? 4) Can you post the exact error that you are getting as well? Regards, Darryl On Oct 14, 3:07 am, Amudha Priya wrote: > Hi all !! > > Can anyone help me out with this? > > The application has multiple frames. It executes wel in IE6 but not in IE > 7. > > The error is : "Frame not found exception" > > And the frame cannot be opened (ie.goto()) directly. > > One of u suggested the following url, we tried all the options in the > given link, > but no success. > > > > > > >http://wiki.openqa.org/display/WTR/Frames > > > 1 ) IE.goto > > We couldnt access the frame straight away. We ' ll hav to cross the all > > pages from the Login to the destiny. > > 2) Tried truting the Site > > 3) It requires High security.. By default it changes to "Medium" even after > > we tried putting it to Low. > > > Hope there would be soln. > > > Thanks for ur help > > > Regards, > > Amudha > > -- > Regards > Amudha --~--~-~--~~~---~--~~ 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] Re: How to copy text with Watir
Hi Peter, a = $IE0.text_field(:id,'field1').value $IE0.text_field(:id,'oherField').set(a) good luck, Darryl On Oct 9, 4:30 am, Peter Kras wrote: > Hi! > > I need to check such situation: > > I have text field with id="field1" that contains text '250M'. When you > click on it - only '250' becomes highlighted - special logic. > > Testing it with watir: > $IE0 = Watir::IE.new > .. > $IE0.text_field(:id,'field1').focus # this works > > $IE0.send_keys('^{c}') # copies, but txt in url field of browser > > $IE0.text_field(:id,'oherField').focus #doesn't work > > $IE0.send_keys('^{v}') > > But the problem is that focus in URL field of browser (IE7). --~--~-~--~~~---~--~~ 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] Re: Clear cache and temporary internet internet explorer files.
Hi Chandrika, Try the following code: path = File.dirname(__FILE__) << '/' cache = path << "del_cache.rb" system "ruby #{cache}" 1) This assumes that del_cache.rb is in the same directory as the calling script. Change path to suite your needs. 2) Un-comment line 200 in del_cache.rb to see how many items are deleted when the script is ran. Regards, Darryl On Jan 16, 2:40 am, Chandu80 wrote: > I want the internet explorer cache and temporary internet files to be > deleted when the script is running.I used the following two commands: > > 1)cache = path << del_cache.rb > exec "ruby #{cache}" > > 2)cache = path << del_cache.rb > system "ruby #{cache}" > > In the above code,path is the directory in which the del_cache method > lies.The del_cache method is the same one as downloaded from the given > location > > http://rubyforge.org/snippet/detail.php?type=snippet&id=26 > > So as seen above I want to launch the del_cache script from within a > script. > > When I run the piece of code as given in either 1 or 2 I get the > following error > > undefined local variable or method `del_cache' for main:Object > > Can anybody suggest what needs to be done in this case.Or in case > arguments need to be passed to those system commands what they would > be? > > Thanks in advance > > Regards > Chandrika -- 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] Re: Clear cache and temporary internet internet explorer files.
Correction to item 2) below: Un-comment - print "Deleted #{n} items\n" at the end of del_cache.rb Darryl On Jan 16, 10:51 pm, "Darryl (gem dandy) Brown" wrote: > Hi Chandrika, > > Try the following code: > > path = File.dirname(__FILE__) << '/' > cache = path << "del_cache.rb" > system "ruby #{cache}" > > 1) This assumes that del_cache.rb is in the same directory > as the calling script. Change path to suite your needs. > > 2) Un-comment line 200 in del_cache.rb to see how many items > are deleted when the script is ran. > > Regards, > Darryl > > On Jan 16, 2:40 am, Chandu80 wrote: > > > I want the internet explorer cache and temporary internet files to be > > deleted when the script is running.I used the following two commands: > > > 1)cache = path << del_cache.rb > > exec "ruby #{cache}" > > > 2)cache = path << del_cache.rb > > system "ruby #{cache}" > > > In the above code,path is the directory in which the del_cache method > > lies.The del_cache method is the same one as downloaded from the given > > location > > >http://rubyforge.org/snippet/detail.php?type=snippet&id=26 > > > So as seen above I want to launch the del_cache script from within a > > script. > > > When I run the piece of code as given in either 1 or 2 I get the > > following error > > > undefined local variable or method `del_cache' for main:Object > > > Can anybody suggest what needs to be done in this case.Or in case > > arguments need to be passed to those system commands what they would > > be? > > > Thanks in advance > > > Regards > > Chandrika > > -- 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] Wonderful Job on the Watir wiki
Great job on the Watir wiki Alister !! Thanks, Darryl -- 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] Re: A printable Watir Tutorial
I think that this is a good idea. My thoughts are along the lines of the online Pickaxe => http://www.ruby-doc.org/docs/ProgrammingRuby/ I'm not sure of the effort required to get there but I'm willing to help. At minimum it would be good to have an index. Darryl Central Ohio On Feb 5, 7:49 pm, Alister Scott wrote: > I've been thinking for sometime to create a single (long) page Watir > Tutorial by merging multiple tutorial pages into one.The aim would be > to make it easier for a new Watir user to follow, and the added > benefit is it could be printed. > > The process of creating this is a little daunting. As a starting > point, or experiment, I thought I could create a printable tutorial on > the wiki, which is essentially syndicated content from each individual > tutorial page, displayed in a single, printable, page. > > I've done this now,http://wiki.openqa.org/display/WTR/Printable+Tutorial, > and by doing it is has made me realize how long, and detailed, the > Watir tutorial actually is. It makes the process of creating a single > page Watir tutorial even more daunting. > > I am interesting in your thoughts. Is a single page tutorial something > that others would consider helpful for new users? Is the current, > multi-page, tutorial sufficient? Does anyone have any different ideas > for creating an easy to follow, and print, tutorial? Is it just me who > wants the tutorial to be printable? > > Cheers, > > Alister Scott > Brisbane, Australia -- 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