From angrez at gmail.com Tue May 1 01:47:34 2007 From: angrez at gmail.com (Angrez Singh) Date: Tue, 1 May 2007 11:17:34 +0530 Subject: [Wtr-general] Do AutoIt3 scripts also work in Firewatir? In-Reply-To: <46362144.7080102@pettichord.com> References: <46362144.7080102@pettichord.com> Message-ID: Hi Bret, You are right user can use AutoIt3 with Firewatir but that restricts his/her scripts to Windows only. - Angrez On 4/30/07, Bret Pettichord wrote: > > Angrez Singh wrote: > > AutoIt3 is not supported by FireWatir. This is done so as to make > > Firewatir platform independent. Only 'alert' and 'confirm' javascript > > pop ups are supported as of now. We are looking into the > > alternatives/solutions were we can support other dialogs like Save > > File etc > Of course, any user can choose to use AutoIt3 with Firefox. It will work > (on windows). > > Bret > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070501/3ee23768/attachment.html From shalinigupta2006 at gmail.com Tue May 1 01:59:35 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Tue, 1 May 2007 11:29:35 +0530 Subject: [Wtr-general] how to handle popup windows Message-ID: <7523f5800704302259w3d93a85frb7a766f6d8618f17@mail.gmail.com> hi all, i have a problem in my project.i have to handle a popup window.In my project after clicking on 'Download ' button.it Opens a popup window named as:-" http://cfo-bat.ceb.com/Members/Popup/Download.aspx?cid=9563293-MicrosoftInternet Explorer" and then it automatically opens a File DIalog window.which contains 'save' and 'cancel' button... i tried this:without successs def start_jsalert_clicker Thread.new{ system("ruby \"c:\\wev2\\jscriptExtraAlert.rb\"") } end code is:- $ie.div(:id,"graphics").click() start_jsalert_clicker $ie.image(:src,"http://cfo-bat.ceb.com/Images/btn_browse_download.gif ").click $ie.wait_for_browser it generates these errors:- NoMethodError: undefined method `wait_for_browser' for # lo.rb:36:in `download' lo.rb:17:in `start' lo.rb:30:in `test_start_app' i have two problems first is...first window named :-' http://cfo-bat.ceb.com/Members/Popup/Download.aspx?cid=9563293-MicrosoftInternet Explorer' does not automatically open that File Dialog window when i do this through script.but when i do this manually it opens that file dialog window.. and second is:-how to click on 'save' and 'cancel' button..and how to specify path please help as soon as possible. it very urgent Thanks In advance regards Shalini Gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070501/d7f5f884/attachment.html From paul.rogers at shaw.ca Tue May 1 11:23:18 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 01 May 2007 09:23:18 -0600 Subject: [Wtr-general] Do AutoIt3 scripts also work in Firewatir? In-Reply-To: References: <46362144.7080102@pettichord.com> Message-ID: seems like we should have some platform independant way of doing this: watir::winclicker.click_dialog_button() for windows it can then either use auto it of winclicker and then for firewatir/linux/mac it can use the appropriate method for that platform. This may be a good thing to try and coordinate with Chris Macmahons Win32guitest port. I may have a bit of time later in the week that I can help out. -------------- next part -------------- Hi Bret, You are right user can use AutoIt3 with Firewatir but that restricts his/her scripts to Windows only. - Angrez On 4/30/07, Bret Pettichord wrote: > > Angrez Singh wrote: > > AutoIt3 is not supported by FireWatir. This is done so as to make > > Firewatir platform independent. Only 'alert' and 'confirm' javascript > > pop ups are supported as of now. We are looking into the > > alternatives/solutions were we can support other dialogs like Save > > File etc > Of course, any user can choose to use AutoIt3 with Firefox. It will work > (on windows). > > Bret > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070501/1a20d5d9/attachment.html -------------- next part -------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Tue May 1 11:36:59 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 1 May 2007 09:36:59 -0600 Subject: [Wtr-general] Do AutoIt3 scripts also work in Firewatir? In-Reply-To: References: <46362144.7080102@pettichord.com> Message-ID: <72799cd70705010836h215ebb31j7226ef69999d991@mail.gmail.com> > This may be a good thing to try and coordinate with Chris Macmahons > Win32guitest port. Crossing my fingers that I can spend some time on this in the not-too-distant future. From bret at pettichord.com Tue May 1 12:22:15 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 01 May 2007 11:22:15 -0500 Subject: [Wtr-general] manipulating dos prompt with watir In-Reply-To: <31000054.9721177978925633.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <31000054.9721177978925633.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <46376937.4090906@pettichord.com> alan wrote: > In my watir script i would like to have it go to open a dos command window and start sqlplus, then run a simple query to see if a member exists, the flow would be something like: > open cmd.exe > log in as name at data09 > pass the password somewhere around here > do query select * from members where name = 'testername' > if cmd contains(testername) > puts 'yay' > else > puts 'drat' > end > > is this easily done? so far after spending most of the day in google and trying some different ideas I still have nothing. suggestions? > i'm new to sql and watir, but since i did make watir send results to and excel file I figure this must also be doable. > You should use Ruby's system command to directly call sqlplus and put your commands in a file that is then passed as an argument to sqlplus. You will need to refer to the sqlplus command line documentation for details on how to do this. I am currently using this approach to run scripts using sqlcmd, which is the SQL Server corolate to Oracle's sqlplus. Some other people have suggested other methods for accessing a database, which you may also want to experiment with, but this approach will probably be the easiest for you. Bret From bret at pettichord.com Tue May 1 12:26:11 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 01 May 2007 11:26:11 -0500 Subject: [Wtr-general] Do AutoIt3 scripts also work in Firewatir? In-Reply-To: References: <46362144.7080102@pettichord.com> Message-ID: <46376A23.6060609@pettichord.com> Paul Rogers wrote: > This may be a good thing to try and coordinate with Chris Macmahons Win32guitest port. > Where can i find out more about this? Bret From christopher.mcmahon at gmail.com Tue May 1 12:33:11 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 1 May 2007 10:33:11 -0600 Subject: [Wtr-general] Do AutoIt3 scripts also work in Firewatir? In-Reply-To: <46376A23.6060609@pettichord.com> References: <46362144.7080102@pettichord.com> <46376A23.6060609@pettichord.com> Message-ID: <72799cd70705010933w707b1ab8if2a2918c4a38e6b2@mail.gmail.com> On 5/1/07, Bret Pettichord wrote: > Paul Rogers wrote: > > This may be a good thing to try and coordinate with Chris Macmahons Win32guitest port. > > > Where can i find out more about this? http://rubyforge.org/projects/guitest/ I've mostly been a cheerleader, but there is working code there from Wayne Vucenic, and a pretty good number of features. From forum-watir-users at openqa.org Tue May 1 12:50:13 2007 From: forum-watir-users at openqa.org (annapurna) Date: Tue, 01 May 2007 11:50:13 CDT Subject: [Wtr-general] Can Watir be paused & resumed manually when running test cases? In-Reply-To: Message-ID: <29552775.12251178038243404.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Please can you provide steps to use the ruby-debugger. Thanks in advance, anna From christopher.mcmahon at gmail.com Tue May 1 13:00:01 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 1 May 2007 11:00:01 -0600 Subject: [Wtr-general] Can Watir be paused & resumed manuallywhenrunning test cases? In-Reply-To: References: Message-ID: <72799cd70705011000u5643ace3kd0feb74605a2a58a@mail.gmail.com> > The purpose of pausing the testing is to let people have time to check the > status of GUI and device under test, after running some test cases or some > steps of a test case. There is a really simple way, if this helps: #################### puts "type anything and hit return to resume the script" input = gets puts "finishing now" From forum-watir-users at openqa.org Tue May 1 13:28:17 2007 From: forum-watir-users at openqa.org (annapurna) Date: Tue, 01 May 2007 12:28:17 CDT Subject: [Wtr-general] Can Watir be paused & resumed manuallywhenrunning test cases? In-Reply-To: <72799cd70705011000u5643ace3kd0feb74605a2a58a@mail.gmail.com> Message-ID: <29204968.12361178040527144.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for the reply. i downloaded the debugger to step through the test script. can you explain how to use the ruby-debugger? Anna From forum-watir-users at openqa.org Tue May 1 13:32:27 2007 From: forum-watir-users at openqa.org (annapurna) Date: Tue, 01 May 2007 12:32:27 CDT Subject: [Wtr-general] Dynamic HTML works when i use div tag In-Reply-To: <30423358.8201177964466242.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <28464466.12421178040777869.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks Charley. From bret at pettichord.com Tue May 1 15:52:41 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 01 May 2007 14:52:41 -0500 Subject: [Wtr-general] Can Watir be paused & resumed manually when running test cases? In-Reply-To: References: Message-ID: <46379A89.7030206@pettichord.com> ?eljko Filipin wrote: > For more functionality, see ruby-breakpoint > (http://rubyforge.org/projects/ruby-breakpoint/ > ) or ruby-debug > (http://rubyforge.org/projects/ruby-debug/). I have not used them, but > I have read at this list that ruby-breakpoint can pause and then > resume ruby script. I use ruby-breakpoint all the time. I strongly recommend that all Watir users take a look at this. It is a great tool for debugging scripts. In my view it is actually what people want when they say they want a debugger. Bret From charley.baker at gmail.com Tue May 1 16:13:35 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 1 May 2007 14:13:35 -0600 Subject: [Wtr-general] Can Watir be paused & resumed manually when running test cases? In-Reply-To: <46379A89.7030206@pettichord.com> References: <46379A89.7030206@pettichord.com> Message-ID: I'd highly second that. It's small simple and breaks you out where you want to be to inspect your current state through irb. It's been dropped and ruby-debugger is the newer project, but since I haven't had a need for much else, I haven't looked at ruby-debugger yet. The ruby eclipse plugin also has debugging facilities, but since I don't run through Eclipse but by command line, I can't say too much about it, other than it's your basic ide debugger. -Charley On 5/1/07, Bret Pettichord wrote: > > ?eljko Filipin wrote: > > For more functionality, see ruby-breakpoint > > (http://rubyforge.org/projects/ruby-breakpoint/ > > ) or ruby-debug > > (http://rubyforge.org/projects/ruby-debug/). I have not used them, but > > I have read at this list that ruby-breakpoint can pause and then > > resume ruby script. > I use ruby-breakpoint all the time. I strongly recommend that all Watir > users take a look at this. It is a great tool for debugging scripts. In > my view it is actually what people want when they say they want a > debugger. > > Bret > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070501/5a5da36c/attachment.html From freezingkiwis at gmail.com Wed May 2 07:19:39 2007 From: freezingkiwis at gmail.com (Jason & Aneta) Date: Wed, 2 May 2007 12:19:39 +0100 Subject: [Wtr-general] How to identify the nth instance of a div? Message-ID: Hey all, Using the 1.5.1.1158 gem and enjoying the class support. Within my web page, I have the following, with 3
nested inside the main "content"
.
How do I retrieve / act within the nth instance, i.e. the 1st, 2nd or 3rd of these "contentItem" divs? Cheers, Jason From forum-watir-users at openqa.org Wed May 2 07:59:54 2007 From: forum-watir-users at openqa.org (John) Date: Wed, 02 May 2007 06:59:54 CDT Subject: [Wtr-general] Error when loading iframe Message-ID: <30498002.17081178107224530.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, When you click on a link in my website an iframe is loaded in the middle of the page. It seems watir has trouble with it, because it gives an error (see below). I use this to click on the link: $ie.link(:url, /club_philips_streamium_management/).click It then returns this error: irb(main):011:0> ie.link(:url, /club_philips_streamium_management/).click WIN32OLERuntimeError: document OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in `method_missing' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in `wait' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in `times' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in `wait' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:2577:in `click' from (irb):11 From jeff.fry at gmail.com Wed May 2 10:04:32 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Wed, 2 May 2007 07:04:32 -0700 Subject: [Wtr-general] How to identify the nth instance of a div? In-Reply-To: References: Message-ID: <970956b0705020704m378c247ah1bd1e85bf746a665@mail.gmail.com> On 5/2/07, Jason & Aneta wrote: > > Hey all, > > Using the 1.5.1.1158 gem and enjoying the class support. > > Within my web page, I have the following, with 3
nested inside > the main "content"
. > >
>
>
>
>
>
>
>
> > How do I retrieve / act within the nth instance, i.e. the 1st, 2nd or > 3rd of these "contentItem" divs? Hi Jason, divs (and many other elements) can be accessed by :index. For example: ie.div(:index,2) # access the second div on the page You can also identify elements using multiple attributes, for example :class and :index : ie.div(:class => 'contentItem', :index => 3) # access the 3rd div with a class of 'contentItem' ...I believe that you can also as a variation go for the Nth div within a div like so: ie.div(:class, 'content').div(:index, 4) # access the div with class='content', and then access the 4th div within it. Take this last one with a grain of salt - I don't have a page to test it on right now, but I believe that it works as I describe here. Hope that helps, Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070502/78bf3b27/attachment.html From charley.baker at gmail.com Wed May 2 10:46:15 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 2 May 2007 08:46:15 -0600 Subject: [Wtr-general] Error when loading iframe In-Reply-To: <30498002.17081178107224530.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30498002.17081178107224530.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Try running the latest code from svn, there've been some changes around dealing with frame access errors. Follow this link for the instructions: http://wiki.openqa.org/display/WTR/FAQ#FAQ-devgem -Charley On 5/2/07, John wrote: > > Hi, > > When you click on a link in my website an iframe is loaded in the middle > of the page. It seems watir has trouble with it, because it gives an error > (see below). I use this to click on the link: $ie.link(:url, > /club_philips_streamium_management/).click > It then returns this error: > > irb(main):011:0> ie.link(:url, /club_philips_streamium_management/).click > WIN32OLERuntimeError: document > OLE error code:80070005 in > Access is denied. > > HRESULT error code:0x80020009 > Exception occurred. > from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in > `method_missing' > from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in > `wait' > from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in > `times' > from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in > `wait' > from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:2577:in > `click' > from (irb):11 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070502/7ea94549/attachment-0001.html From forum-watir-users at openqa.org Wed May 2 11:27:48 2007 From: forum-watir-users at openqa.org (Jason) Date: Wed, 02 May 2007 10:27:48 CDT Subject: [Wtr-general] How to identify the nth instance of a div? In-Reply-To: <970956b0705020704m378c247ah1bd1e85bf746a665@mail.gmail.com> Message-ID: <32078010.18571178119698374.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> > You can also identify elements using multiple attributes, for example :class and :index :

ie.div(:class => 'contentItem', :index => 3)  # access the 3rd div with a class of ' > Perfect - that's exactly what I was after. Must have missed that in my tutorials and readings. Lovely. From imran_x at hotmail.com Wed May 2 12:04:45 2007 From: imran_x at hotmail.com (Imran Hussain) Date: Wed, 2 May 2007 17:04:45 +0100 Subject: [Wtr-general] 'Unable to locate object' problem Message-ID: Hi, 'Unable to locate object' problem When running the following show_all_objects command, I get; rb(main):016:0> ie.show_all_objects-----------Objects in page ------------- HTML Document name= id=SN_NOTESSFrame src=textarea name=SN_NOTESSText id= value= How do I write to this object? do I use this: ie.text_field(:id ,"SN_NOTESSFrame").set("TESTING 1234") Is this within a frame?? This doesn't seem to be working .... can someone help? Thanks,Imran -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070502/57205157/attachment.html From charley.baker at gmail.com Wed May 2 12:19:26 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 2 May 2007 10:19:26 -0600 Subject: [Wtr-general] 'Unable to locate object' problem In-Reply-To: References: Message-ID: You're trying to write to what appears to be a frame not the textarea. ie.text_field(:name, 'SN_NOTESSText').set('this should work') -Charley On 5/2/07, Imran Hussain wrote: > > Hi, > > 'Unable to locate object' problem > > When running the following show_all_objects command, I get; > > rb(main):016:0> ie.show_all_objects > -----------Objects in page ------------- > HTML Document name= id=SN_NOTESSFrame src= > textarea name=SN_NOTESSText id= value= > > How do I write to this object? do I use this: > > ie.text_field(:id ,"SN_NOTESSFrame").set("TESTING 1234") > > Is this within a frame?? > This doesn't seem to be working .... can someone help? > > Thanks, > Imran > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070502/5bbc8640/attachment.html From jeff.fry at gmail.com Wed May 2 13:42:09 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Wed, 2 May 2007 10:42:09 -0700 Subject: [Wtr-general] How to identify the nth instance of a div? In-Reply-To: <32078010.18571178119698374.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <970956b0705020704m378c247ah1bd1e85bf746a665@mail.gmail.com> <32078010.18571178119698374.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <970956b0705021042u541cad35y5ac3818caf110f33@mail.gmail.com> On 5/2/07, Jason wrote: > > > Perfect - that's exactly what I was after. Cool. Must have missed that in my tutorials and readings. Lovely. :index is in the rdoc already, but :class and multiple attribute support aren't there yet. I have started writing both up, and hope to get a good bit done over the next week and a half. Happy scripting! Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070502/57e74ddd/attachment.html From sgoel at yahoo-inc.com Wed May 2 18:57:03 2007 From: sgoel at yahoo-inc.com (Suman Goel) Date: Wed, 2 May 2007 15:57:03 -0700 Subject: [Wtr-general] Error when loading iframe In-Reply-To: References: <30498002.17081178107224530.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <008001c78d0d$34605c10$e39b15ac@ds.corp.yahoo.com> Try adding the following line after creating the ie instance ie.logger.level = Logger::ERROR This will not show these warnings. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Charley Baker Sent: Wednesday, May 02, 2007 7:46 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Error when loading iframe Try running the latest code from svn, there've been some changes around dealing with frame access errors. Follow this link for the instructions: http://wiki.openqa.org/display/WTR/FAQ#FAQ-devgem -Charley On 5/2/07, John wrote: Hi, When you click on a link in my website an iframe is loaded in the middle of the page. It seems watir has trouble with it, because it gives an error (see below). I use this to click on the link: $ie.link(:url, /club_philips_streamium_management/).click It then returns this error: irb(main):011:0> ie.link(:url, /club_philips_streamium_management/).click WIN32OLERuntimeError: document OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in `method_missing' from C:/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.1158/./watir.rb:1830:in `wait' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in `times' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in `wait' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:2577:in `click' from (irb):11 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Wed May 2 19:56:14 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 2 May 2007 17:56:14 -0600 Subject: [Wtr-general] playing with FireWatir on OSX Message-ID: <72799cd70705021656x56feb7bdq88a86c3429371b24@mail.gmail.com> I've got jssh in place, and I can establish a connection on port 9997, but all the unittest scripts (and my little spike) hang as if nothing is going over the socket. Here's the stack trace after doing CTRL-C: ^C./../container.rb:842:in `recv': Interrupt from ./../container.rb:842:in `read_socket' from ./../container.rb:837:in `each' from ./../container.rb:837:in `read_socket' from ./../firewatir.rb:547:in `wait' from ./../firewatir.rb:259:in `goto' from form_test.rb:11:in `setup' from /usr/local/lib/ruby/1.8/test/unit/testcase.rb:77:in `run' from /usr/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run' ... 9 levels... from /usr/local/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run' from /usr/local/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run' from /usr/local/lib/ruby/1.8/test/unit.rb:278 from form_test.rb:233 From timm at zillow.com Wed May 2 20:06:55 2007 From: timm at zillow.com (Timm Mason) Date: Wed, 2 May 2007 20:06:55 -0400 Subject: [Wtr-general] problem filling text_field - validation fails Message-ID: <4514A6353D36BD4AAE97E53D00D28D0503DD73D3@ms07.mse2.exchange.ms> Hi, I'm having a problem with a text_field. If I populate the value with Watir, then submit, there is a validation that fails. However, I can manually type in the same value and the validation passes. Here's some HTML:
  • Tell us it's for sale
    Close
    Is This Home For Sale?

    What is your relationship to this home?

  • And my code: $b.link(:id, "ownerToolbox_reportSale").click $b.text_field(:id, "ownerToolbox_askingPrice").set("234567") $b.radio(:id, "ownerToolbox_agent").set $b.button(:name, "SubmitButton").click Just started working with Watir and it's great so far. Any help is appreciated! ____________________________________________________ Timm Mason Software Test Engineer P (206) 757-2736 F (206) 470-7001 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070502/fedce310/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1128 bytes Desc: zillow_logo_emailsig.gif Url : http://rubyforge.org/pipermail/wtr-general/attachments/20070502/fedce310/attachment-0001.gif From paul.rogers at shaw.ca Wed May 2 23:34:44 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 02 May 2007 21:34:44 -0600 Subject: [Wtr-general] problem filling text_field - validation fails References: <4514A6353D36BD4AAE97E53D00D28D0503DD73D3@ms07.mse2.exchange.ms> Message-ID: <070101c78d33$fe5ffae0$6400a8c0@laptop> Hi Timm I dont see any code that would do validations in the html you've supplied you can also try this, which may help $b.link(:id, "ownerToolbox_reportSale").click $b.text_field(:id, "ownerToolbox_askingPrice").value="234567" $b.radio(:id, "ownerToolbox_agent").set $b.button(:name, "SubmitButton").click this does some slightly different things ----- Original Message ----- From: Timm Mason To: wtr-general at rubyforge.org Sent: Wednesday, May 02, 2007 6:06 PM Subject: [Wtr-general] problem filling text_field - validation fails Hi, I'm having a problem with a text_field. If I populate the value with Watir, then submit, there is a validation that fails. However, I can manually type in the same value and the validation passes. Here's some HTML:
  • Tell us it's for sale
    Close
    Is This Home For Sale?

    What is your relationship to this home?

  • And my code: $b.link(:id, "ownerToolbox_reportSale").click $b.text_field(:id, "ownerToolbox_askingPrice").set("234567") $b.radio(:id, "ownerToolbox_agent").set $b.button(:name, "SubmitButton").click Just started working with Watir and it's great so far. Any help is appreciated! ____________________________________________________ Timm Mason Software Test Engineer P (206) 757-2736 F (206) 470-7001 ------------------------------------------------------------------------------ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070502/cf0e5894/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1128 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20070502/cf0e5894/attachment.gif From tunde.jinadu at gmail.com Thu May 3 01:02:28 2007 From: tunde.jinadu at gmail.com (Tunde Jinadu) Date: Thu, 3 May 2007 06:02:28 +0100 Subject: [Wtr-general] Field length validation In-Reply-To: <1624b0140705020733q850272bif7cdb7404a5a2891@mail.gmail.com> References: <1624b0140705020733q850272bif7cdb7404a5a2891@mail.gmail.com> Message-ID: <1624b0140705022202q11eccbdflce8ef1bc08214ead@mail.gmail.com> Hi, I'm looking to do the following, attempt to enter text into a field where the max length is x, + one character. I've tried ie.text_field(:name,/tb_FirstName/).set('PHHHHHHHHHHHHHHPL') puts 'Name entered greater than 16 characters' if ie.contains_text("PHHHHHHHHHHHHHHPL") puts("Test Failed. data greater than 16 characters accepted in first name field") else puts("Test Passed. no more than 16 character can be entered in the first name field") end TEST FAILED. following String found in First Name: 'PHHHHHHHHHHHHHHPL' character length greater than 16 characters F but this did not work as the data entered is being read, as opposed to the data displayed. hope this makes sense. -- In the beginning there was nothing. God said, 'Let there be light!' And there was light. There was still nothing, but you could see it a whole lot better. - Ellen DeGeneres -- In the beginning there was nothing. God said, 'Let there be light!' And there was light. There was still nothing, but you could see it a whole lot better. - Ellen DeGeneres -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070503/ad1a94e6/attachment.html From angrez at gmail.com Thu May 3 02:04:26 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 3 May 2007 11:34:26 +0530 Subject: [Wtr-general] playing with FireWatir on OSX In-Reply-To: <72799cd70705021656x56feb7bdq88a86c3429371b24@mail.gmail.com> References: <72799cd70705021656x56feb7bdq88a86c3429371b24@mail.gmail.com> Message-ID: Hi Chris, You might want to have a look at this for installing FireWatir or MAC OS X. http://crasch.livejournal.com/550521.html According to the troubleshooting section of this article, the error you are getting is because of incorrect xpi. Let me know if this helps. Regards, Angrez On 5/3/07, Chris McMahon wrote: > > I've got jssh in place, and I can establish a connection on port 9997, > but all the unittest scripts (and my little spike) hang as if nothing > is going over the socket. Here's the stack trace after doing CTRL-C: > > > ^C./../container.rb:842:in `recv': Interrupt > from ./../container.rb:842:in `read_socket' > from ./../container.rb:837:in `each' > from ./../container.rb:837:in `read_socket' > from ./../firewatir.rb:547:in `wait' > from ./../firewatir.rb:259:in `goto' > from form_test.rb:11:in `setup' > from /usr/local/lib/ruby/1.8/test/unit/testcase.rb:77:in `run' > from /usr/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run' > ... 9 levels... > from /usr/local/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run' > from /usr/local/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run' > from /usr/local/lib/ruby/1.8/test/unit.rb:278 > from form_test.rb:233 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070503/00b91a30/attachment.html From zeljko.filipin at gmail.com Thu May 3 02:24:28 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 3 May 2007 08:24:28 +0200 Subject: [Wtr-general] Field length validation In-Reply-To: <1624b0140705022202q11eccbdflce8ef1bc08214ead@mail.gmail.com> References: <1624b0140705020733q850272bif7cdb7404a5a2891@mail.gmail.com> <1624b0140705022202q11eccbdflce8ef1bc08214ead@mail.gmail.com> Message-ID: Hi Tunde, Text you enter at text field is not included in ie.contains_text. To see what is entered in text field you can use this. ie.text_field(:name,/tb_FirstName/).value Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070503/7c71de28/attachment-0001.html From tunde.jinadu at gmail.com Thu May 3 04:33:49 2007 From: tunde.jinadu at gmail.com (Tunde Jinadu) Date: Thu, 3 May 2007 09:33:49 +0100 Subject: [Wtr-general] Field length validation In-Reply-To: References: <1624b0140705020733q850272bif7cdb7404a5a2891@mail.gmail.com> <1624b0140705022202q11eccbdflce8ef1bc08214ead@mail.gmail.com> Message-ID: <1624b0140705030133mbfce17ah4609a68c2db59758@mail.gmail.com> Thanks Zeljko, I'll give it a try On 5/3/07, ?eljko Filipin wrote: > > Hi Tunde, > > Text you enter at text field is not included in ie.contains_text. To see > what is entered in text field you can use this. > > ie.text_field(:name,/tb_FirstName/).value > > Zeljko > -- > ZeljkoFilipin.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- In the beginning there was nothing. God said, 'Let there be light!' And there was light. There was still nothing, but you could see it a whole lot better. - Ellen DeGeneres -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070503/057e715e/attachment.html From forum-watir-users at openqa.org Thu May 3 05:01:41 2007 From: forum-watir-users at openqa.org (John) Date: Thu, 03 May 2007 04:01:41 CDT Subject: [Wtr-general] Error when loading iframe In-Reply-To: <30498002.17081178107224530.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <34167445.25101178182931455.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you very much! Downloading the latest development build solved this issue and it now works fine. From imran_x at hotmail.com Thu May 3 05:32:51 2007 From: imran_x at hotmail.com (Imran Hussain) Date: Thu, 3 May 2007 10:32:51 +0100 Subject: [Wtr-general] Wtr-general Digest, Vol 42, Issue 3 Message-ID: Hi Charley, Thanks for the info but it still doesn't work, I now get the following error: c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3388:in `method_missing': focus (WIN32OLERuntimeError) OLE error code:800A083E in htmlfile Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus. HRESULT error code:0x80020009 Exception occurred. from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3388:in `set' Thanks, Imran > From: wtr-general-request at rubyforge.org> Subject: Wtr-general Digest, Vol 42, Issue 3> To: wtr-general at rubyforge.org> Date: Wed, 2 May 2007 20:19:00 -0400> > Send Wtr-general mailing list submissions to> wtr-general at rubyforge.org> > To subscribe or unsubscribe via the World Wide Web, visit> http://rubyforge.org/mailman/listinfo/wtr-general> or, via email, send a message with subject or body 'help' to> wtr-general-request at rubyforge.org> > You can reach the person managing the list at> wtr-general-owner at rubyforge.org> > When replying, please edit your Subject line so it is more specific> than "Re: Contents of Wtr-general digest..."> > > Today's Topics:> > 1. Re: How to identify the nth instance of a div? (Jason)> 2. 'Unable to locate object' problem (Imran Hussain)> 3. Re: 'Unable to locate object' problem (Charley Baker)> 4. Re: How to identify the nth instance of a div? (Jeff Fry)> 5. Re: Error when loading iframe (Suman Goel)> 6. playing with FireWatir on OSX (Chris McMahon)> 7. problem filling text_field - validation fails (Timm Mason)> > > ----------------------------------------------------------------------> > Message: 1> Date: Wed, 02 May 2007 10:27:48 CDT> From: Jason > Subject: Re: [Wtr-general] How to identify the nth instance of a div?> To: wtr-general at rubyforge.org> Message-ID:> <32078010.18571178119698374.JavaMail.oqa-j2ee at openqa01.managed.contegix.com>> > Content-Type: text/plain; charset=ISO-8859-1> > > You can also identify elements using multiple attributes, for example :class and :index :

    ie.div(:class => 'contentItem', :index => 3)  # access the 3rd div with a class of '> > > > Perfect - that's exactly what I was after. Must have missed that in my tutorials and readings. Lovely.> > > ------------------------------> > Message: 2> Date: Wed, 2 May 2007 17:04:45 +0100> From: Imran Hussain > Subject: [Wtr-general] 'Unable to locate object' problem> To: > Cc: "imran_x at hotmail.com" > Message-ID: > Content-Type: text/plain; charset="iso-8859-1"> > Hi,> > 'Unable to locate object' problem> > When running the following show_all_objects command, I get;> > rb(main):016:0> ie.show_all_objects-----------Objects in page -------------> HTML Document name= id=SN_NOTESSFrame src=textarea name=SN_NOTESSText id= value=> > How do I write to this object? do I use this:> > ie.text_field(:id ,"SN_NOTESSFrame").set("TESTING 1234")> > Is this within a frame??> This doesn't seem to be working .... can someone help?> > Thanks,Imran> -------------- next part --------------> An HTML attachment was scrubbed...> URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070502/57205157/attachment-0001.html > > ------------------------------> > Message: 3> Date: Wed, 2 May 2007 10:19:26 -0600> From: "Charley Baker" > Subject: Re: [Wtr-general] 'Unable to locate object' problem> To: wtr-general at rubyforge.org> Message-ID:> > Content-Type: text/plain; charset="iso-8859-1"> > You're trying to write to what appears to be a frame not the textarea.> > ie.text_field(:name, 'SN_NOTESSText').set('this should work')> > > > -Charley> > > On 5/2/07, Imran Hussain wrote:> >> > Hi,> >> > 'Unable to locate object' problem> >> > When running the following show_all_objects command, I get;> >> > rb(main):016:0> ie.show_all_objects> > -----------Objects in page -------------> > HTML Document name= id=SN_NOTESSFrame src=> > textarea name=SN_NOTESSText id= value=> >> > How do I write to this object? do I use this:> >> > ie.text_field(:id ,"SN_NOTESSFrame").set("TESTING 1234")> >> > Is this within a frame??> > This doesn't seem to be working .... can someone help?> >> > Thanks,> > Imran> >> >> >> > _______________________________________________> > Wtr-general mailing list> > Wtr-general at rubyforge.org> > http://rubyforge.org/mailman/listinfo/wtr-general> >> -------------- next part --------------> An HTML attachment was scrubbed...> URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070502/5bbc8640/attachment-0001.html > > ------------------------------> > Message: 4> Date: Wed, 2 May 2007 10:42:09 -0700> From: "Jeff Fry" > Subject: Re: [Wtr-general] How to identify the nth instance of a div?> To: wtr-general at rubyforge.org> Message-ID:> <970956b0705021042u541cad35y5ac3818caf110f33 at mail.gmail.com>> Content-Type: text/plain; charset="iso-8859-1"> > On 5/2/07, Jason wrote:> >> >> > Perfect - that's exactly what I was after.> > > Cool.> > Must have missed that in my tutorials and readings. Lovely.> > > :index is in the rdoc already, but :class and multiple attribute support> aren't there yet. I have started writing both up, and hope to get a good bit> done over the next week and a half.> > Happy scripting!> Jeff> > -- > http://testingjeff.wordpress.com> -------------- next part --------------> An HTML attachment was scrubbed...> URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070502/57e74ddd/attachment-0001.html > > ------------------------------> > Message: 5> Date: Wed, 2 May 2007 15:57:03 -0700> From: "Suman Goel" > Subject: Re: [Wtr-general] Error when loading iframe> To: > Message-ID: <008001c78d0d$34605c10$e39b15ac at ds.corp.yahoo.com>> Content-Type: text/plain; charset="us-ascii"> > Try adding the following line after creating the ie instance> ie.logger.level = Logger::ERROR> > This will not show these warnings.> > -----Original Message-----> From: wtr-general-bounces at rubyforge.org> [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Charley Baker> Sent: Wednesday, May 02, 2007 7:46 AM> To: wtr-general at rubyforge.org> Subject: Re: [Wtr-general] Error when loading iframe> > Try running the latest code from svn, there've been some changes around> dealing with frame access errors. Follow this link for the instructions:> http://wiki.openqa.org/display/WTR/FAQ#FAQ-devgem > > -Charley > > > On 5/2/07, John wrote:> > Hi,> > When you click on a link in my website an iframe is loaded in the> middle of the page. It seems watir has trouble with it, because it gives an> error (see below). I use this to click on the link: $ie.link(:url,> /club_philips_streamium_management/).click > It then returns this error:> > irb(main):011:0> ie.link(:url,> /club_philips_streamium_management/).click> WIN32OLERuntimeError: document> OLE error code:80070005 in > Access is denied. > > HRESULT error code:0x80020009> Exception occurred.> from> C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in> `method_missing'> from C:/ruby/lib/ruby/gems/1.8/gems/watir-> 1.5.1.1158/./watir.rb:1830:in `wait'> from> C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in `times'> from> C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in `wait' > from> C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:2577:in `click'> from (irb):11> _______________________________________________> Wtr-general mailing list> Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general> > > > > > > ------------------------------> > Message: 6> Date: Wed, 2 May 2007 17:56:14 -0600> From: "Chris McMahon" > Subject: [Wtr-general] playing with FireWatir on OSX> To: wtr-general at rubyforge.org> Message-ID:> <72799cd70705021656x56feb7bdq88a86c3429371b24 at mail.gmail.com>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed> > I've got jssh in place, and I can establish a connection on port 9997,> but all the unittest scripts (and my little spike) hang as if nothing> is going over the socket. Here's the stack trace after doing CTRL-C:> > > ^C./../container.rb:842:in `recv': Interrupt> from ./../container.rb:842:in `read_socket'> from ./../container.rb:837:in `each'> from ./../container.rb:837:in `read_socket'> from ./../firewatir.rb:547:in `wait'> from ./../firewatir.rb:259:in `goto'> from form_test.rb:11:in `setup'> from /usr/local/lib/ruby/1.8/test/unit/testcase.rb:77:in `run'> from /usr/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'> ... 9 levels...> from /usr/local/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run'> from /usr/local/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run'> from /usr/local/lib/ruby/1.8/test/unit.rb:278> from form_test.rb:233> > > ------------------------------> > Message: 7> Date: Wed, 2 May 2007 20:06:55 -0400> From: "Timm Mason" > Subject: [Wtr-general] problem filling text_field - validation fails> To: > Message-ID:> <4514A6353D36BD4AAE97E53D00D28D0503DD73D3 at ms07.mse2.exchange.ms>> Content-Type: text/plain; charset="us-ascii"> > Hi, I'm having a problem with a text_field. If I populate the value> with Watir, then submit, there is a validation that fails. However, I> can manually type in the same value and the validation passes.> > Here's some HTML:>
  • > id="ownerToolbox_reportSale">Tell us it's for sale> >
    > href="javascript:void(0)" class="close">Close>
    >
    Is This Home For Sale?
    > >
    >
    action="/HomeDetails,ownerToolbox.reportForSalePopup.reportForSaleForm.s> direct" name="reportForSaleForm_0" id="reportForSaleForm_0">>
    value="ownerToolbox_askingPrice,salePriceField,claimTypeRadioGroup,Submi> tButton"/>> value="ZH4sIAAAAAAAAAI1Svy9DURQ+r9EY/EhpYkNDrQ8J0ZEmGk2kXjB1u7zTuvp673Xe> fb1tB2FhsLIZDMb+K0a7WIVVYnJfUSGRGu5w7znfd77z3a/zDEkzDAD2JEPNNCozCDDQVtwP> CcYOWYO5ARNVtyg0VpHGH29uX0/PcwlwipBssCDCJkHqu68U1feQzjpXk0OXDxcJgKZKPBXA> LDowLY1A2pUy2JNNl1BJ0gVJOyxAT6pIwYhCCnmo0S/H84/gGKALzjmQkZUKUlFUpJsNuKiF> WY9khQe47nO9aR8g3UNvo45IeKyKGlL1VpsHgTTzn/1mwYGpbzLNarjVQPJkqLmo9hEyCjAk> iaOwVnEpNCRLdokDs+LAXBstQ91auIHMR3KZ7+dJ1pCsjnhUH+rVf1NM9Ch6xRKr213BLDkw> 85ukr9GxhkGz7MDsb2ikfHuJcX8t8IFNA6S0xa75occo1mJ7fsQnb38dmbjL0Mn99duLjU/5> Kz4KupHb57ql3gFtyY3GkAIAAA=="/>> > > >
    >
    >

    > > id="ownerToolbox_askingPrice"/>> >

    > >

    What is your relationship to this home?

    > >
      >
    • id="ownerToolbox_owner"/>
    • >
    • id="ownerToolbox_agent"/>
    • >
    • checked="checked" value="2" id="ownerToolbox_other"/>
    • >
    > > > name="HomeDetails/ownerToolbox.reportForSalePopup.reportForSaleForm_Subm> itButton_submitflag"> id="HomeDetails/ownerToolbox.reportForSalePopup.reportForSaleForm_Submit> Button_submitflag" value="0">> > > > >
    >
    >
    > >
    >
    >
  • > > And my code:> $b.link(:id, "ownerToolbox_reportSale").click> $b.text_field(:id, "ownerToolbox_askingPrice").set("234567")> $b.radio(:id, "ownerToolbox_agent").set> $b.button(:name, "SubmitButton").click> > Just started working with Watir and it's great so far. Any help is> appreciated!> > ____________________________________________________ > > Timm Mason> Software Test Engineer> P (206) 757-2736> F (206) 470-7001> > > > -------------- next part --------------> An HTML attachment was scrubbed...> URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070502/fedce310/attachment.html > -------------- next part --------------> A non-text attachment was scrubbed...> Name: not available> Type: image/gif> Size: 1128 bytes> Desc: zillow_logo_emailsig.gif> Url : http://rubyforge.org/pipermail/wtr-general/attachments/20070502/fedce310/attachment.gif > > ------------------------------> > _______________________________________________> Wtr-general mailing list> Wtr-general at rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general> > End of Wtr-general Digest, Vol 42, Issue 3> ****************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070503/d20d91d7/attachment-0001.html From sw_latha at yahoo.com Thu May 3 07:28:37 2007 From: sw_latha at yahoo.com (swarna latha) Date: Thu, 3 May 2007 04:28:37 -0700 (PDT) Subject: [Wtr-general] FireWatir -1.0.2 - help Message-ID: <175584.6464.qm@web56201.mail.re3.yahoo.com> Hi, I have successfully installed the Firewatir 1.0.2 gem and Jssh XPI following the Installation Guide for FireWatir. Now, I have some scripts that run fine with IE - Watir. After doing elementary changes like Initializing the browser - firefox ($ff = FireWatir::Firefox:new), the same script fails with firewatir. Problem: The execution hangs at $ff.down_load_time and the output is blank in spreadsheet(csv file) Question: Is this function *down_load_time* valid for Firefox as well?If not any enhanced Methods or functions are introduced? however the script runs fine on IE. Note# Any documentation or Faq on firewatir exclusively would be helpful. What are the steps involved in running IE watir scripts for Firefox on firewatir? Please find the main and function scripts attached along with the excel file. Would appreciate any help to find my mistake....:) Thanks for the Help... Swarna. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- A non-text attachment was scrubbed... Name: OurCityFnFF.rb Type: application/octet-stream Size: 1890 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20070503/2183facf/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: OurCityMnFF.rb Type: application/octet-stream Size: 123 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20070503/2183facf/attachment-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: List.xls Type: application/octet-stream Size: 13824 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20070503/2183facf/attachment-0002.obj From angrez at gmail.com Thu May 3 07:55:53 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 3 May 2007 17:25:53 +0530 Subject: [Wtr-general] FireWatir -1.0.2 - help In-Reply-To: <175584.6464.qm@web56201.mail.re3.yahoo.com> References: <175584.6464.qm@web56201.mail.re3.yahoo.com> Message-ID: Hi, FireWatir is not fully compatible with the latest watir versions. down_load_time method is not defined for Firewatir. You can refer to the Rdoc for the documentation. Regards, Angrez On 5/3/07, swarna latha wrote: > > Hi, > I have successfully installed the Firewatir 1.0.2 gem and Jssh XPI > following the Installation Guide for FireWatir. Now, I have some scripts > that run fine with IE - Watir. After doing elementary changes like > Initializing the browser - firefox ($ff = FireWatir::Firefox:new), the same > script fails with firewatir. > > Problem: The execution hangs at $ff.down_load_time and the output is > blank in spreadsheet(csv file) > Question: Is this function *down_load_time* valid for Firefox as well?If > not any enhanced Methods or functions are introduced? however the script > runs fine on IE. > > Note# Any documentation or Faq on firewatir exclusively would be helpful. > What are the steps involved in running IE watir scripts for Firefox on > firewatir? > Please find the main and function scripts attached along with the excel > file. > Would appreciate any help to find my mistake....:) > > Thanks for the Help... > Swarna. > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070503/855d7402/attachment.html From charley.baker at gmail.com Thu May 3 10:48:40 2007 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 3 May 2007 08:48:40 -0600 Subject: [Wtr-general] 'Unable to locate object' problem Message-ID: Hi, Please edit responses to refer to the original header and not the digest header. I missed the fact that the src attribute is pointing to textarea, it's not a text control. Try using IE developer toolbar to find the control and some sort of identifiable attribute - name, id, index. Then use that to set it in Watir. http://www.microsoft.com/downloads/details.aspx?FamilyID=E59C3964-672D-4511-BB3E-2D5E1DB91038 -Charley On 5/3/07, Imran Hussain wrote: > > Hi Charley, > > Thanks for the info but it still doesn't work, I now get the following > error: > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3388:in `method_missing': focus > (WIN32OL > ERuntimeError) > OLE error code:800A083E in htmlfile > Can't move focus to the control because it is invisible, not > enabled, or o > f a type that does not accept the focus. > HRESULT error code:0x80020009 > Exception occurred. from > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:338 > 8:in `set' > > > Thanks, > Imran > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070503/705b0836/attachment-0001.html From christopher.mcmahon at gmail.com Thu May 3 11:01:07 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 3 May 2007 09:01:07 -0600 Subject: [Wtr-general] playing with FireWatir on OSX In-Reply-To: References: <72799cd70705021656x56feb7bdq88a86c3429371b24@mail.gmail.com> Message-ID: <72799cd70705030801s2dbafe69kf977c538d1ee52e1@mail.gmail.com> On 5/3/07, Angrez Singh wrote: > Hi Chris, > > You might want to have a look at this for installing FireWatir or MAC OS X. > http://crasch.livejournal.com/550521.html > > According to the troubleshooting section of this article, the error you are > getting is because of incorrect xpi. Ah, I didn't read that far, thanks. I've tried both Darwin xpi files and the Linux xpi file from http://people.mozilla.com/~davel/jssh/. The earlier Darwin one fails to open port 9997 at all; the later Darwin one opens port 9997, but doesn't seem to communicate; the Linux one appears in the FF Tools menu, but I can't seem to activate it-- it's UI won't let me click "OK", although it will let me click "Cancel". From angrez at gmail.com Thu May 3 11:06:10 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 3 May 2007 20:36:10 +0530 Subject: [Wtr-general] playing with FireWatir on OSX In-Reply-To: <72799cd70705030801s2dbafe69kf977c538d1ee52e1@mail.gmail.com> References: <72799cd70705021656x56feb7bdq88a86c3429371b24@mail.gmail.com> <72799cd70705030801s2dbafe69kf977c538d1ee52e1@mail.gmail.com> Message-ID: Hi Chris, Did you tried the XPI at http://alephzarro.com/blog/2007/03/12/jssh-for-firefox-on-linux-because-firewatir-loves-it Its an XPI for linux but seems to work on Mac OS also (according the link i sent you in last mail) Regards, Angrez On 5/3/07, Chris McMahon wrote: > > On 5/3/07, Angrez Singh wrote: > > Hi Chris, > > > > You might want to have a look at this for installing FireWatir or MAC OS > X. > > http://crasch.livejournal.com/550521.html > > > > According to the troubleshooting section of this article, the error you > are > > getting is because of incorrect xpi. > > Ah, I didn't read that far, thanks. > > I've tried both Darwin xpi files and the Linux xpi file from > http://people.mozilla.com/~davel/jssh/. The earlier Darwin one fails > to open port 9997 at all; the later Darwin one opens port 9997, but > doesn't seem to communicate; the Linux one appears in the FF Tools > menu, but I can't seem to activate it-- it's UI won't let me click > "OK", although it will let me click "Cancel". > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070503/375e8330/attachment.html From christopher.mcmahon at gmail.com Thu May 3 11:22:56 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 3 May 2007 09:22:56 -0600 Subject: [Wtr-general] playing with FireWatir on OSX In-Reply-To: References: <72799cd70705021656x56feb7bdq88a86c3429371b24@mail.gmail.com> <72799cd70705030801s2dbafe69kf977c538d1ee52e1@mail.gmail.com> Message-ID: <72799cd70705030822k4451ccd1o7981ff82beaaccb4@mail.gmail.com> On 5/3/07, Angrez Singh wrote: > Hi Chris, > > Did you tried the XPI at > http://alephzarro.com/blog/2007/03/12/jssh-for-firefox-on-linux-because-firewatir-loves-it > Its an XPI for linux but seems to work on Mac OS also (according the link i > sent you in last mail) Yay! That one works. Interestingly, it has the same name as the one from mozilla, but it behaves differently. -Chris From forum-watir-users at openqa.org Thu May 3 14:03:05 2007 From: forum-watir-users at openqa.org (Venkata) Date: Thu, 03 May 2007 13:03:05 CDT Subject: [Wtr-general] How do I connect to MS SQL 2005 using Ruby? In-Reply-To: <72799cd70702070747g66ca0aecg630a06bdd7d6dc57@mail.gmail.com> Message-ID: <27192128.981178215415305.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Charley, Do you have an example Test script executing SQL from water - ruby. please can you attach that. I need as soon as possible. Thanks, From charley.baker at gmail.com Thu May 3 14:55:44 2007 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 3 May 2007 12:55:44 -0600 Subject: [Wtr-general] How do I connect to MS SQL 2005 using Ruby? In-Reply-To: <27192128.981178215415305.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <72799cd70702070747g66ca0aecg630a06bdd7d6dc57@mail.gmail.com> <27192128.981178215415305.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: This is straight ruby and dbi, take a look at this link: http://www.kitebird.com/articles/ruby-dbi.html -c On 5/3/07, Venkata wrote: > > Charley, > > Do you have an example Test script executing SQL from water - ruby. > please can you attach that. > > I need as soon as possible. > > Thanks, > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070503/76517449/attachment.html From forum-watir-users at openqa.org Thu May 3 15:07:16 2007 From: forum-watir-users at openqa.org (Venkata) Date: Thu, 03 May 2007 14:07:16 CDT Subject: [Wtr-general] can you help why ODBC connection failure worked one time and not working no Message-ID: <27238663.1831178219266594.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> helo all, I am trying to connect to SQL server through ODBC. Steps 1) I alreday have ODBC available. 2) Created a DSN and tested with Test connection there. 3) verified C:\IRBmain> Require 'ODBC' > true. 4) I created a scripts according to the examples. require 'watir' require 'ODBC' include 'watir' require 'Driver' #~ # Connect to the Databse conn = ODBC::connect('Myvalue','user','password') #~ # get the from the table h = conn.run("SELECT * FROM tableName where ssn = 'ssn'") #~ # get the ecah field value and prints to the log. h.each do |row| puts row end it worked and retrieved the values one time. Now it is not idetifying the ODBC anymore. i am getting Load error. ruby DBconnect.rb c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt/ODBC.so: 127: The specified procedure could not be found. - Init_ODBC (LoadError) c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt/ODBC.so from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from DBconnect.rb:2 Please can you help me. do i have to disconnect? if it is please tell me how May be ODBC::disconnect ? Thanks, From christopher.mcmahon at gmail.com Thu May 3 15:42:47 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 3 May 2007 13:42:47 -0600 Subject: [Wtr-general] can you help why ODBC connection failure worked one time and not working no In-Reply-To: <27238663.1831178219266594.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <27238663.1831178219266594.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70705031242s13d01012p436198eb0b5c46aa@mail.gmail.com> I think it should be require 'odbc' not require 'ODBC' PS also should be include Watir I don't know what the "Driver" is. On 5/3/07, Venkata wrote: > helo all, > > I am trying to connect to SQL server through ODBC. > > Steps > 1) I alreday have ODBC available. > 2) Created a DSN and tested with Test connection there. > 3) verified C:\IRBmain> Require 'ODBC' > true. > > 4) I created a scripts according to the examples. > > > require 'watir' > require 'ODBC' > include 'watir' > require 'Driver' > > #~ # Connect to the Databse > conn = ODBC::connect('Myvalue','user','password') > > #~ # get the from the table > h = conn.run("SELECT * FROM tableName where ssn = 'ssn'") > > > #~ # get the ecah field value and prints to the log. > h.each do |row| > puts row > end > > > it worked and retrieved the values one time. > > Now it is not idetifying the ODBC anymore. i am getting Load error. > > ruby DBconnect.rb > c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt/ODBC.so: 127: The specified procedure could not be found. > - Init_ODBC (LoadError) > c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt/ODBC.so from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' > from DBconnect.rb:2 > > > > > Please can you help me. > > do i have to disconnect? if it is please tell me how May be > > ODBC::disconnect ? > > Thanks, > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Thu May 3 15:58:59 2007 From: forum-watir-users at openqa.org (Ken) Date: Thu, 03 May 2007 14:58:59 CDT Subject: [Wtr-general] Finding the name of objects Message-ID: <29807791.2121178222369071.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I just got started with this and am trying to write a simple script to get my feet wet. I was following the googlesearch.rb case that is provided. My question is how do you find the name of the object that you want to perform an action with? For example: ie.text_field(:name, "q").set("pickaxe") # q is the name of the search field How do you know that q is the name of the search field? I viewed the source of the page and eventually found the field named q but it was not obvious or easy. It was so murky that if I didnt know already that the fields name was q I never would have found it. Is there a simple way to identify a list box, text field, radio button...etc? Thanks. From christopher.mcmahon at gmail.com Thu May 3 16:05:39 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 3 May 2007 14:05:39 -0600 Subject: [Wtr-general] Finding the name of objects In-Reply-To: <29807791.2121178222369071.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <29807791.2121178222369071.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70705031305t63f34446ya7969f5d2a1e0b3f@mail.gmail.com> The Developer Toolbar is great http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en Also, Watir has nice "show_all_*" methods we like to use from IRB. Using the "flash" method from IRB is also recommended. And eventually, you even get pretty good at reading the HTML. -Chris On 5/3/07, Ken wrote: > I just got started with this and am trying to write a simple script to get my feet wet. I was following the googlesearch.rb case that is provided. My question is how do you find the name of the object that you want to perform an action with? For example: > > ie.text_field(:name, "q").set("pickaxe") # q is the name of the search field > > How do you know that q is the name of the search field? I viewed the source of the page and eventually found the field named q but it was not obvious or easy. It was so murky that if I didnt know already that the fields name was q I never would have found it. Is there a simple way to identify a list box, text field, radio button...etc? > > Thanks. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From charley.baker at gmail.com Thu May 3 16:12:24 2007 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 3 May 2007 14:12:24 -0600 Subject: [Wtr-general] Finding the name of objects In-Reply-To: <29807791.2121178222369071.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <29807791.2121178222369071.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: I'm starting to sound like a broken record and was just thinking about updating the user guide for this. Use the ie developer toolbar to find controls and identify them, while being familiar with the html source and some basic knowledge around the dom is important, this will also help: http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en -Charley On 5/3/07, Ken wrote: > > I just got started with this and am trying to write a simple script to get > my feet wet. I was following the googlesearch.rb case that is > provided. My question is how do you find the name of the object that you > want to perform an action with? For example: > > ie.text_field(:name, "q").set("pickaxe") # q is the name of the search > field > > How do you know that q is the name of the search field? I viewed the > source of the page and eventually found the field named q but it was not > obvious or easy. It was so murky that if I didnt know already that the > fields name was q I never would have found it. Is there a simple way to > identify a list box, text field, radio button...etc? > > Thanks. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070503/e6b2b56b/attachment-0001.html From charley.baker at gmail.com Thu May 3 16:14:43 2007 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 3 May 2007 14:14:43 -0600 Subject: [Wtr-general] can you help why ODBC connection failure worked one time and not working no In-Reply-To: <27238663.1831178219266594.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <27238663.1831178219266594.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: I'm not familiar with any ODBC library. You should use DBI if you want to go this route which in turn has an ODBC driver. http://www.kitebird.com/articles/ruby-dbi.html -Charley On 5/3/07, Venkata wrote: > > helo all, > > I am trying to connect to SQL server through ODBC. > > Steps > 1) I alreday have ODBC available. > 2) Created a DSN and tested with Test connection there. > 3) verified C:\IRBmain> Require 'ODBC' > true. > > 4) I created a scripts according to the examples. > > > require 'watir' > require 'ODBC' > include 'watir' > require 'Driver' > > #~ # Connect to the Databse > conn = ODBC::connect('Myvalue','user','password') > > #~ # get the from the table > h = conn.run("SELECT * FROM tableName where ssn = 'ssn'") > > > #~ # get the ecah field value and prints to the log. > h.each do |row| > puts row > end > > > it worked and retrieved the values one time. > > Now it is not idetifying the ODBC anymore. i am getting Load error. > > ruby DBconnect.rb > c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt/ODBC.so: 127: The specified > procedure could not be found. > - Init_ODBC (LoadError) > c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt/ODBC.so from > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' > from DBconnect.rb:2 > > > > > Please can you help me. > > do i have to disconnect? if it is please tell me how May be > > ODBC::disconnect ? > > Thanks, > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070503/ef3ac283/attachment.html From paul.rogers at shaw.ca Thu May 3 16:16:12 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 03 May 2007 14:16:12 -0600 Subject: [Wtr-general] Finding the name of objects References: <29807791.2121178222369071.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <07da01c78dbf$e5390de0$6400a8c0@laptop> you can also use the show_all_objects method, like this in irb require 'watir' ie=Watir::IE.attach(:title , 'the title of your browser window') ie.show_all_objects and then you can use flash and to_s ie.text_field(:index,1).flash ie.text_field(:index,1).to_s ----- Original Message ----- From: Charley Baker To: wtr-general at rubyforge.org Sent: Thursday, May 03, 2007 2:12 PM Subject: Re: [Wtr-general] Finding the name of objects I'm starting to sound like a broken record and was just thinking about updating the user guide for this. Use the ie developer toolbar to find controls and identify them, while being familiar with the html source and some basic knowledge around the dom is important, this will also help: http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en -Charley On 5/3/07, Ken wrote: I just got started with this and am trying to write a simple script to get my feet wet. I was following the googlesearch.rb case that is provided. My question is how do you find the name of the object that you want to perform an action with? For example: ie.text_field(:name, "q").set("pickaxe") # q is the name of the search field How do you know that q is the name of the search field? I viewed the source of the page and eventually found the field named q but it was not obvious or easy. It was so murky that if I didnt know already that the fields name was q I never would have found it. Is there a simple way to identify a list box, text field, radio button...etc? Thanks. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------------------------------------------------------ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070503/dd3a7518/attachment.html From paul.rogers at shaw.ca Thu May 3 16:19:53 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 03 May 2007 14:19:53 -0600 Subject: [Wtr-general] Finding the name of objects References: <29807791.2121178222369071.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <07da01c78dbf$e5390de0$6400a8c0@laptop> Message-ID: <07f201c78dc0$68cf45c0$6400a8c0@laptop> oops, you can also do this too give focus to the element you are interested in ( for a text field, just click in it , for a link you have to tab to it ) then do ie.show_active Paul ----- Original Message ----- From: Paul Rogers To: wtr-general at rubyforge.org Sent: Thursday, May 03, 2007 2:16 PM Subject: Re: [Wtr-general] Finding the name of objects you can also use the show_all_objects method, like this in irb require 'watir' ie=Watir::IE.attach(:title , 'the title of your browser window') ie.show_all_objects and then you can use flash and to_s ie.text_field(:index,1).flash ie.text_field(:index,1).to_s ----- Original Message ----- From: Charley Baker To: wtr-general at rubyforge.org Sent: Thursday, May 03, 2007 2:12 PM Subject: Re: [Wtr-general] Finding the name of objects I'm starting to sound like a broken record and was just thinking about updating the user guide for this. Use the ie developer toolbar to find controls and identify them, while being familiar with the html source and some basic knowledge around the dom is important, this will also help: http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en -Charley On 5/3/07, Ken wrote: I just got started with this and am trying to write a simple script to get my feet wet. I was following the googlesearch.rb case that is provided. My question is how do you find the name of the object that you want to perform an action with? For example: ie.text_field(:name, "q").set("pickaxe") # q is the name of the search field How do you know that q is the name of the search field? I viewed the source of the page and eventually found the field named q but it was not obvious or easy. It was so murky that if I didnt know already that the fields name was q I never would have found it. Is there a simple way to identify a list box, text field, radio button...etc? Thanks. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ---------------------------------------------------------------------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------------------------------------------------------ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070503/971d699c/attachment.html From forum-watir-users at openqa.org Thu May 3 16:27:08 2007 From: forum-watir-users at openqa.org (Venkata) Date: Thu, 03 May 2007 15:27:08 CDT Subject: [Wtr-general] can you help why ODBC connection failure worked one time and not working no In-Reply-To: <72799cd70705031242s13d01012p436198eb0b5c46aa@mail.gmail.com> Message-ID: <26788460.2631178224058438.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks and it worked. i did not notice that i put caps. thansk for answering all these issues. How to clean the Garbage collection through our script. Thanks you very much. From christopher.mcmahon at gmail.com Thu May 3 16:33:07 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 3 May 2007 14:33:07 -0600 Subject: [Wtr-general] Finding the name of objects In-Reply-To: <07f201c78dc0$68cf45c0$6400a8c0@laptop> References: <29807791.2121178222369071.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <07da01c78dbf$e5390de0$6400a8c0@laptop> <07f201c78dc0$68cf45c0$6400a8c0@laptop> Message-ID: <72799cd70705031333g4f7141c5ja869e9e3769ac592@mail.gmail.com> In fact, do a string search in watir.rb for "show_"-- there are lots of good methods for mucking around in the DOM. -C On 5/3/07, Paul Rogers wrote: > > > oops, you can also do this too > > give focus to the element you are interested in ( for a text field, just > click in it , for a link you have to tab to it ) > then do > ie.show_active > > Paul > > ----- Original Message ----- > From: Paul Rogers > To: wtr-general at rubyforge.org > > Sent: Thursday, May 03, 2007 2:16 PM > Subject: Re: [Wtr-general] Finding the name of objects > > > you can also use the show_all_objects method, like this > > in irb > require 'watir' > ie=Watir::IE.attach(:title , 'the title of your browser window') > ie.show_all_objects > > and then you can use flash and to_s > > ie.text_field(:index,1).flash > ie.text_field(:index,1).to_s > > ----- Original Message ----- > From: Charley Baker > To: wtr-general at rubyforge.org > Sent: Thursday, May 03, 2007 2:12 PM > Subject: Re: [Wtr-general] Finding the name of objects > > I'm starting to sound like a broken record and was just thinking about > updating the user guide for this. Use the ie developer toolbar to find > controls and identify them, while being familiar with the html source and > some basic knowledge around the dom is important, this will also help: > > http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en > > -Charley > > > On 5/3/07, Ken wrote: > > I just got started with this and am trying to write a simple script to get > my feet wet. I was following the googlesearch.rb case that is provided. My > question is how do you find the name of the object that you want to perform > an action with? For example: > > > > ie.text_field(:name, "q").set("pickaxe") # q is the name of the search > field > > > > How do you know that q is the name of the search field? I viewed the > source of the page and eventually found the field named q but it was not > obvious or easy. It was so murky that if I didnt know already that the > fields name was q I never would have found it. Is there a simple way to > identify a list box, text field, radio button...etc? > > > > Thanks. > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > ________________________________ > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > ________________________________ > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From dara.lillis at kiodex.com Thu May 3 17:03:29 2007 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Thu, 3 May 2007 14:03:29 -0700 Subject: [Wtr-general] Finding the name of objects In-Reply-To: <72799cd70705031333g4f7141c5ja869e9e3769ac592@mail.gmail.com> Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E025E518D@ehost011-27.exch011.intermedia.net> In addition to the other suggestions, SpySmith is a useful tool for getting this sort of information. http://qualityforge.com/spysmith/ > On 5/3/07, Ken wrote: > > I just got started with this and am trying to write a simple script > > to get > my feet wet. I was following the googlesearch.rb case that is > provided. My question is how do you find the name of the object that > you want to perform an action with? For example: > > > > ie.text_field(:name, "q").set("pickaxe") # q is the name of the > > search > field > > > > How do you know that q is the name of the search field? I viewed > > the > source of the page and eventually found the field named q but it was > not obvious or easy. It was so murky that if I didnt know already > that the fields name was q I never would have found it. Is there a > simple way to identify a list box, text field, radio button...etc? > > > > Thanks. > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > ________________________________ > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > ________________________________ > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From charley.baker at gmail.com Thu May 3 17:46:29 2007 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 3 May 2007 15:46:29 -0600 Subject: [Wtr-general] can you help why ODBC connection failure worked one time and not working no In-Reply-To: <26788460.2631178224058438.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <72799cd70705031242s13d01012p436198eb0b5c46aa@mail.gmail.com> <26788460.2631178224058438.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: i'm not sure why you'd worry about garbage collection. if you want to, there's a ruby gc library where you can explicity clean it up. -c On 5/3/07, Venkata wrote: > > Thanks and it worked. i did not notice that i put caps. > > thansk for answering all these issues. How to clean the Garbage collection > through our script. > > > Thanks you very much. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070503/d176fe4f/attachment.html From crasch at gmail.com Thu May 3 18:15:00 2007 From: crasch at gmail.com (Chris .Rasch) Date: Thu, 3 May 2007 15:15:00 -0700 Subject: [Wtr-general] Access is denied Message-ID: <28d5af770705031515j2efad93cx908e0f4cb5d9fac8@mail.gmail.com> When running the attached script, while executing line 238, I would get the following error: 1) Error: test_300_buywizard(MT_mtaco): WIN32OLERuntimeError: failed to get IEnum Interface HRESULT error code:0x80070005 Access is denied. marketocracy_login2.rb:61:in `each' marketocracy_login2.rb:61:in `visible_menus' marketocracy_login2.rb:46:in `visible_child_by_text' marketocracy_login2.rb:37:in `nav_menu' marketocracy_login2.rb:239:in `test_300_buywizard' (Line numbering is a bit off since I changed the script after the error message was generated). Note that I called the same function earlier in the test, but don't get the error then. The error appears to arise from line 61 in the load_nav_menu method: @marketocracy_divs.each do |d| The first time it's called, the @marketocracy_divs variable is uninitialized (set to nil). However, when the bug arises, the @marketocracy_divs variable still retains the values it had from a previous call. I suspected I got the "Access is denied" error message because I was trying to access DIV objects that had been created from an earlier page. So I changed line 59 from this: load_nav_menu unless @marketocracy_divs # grab it on the first try to this: load_nav_menu # unless @marketocracy_divs # grab it on the first try This time it ran without error. Since I was apparently able to work around the problem, this is posted mostly in case someone else has a similar problem. However, is my analysis of the cause of the problem correct? Any comments in general on the causes of "Access is denied." error messages? About my system: Watir 1.5 running under cygwin (2.510.2.2) on Windows XP Professional (Version 2002, Service Pack 2). Windows XP is in turn running as a virtual OS under Parallels (Build 3170 RC3) running on OS X Tiger 10.4.9 (2.16 GHz Intel Core 2 Duo) cygwin+cygwin ruby (via cygwin setup.exe)+rubygems-0.9.2 (via tarball)+watir-1.5.1.1164 (via gem) -------------- next part -------------- require 'rubygems' require 'watir' require 'ruby-debug' require 'test/unit' require 'test/unit/ui/console/testrunner' Debugger.start class MarketocracyNavMenuException < Watir::Exception::WatirException; end module Watir # I am patching Watir with some custom code written # specifically for the marketocracy navigation menu. class IE # Once you've opened one of the top 4 menus # use this method to drill down to a specific # menu item by providing a variable length list # of Strings representing the menu items # # Raises MarketocracyNavMenuException # # Typical usage: # # ie.image(:name, "Menu4i").fire_event("onmouseover") # ie.nav_menu("Cash", "Benchmarks", "Alpha Contour") def nav_menu(*path) destination = path.pop # pop removes the last element from an array and returns it path.each do |step| # each step in the path do the following child = visible_child_by_text(step) child.fireEvent("onmouseover") # Wait a few milliseconds for JavaScript to execute sleep 0.2 end visible_child_by_text(destination).click wait load_nav_menu # need to reload divs on each page end private def visible_child_by_text(text) result = nil visible_menus.each do |menu| menu.children.each do |child| if child.innerText == text result = child end end end raise MarketocracyNavMenuException, "Menu item with #{text} was not visible!" unless result result end def visible_menus # execute the load_nav_menu method, unless the @marketocracy_divs variable # has already been set load_nav_menu # unless @marketocracy_divs # grab it on the first try visible = [] @marketocracy_divs.each do |d| # append each visible marketocracy div to the visible array # Where are the style and invoke methods defined? visible << d if d.style.invoke('visibility') =~ /visible/ end # return the array of visible divs visible end def load_nav_menu # Document is defined in watir.rb. It returns an @ie.document object, # @ie is created by WIN32OLE.new('InternetExplorer.Application') @marketocracy_divs = document.getElementsByTagName("DIV") end end end class MT_mtaco < Test::Unit::TestCase include Watir @@tb_adminPassword = "m" @@logins = "m100.csv" @@beginTime = Time.now @@homepageTime = 0 @@overviewTime = 0 @@timeSpreadsheet = File.new(Time.now.strftime("%d-%b-%y") + ".csv", "a") #Note this creates a new file every day... @@maxAllowedLoginTime = 30 @@executionEnvironment = "Test" def close_all_windows loop do begin Watir::IE.attach(:title, //).close rescue Watir::Exception::NoMatchingWindowFoundException break rescue retry end end end def setup begin close_all_windows $ie = Watir::IE.new test_site='http://www.marketocracy.com' $ie.goto(test_site) @@homepageTime = Time.now - @@beginTime end end # def test_100_homepage # teststring = "research" # begin # assert($ie.contains_text("#{teststring}")) # puts("PASSED. Found test string: #{teststring}") # rescue => e # puts("FAILED. Could not find test string: #{teststring}. " + e.message + "\n" + e.backtrace.join("\n")) # end # end # def login(username, password) @@homepageTime = Time.now - @@beginTime error_count = 0 error_message = "" # debugger $ie.text_field(:name, "username").set("#{username}") $ie.text_field(:name, "password").set("#{@@tb_adminPassword}") $ie.button(:name, "Submit").click refresh_count = 0 while $ie.contains_text("PLEASE CLICK HERE TO REFRESH") && refresh_count < 20 sleep 3 $ie.link(:text, /PLEASE CLICK HERE TO REFRESH/ ).click refresh_count += 1 end @@overviewTime = Time.now - @@beginTime if refresh_count >= 20 error_count += 1 puts error_message += "#{error_count}. More than 20 refreshes. " end if !$ie.contains_text("Funds Managed by") error_count +=1 error_count +=1 puts error_message += "#{error_count}. Not on overview page. " end if @@overviewTime > 60 error_count +=1 puts error_message += "#{error_count}. Login time > max allowed login time. " end puts "@@homepageTime: #{@@homepageTime}" puts "@@overviewTime: #{@@overviewTime}" @@timeSpreadsheet.puts "#{@@executionEnvironment}, #{@@homepageTime}, #{@@overviewTime}, #{refresh_count}, #{error_message}" return error_count, error_message end # def test_menu # # ie = Watir::IE.start('http://www.marketocracy.com') # ie.text_field(:name, "username").set("trasch") # ie.text_field(:name, "password").set("m") # ie.button(:name, "Submit").click # # # get my funds loaded asap # refresh_link = ie.link(:text, /PLEASE CLICK HERE TO REFRESH/) # refresh_link.click if refresh_link.exists? # # ie.image(:name, "Menu4i").fire_event("onmouseover") # ie.nav_menu("Cash", "Benchmarks", "Alpha Contour") # # ie.image(:name, "Menu1i").fire_event("onmouseover") # ie.nav_menu("About Us", "Overview") # # end # def test_200_singlelogin # # login = "trasch" # # error_count, error_message = login("#{login}", "#{@@tb_adminPassword}") # # if error_count > 0 # flunk # end # end # def test_250_makeatrade # # login = "trasch" # # error_count, error_message = login("#{login}", "#{@@tb_adminPassword}") # # # debugger # $ie.image(:name, "Menu4i").fire_event("onmouseover") # $ie.nav_menu("Make a Trade") # $ie.text_field(:index, 2).set("MSFT") # $ie.button(:value, "Quote").click # $ie.text_field(:index, 4).set("1") # $ie.button(:value, "Buy").click # if not ($ie.contains_text(/MSFT/) and $ie.contains_text(/Last Filled/)) # error_count +=1 # error_message += "\nPage did not contain expected text" # end # # # if error_count > 0 # puts error_message # flunk # end # end def test_300_buywizard login = "trasch" error_count, error_message = login("#{login}", "#{@@tb_adminPassword}") # debugger $ie.image(:name, "Menu4i").fire_event("onmouseover") $ie.nav_menu("T2", "Buy Wizard") $ie.text_field(:index, 2).set("MSFT") $ie.text_field(:index, 3).set("1") $ie.button(:value, "Buy").click $ie.image(:name, "Menu4i").fire_event("onmouseover") $ie.nav_menu("Make a Trade") if not ($ie.contains_text(/MSFT/) and $ie.contains_text(/Last Filled/)) error_count +=1 error_message += "\nPage did not contain expected text" end if error_count > 0 puts error_message flunk end end # def test_250_sell_wizard # # login = "trasch" # # error_count, error_message = login("#{login}", "#{@@tb_adminPassword}") # # # debugger # $ie.image(:name, "Menu4i").fire_event("onmouseover") # $ie.nav_menu("T2", "Sell Wizard") # # debugger # $ie.text_field(:index, 2).set("MSFT") # $ie.text_field(:index, 3).set("1") # $ie.button(:value, "Buy").click # $ie.image(:name, "Menu4i").fire_event("onmouseover") # $ie.nav_menu("Make a Trade", "Open Orders") # if not ($ie.contains_text(/MSFT/) and $ie.contains_text(/Last Filled/)) # error_count +=1 # error_message += "\nPage did not contain expected text" # end # # # if error_count > 0 # puts error_message # flunk # end # end # def test_300_averagelogin # File.open("#{@@logins}", "r") do |file| # file.each do |login| # error_count, error_message = login("#{login}", "#{@@tb_adminPassword}") # end # end # end end From christopher.mcmahon at gmail.com Thu May 3 19:43:22 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 3 May 2007 17:43:22 -0600 Subject: [Wtr-general] FireWatir not finding buttons by id Message-ID: <72799cd70705031643t614a63b0sc3d1704eacf5cc7f@mail.gmail.com> Hi... Seems like this script should work, but I'm getting FireWatir::Exception::UnknownObjectException: Unable to locate object, using id and for both the buttons. I put the sleeps in in case it was a page-rendering issue, but I don't think that it is. (BTW, feel free to add yourself, log in and try the rest of the script if you want.) ################### require 'rubygems' require 'firewatir' require 'test/unit' require 'firewatir/testUnitAddons' include FireWatir ff = FireWatir::Firefox.new() ff.goto("http://www.socialtext.net/stoss/index.cgi?mcmahon_test") sleep 2 #DOESN'T FIND THIS BUTTON ff.button(:id,'st-login-to-edit-button-link') ff.text_field(:id, 'username').set('myemail at email.com') ff.text_field(:id, 'password').set('mypass') ff.button(:value, 'Log in').click sleep 2 #DOESN'T FIND THIS BUTTON EITHER ff.button(:id,"st-edit-button-link").click ff.text_field(:id,'wikiwyg_wikitext_textarea').set('*test data*') ff.button(:id,'st-save-button-link').click From bret at pettichord.com Fri May 4 00:10:50 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 03 May 2007 23:10:50 -0500 Subject: [Wtr-general] Access is denied In-Reply-To: <28d5af770705031515j2efad93cx908e0f4cb5d9fac8@mail.gmail.com> References: <28d5af770705031515j2efad93cx908e0f4cb5d9fac8@mail.gmail.com> Message-ID: <463AB24A.5010405@pettichord.com> The first time it's called, the @marketocracy_divs variable is uninitialized (set to nil). However, when the bug arises, the @marketocracy_divs variable still retains the values it had from a previous call. I suspected I got the "Access is denied" error message because I was trying to access DIV objects that had been created from an earlier page. Chris, Thanks for sharing your code and your problem. I completely agree with your analysis. Bret From forum-watir-users at openqa.org Fri May 4 01:41:53 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Fri, 04 May 2007 00:41:53 CDT Subject: [Wtr-general] How to write AutoIt script in Watir? Message-ID: <36620496.3611178257343040.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello, I have a test case to run with Internet Option language setting. Can I use autoit to do the Internet Option language setting first and then run web application test in Watir? Here is the test cases I want to do: 1. Open IE window 2. Click on Tools | Internet Options 3. Click Languages 4. Add a language 5. Move the newly created language to the top of the Language Preference list 6. Close IE browser 7. Web application browser is open 8. Testing steps Steps 1-6 using AutoIt Steps 7 using water Script for steps 1 ? 6 using AutoIt: #include $oID = _IECreate ("http://wiki/index.php/Main_Page") WinWaitActive("xxxxxx") Send("Today's time/date is {F5}") Send ("!to") ;sends Alt T (Tools) and O (options) to open Internet Options Send ("!L") Send ("!a") ... My question is how to code the AutoIt script part in Watir? Do we have documentation for this? Do we have code example that is similar to this case? Thanks! Kui From angrez at gmail.com Fri May 4 02:08:03 2007 From: angrez at gmail.com (Angrez Singh) Date: Fri, 4 May 2007 11:38:03 +0530 Subject: [Wtr-general] FireWatir not finding buttons by id In-Reply-To: <72799cd70705031643t614a63b0sc3d1704eacf5cc7f@mail.gmail.com> References: <72799cd70705031643t614a63b0sc3d1704eacf5cc7f@mail.gmail.com> Message-ID: Hi Chris, I tried your script. I seems like you are accessing wrong element. #DOESN'T FIND THIS BUTTON > ff.button(:id,'st-login-to-edit-button-link') This is actually a link . So the following should be used to access this element ff.link(:id, 'st-login-to-edit-button-link') Using this I was able to go to login page and was able to enter login name and password. ff.text_field(:id, 'username').set('myemail at email.com') > ff.text_field(:id, 'password').set('mypass') > ff.button(:value, 'Log in').click Don't know correct user name and password :) so was not able to go ahead with the test. #DOESN'T FIND THIS BUTTON EITHER > ff.button(:id,"st-edit-button-link").click I think this might be again a link. Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070504/800799f3/attachment-0001.html From forum-watir-users at openqa.org Fri May 4 03:39:34 2007 From: forum-watir-users at openqa.org (Maisonnette) Date: Fri, 04 May 2007 02:39:34 CDT Subject: [Wtr-general] Watir + Autoit + Save As Message-ID: <28184734.231178264404836.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi everyone, Do you know how can i use watir to 'pilot' a 'save as' internet explorer form ? I already found this code : ----- *autoit = WIN32OLE.new("AutoItX3.Control")* *autoit.WinWait("T?l?chargement de fichier", "Voulez-vous ouvrir ou enregistrer ce fichier ?", 15)* *autoit.ControlClick("T?l?chargement de fichier", "", "Button2")* *autoit.WinWait("Enregistrer sous", "Enregistrer sous", 15)* *autoit.ControlSetText("Enregistrer sous", "Enregistrer &dans :", "Edit1", "c:\test.zip")* *autoit.ControlClick("Enregistrer sous", "Enregistrer &dans :", "&Enregistrer")* ----- The line number 1 : Return 1 The line number 1 : Return 1 The line number 1 : Return 1 The last one return 0 And with this code i got the focus on the 'save as'(Enregistrer sous) button ... I really don't understand why i can't click on it because the 'ControlClick' function is build to do that ! :-) Any help will be highly appreciated ! :-) Some complementary informations : ----- +http://rubyforge.org/tracker/index.php?func=detail&aid=2467&group_id=104&atid=490+ +http://www.autoitscript.com/autoit3/docs/functions.htm+ +WinXp Sp2 (French)+ +ruby 1.8.5 (2006-08-25) [i386-mswin32]+ +watir-1[1].5.1.1145 (gem)+ From forum-watir-users at openqa.org Fri May 4 07:34:51 2007 From: forum-watir-users at openqa.org (san) Date: Fri, 04 May 2007 06:34:51 CDT Subject: [Wtr-general] How To Click On The Image Button...With This html Code? Message-ID: <26647775.1701178278521385.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi People.. Heres The Code: Clear Clear & I Wanna Click On The image button with url "search_top.gif" So I Used [i]ie.image(:src, /search_top/i).click[/i] But It Didn't Work Properly As It Always Clicking On The 2nd Occurrence Of "search_top", i.e On The Link "clear_search_top" ... I Don't Know Why... Any Ideas Will Be Helpful... :) Thanks.... From angrez at gmail.com Fri May 4 08:12:49 2007 From: angrez at gmail.com (Angrez Singh) Date: Fri, 4 May 2007 17:42:49 +0530 Subject: [Wtr-general] How To Click On The Image Button...With This html Code? In-Reply-To: <26647775.1701178278521385.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <26647775.1701178278521385.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi, The element you are trying to click is not an image element i.e. not of type . But its which is different. So you should try using following code. ie.button(:src, /search_top/i).click If you use your code 'Watir' is correctly clicking the image which is having the source you specified and not clicking image button which you should access using ie.button. - Angrez On 5/4/07, san wrote: > > Hi People.. > > Heres The Code: > > > > > > name="CTL_SUBMIT" type="image"> > Clear src="../images/clear_search_top.gif"> > border="0" alt="Clear" src="../images/save_search_button.gif"> > > > > > & I Wanna Click On The image button with url "search_top.gif" > So I Used [i]ie.image(:src, /search_top/i).click[/i] > But It Didn't Work Properly As It Always Clicking On The 2nd Occurrence Of > "search_top", i.e On The Link "clear_search_top" ... I Don't Know Why... > > Any Ideas Will Be Helpful... :) > Thanks.... > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070504/4c9a7e14/attachment.html From forum-watir-users at openqa.org Fri May 4 08:43:07 2007 From: forum-watir-users at openqa.org (san) Date: Fri, 04 May 2007 07:43:07 CDT Subject: [Wtr-general] How To Add A Cookie Earned From Watir To Mechanize... Message-ID: <27546995.2351178282617795.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi People... I Need To Add A Cookie From A Site That I Accessed Through Watir To A WWW::Mechanize Agent... Is There Any Way To Do It, Or Will It Be Possible To Be Really Authenticated In The Site Then By Mechanize Agent.. e.g If I Say If I Login In Yahoo By Watir And Then Try To Access My Inbox By A New Mechanize Agent Will It Do? ie=IE.new ie.goto('....') ie.... # Logged In cookie = ie.document.cookie agent = WWW::Mechanize.new page = agent.get('....') # here I Want To Go To My Inbox But I Have Authentication Problem 401 error I Hope If I Can Transfer Cookie To Mechanize It Will Authenticate Me... Any Suggestions... Thanks... From forum-watir-users at openqa.org Fri May 4 08:50:49 2007 From: forum-watir-users at openqa.org (san) Date: Fri, 04 May 2007 07:50:49 CDT Subject: [Wtr-general] How To Click On The Image Button...With This html In-Reply-To: Message-ID: <27558260.2581178283079476.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Angrez, Thanks.. That Worked... Don't Know How Did I Missed That Out.... :P Thanks... :) From angrez at gmail.com Fri May 4 08:58:36 2007 From: angrez at gmail.com (Angrez Singh) Date: Fri, 4 May 2007 18:28:36 +0530 Subject: [Wtr-general] How To Click On The Image Button...With This html In-Reply-To: <27558260.2581178283079476.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <27558260.2581178283079476.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi, Again as Bret mailed earlier regarding mail replies and threads, please don't change the subject while replying to an already existing thread. Replying to the mail with subject intact helps in tracking the mail and to make sure the context is there when some one is reading the thread. Make sure next time you reply to a thread, the subject is same. Regards, Angrez On 5/4/07, san wrote: > > Hi Angrez, Thanks.. That Worked... Don't Know How Did I Missed That > Out.... :P > > Thanks... :) > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070504/724bb57c/attachment.html From forum-watir-users at openqa.org Fri May 4 09:14:35 2007 From: forum-watir-users at openqa.org (Venkata) Date: Fri, 04 May 2007 08:14:35 CDT Subject: [Wtr-general] can you help why ODBC connection failure worked one time and not working no In-Reply-To: Message-ID: <33397086.2691178284505842.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks chareley, i keep getting warning message in the log end of te script execution. Thanks. From charley.baker at gmail.com Fri May 4 10:55:28 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 4 May 2007 08:55:28 -0600 Subject: [Wtr-general] can you help why ODBC connection failure worked one time and not working no In-Reply-To: <33397086.2691178284505842.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <33397086.2691178284505842.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: What's the warning message? On 5/4/07, Venkata wrote: > > Thanks chareley, > > i keep getting warning message in the log end of te script execution. > > Thanks. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070504/018755d8/attachment.html From christopher.mcmahon at gmail.com Fri May 4 11:17:22 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 4 May 2007 09:17:22 -0600 Subject: [Wtr-general] FireWatir not finding buttons by id In-Reply-To: References: <72799cd70705031643t614a63b0sc3d1704eacf5cc7f@mail.gmail.com> Message-ID: <72799cd70705040817p75985b2ud0e40598b98b6e08@mail.gmail.com> Interesting. Watir-for-IE sees that link as a button and clicks it. On the page, it is the graphical element presented to the user. Thanks, Angrez. (Feel free to set yourself up as a user!) On 5/4/07, Angrez Singh wrote: > Hi Chris, > > I tried your script. I seems like you are accessing wrong element. > > > > #DOESN'T FIND THIS BUTTON > > > > ff.button(:id,'st-login-to-edit-button-link') > > This is actually a link id="st-login-to-edit-button-link">. > So the following should be used to access this element > ff.link(:id, 'st-login-to-edit-button-link') > Using this I was able to go to login page and was able to enter login name > and password. > > > ff.text_field(:id, 'username').set(' myemail at email.com') > > ff.text_field(:id, 'password').set('mypass') > > ff.button(:value, 'Log in').click > > Don't know correct user name and password :) so was not able to go ahead > with the test. > > > #DOESN'T FIND THIS BUTTON EITHER > > ff.button(:id,"st-edit-button-link").click > > I think this might be again a link. > > Regards, > Angrez > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From charley.baker at gmail.com Fri May 4 11:24:48 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 4 May 2007 09:24:48 -0600 Subject: [Wtr-general] Watir + Autoit + Save As In-Reply-To: <28184734.231178264404836.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28184734.231178264404836.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: It looks fine, you might however have to use ControlFocus to make sure the control has focus before attempting to click on it. autoit.ControlFocus("Enregistrer sous", "", "&Enregistrer") autoit.ControlClick("Enregistrer sous", "Enregistrer &dans :", "&Enregistrer") -Charley On 5/4/07, Maisonnette wrote: > > Hi everyone, > > Do you know how can i use watir to 'pilot' a 'save as' internet explorer > form ? > I already found this code : > ----- > > *autoit = WIN32OLE.new("AutoItX3.Control")* > *autoit.WinWait("T?l?chargement de fichier", "Voulez-vous ouvrir ou > enregistrer ce fichier ?", 15)* > *autoit.ControlClick("T?l?chargement de fichier", "", "Button2")* > *autoit.WinWait("Enregistrer sous", "Enregistrer sous", 15)* > *autoit.ControlSetText("Enregistrer sous", "Enregistrer &dans :", > "Edit1", "c:\test.zip")* > *autoit.ControlClick("Enregistrer sous", "Enregistrer &dans :", > "&Enregistrer")* > > ----- > > The line number 1 : Return 1 > The line number 1 : Return 1 > The line number 1 : Return 1 > The last one return 0 > > And with this code i got the focus on the 'save as'(Enregistrer sous) > button ... I really don't understand why i can't click on it because the > 'ControlClick' function is build to do that ! > > :-) Any help will be highly appreciated ! :-) > > Some complementary informations : > ----- > > +http://rubyforge.org/tracker/index.php?func=detail&aid=2467&group_id=104&atid=490+ > +http://www.autoitscript.com/autoit3/docs/functions.htm+ > +WinXp Sp2 (French)+ > +ruby 1.8.5 (2006-08-25) [i386-mswin32]+ > +watir-1[1].5.1.1145 (gem)+ > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070504/26d29763/attachment-0001.html From paul.rogers at shaw.ca Fri May 4 11:28:13 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 04 May 2007 09:28:13 -0600 Subject: [Wtr-general] FireWatir not finding buttons by id References: <72799cd70705031643t614a63b0sc3d1704eacf5cc7f@mail.gmail.com> <72799cd70705040817p75985b2ud0e40598b98b6e08@mail.gmail.com> Message-ID: <08c201c78e60$d4c4a450$6400a8c0@laptop> the really interesting thing is that watir 1.4 only lets you access it with a link irb(main):006:0> ie.link(:id,'st-login-to-edit-button-link').flash => nil irb(main):007:0> ie.button(:id,'st-login-to-edit-button-link').flash Watir::Exception::UnknownObjectException: Unable to locate object, using id and st-login-to-edit-button-link but 1.5.1.1158 ( thr only 1.5 I have installed right now) works with either irb(main):006:0> ie.button(:id,'st-login-to-edit-button-link').flash => nil irb(main):007:0> ie.link(:id,'st-login-to-edit-button-link').flash => nil Im going to guess that this is a bug in 1.5 Paul ----- Original Message ----- From: "Chris McMahon" To: Sent: Friday, May 04, 2007 9:17 AM Subject: Re: [Wtr-general] FireWatir not finding buttons by id > Interesting. Watir-for-IE sees that link as a button and clicks it. > On the page, it is the graphical element presented to the user. > Thanks, Angrez. (Feel free to set yourself up as a user!) > > On 5/4/07, Angrez Singh wrote: >> Hi Chris, >> >> I tried your script. I seems like you are accessing wrong element. >> >> >> > #DOESN'T FIND THIS BUTTON >> > >> > ff.button(:id,'st-login-to-edit-button-link') >> >> This is actually a link > id="st-login-to-edit-button-link">. >> So the following should be used to access this element >> ff.link(:id, 'st-login-to-edit-button-link') >> Using this I was able to go to login page and was able to enter login >> name >> and password. >> >> > ff.text_field(:id, 'username').set(' myemail at email.com') >> > ff.text_field(:id, 'password').set('mypass') >> > ff.button(:value, 'Log in').click >> >> Don't know correct user name and password :) so was not able to go ahead >> with the test. >> >> > #DOESN'T FIND THIS BUTTON EITHER >> > ff.button(:id,"st-edit-button-link").click >> >> I think this might be again a link. >> >> Regards, >> Angrez >> >> _______________________________________________ >> Wtr-general mailing list >> Wtr-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-general >> > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Fri May 4 11:35:01 2007 From: forum-watir-users at openqa.org (Maisonnette) Date: Fri, 04 May 2007 10:35:01 CDT Subject: [Wtr-general] Watir + Autoit + Save As In-Reply-To: Message-ID: <26919935.4291178292931800.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank's, Yes i already do that, and the control take the focus, but it don't want to click on it ... :-( Any suggestion ?? From paul.rogers at shaw.ca Fri May 4 11:43:37 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 04 May 2007 09:43:37 -0600 Subject: [Wtr-general] Watir + Autoit + Save As References: <26919935.4291178292931800.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <08d901c78e62$fb4aa1e0$6400a8c0@laptop> if you want to just save the html you can do this html = ie.html File.open("my_file){ |f| f.puts html } # check this, you may have to open the file for writing Paul ----- Original Message ----- From: "Maisonnette" To: Sent: Friday, May 04, 2007 9:35 AM Subject: Re: [Wtr-general] Watir + Autoit + Save As > Thank's, > > Yes i already do that, and the control take the focus, but it don't want > to click on it ... > > :-( > > Any suggestion ?? > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Fri May 4 11:48:00 2007 From: forum-watir-users at openqa.org (Trevor Mason) Date: Fri, 04 May 2007 10:48:00 CDT Subject: [Wtr-general] Setting focus in a frame in IE7 Message-ID: <24486158.4581178293710074.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have a test that used to work on IE6(WIN2k), but does not with IE7(WINXP) I am using send_keys to send 4 chars to a text field that has a maximum length of 3, then checking there are only 3 chars In IE7, the focus does not move from the IE address bar, and I get xxxx placed here. If I use IRB and manually click somewhere within the frame before running these commands, it works! $ie.frame("mainFrame").frame("centralFrame").text_field(:name, 'privateDataDescriptor').focus $ie.send_keys("xxxx") Does anyone have any ideas? Trevor From forum-watir-users at openqa.org Fri May 4 11:50:13 2007 From: forum-watir-users at openqa.org (Eoin) Date: Fri, 04 May 2007 10:50:13 CDT Subject: [Wtr-general] FireWatir doesn't ignore if it doesn't exists but Watir does Message-ID: <26394307.4641178293843455.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Folks, I have scripts that use authentication. So when I start my first test, it goes to a login page and once I click the login button, my test runs. Subsequent tests runs without going to the login page as I'm now authorished to run the rest of the scripts. So in my code if the login button appears, I click it. If it doesn't appear due to me being already logged in, it justs prints a message and runs the rest of the script. Watir doesn't this fine i.e. clicks the login button if there, otherwise ignores it However FireWatir doesn't ignore the login button and bombs out when it sees it. if browser.contains_text("Login Page") browser.button(:name, "LoginButton").click puts " Action: clicked the Login button." else puts " Action: the login page didn't appear" end From paul.rogers at shaw.ca Fri May 4 12:13:15 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 04 May 2007 10:13:15 -0600 Subject: [Wtr-general] Setting focus in a frame in IE7 References: <24486158.4581178293710074.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <08fe01c78e67$1f387d80$6400a8c0@laptop> Assuming your html uses regular type html and you only want to test that the text field only allows 3 chars, why not use ie.text_field(:index,1).maxLength I guess if the maximum length is imposed by a javascript method on the onKeyPress event, then this wouldnt work. As to why your code no longer works, I have no clue ;-) ----- Original Message ----- From: "Trevor Mason" To: Sent: Friday, May 04, 2007 9:48 AM Subject: [Wtr-general] Setting focus in a frame in IE7 >I have a test that used to work on IE6(WIN2k), but does not with IE7(WINXP) > I am using send_keys to send 4 chars to a text field that has a maximum > length of 3, then checking there are only 3 chars > > In IE7, the focus does not move from the IE address bar, and I get xxxx > placed here. > If I use IRB and manually click somewhere within the frame before running > these commands, it works! > > $ie.frame("mainFrame").frame("centralFrame").text_field(:name, > 'privateDataDescriptor').focus > $ie.send_keys("xxxx") > > Does anyone have any ideas? > > Trevor > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From charley.baker at gmail.com Fri May 4 12:38:20 2007 From: charley.baker at gmail.com (Charley Bak