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 Baker) Date: Fri, 4 May 2007 10:38:20 -0600 Subject: [Wtr-general] Setting focus in a frame in IE7 In-Reply-To: <08fe01c78e67$1f387d80$6400a8c0@laptop> References: <24486158.4581178293710074.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <08fe01c78e67$1f387d80$6400a8c0@laptop> Message-ID: I just ran the same code with IE7 and it appeared to work fine. Just out of curiosity why use send_keys instead of setting the text field? ie.text_field(:index, 1).set('foo') -Charley On 5/4/07, Paul Rogers wrote: > > 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 > > > > > _______________________________________________ > 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/f0414cf4/attachment.html From forum-watir-users at openqa.org Fri May 4 14:21:16 2007 From: forum-watir-users at openqa.org (Alien Ruby) Date: Fri, 04 May 2007 13:21:16 CDT Subject: [Wtr-general] how to include external script (.rb) in Watir? Message-ID: <25037240.6381178302906717.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi guys, I apologize if this thread had been discussed before. I was looking for it, but I couldnt find it. here is what I'm trying to do. I define a bunch of classes and functions in a.rb file, and I'm going to write the main script which hopefully can interact/use all the functions and classes in .rb scripts. Let's say all the functions and classes are defined in extra.rb and my main driver script is main.rb. My question is what the script is to include/require extra.rb file in my main.rb. The reason is in main.rb, I want to have something simple like, # the header require 'watir' # the watir controller require 'win32ole' # excel sheet ?? require 'extra.rb' or open 'extra.rb' or what?? ... # the script DoEverything1() # function defined in extra.rb DoEverything2() # function defined in extra.rb ... # end of script any help or hint will be much appreciate. thank you. From zeljko.filipin at gmail.com Fri May 4 14:29:48 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 4 May 2007 20:29:48 +0200 Subject: [Wtr-general] how to include external script (.rb) in Watir? In-Reply-To: <25037240.6381178302906717.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <25037240.6381178302906717.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi, Put require 'extra' near the top of main.rb. For now keep them both (extra.rb and main.rb) located in the same folder. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070504/1e9487ec/attachment.html From christopher.mcmahon at gmail.com Fri May 4 14:37:54 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 4 May 2007 12:37:54 -0600 Subject: [Wtr-general] FireWatir not finding buttons by id In-Reply-To: <08c201c78e60$d4c4a450$6400a8c0@laptop> References: <72799cd70705031643t614a63b0sc3d1704eacf5cc7f@mail.gmail.com> <72799cd70705040817p75985b2ud0e40598b98b6e08@mail.gmail.com> <08c201c78e60$d4c4a450$6400a8c0@laptop> Message-ID: <72799cd70705041137j24752e8cyda297309fb16cfb7@mail.gmail.com> > Im going to guess that this is a bug in 1.5 Seems like this would be an opportunity to sync up FireWatir with Watir. I think Charley has been looking into some of that recently. From forum-watir-users at openqa.org Fri May 4 14:52:37 2007 From: forum-watir-users at openqa.org (Alien Ruby) Date: Fri, 04 May 2007 13:52:37 CDT Subject: [Wtr-general] how to include external script (.rb) in Watir? In-Reply-To: Message-ID: <29411403.6711178304787643.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> thanks for the quick respond. that was easy, huh.. I just thought too much on that one. beginner...:( From zeljko.filipin at gmail.com Fri May 4 14:59:39 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 4 May 2007 20:59:39 +0200 Subject: [Wtr-general] how to include external script (.rb) in Watir? In-Reply-To: <29411403.6711178304787643.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <29411403.6711178304787643.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 5/4/07, Alien Ruby wrote: > > thanks for the quick respond. You are welcome. :) that was easy, huh.. It is Ruby, (almost) everything is easy here. I just thought too much on that one. beginner...:( > It happens. That is why this mailing list exists. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070504/33f31964/attachment.html From charley.baker at gmail.com Fri May 4 15:06:56 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 4 May 2007 13:06:56 -0600 Subject: [Wtr-general] FireWatir not finding buttons by id In-Reply-To: <72799cd70705041137j24752e8cyda297309fb16cfb7@mail.gmail.com> References: <72799cd70705031643t614a63b0sc3d1704eacf5cc7f@mail.gmail.com> <72799cd70705040817p75985b2ud0e40598b98b6e08@mail.gmail.com> <08c201c78e60$d4c4a450$6400a8c0@laptop> <72799cd70705041137j24752e8cyda297309fb16cfb7@mail.gmail.com> Message-ID: It's a curious bug, just saw the same thing. A bug/feature, works more than it should. :) Chris is right we should definitely spend more time with Angrez, Prema and the Firewatir community. I'm getting slammed by requests for multiple browser tests and starting to abstract layers so that it's easier. -c On 5/4/07, Chris McMahon wrote: > > > Im going to guess that this is a bug in 1.5 > > Seems like this would be an opportunity to sync up FireWatir with > Watir. I think Charley has been looking into some of that recently. > _______________________________________________ > 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/f7d09646/attachment.html From I_Webb at acs.org Fri May 4 17:07:26 2007 From: I_Webb at acs.org (Ian Webb) Date: Fri, 4 May 2007 17:07:26 -0400 Subject: [Wtr-general] Using an ie.table.each do |row| loop when the page in the ie window refreshes itself Message-ID: <353BA7F10699794198CD75B3033E62AA02314AA9@washnt57.acs.org> Here's the code snippet that's giving me problems: ie.table(:index,29).each do |row| if (row[1].text =~ /#{journals}/) != nil then #If there is a match for that regex row[5].link(:index,1).click # this makes the popup window appear cw = Watir::IE.attach(:title,'Popup Window') # attach to the popup window doRolesPopup(cw) # fill out and submit the form end end doRolesPopup fills out a form in the cw page, then clicks submit. The submit button submits the form, then closes the cw window and reloads the ie window. This reload of the page referenced by the ie object appears to break the row object, since I get the following error: c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `invoke': unknown property or method `rows' (WIN32OLERuntimeError) HRESULT error code:0x80070005 Access is denied. from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `row' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `upto' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' from assignroles.rb:51 from c:/ruby/lib/ruby/1.8/csv.rb:532:in `parse' from c:/ruby/lib/ruby/1.8/csv.rb:560:in `each' from c:/ruby/lib/ruby/1.8/csv.rb:531:in `parse' from assignroles.rb:35 Is there any way to keep this simple .each loop, or do I need to work around it? Thanks, Ian From forum-watir-users at openqa.org Fri May 4 17:33:39 2007 From: forum-watir-users at openqa.org (Alien Ruby) Date: Fri, 04 May 2007 16:33:39 CDT Subject: [Wtr-general] how to include external script (.rb) in Watir? In-Reply-To: Message-ID: <32765975.51178314449567.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi... Do you know if there is any document for me to read about function declaration, function returning values (integer, strings), and etc. let's say I want to multiply something by 10, x = Multiply(3) puts x # this line should give me 30. How do I use something like, def integer Multiply(y) { temp = 10 * y return temp } or do a public class ? Again, I appreciate your time. From zeljko.filipin at gmail.com Fri May 4 17:45:22 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 4 May 2007 23:45:22 +0200 Subject: [Wtr-general] how to include external script (.rb) in Watir? In-Reply-To: <32765975.51178314449567.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32765975.51178314449567.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: You should read this book http://www.rubycentral.com/book/ Look for chapters about methods and classes. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070504/a14168c6/attachment.html From forum-watir-users at openqa.org Fri May 4 17:51:09 2007 From: forum-watir-users at openqa.org (Alien Ruby) Date: Fri, 04 May 2007 16:51:09 CDT Subject: [Wtr-general] how to include external script (.rb) in Watir? In-Reply-To: Message-ID: <31467556.161178315499299.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Very nice, that'll be my homework for the weekend. thanks a bunch...!! From christopher.mcmahon at gmail.com Fri May 4 18:01:27 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 4 May 2007 16:01:27 -0600 Subject: [Wtr-general] how to include external script (.rb) in Watir? In-Reply-To: <31467556.161178315499299.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <31467556.161178315499299.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70705041501ndf46120s77f72d7b0613b1bf@mail.gmail.com> On 5/4/07, Alien Ruby wrote: > Very nice, that'll be my homework for the weekend. > > thanks a bunch...!! It's on your computer, too, in C:/ruby/doc From charley.baker at gmail.com Fri May 4 18:09:55 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 4 May 2007 16:09:55 -0600 Subject: [Wtr-general] Community involvement with Watir Message-ID: Hi all, I'd like to send out another annoucement asking for people to contribute to the Watir user guide and volunteer. I've started poking around at the user guide today and made a few changes, notably to update view source with the ie developer toolbar. I'll make further changes if as I get time, but am making the call for volunteers to add information and help out, much of which is related to Watir 1.5. Let me know if you're interested in helping out. I'll also suggest helping out on the lists or whereever you think you might be useful. If you've worked with Ruby or Watir for more than a couple of days, you're a couple of days ahead of the next person and can provide some knowledge, don't be afraid to be wrong, jump in. Additionally there is a section on the wiki for user contributions as you write code that might be useful to other people. This is an open source project that depends on community involvement. (Starting to sound like a pbs pledge drive). Thanks, Charley -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070504/ecd27bce/attachment.html From forum-watir-users at openqa.org Fri May 4 18:25:52 2007 From: forum-watir-users at openqa.org (Alien Ruby) Date: Fri, 04 May 2007 17:25:52 CDT Subject: [Wtr-general] how to include external script (.rb) in Watir? In-Reply-To: <72799cd70705041501ndf46120s77f72d7b0613b1bf@mail.gmail.com> Message-ID: <30050885.721178317582534.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> How are you guys so helpful ? It just makes me want to keep coding all weekend. need lots of coffee then... have a great weekend, guys..!! From christopher.mcmahon at gmail.com Fri May 4 18:49:36 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 4 May 2007 16:49:36 -0600 Subject: [Wtr-general] how to include external script (.rb) in Watir? In-Reply-To: <30050885.721178317582534.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <72799cd70705041501ndf46120s77f72d7b0613b1bf@mail.gmail.com> <30050885.721178317582534.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70705041549u5d00a068w87f65ead35374263@mail.gmail.com> On 5/4/07, Alien Ruby wrote: > How are you guys so helpful ? That's actually a really good question. The people who started Watir had all participated in other Open Source projects, some successful, some unsuccessful. The early Watir community insisted that everyone, particularly beginners, be treated with respect and courtesy. Many, if not most, of the Watir community are not expert programmers. If the project is going to continue, and continue to be successful, two things have to happen: beginners must continue to be treated with respect and courtesy; and as people get more experience with Watir and Ruby, they have to be encouraged in turn to help out where they can contribute. Mostly this means answering questions on the list: if you see a question you can answer, please do so. It's OK if you're wrong-- as long as you are not deliberately misleading, we will all learn something. In addition, if you can help with documentation or patches or features, please contribute that work also. Charley just asked today for contributions to the user guide. Maybe a reference to the copy of Pickaxe included with the Ruby distro would be a good thing. One very exciting project happening sort of under the radar is to make Watir, FireWatir, SafariWatir, (and possibly Selenium RC) all have a more consistent set of functionality and syntax. I'm not a great programmer, but I like to answer off-topic questions on the list, and I've started to use the non-IE Watirs, and I contributed my first inconsistency report yesterday. The point being, that a few little contributions here and there move the project along nicely, as long as a large number of people are making the contributions. From christopher.mcmahon at gmail.com Fri May 4 19:07:25 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 4 May 2007 17:07:25 -0600 Subject: [Wtr-general] FireWatir not finding buttons by id In-Reply-To: <08c201c78e60$d4c4a450$6400a8c0@laptop> References: <72799cd70705031643t614a63b0sc3d1704eacf5cc7f@mail.gmail.com> <72799cd70705040817p75985b2ud0e40598b98b6e08@mail.gmail.com> <08c201c78e60$d4c4a450$6400a8c0@laptop> Message-ID: <72799cd70705041607v199383dhfb6e9bee7c014ed8@mail.gmail.com> Seems like the best behavior would be to allow both, in which case 1.4 and FW have bugs; or you could allow access only to the element presented to the user, in which case 1.5 and FW have bugs; or you could allow access only to the underlying element, in which case 1.4 and FW have bugs. I'd like to have access by both. -Chris On 5/4/07, Paul Rogers wrote: > 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 > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Fri May 4 20:58:43 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 04 May 2007 19:58:43 -0500 Subject: [Wtr-general] Community involvement with Watir In-Reply-To: References: Message-ID: <463BD6C3.7080403@pettichord.com> Charley Baker wrote: > I'd like to send out another annoucement asking for people to > contribute to the Watir user guide and volunteer. I've started poking > around at the user guide today and made a few changes, notably to > update view source with the ie developer toolbar. I'll make further > changes if as I get time, but am making the call for volunteers to add > information and help out, much of which is related to Watir 1.5. Let > me know if you're interested in helping out. I think i convinced Zeljko today to take the lead in updating the users guide. Zeljko, how can we all help you? Bret From bret at pettichord.com Fri May 4 21:10:42 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 04 May 2007 20:10:42 -0500 Subject: [Wtr-general] FireWatir doesn't ignore if it doesn't exists but Watir does In-Reply-To: <26394307.4641178293843455.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <26394307.4641178293843455.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <463BD992.2000404@pettichord.com> Eoin wrote: > However FireWatir doesn't ignore the login button and bombs out when it sees it. > It would help if you showed us the error and the page. However, my guess is that the problem is with the behavior of contains_text. In Watir for IE 1.4 this did not include the title. In Watir for 1.5 it does look in the title. I think Firewatir is working like Watir for IE 1.4. Bret From bret at pettichord.com Fri May 4 23:16:42 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 04 May 2007 22:16:42 -0500 Subject: [Wtr-general] The Plan for Watir Message-ID: <463BF71A.9020000@pettichord.com> I've been doing a lot of thinking and planning for what we need to do with Watir. I've also been fairly quiet. I now have a new job and have been preoccupied by the change in jobs lately: with wrapping up affairs at my old job at DataCert, with a job search, and then with starting at Dovetail, where they had built up a bit of a backlog of work for me which I've finally dug out from. Dovetail has made a big commitment to Watir: to using it to test our software, to supporting enhancements that we will be using, and even to giving me time to attend to the necessary affairs in running an open-source project. In fact, Dovetail intends to ship our testing framework and our tests themselves to our customers. This means that our tests will need to be good: be easy to understand, extend, run and interpret. I am very excited by the opportunity. Watir 1.5 is getting very close to being "done." As soon as it looks like we've fixed all the serious compatability bugs with Watir 1.4, we will be posting the 1.5 gem to Rubyforge. This means that it will become the default gem that will be installed when you do a "gem install watir". Originally I wanted to wait until we got the documentation for 1.5 updated, but now now i think that can wait for a later point release (say 1.5.3). Charley tells me that many of the questions on the wtr-general list regard problems that would be solved by moving to 1.5, so it really will help to move there. By the way, Charley has also been rather busy lately, partly because people keep hiring his Watir testers away from him. So if you are one of these people, stop it. It only hurts Watir, in the end, by forcing him to spend all his time on his day job. Jeff Fry is threatening to help out with the Rdoc and Zeljko has agreed to take the lead with updating the users guide. Please cooperate with any requests that they make. Many of you have noticed that FireWatir is looking very good. SafariWatir is also looking good. The number one goal that I have for Watir is pull together these different forks of Watir. In my view they should all be part of one library, or perhaps each will be a plug in to a standard library, much as, say the Ruby DBI library supports plug ins for each of the different types of databases. In our case, we'd have separate plug ins for each browser. This means supporting multiple browsers and making Watir work on multiple platforms. The importance and complexity of this goal is part of what is urging me to wrap up Watir 1.5. We are targeting Watir 2.0 to include plugins for each of the main browsers. I also plan to continue working on a Selenium plugin to Watir. This would allow existing Watir tests to run tests using any browser when connecting to a Selenium-enabled server. This, like all the browsers, will be optional; so if Selenium scares you, you will be able to continue to use Watir the old-fashioned way. In preparation for this, Watir 1.6 will begin the restructuring of the existing code base to support plugins and remove the code duplication that currently exists in the different forks. This will require reorganizing the code files, and therefore we will want to merge all patches before this reorg starts. We will also be taking this occassion to make many changes to Watir that we've been considering for some time, but have put off because of concerns about backwards compatibility. We have attempted to make upgrading from 1.4 to 1.5 extremely easy. Upgrading to 1.6 will be more difficult. In particular, we will be converting Watir to use zero-based indexing in 1.6. Another key element to getting Watir 1.5 out is updating our website. We will be publishing a new, detailed, multi-page website aimed at our general user community. This website will be hosted at wtr.rubyforge.org and will include current information about the various releases and how to install them and where the mailing lists are. And we'll be keeping it up to date, as we move forward with this plan. We will continue to use the wiki at OpenQA for the active user community and there will be several links from the general website into the wiki. We have had a lot trouble keeping the various pages on the OpenQA website updated and accurate and will be replacing them with pointers either to the website or to the wiki. I realize that the current arrangement is very confusing and appreciate your patience. The Jira roadmap more or less lays out the next few steps in our plan. We will be updating it shortly to better match up to the plan I lay out here. If you have bugs you want fixed or features you want added, please make sure there is an open Jira ticket for them. Bret From christopher.mcmahon at gmail.com Fri May 4 23:39:41 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 4 May 2007 21:39:41 -0600 Subject: [Wtr-general] The Plan for Watir In-Reply-To: <463BF71A.9020000@pettichord.com> References: <463BF71A.9020000@pettichord.com> Message-ID: <72799cd70705042039k50d70a12wbce90df323693bf6@mail.gmail.com> Good information. You and Charley and maybe some others should put this in blogs so the wider world can find it. On 5/4/07, Bret Pettichord wrote: > I've been doing a lot of thinking and planning for what we need to do > with Watir. I've also been fairly quiet. I now have a new job and have > been preoccupied by the change in jobs lately: with wrapping up > affairs at my old job at DataCert, with a job search, and then with > starting at Dovetail, where they had built up a bit of a backlog of > work for me which I've finally dug out from. > > Dovetail has made a big commitment to Watir: to using it to test our > software, to supporting enhancements that we will be using, and even > to giving me time to attend to the necessary affairs in running an > open-source project. In fact, Dovetail intends to ship our testing > framework and our tests themselves to our customers. This means that > our tests will need to be good: be easy to understand, extend, run and > interpret. I am very excited by the opportunity. > > Watir 1.5 is getting very close to being "done." As soon as it looks > like we've fixed all the serious compatability bugs with Watir 1.4, we > will be posting the 1.5 gem to Rubyforge. This means that it will > become the default gem that will be installed when you do a "gem > install watir". Originally I wanted to wait until we got the > documentation for 1.5 updated, but now now i think that can wait for a > later point release (say 1.5.3). Charley tells me that many of the > questions on the wtr-general list regard problems that would be solved > by moving to 1.5, so it really will help to move there. > > By the way, Charley has also been rather busy lately, partly because > people keep hiring his Watir testers away from him. So if you are one > of these people, stop it. It only hurts Watir, in the end, by forcing > him to spend all his time on his day job. > > Jeff Fry is threatening to help out with the Rdoc and Zeljko has > agreed to take the lead with updating the users guide. Please > cooperate with any requests that they make. > > Many of you have noticed that FireWatir is looking very good. > SafariWatir is also looking good. The number one goal that I have for > Watir is pull together these different forks of Watir. In my view they > should all be part of one library, or perhaps each will be a plug in > to a standard library, much as, say the Ruby DBI library supports plug > ins for each of the different types of databases. In our case, we'd > have separate plug ins for each browser. This means supporting > multiple browsers and making Watir work on multiple platforms. The > importance and complexity of this goal is part of what is urging me to > wrap up Watir 1.5. > > We are targeting Watir 2.0 to include plugins for each of the main > browsers. I also plan to continue working on a Selenium plugin to > Watir. This would allow existing Watir tests to run tests using any > browser when connecting to a Selenium-enabled server. This, like all > the browsers, will be optional; so if Selenium scares you, you will be > able to continue to use Watir the old-fashioned way. > > In preparation for this, Watir 1.6 will begin the restructuring of the > existing code base to support plugins and remove the code duplication > that currently exists in the different forks. This will require > reorganizing the code files, and therefore we will want to merge all > patches before this reorg starts. We will also be taking this > occassion to make many changes to Watir that we've been considering > for some time, but have put off because of concerns about backwards > compatibility. We have attempted to make upgrading from 1.4 to 1.5 > extremely easy. Upgrading to 1.6 will be more difficult. In > particular, we will be converting Watir to use zero-based indexing in > 1.6. > > Another key element to getting Watir 1.5 out is updating our > website. We will be publishing a new, detailed, multi-page website aimed > at our general user community. This website will be hosted at > wtr.rubyforge.org and will include current information about the > various releases and how to install them and where the mailing lists > are. And we'll be keeping it up to date, as we move forward with this > plan. We will continue to use the wiki at OpenQA for the active user > community and there will be several links from the general website > into the wiki. We have had a lot trouble keeping the various pages on > the OpenQA website updated and accurate and will be replacing them > with pointers either to the website or to the wiki. I realize that the > current arrangement is very confusing and appreciate your patience. > > The Jira roadmap more or less lays out the next few steps in our > plan. We will be updating it shortly to better match up to the plan I > lay out here. If you have bugs you want fixed or features you want > added, please make sure there is an open Jira ticket for them. > > Bret > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From zeljko.filipin at gmail.com Sat May 5 12:25:46 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Sat, 5 May 2007 18:25:46 +0200 Subject: [Wtr-general] Community involvement with Watir In-Reply-To: <463BD6C3.7080403@pettichord.com> References: <463BD6C3.7080403@pettichord.com> Message-ID: On 5/5/07, Bret Pettichord wrote: > > I think i convinced Zeljko today to take the lead in updating the users > guide. You certainly did. Last night I had a dream how I bribed cartoon foxes from why's (poignant) guide to ruby to switch to Watir user guide. :) (Bret encouraged me to be "bold".) Zeljko, how can we all help you? The usual. Suggestions. What to add, what to remove, what to change. Comments on my changes. They will be bold. Bacon. Those foxes demanded lots of bacon. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070505/afe4eea8/attachment.html From christopher.mcmahon at gmail.com Sat May 5 13:43:33 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Sat, 5 May 2007 11:43:33 -0600 Subject: [Wtr-general] Community involvement with Watir In-Reply-To: References: <463BD6C3.7080403@pettichord.com> Message-ID: <72799cd70705051043r1cae4cf2q48552a0c28b4ccd3@mail.gmail.com> > > Zeljko, how can we all help you? > > The usual. > Suggestions. What to add, what to remove, what to change. > Comments on my changes. They will be bold. > Bacon. Those foxes demanded lots of bacon. Chunky bacon! One thing I would like to see featured prominently is a discussion not only of how to run the unit tests, but also how to read the unit tests. Also, a discussion of how to surf watir.rb itself for particular methods like show_whatever and even how goto() works would be useful. Both the unit tests and watir.rb are pretty literate, and not too difficult to parse, even for less-experienced Rubyists. From esjewett at gmail.com Sat May 5 18:54:42 2007 From: esjewett at gmail.com (Ethan Jewett) Date: Sat, 5 May 2007 17:54:42 -0500 Subject: [Wtr-general] Using an ie.table.each do |row| loop when the page in the ie window refreshes itself In-Reply-To: <353BA7F10699794198CD75B3033E62AA02314AA9@washnt57.acs.org> References: <353BA7F10699794198CD75B3033E62AA02314AA9@washnt57.acs.org> Message-ID: <68f4a0e80705051554l24c0f4e0t1cd6385633d2d4c4@mail.gmail.com> Ian, Reloading probably invalidates the table object, resulting in your "Access denied" error when ruby goes back for the next row in the table. Suggestion: Assuming that submitting and reloading doesn't affect the table layout, use rows.each_with_index to build an array of indices of relevant rows. Then cycle through the array clicking and submitting. For instance (untested, unfortunately): rows_to_click = Array.new ie.table(:index, 29).rows.each_with_index do |row, i| rows_to_click << i if (row[1].text =~ /#{journals}/) != nil end rows_to_click.each do |i| [Do the clicking and such for row i here.] end This could be made substantially prettier, but hopefully it gets the job done. Ethan On 5/4/07, Ian Webb wrote: > Here's the code snippet that's giving me problems: > > ie.table(:index,29).each do |row| > if (row[1].text =~ /#{journals}/) != nil then #If there is a match > for that regex > row[5].link(:index,1).click # this makes the popup window appear > cw = Watir::IE.attach(:title,'Popup Window') # attach to the popup > window > doRolesPopup(cw) # fill out and submit the form > end > end > > doRolesPopup fills out a form in the cw page, then clicks submit. The > submit button submits the form, then closes the cw window and reloads > the ie window. This reload of the page referenced by the ie object > appears to break the row object, since I get the following error: > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `invoke': unknown > property or method `rows' (WIN32OLERuntimeError) > HRESULT error code:0x80070005 > Access is denied. from > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `row' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `upto' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' > from assignroles.rb:51 > from c:/ruby/lib/ruby/1.8/csv.rb:532:in `parse' > from c:/ruby/lib/ruby/1.8/csv.rb:560:in `each' > from c:/ruby/lib/ruby/1.8/csv.rb:531:in `parse' > from assignroles.rb:35 > > Is there any way to keep this simple .each loop, or do I need to work > around it? > > Thanks, > Ian > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From kenniston.lim at gmail.com Mon May 7 02:25:10 2007 From: kenniston.lim at gmail.com (Ken Lim) Date: Mon, 7 May 2007 14:25:10 +0800 Subject: [Wtr-general] unknown property or method `readyState' In-Reply-To: <224000620705040856vfa1c497gf42ecfcd87ff2043@mail.gmail.com> References: <224000620705040856vfa1c497gf42ecfcd87ff2043@mail.gmail.com> Message-ID: <224000620705062325m264b44ddof552484ffa3b4498@mail.gmail.com> Hi, Good day. Hope I understood your request for stack traces correctly. Please see below: WIN32OLERuntimeError: unknown property or method `readyState' HRESULT error code:0x80070005 Access is denied. C:/Program Files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1819:in `method_missing' C:/Program Files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1819:in `wait' C:/Program Files/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.1164/./watir.rb:2575:in `click' Regards, -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070507/da80a1b5/attachment.html From I_Webb at acs.org Mon May 7 08:55:46 2007 From: I_Webb at acs.org (Ian Webb) Date: Mon, 7 May 2007 08:55:46 -0400 Subject: [Wtr-general] Using an ie.table.each do |row| loop when thepage in the ie window refreshes itself In-Reply-To: <68f4a0e80705051554l24c0f4e0t1cd6385633d2d4c4@mail.gmail.com> References: <353BA7F10699794198CD75B3033E62AA02314AA9@washnt57.acs.org> <68f4a0e80705051554l24c0f4e0t1cd6385633d2d4c4@mail.gmail.com> Message-ID: <353BA7F10699794198CD75B3033E62AA025212E0@washnt57.acs.org> Thanks - this does look like a good approach. The table's layout doesn't change, it just reloads to update the data within the table with the entries that were just made in the popup window. It's a really annoying UI, especially when you have test cases that require changing a dozen rows and therefore opening the popup a dozen times.. hence why I'm quite eager to get Watir doing it instead. However, each_with_index appears to be an undefined method for ie.table objects. I can iterate on .each just fine, but .each_with_index is undefined. (.rows is undefined as well; .each works fine if I leave it out) I'm wondering if maybe there's a way to store the indices of the buttons it's going to click on within the array, rather than the rows themselves. I tried buttons_to_click << row[5].link(:index,1), but that doesn't work. Thanks, Ian -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Ethan Jewett Sent: Saturday, May 05, 2007 6:55 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Using an ie.table.each do |row| loop when thepage in the ie window refreshes itself Ian, Reloading probably invalidates the table object, resulting in your "Access denied" error when ruby goes back for the next row in the table. Suggestion: Assuming that submitting and reloading doesn't affect the table layout, use rows.each_with_index to build an array of indices of relevant rows. Then cycle through the array clicking and submitting. For instance (untested, unfortunately): rows_to_click = Array.new ie.table(:index, 29).rows.each_with_index do |row, i| rows_to_click << i if (row[1].text =~ /#{journals}/) != nil end rows_to_click.each do |i| [Do the clicking and such for row i here.] end This could be made substantially prettier, but hopefully it gets the job done. Ethan On 5/4/07, Ian Webb wrote: > Here's the code snippet that's giving me problems: > > ie.table(:index,29).each do |row| > if (row[1].text =~ /#{journals}/) != nil then #If there is a match > for that regex > row[5].link(:index,1).click # this makes the popup window appear > cw = Watir::IE.attach(:title,'Popup Window') # attach to the popup > window > doRolesPopup(cw) # fill out and submit the form > end > end > > doRolesPopup fills out a form in the cw page, then clicks submit. The > submit button submits the form, then closes the cw window and reloads > the ie window. This reload of the page referenced by the ie object > appears to break the row object, since I get the following error: > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `invoke': unknown > property or method `rows' (WIN32OLERuntimeError) > HRESULT error code:0x80070005 > Access is denied. from > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `row' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `upto' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' > from assignroles.rb:51 > from c:/ruby/lib/ruby/1.8/csv.rb:532:in `parse' > from c:/ruby/lib/ruby/1.8/csv.rb:560:in `each' > from c:/ruby/lib/ruby/1.8/csv.rb:531:in `parse' > from assignroles.rb:35 > > Is there any way to keep this simple .each loop, or do I need to work > around it? > > Thanks, > Ian > _______________________________________________ > 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 zeljko.filipin at gmail.com Mon May 7 09:04:27 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 7 May 2007 15:04:27 +0200 Subject: [Wtr-general] Using an ie.table.each do |row| loop when thepage in the ie window refreshes itself In-Reply-To: <353BA7F10699794198CD75B3033E62AA025212E0@washnt57.acs.org> References: <353BA7F10699794198CD75B3033E62AA02314AA9@washnt57.acs.org> <68f4a0e80705051554l24c0f4e0t1cd6385633d2d4c4@mail.gmail.com> <353BA7F10699794198CD75B3033E62AA025212E0@washnt57.acs.org> Message-ID: On 5/7/07, Ian Webb wrote: > > I'm wondering if maybe there's a way to store the indices of the buttons > it's going to click on within the array, rather than the rows > themselves. I tried buttons_to_click << row[5].link(:index,1), but that > doesn't work. Hi Ian, I am not sure I understood what you want to do here (I need to see html), but try changing buttons_to_click << row[5].link(:index,1) to buttons_to_click << ie.row[5].link(:index,1) Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070507/360e779e/attachment.html From David_Brown at mentor.com Mon May 7 12:38:35 2007 From: David_Brown at mentor.com (Brown, David) Date: Mon, 7 May 2007 09:38:35 -0700 Subject: [Wtr-general] Excelent debugging tool - Unroller In-Reply-To: Message-ID: <44B054F46C2E4E4996C27D92F9B825EE04ED4279@SVR-ORW-EXC-07.mgc.mentorg.com> All, I stumbled across this handy little debugging tool the other day when I was trying to find a tool that would display/trace the execution of my test script. This tool called "Unroller" will print out each line of code that is executed along with the values of the variable passed into and returned from methods. (optionally it will also keep track of local variables.) It is very helpful for quickly identifying exactly where your script died, and what values were causing it to choke. http://unroller.rubyforge.org/ For some reason I had to install the win32console gem as well to get it working: http://rubyforge.org/frs/?group_id=1766 Tip: when you invoke the unroller, you may want to "exclude" the common classes that you don't care about ie watir, string, array ... So that it only traces your code. For example: Unroller::trace(:max_depth => 5, :show_locals=>true,:exclude_classes =>[/Watir/,/String/,/Array/]) do # some watir test script code goes here end I hope some of you find this helpful! -David From I_Webb at acs.org Mon May 7 15:49:55 2007 From: I_Webb at acs.org (Ian Webb) Date: Mon, 7 May 2007 15:49:55 -0400 Subject: [Wtr-general] Using an ie.table.each do |row| loop when thepagein the ie window refreshes itself In-Reply-To: References: <353BA7F10699794198CD75B3033E62AA02314AA9@washnt57.acs.org><68f4a0e80705051554l24c0f4e0t1cd6385633d2d4c4@mail.gmail.com><353BA7F10699794198CD75B3033E62AA025212E0@washnt57.acs.org> Message-ID: <353BA7F10699794198CD75B3033E62AA02521434@washnt57.acs.org> Here's the HTML. This row repeats with different values. The field with "Name Goes Here" in it is the field we're filtering on - if this field is matched by a given regex, then make a note that we need to click the button in the last column of this row.

    Name Goes Here

    Active Member

    AU, REV

     Support 

    The PERSON_ID field in this request is constant for each user/time the table is displayed, but is not constant between instances. The ORGANIZATION_ID field changes for each row of the table, and *is* the same between instances. I would rather not parse out the HTML and then manually construct these requests - this should as much as possible be based on what the user sees, not the underlying HTML. However, if I have to that's a possibility. Thanks, Ian ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of ?eljko Filipin Sent: Monday, May 07, 2007 9:04 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Using an ie.table.each do |row| loop when thepagein the ie window refreshes itself On 5/7/07, Ian Webb wrote: I'm wondering if maybe there's a way to store the indices of the buttons it's going to click on within the array, rather than the rows themselves. I tried buttons_to_click << row[5].link(:index,1), but that doesn't work. Hi Ian, I am not sure I understood what you want to do here (I need to see html), but try changing buttons_to_click << row[5].link(:index,1) to buttons_to_click << ie.row[5].link(:index,1) Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070507/66a1a13d/attachment.html From forum-watir-users at openqa.org Mon May 7 16:20:13 2007 From: forum-watir-users at openqa.org (Aaron) Date: Mon, 07 May 2007 15:20:13 CDT Subject: [Wtr-general] Remote Watir Message-ID: <26641871.10251178569244007.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am in the process of switching our test environment from Selenium to Watir. So, I am a newb with respect to Ruby and Watir. Is there any thing in Watir or inherent in Ruby that would mimic the capability of "Selenium Remote Control"? In particular, we have a room full of Windows boxes with various flavors of IE. >From one central Linux box, we want to execute tests on all of the Windows boxes concurrently. This was trivial to do with the Selenium Remote Control server but I have found nothing similar for Ruby/Watir yet. Any ideas, or do I have to write my own proxy server in ruby to remotely execute scripts and return results? Thanks in advance. From crasch at gmail.com Mon May 7 19:48:44 2007 From: crasch at gmail.com (Christopher Rasch) Date: Mon, 07 May 2007 16:48:44 -0700 Subject: [Wtr-general] The Plan for Watir In-Reply-To: <463BF71A.9020000@pettichord.com> References: <463BF71A.9020000@pettichord.com> Message-ID: <463FBADC.50001@gmail.com> Bret Pettichord wrote: > I've been doing a lot of thinking and planning for what we need to do > with Watir. Hi Brett, I think your current plans are great! I'm looking forward to greater integration of the various watirs to the main code base, as well as better support for modal_dialogs on the supported platforms. Thanks! Chris * * From forum-watir-users at openqa.org Mon May 7 20:19:26 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Mon, 07 May 2007 19:19:26 CDT Subject: [Wtr-general] WIN32OLERuntimeError Message-ID: <40612309.10511178583596506.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello, I have a test case below: 1. Open IE browser window, change the language setting using autoit. Then, close the window. 2. Open a web page in IE to do a sample testing. Then, close IE window. 3. Open IE browser window, reset the language setting using autoit. Then, close the window. The code for step 1 is: ie = Watir::IE.new autoit = WIN32OLE.new('AutoItX3.Control') autoit.WinWaitActive("Blank Page - Windows Internet Explorer provided by Yahoo!") autoit.Send ("!to") #sends Alt T (Tools) and O (options) to open Internet Options autoit.WinWaitActive("Internet Options") autoit.Send ("!l") autoit.Send ("!a") When running the script for step 1 and 2, the setps get completed fine. But, at step 3, received error message and IE browser is not open: C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1570:in `initialize': failed to create WIN32OLE object from `InternetExplorer.Application' (WIN32OLERuntimeError) HRESULT error code:0x80004002 No such interface supported from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1570:in `new' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1570:in `create_browser_window' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1477:in `initialize' from C:/depot/eng/bedrock/active/qa/all/cc/qa/Ruby/test.rb:51:in `new' from C:/depot/eng/bedrock/active/qa/all/cc/qa/Ruby/test.rb:51 Step3 is very similar to the step1. Why it is working in step 1, but not working in step 3? Please help! Thanks. Kui From crasch at gmail.com Mon May 7 20:39:43 2007 From: crasch at gmail.com (Christopher Rasch) Date: Mon, 07 May 2007 17:39:43 -0700 Subject: [Wtr-general] Community involvement with Watir In-Reply-To: References: Message-ID: <463FC6CF.7010903@gmail.com> Charley Baker wrote: > Hi all, > > I'd like to send out another annoucement asking for people to > contribute to > the Watir user guide and volunteer. I've started poking around at the > user > guide today and made a few changes, notably to update view source with > the > ie developer toolbar. I'll make further changes if as I get time, but am > making the call for volunteers to add information and help out, much of > which is related to Watir 1.5. Let me know if you're interested in > helping > out. Hi Charley, Thanks! How should we contribute to the User Guide? It doesn't appear to be user editable: http://wtr.rubyforge.org/watir_user_guide.html Is this the wiki we should be editing? http://wiki.openqa.org/display/WTR/Project+Home Feel free to add my tutorial for installing FireWatir on Mac OS X (Intel) (or let me know where I should add it): http://crasch.livejournal.com/550521.html#cutid1 Under what license do you publish the Watir documention? Chris From paul.rogers at shaw.ca Mon May 7 22:14:42 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 07 May 2007 20:14:42 -0600 Subject: [Wtr-general] Remote Watir References: <26641871.10251178569244007.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <003101c79116$a402e670$6400a8c0@laptop> drb might be what you want. Also search the list here - someone posted a link to a library that might be more like what you want. I wish I could remember who/what/when to help narrow your search ----- Original Message ----- From: "Aaron" To: Sent: Monday, May 07, 2007 2:20 PM Subject: [Wtr-general] Remote Watir >I am in the process of switching our test environment from Selenium to >Watir. > So, I am a newb with respect to Ruby and Watir. > > Is there any thing in Watir or inherent in Ruby that would mimic the > capability of "Selenium Remote Control"? > > In particular, we have a room full of Windows boxes with various flavors > of IE. >>From one central Linux box, we want to execute tests on all of the Windows >>boxes concurrently. > This was trivial to do with the Selenium Remote Control server but I have > found nothing similar for Ruby/Watir yet. > > Any ideas, or do I have to write my own proxy server in ruby to remotely > execute scripts and return results? > > Thanks in advance. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From christopher.mcmahon at gmail.com Tue May 8 00:29:44 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 7 May 2007 22:29:44 -0600 Subject: [Wtr-general] Community involvement with Watir In-Reply-To: <463FC6CF.7010903@gmail.com> References: <463FC6CF.7010903@gmail.com> Message-ID: <72799cd70705072129l6e017bd3mf90f69b8adc27bf2@mail.gmail.com> > Thanks! How should we contribute to the User Guide? It doesn't appear > to be user editable: I'd suggest either adding to this thread, or contacting Zeljko directly. > Feel free to add my tutorial for installing FireWatir on Mac OS X > (Intel) (or let me know where I should add it): > > http://crasch.livejournal.com/550521.html#cutid1 I couldn't get the Linux jssh xpi to function with the lastest osx and latest FF. In another thread (and mentioned to Angrez) I found a Darwin jssh that worked properly. From crasch at gmail.com Tue May 8 01:49:56 2007 From: crasch at gmail.com (Christopher Rasch) Date: Mon, 07 May 2007 22:49:56 -0700 Subject: [Wtr-general] Community involvement with Watir In-Reply-To: <72799cd70705072129l6e017bd3mf90f69b8adc27bf2@mail.gmail.com> References: <463FC6CF.7010903@gmail.com> <72799cd70705072129l6e017bd3mf90f69b8adc27bf2@mail.gmail.com> Message-ID: <46400F84.6020707@gmail.com> Chris McMahon wrote: >> Thanks! How should we contribute to the User Guide? It doesn't appear >> to be user editable: >> > > I'd suggest either adding to this thread, or contacting Zeljko directly. > > Thanks! >> Feel free to add my tutorial for installing FireWatir on Mac OS X >> (Intel) (or let me know where I should add it): >> >> http://crasch.livejournal.com/550521.html#cutid1 >> > > I couldn't get the Linux jssh xpi to function with the lastest osx and > latest FF. In another thread (and mentioned to Angrez) I found a > Darwin jssh that worked properly. > Hmm...the only message I could find was this one, which suggest that the Linux jssh xpi worked. 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 Tue May 8 02:43:10 2007 From: forum-watir-users at openqa.org (Sadeesh Vinoth) Date: Tue, 08 May 2007 01:43:10 CDT Subject: [Wtr-general] Watir and smartclient In-Reply-To: <25168087.2801176800418516.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <29811696.11631178606620256.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Angrez, What i have attched is the source that is got by right clicking on the page. I think this is what you are refering in your prevoius reply. Thanks, Sadeesh Vinoth T From forum-watir-users at openqa.org Tue May 8 04:19:15 2007 From: forum-watir-users at openqa.org (Trevor Mason) Date: Tue, 08 May 2007 03:19:15 CDT Subject: [Wtr-general] Setting focus in a frame in IE7 In-Reply-To: Message-ID: <34517215.12301178612386214.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Charley, The problem with using set on a text_field is that you it will set more than the maximum field length, so foobar will be entered as foobar and not foo. From forum-watir-users at openqa.org Tue May 8 05:16:32 2007 From: forum-watir-users at openqa.org (Trevor Mason) Date: Tue, 08 May 2007 04:16:32 CDT Subject: [Wtr-general] Setting focus in a frame in IE7 In-Reply-To: <08fe01c78e67$1f387d80$6400a8c0@laptop> Message-ID: <39758802.13631178615822931.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Paul, I'll look into using the maxLength option. As a matter of interest, I have used ie.send_keys("{tab}") to tab away from the address bar, and I can then set the focus in my frame! Very strange! From dhrubojyotib at gmail.com Tue May 8 06:23:29 2007 From: dhrubojyotib at gmail.com (Dhrubojyoti Biswas) Date: Tue, 8 May 2007 15:53:29 +0530 Subject: [Wtr-general] How to contribute to WATIR User Guide and other documentation Message-ID: The company for which I work is heavily using WATIR to write web application tests. Recently we built a generic framework using WATIR as the base for writing UI Automated Tests for all our products. We wrote wrappers on top of WATIR to abstract UI operations. For example we thought that editing a wizard is a UI operation. So we wrote wrappers on top of WATIR that would discover the controls on a page and intelligently fill up forms based on specific test cases. I was the 'so-called' architect of the project and we also ended up displaying our framework in our annual In-House Innovation Program. I would like to contribute to the User Guide and othe WATIR documentation including the much awaited multi-browser support functionality thats en-route. Can somebody gimme some pointers in where to start with the Doc Contributions? It goes without saying that I am a huge fan of WATIR. -- Dhruv On 5/5/07, wtr-general-request at rubyforge.org < wtr-general-request at rubyforge.org> wrote: > > 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 include external script (.rb) in Watir? (Alien Ruby) > 2. Re: how to include external script (.rb) in Watir? > ( ?eljko Filipin ) > 3. Re: FireWatir not finding buttons by id (Charley Baker) > 4. Using an ie.table.each do |row| loop when the page in the ie > window refreshes itself (Ian Webb) > 5. Re: how to include external script (.rb) in Watir? (Alien Ruby) > 6. Re: how to include external script (.rb) in Watir? > ( ?eljko Filipin ) > 7. Re: how to include external script (.rb) in Watir? (Alien Ruby) > 8. Re: how to include external script (.rb) in Watir? (Chris McMahon) > 9. Community involvement with Watir (Charley Baker) > 10. Re: how to include external script (.rb) in Watir? (Alien Ruby) > 11. Re: how to include external script (.rb) in Watir? (Chris McMahon) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 04 May 2007 13:52:37 CDT > From: Alien Ruby > Subject: Re: [Wtr-general] how to include external script (.rb) in > Watir? > To: wtr-general at rubyforge.org > Message-ID: > < > 29411403.6711178304787643.JavaMail.oqa-j2ee at openqa01.managed.contegix.com> > > Content-Type: text/plain; charset=ISO-8859-1 > > thanks for the quick respond. that was easy, huh.. I just thought too much > on that one. beginner...:( > > > ------------------------------ > > Message: 2 > Date: Fri, 4 May 2007 20:59:39 +0200 > From: " ?eljko Filipin " > Subject: Re: [Wtr-general] how to include external script (.rb) in > Watir? > To: wtr-general at rubyforge.org > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > On 5/4/07, Alien Ruby wrote: > > > > thanks for the quick respond. > > > You are welcome. :) > > that was easy, huh.. > > > It is Ruby, (almost) everything is easy here. > > I just thought too much on that one. beginner...:( > > > > It happens. That is why this mailing list exists. > > Zeljko > -- > ZeljkoFilipin.com > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://rubyforge.org/pipermail/wtr-general/attachments/20070504/33f31964/attachment-0001.html > > ------------------------------ > > Message: 3 > Date: Fri, 4 May 2007 13:06:56 -0600 > From: "Charley Baker" > Subject: Re: [Wtr-general] FireWatir not finding buttons by id > To: wtr-general at rubyforge.org > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > It's a curious bug, just saw the same thing. A bug/feature, works more > than > it should. :) Chris is right we should definitely spend more time with > Angrez, Prema and the Firewatir community. I'm getting slammed by requests > for multiple browser tests and starting to abstract layers so that it's > easier. > > -c > > On 5/4/07, Chris McMahon wrote: > > > > > Im going to guess that this is a bug in 1.5 > > > > Seems like this would be an opportunity to sync up FireWatir with > > Watir. I think Charley has been looking into some of that recently. > > _______________________________________________ > > 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/f7d09646/attachment-0001.html > > ------------------------------ > > Message: 4 > Date: Fri, 4 May 2007 17:07:26 -0400 > From: "Ian Webb" > Subject: [Wtr-general] Using an ie.table.each do |row| loop when the > page in the ie window refreshes itself > To: > Message-ID: > <353BA7F10699794198CD75B3033E62AA02314AA9 at washnt57.acs.org> > Content-Type: text/plain; charset="us-ascii" > > Here's the code snippet that's giving me problems: > > ie.table(:index,29).each do |row| > if (row[1].text =~ /#{journals}/) != nil then #If there is a match > for that regex > row[5].link(:index,1).click # this makes the popup window appear > cw = Watir::IE.attach(:title,'Popup Window') # attach to the popup > window > doRolesPopup(cw) # fill out and submit the form > end > end > > doRolesPopup fills out a form in the cw page, then clicks submit. The > submit button submits the form, then closes the cw window and reloads > the ie window. This reload of the page referenced by the ie object > appears to break the row object, since I get the following error: > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `invoke': unknown > property or method `rows' (WIN32OLERuntimeError) > HRESULT error code:0x80070005 > Access is denied. from > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `row' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `upto' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' > from assignroles.rb:51 > from c:/ruby/lib/ruby/1.8/csv.rb:532:in `parse' > from c:/ruby/lib/ruby/1.8/csv.rb:560:in `each' > from c:/ruby/lib/ruby/1.8/csv.rb:531:in `parse' > from assignroles.rb:35 > > Is there any way to keep this simple .each loop, or do I need to work > around it? > > Thanks, > Ian > > > ------------------------------ > > Message: 5 > Date: Fri, 04 May 2007 16:33:39 CDT > From: Alien Ruby > Subject: Re: [Wtr-general] how to include external script (.rb) in > Watir? > To: wtr-general at rubyforge.org > Message-ID: > < > 32765975.51178314449567.JavaMail.oqa-j2ee at openqa01.managed.contegix.com> > > Content-Type: text/plain; charset=ISO-8859-1 > > Hi... > > Do you know if there is any document for me to read about function > declaration, function returning values (integer, strings), and etc. > > let's say I want to multiply something by 10, > > x = Multiply(3) > puts x # this line should give me 30. > > How do I use something like, > > def integer Multiply(y) > { temp = 10 * y > return temp > } > > or > > do a public class ? > > Again, I appreciate your time. > > > ------------------------------ > > Message: 6 > Date: Fri, 4 May 2007 23:45:22 +0200 > From: " ?eljko Filipin " > Subject: Re: [Wtr-general] how to include external script (.rb) in > Watir? > To: wtr-general at rubyforge.org > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > You should read this book http://www.rubycentral.com/book/ > > Look for chapters about methods and classes. > > Zeljko > -- > ZeljkoFilipin.com > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://rubyforge.org/pipermail/wtr-general/attachments/20070504/a14168c6/attachment-0001.html > > ------------------------------ > > Message: 7 > Date: Fri, 04 May 2007 16:51:09 CDT > From: Alien Ruby > Subject: Re: [Wtr-general] how to include external script (.rb) in > Watir? > To: wtr-general at rubyforge.org > Message-ID: > < > 31467556.161178315499299.JavaMail.oqa-j2ee at openqa01.managed.contegix.com> > > Content-Type: text/plain; charset=ISO-8859-1 > > Very nice, that'll be my homework for the weekend. > > thanks a bunch...!! > > > ------------------------------ > > Message: 8 > Date: Fri, 4 May 2007 16:01:27 -0600 > From: "Chris McMahon" > Subject: Re: [Wtr-general] how to include external script (.rb) in > Watir? > To: wtr-general at rubyforge.org > Message-ID: > <72799cd70705041501ndf46120s77f72d7b0613b1bf at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On 5/4/07, Alien Ruby wrote: > > Very nice, that'll be my homework for the weekend. > > > > thanks a bunch...!! > > It's on your computer, too, in C:/ruby/doc > > > ------------------------------ > > Message: 9 > Date: Fri, 4 May 2007 16:09:55 -0600 > From: "Charley Baker" > Subject: [Wtr-general] Community involvement with Watir > To: wtr-general at rubyforge.org > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Hi all, > > I'd like to send out another annoucement asking for people to contribute > to > the Watir user guide and volunteer. I've started poking around at the user > guide today and made a few changes, notably to update view source with the > ie developer toolbar. I'll make further changes if as I get time, but am > making the call for volunteers to add information and help out, much of > which is related to Watir 1.5. Let me know if you're interested in helping > out. > > I'll also suggest helping out on the lists or whereever you think you > might be useful. If you've worked with Ruby or Watir for more than a > couple > of days, you're a couple of days ahead of the next person and can provide > some knowledge, don't be afraid to be wrong, jump in. Additionally there > is > a section on the wiki for user contributions as you write code that might > be > useful to other people. This is an open source project that depends on > community involvement. > > (Starting to sound like a pbs pledge drive). > > Thanks, > > Charley > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://rubyforge.org/pipermail/wtr-general/attachments/20070504/ecd27bce/attachment-0001.html > > ------------------------------ > > Message: 10 > Date: Fri, 04 May 2007 17:25:52 CDT > From: Alien Ruby > Subject: Re: [Wtr-general] how to include external script (.rb) in > Watir? > To: wtr-general at rubyforge.org > Message-ID: > < > 30050885.721178317582534.JavaMail.oqa-j2ee at openqa01.managed.contegix.com> > > Content-Type: text/plain; charset=ISO-8859-1 > > How are you guys so helpful ? > > It just makes me want to keep coding all weekend. need lots of coffee > then... > > have a great weekend, guys..!! > > > ------------------------------ > > Message: 11 > Date: Fri, 4 May 2007 16:49:36 -0600 > From: "Chris McMahon" > Subject: Re: [Wtr-general] how to include external script (.rb) in > Watir? > To: wtr-general at rubyforge.org > Message-ID: > <72799cd70705041549u5d00a068w87f65ead35374263 at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On 5/4/07, Alien Ruby wrote: > > How are you guys so helpful ? > > That's actually a really good question. The people who started Watir > had all participated in other Open Source projects, some successful, > some unsuccessful. The early Watir community insisted that everyone, > particularly beginners, be treated with respect and courtesy. > > Many, if not most, of the Watir community are not expert programmers. > If the project is going to continue, and continue to be successful, > two things have to happen: beginners must continue to be treated with > respect and courtesy; and as people get more experience with Watir and > Ruby, they have to be encouraged in turn to help out where they can > contribute. > > Mostly this means answering questions on the list: if you see a > question you can answer, please do so. It's OK if you're wrong-- as > long as you are not deliberately misleading, we will all learn > something. > > In addition, if you can help with documentation or patches or > features, please contribute that work also. Charley just asked today > for contributions to the user guide. Maybe a reference to the copy of > Pickaxe included with the Ruby distro would be a good thing. > > One very exciting project happening sort of under the radar is to make > Watir, FireWatir, SafariWatir, (and possibly Selenium RC) all have a > more consistent set of functionality and syntax. I'm not a great > programmer, but I like to answer off-topic questions on the list, and > I've started to use the non-IE Watirs, and I contributed my first > inconsistency report yesterday. The point being, that a few little > contributions here and there move the project along nicely, as long as > a large number of people are making the contributions. > > > ------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > End of Wtr-general Digest, Vol 42, Issue 12 > ******************************************* > -- Dhrubo Symantec Corporation www.servergeeks.bravehost.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070508/0e4d3c3d/attachment-0001.html From forum-watir-users at openqa.org Tue May 8 07:05:14 2007 From: forum-watir-users at openqa.org (Vipul) Date: Tue, 08 May 2007 06:05:14 CDT Subject: [Wtr-general] Running multiple test concurrenty in Watir Message-ID: <24844110.601178622344804.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> While running multiple test concurrenty does each thread run parallel or sequentially. For eg require 'thread' require 'watir' def test_google ie = Watir::IE.start('http://www.google.com') ie.text_field(:name, "q").set("pickaxe") ie.button(:value, "Google Search").click end ` # run the same test three times concurrently in separate browsers threads = [] 3.times do threads << Thread.new {test_google} end threads.each {|x| x.join} In this example 3 browser connection are open. Are these 3 browser connection open at same time or one after the another. From forum-watir-users at openqa.org Tue May 8 07:17:33 2007 From: forum-watir-users at openqa.org (Vipul) Date: Tue, 08 May 2007 06:17:33 CDT Subject: [Wtr-general] How to selecting Menu item in Watir Message-ID: <25203840.831178623083747.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I want to write the script for following scenario 1) Enter Username and Password in login screen. 2) Click Login Button. 3) From Menu Tab Select 'Session Menu' 4) Click "Data Administration" under Session Menu. i have written the script for login but i could not wriite script for selecting menu item. Sample html is given below

    OnMenuClick() method fetches the event.result and uses a switch loop to select the menu item like case 'DataAdmin': LoadFrame(command, "Data Administration", "Modules/DataAdmin/DataAdmin.aspx"); break; From zeljko.filipin at gmail.com Tue May 8 07:56:11 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 8 May 2007 13:56:11 +0200 Subject: [Wtr-general] How to selecting Menu item in Watir In-Reply-To: <25203840.831178623083747.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <25203840.831178623083747.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Vipul, I did not understand what you want to do. Click div tag with "Data Administration" text? That can be done with one of these ie.div(:id, "DataAdmin").click ie.div(:text, "Data Administration").click Maybe you will have to click his parent span tag. ie.span(:id, "Sessions").click ie.span(:id, "Sessions").fire_event("onsubmenu_click") Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070508/29a5c22d/attachment.html From zeljko.filipin at gmail.com Tue May 8 08:10:48 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 8 May 2007 14:10:48 +0200 Subject: [Wtr-general] How to contribute to WATIR User Guide and other documentation In-Reply-To: References: Message-ID: On 5/8/07, Dhrubojyoti Biswas wrote: > > Can somebody gimme some pointers in where to start with the Doc > Contributions? > Hi Dhruv, Jeff Fry is focusing on Rdoc I will update user guide. This list is good place for suggestions. What would you like to work on? Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070508/460ee196/attachment.html From esjewett at gmail.com Tue May 8 09:18:17 2007 From: esjewett at gmail.com (Ethan Jewett) Date: Tue, 8 May 2007 08:18:17 -0500 Subject: [Wtr-general] Using an ie.table.each do |row| loop when thepage in the ie window refreshes itself In-Reply-To: <353BA7F10699794198CD75B3033E62AA025212E0@washnt57.acs.org> References: <353BA7F10699794198CD75B3033E62AA02314AA9@washnt57.acs.org> <68f4a0e80705051554l24c0f4e0t1cd6385633d2d4c4@mail.gmail.com> <353BA7F10699794198CD75B3033E62AA025212E0@washnt57.acs.org> Message-ID: <68f4a0e80705080618s6ad6d287j779747d504676fa3@mail.gmail.com> Ian, Sorry about the "rows" and "each_with_index" issues. Hopefully that'll teach me to test suggestions : ) table(:index,29) clearly does the same thing I thought table(:index,29).rows does. As for the "each_with_index", if you just mixin the Enumerable module to the Watir::Table class like this: class Watir::Table include Enumerable end before you use "each_with_index", then you should be in good shape. This seems like something that should be added to the base Watir, since rows in a table are generally an enumerable element and the current Watir::Table.each method returns the rows of the table in order. Any objections? If not, I'll open a ticket. Ethan On 5/7/07, Ian Webb wrote: > Thanks - this does look like a good approach. The table's layout doesn't > change, it just reloads to update the data within the table with the > entries that were just made in the popup window. It's a really annoying > UI, especially when you have test cases that require changing a dozen > rows and therefore opening the popup a dozen times.. hence why I'm quite > eager to get Watir doing it instead. > > However, each_with_index appears to be an undefined method for ie.table > objects. I can iterate on .each just fine, but .each_with_index is > undefined. (.rows is undefined as well; .each works fine if I leave it > out) > > I'm wondering if maybe there's a way to store the indices of the buttons > it's going to click on within the array, rather than the rows > themselves. I tried buttons_to_click << row[5].link(:index,1), but that > doesn't work. > > Thanks, > Ian > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Ethan Jewett > Sent: Saturday, May 05, 2007 6:55 PM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Using an ie.table.each do |row| loop when > thepage in the ie window refreshes itself > > Ian, > > Reloading probably invalidates the table object, resulting in your > "Access denied" error when ruby goes back for the next row in the > table. > > Suggestion: Assuming that submitting and reloading doesn't affect the > table layout, use rows.each_with_index to build an array of indices of > relevant rows. Then cycle through the array clicking and submitting. > For instance (untested, unfortunately): > > rows_to_click = Array.new > > ie.table(:index, 29).rows.each_with_index do |row, i| > rows_to_click << i if (row[1].text =~ /#{journals}/) != nil > end > > rows_to_click.each do |i| > [Do the clicking and such for row i here.] > end > > This could be made substantially prettier, but hopefully it gets the job > done. > > Ethan > > On 5/4/07, Ian Webb wrote: > > Here's the code snippet that's giving me problems: > > > > ie.table(:index,29).each do |row| > > if (row[1].text =~ /#{journals}/) != nil then #If there is a match > > for that regex > > row[5].link(:index,1).click # this makes the popup window appear > > cw = Watir::IE.attach(:title,'Popup Window') # attach to the > popup > > window > > doRolesPopup(cw) # fill out and submit the form > > end > > end > > > > doRolesPopup fills out a form in the cw page, then clicks submit. The > > submit button submits the form, then closes the cw window and reloads > > the ie window. This reload of the page referenced by the ie object > > appears to break the row object, since I get the following error: > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `invoke': unknown > > property or method `rows' (WIN32OLERuntimeError) > > HRESULT error code:0x80070005 > > Access is denied. from > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `row' > > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' > > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `upto' > > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' > > from assignroles.rb:51 > > from c:/ruby/lib/ruby/1.8/csv.rb:532:in `parse' > > from c:/ruby/lib/ruby/1.8/csv.rb:560:in `each' > > from c:/ruby/lib/ruby/1.8/csv.rb:531:in `parse' > > from assignroles.rb:35 > > > > Is there any way to keep this simple .each loop, or do I need to work > > around it? > > > > Thanks, > > Ian > > _______________________________________________ > > 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 Tue May 8 10:35:50 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 8 May 2007 08:35:50 -0600 Subject: [Wtr-general] Remote Watir In-Reply-To: <003101c79116$a402e670$6400a8c0@laptop> References: <26641871.10251178569244007.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <003101c79116$a402e670$6400a8c0@laptop> Message-ID: Bill Agee uploaded a rails app to run tests remotely, it's in the user contributions area on the wiki: http://wiki.openqa.org/display/WTR/Rails+test+runner+example+app -Charley On 5/7/07, Paul Rogers wrote: > > drb might be what you want. > Also search the list here - someone posted a link to a library that might > be > more like what you want. I wish I could remember who/what/when to help > narrow your search > > ----- Original Message ----- > From: "Aaron" > To: > Sent: Monday, May 07, 2007 2:20 PM > Subject: [Wtr-general] Remote Watir > > > >I am in the process of switching our test environment from Selenium to > >Watir. > > So, I am a newb with respect to Ruby and Watir. > > > > Is there any thing in Watir or inherent in Ruby that would mimic the > > capability of "Selenium Remote Control"? > > > > In particular, we have a room full of Windows boxes with various flavors > > of IE. > >>From one central Linux box, we want to execute tests on all of the > Windows > >>boxes concurrently. > > This was trivial to do with the Selenium Remote Control server but I > have > > found nothing similar for Ruby/Watir yet. > > > > Any ideas, or do I have to write my own proxy server in ruby to remotely > > execute scripts and return results? > > > > Thanks in advance. > > _______________________________________________ > > 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/20070508/1b12dc8f/attachment.html From rdewolfe at Credant.com Tue May 8 10:45:27 2007 From: rdewolfe at Credant.com (Russ DeWolfe) Date: Tue, 8 May 2007 09:45:27 -0500 Subject: [Wtr-general] Wtr-general Digest, Vol 42, Issue 14 In-Reply-To: Message-ID: Here is the message I get when I attempt to install this gem: ERROR: While executing gem ... (RuntimeError) Error instaling unroller: unroller requires facets >= 1.8.54 NOTE: I DID install the win32console gem -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of wtr-general-request at rubyforge.org Sent: Monday, May 07, 2007 3:21 PM To: wtr-general at rubyforge.org Subject: Wtr-general Digest, Vol 42, Issue 14 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: unknown property or method `readyState' (Ken Lim) 2. Re: Using an ie.table.each do |row| loop when thepage in the ie window refreshes itself (Ian Webb) 3. Re: Using an ie.table.each do |row| loop when thepage in the ie window refreshes itself ( ?eljko Filipin ) 4. Excelent debugging tool - Unroller (Brown, David) 5. Re: Using an ie.table.each do |row| loop when thepagein the ie window refreshes itself (Ian Webb) 6. Remote Watir (Aaron) ---------------------------------------------------------------------- Message: 1 Date: Mon, 7 May 2007 14:25:10 +0800 From: "Ken Lim" Subject: Re: [Wtr-general] unknown property or method `readyState' To: wtr-general at rubyforge.org Message-ID: <224000620705062325m264b44ddof552484ffa3b4498 at mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" Hi, Good day. Hope I understood your request for stack traces correctly. Please see below: WIN32OLERuntimeError: unknown property or method `readyState' HRESULT error code:0x80070005 Access is denied. C:/Program Files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1819:in `method_missing' C:/Program Files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1819:in `wait' C:/Program Files/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.1164/./watir.rb:2575:in `click' Regards, -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070507/da80a1b5 /attachment-0001.html ------------------------------ Message: 2 Date: Mon, 7 May 2007 08:55:46 -0400 From: "Ian Webb" Subject: Re: [Wtr-general] Using an ie.table.each do |row| loop when thepage in the ie window refreshes itself To: Message-ID: <353BA7F10699794198CD75B3033E62AA025212E0 at washnt57.acs.org> Content-Type: text/plain; charset="us-ascii" Thanks - this does look like a good approach. The table's layout doesn't change, it just reloads to update the data within the table with the entries that were just made in the popup window. It's a really annoying UI, especially when you have test cases that require changing a dozen rows and therefore opening the popup a dozen times.. hence why I'm quite eager to get Watir doing it instead. However, each_with_index appears to be an undefined method for ie.table objects. I can iterate on .each just fine, but .each_with_index is undefined. (.rows is undefined as well; .each works fine if I leave it out) I'm wondering if maybe there's a way to store the indices of the buttons it's going to click on within the array, rather than the rows themselves. I tried buttons_to_click << row[5].link(:index,1), but that doesn't work. Thanks, Ian -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Ethan Jewett Sent: Saturday, May 05, 2007 6:55 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Using an ie.table.each do |row| loop when thepage in the ie window refreshes itself Ian, Reloading probably invalidates the table object, resulting in your "Access denied" error when ruby goes back for the next row in the table. Suggestion: Assuming that submitting and reloading doesn't affect the table layout, use rows.each_with_index to build an array of indices of relevant rows. Then cycle through the array clicking and submitting. For instance (untested, unfortunately): rows_to_click = Array.new ie.table(:index, 29).rows.each_with_index do |row, i| rows_to_click << i if (row[1].text =~ /#{journals}/) != nil end rows_to_click.each do |i| [Do the clicking and such for row i here.] end This could be made substantially prettier, but hopefully it gets the job done. Ethan On 5/4/07, Ian Webb wrote: > Here's the code snippet that's giving me problems: > > ie.table(:index,29).each do |row| > if (row[1].text =~ /#{journals}/) != nil then #If there is a match > for that regex > row[5].link(:index,1).click # this makes the popup window appear > cw = Watir::IE.attach(:title,'Popup Window') # attach to the popup > window > doRolesPopup(cw) # fill out and submit the form > end > end > > doRolesPopup fills out a form in the cw page, then clicks submit. The > submit button submits the form, then closes the cw window and reloads > the ie window. This reload of the page referenced by the ie object > appears to break the row object, since I get the following error: > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `invoke': unknown > property or method `rows' (WIN32OLERuntimeError) > HRESULT error code:0x80070005 > Access is denied. from > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `row' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `upto' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' > from assignroles.rb:51 > from c:/ruby/lib/ruby/1.8/csv.rb:532:in `parse' > from c:/ruby/lib/ruby/1.8/csv.rb:560:in `each' > from c:/ruby/lib/ruby/1.8/csv.rb:531:in `parse' > from assignroles.rb:35 > > Is there any way to keep this simple .each loop, or do I need to work > around it? > > Thanks, > Ian > _______________________________________________ > 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 ------------------------------ Message: 3 Date: Mon, 7 May 2007 15:04:27 +0200 From: " ?eljko Filipin " Subject: Re: [Wtr-general] Using an ie.table.each do |row| loop when thepage in the ie window refreshes itself To: wtr-general at rubyforge.org Message-ID: Content-Type: text/plain; charset="utf-8" On 5/7/07, Ian Webb wrote: > > I'm wondering if maybe there's a way to store the indices of the > buttons it's going to click on within the array, rather than the rows > themselves. I tried buttons_to_click << row[5].link(:index,1), but > that doesn't work. Hi Ian, I am not sure I understood what you want to do here (I need to see html), but try changing buttons_to_click << row[5].link(:index,1) to buttons_to_click << ie.row[5].link(:index,1) Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070507/360e779e /attachment-0001.html ------------------------------ Message: 4 Date: Mon, 7 May 2007 09:38:35 -0700 From: "Brown, David" Subject: [Wtr-general] Excelent debugging tool - Unroller To: Message-ID: <44B054F46C2E4E4996C27D92F9B825EE04ED4279 at SVR-ORW-EXC-07.mgc.mentorg.com > Content-Type: text/plain; charset="us-ascii" All, I stumbled across this handy little debugging tool the other day when I was trying to find a tool that would display/trace the execution of my test script. This tool called "Unroller" will print out each line of code that is executed along with the values of the variable passed into and returned from methods. (optionally it will also keep track of local variables.) It is very helpful for quickly identifying exactly where your script died, and what values were causing it to choke. http://unroller.rubyforge.org/ For some reason I had to install the win32console gem as well to get it working: http://rubyforge.org/frs/?group_id=1766 Tip: when you invoke the unroller, you may want to "exclude" the common classes that you don't care about ie watir, string, array ... So that it only traces your code. For example: Unroller::trace(:max_depth => 5, :show_locals=>true,:exclude_classes =>[/Watir/,/String/,/Array/]) do # some watir test script code goes here end I hope some of you find this helpful! -David ------------------------------ Message: 5 Date: Mon, 7 May 2007 15:49:55 -0400 From: "Ian Webb" Subject: Re: [Wtr-general] Using an ie.table.each do |row| loop when thepagein the ie window refreshes itself To: Message-ID: <353BA7F10699794198CD75B3033E62AA02521434 at washnt57.acs.org> Content-Type: text/plain; charset="iso-8859-2" Here's the HTML. This row repeats with different values. The field with "Name Goes Here" in it is the field we're filtering on - if this field is matched by a given regex, then make a note that we need to click the button in the last column of this row.

    Name Goes Here

    Active Member

    AU, REV

     Support 

    The PERSON_ID field in this request is constant for each user/time the table is displayed, but is not constant between instances. The ORGANIZATION_ID field changes for each row of the table, and *is* the same between instances. I would rather not parse out the HTML and then manually construct these requests - this should as much as possible be based on what the user sees, not the underlying HTML. However, if I have to that's a possibility. Thanks, Ian ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of ?eljko Filipin Sent: Monday, May 07, 2007 9:04 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Using an ie.table.each do |row| loop when thepagein the ie window refreshes itself On 5/7/07, Ian Webb wrote: I'm wondering if maybe there's a way to store the indices of the buttons it's going to click on within the array, rather than the rows themselves. I tried buttons_to_click << row[5].link(:index,1), but that doesn't work. Hi Ian, I am not sure I understood what you want to do here (I need to see html), but try changing buttons_to_click << row[5].link(:index,1) to buttons_to_click << ie.row[5].link(:index,1) Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070507/66a1a13d /attachment-0001.html ------------------------------ Message: 6 Date: Mon, 07 May 2007 15:20:13 CDT From: Aaron Subject: [Wtr-general] Remote Watir To: wtr-general at rubyforge.org Message-ID: <26641871.10251178569244007.JavaMail.oqa-j2ee at openqa01.managed.contegix. com> Content-Type: text/plain; charset=ISO-8859-1 I am in the process of switching our test environment from Selenium to Watir. So, I am a newb with respect to Ruby and Watir. Is there any thing in Watir or inherent in Ruby that would mimic the capability of "Selenium Remote Control"? In particular, we have a room full of Windows boxes with various flavors of IE. >From one central Linux box, we want to execute tests on all of the Windows boxes concurrently. This was trivial to do with the Selenium Remote Control server but I have found nothing similar for Ruby/Watir yet. Any ideas, or do I have to write my own proxy server in ruby to remotely execute scripts and return results? Thanks in advance. ------------------------------ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general End of Wtr-general Digest, Vol 42, Issue 14 ******************************************* From christopher.mcmahon at gmail.com Tue May 8 10:52:10 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 8 May 2007 08:52:10 -0600 Subject: [Wtr-general] Community involvement with Watir In-Reply-To: <46400F84.6020707@gmail.com> References: <463FC6CF.7010903@gmail.com> <72799cd70705072129l6e017bd3mf90f69b8adc27bf2@mail.gmail.com> <46400F84.6020707@gmail.com> Message-ID: <72799cd70705080752g1cc89f5dtf382cb99d40de27@mail.gmail.com> You're right, I misspoke. The one from alephzarro worked, but the one from people.mozilla.com/davel didn't. Which was strange, because the files have the same names and are exactly the same size. Sorry I got confused... -Chris > Hmm...the only message I could find was this one, which suggest that the > Linux jssh xpi worked. > > 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 > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Tue May 8 11:23:47 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 08 May 2007 10:23:47 -0500 Subject: [Wtr-general] Community involvement with Watir In-Reply-To: <463FC6CF.7010903@gmail.com> References: <463FC6CF.7010903@gmail.com> Message-ID: <46409603.2090405@pettichord.com> Christopher Rasch wrote: > Thanks! How should we contribute to the User Guide? It doesn't appear > to be user editable: > > http://wtr.rubyforge.org/watir_user_guide.html > This HTML file is stored in our SVN repository. I think one question Zeljko needs to address is what form he wants it to be. I think he said something about breaking it into separate files, which is fine. Another option is to migrate it to the wiki, which would make eat easier to get contributions from others... > Is this the wiki we should be editing? > > http://wiki.openqa.org/display/WTR/Project+Home > > Feel free to add my tutorial for installing FireWatir on Mac OS X > (Intel) (or let me know where I should add it): > > http://crasch.livejournal.com/550521.html#cutid1 > Yes this is our wiki. Anybody can edit the wiki. If you see something that could be improved please just go ahead and make the change. If you have bold changes you are considering, but would like review first, you can always create a new page with the changes and then solicit review. > Under what license do you publish the Watir documention? > I suppose it is covered by the same BSD license that covers the code. Why do you ask? Do you have suggestions or concerns? Bret From bret at pettichord.com Tue May 8 11:33:14 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 08 May 2007 10:33:14 -0500 Subject: [Wtr-general] The Plan for Watir In-Reply-To: <463FBADC.50001@gmail.com> References: <463BF71A.9020000@pettichord.com> <463FBADC.50001@gmail.com> Message-ID: <4640983A.30302@pettichord.com> Christopher Rasch wrote: > I'm looking forward to ... better support for modal_dialogs on the supported platforms. Nothing is planned in this area. What were you hoping for? Bret From bret at pettichord.com Tue May 8 11:35:30 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 08 May 2007 10:35:30 -0500 Subject: [Wtr-general] unknown property or method `readyState' In-Reply-To: <224000620705062325m264b44ddof552484ffa3b4498@mail.gmail.com> References: <224000620705040856vfa1c497gf42ecfcd87ff2043@mail.gmail.com> <224000620705062325m264b44ddof552484ffa3b4498@mail.gmail.com> Message-ID: <464098C2.9040105@pettichord.com> I'm not sure i understand the context (is this supposed to be part of a thread? because it isn't). In any case, there are some recent changes that I made to trunk that might fix this problem. Bret Ken Lim wrote: > Good day. > Hope I understood your request for stack traces correctly. > Please see below: > > WIN32OLERuntimeError: unknown property or method `readyState' > HRESULT error code:0x80070005 > Access is denied. > C:/Program > Files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1819:in > `method_missing' > C:/Program > Files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1819:in > `wait' > C:/Program Files/ruby/lib/ruby/gems/1.8/gems/watir- > 1.5.1.1164/./watir.rb:2575:in `click' From I_Webb at acs.org Tue May 8 12:15:31 2007 From: I_Webb at acs.org (Ian Webb) Date: Tue, 8 May 2007 12:15:31 -0400 Subject: [Wtr-general] Using an ie.table.each do |row| loop when thepagein the ie window refreshes itself In-Reply-To: <68f4a0e80705080618s6ad6d287j779747d504676fa3@mail.gmail.com> References: <353BA7F10699794198CD75B3033E62AA02314AA9@washnt57.acs.org><68f4a0e80705051554l24c0f4e0t1cd6385633d2d4c4@mail.gmail.com><353BA7F10699794198CD75B3033E62AA025212E0@washnt57.acs.org> <68f4a0e80705080618s6ad6d287j779747d504676fa3@mail.gmail.com> Message-ID: <353BA7F10699794198CD75B3033E62AA0252153C@washnt57.acs.org> This worked great! I only had to make a couple of minor corrections. First off, each_with_index starts counting at 0, while Watir starts counting as 1. So I had to do rows_to_click << (i+1). And when iterating back through the table to actually click the links, I had to add ie.wait to that loop to keep it from trying to click the link as soon as the child window closed, before IE had even had a chance to render the reloaded page! In any case, it's working now, and I learned quite a bit. I agree that the each_with_index should be included - although I'm not sure what the preferred index behaviour should be. Perhaps that's why it's not in there now? Thanks again, Ian -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Ethan Jewett Sent: Tuesday, May 08, 2007 9:18 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Using an ie.table.each do |row| loop when thepagein the ie window refreshes itself Ian, Sorry about the "rows" and "each_with_index" issues. Hopefully that'll teach me to test suggestions : ) table(:index,29) clearly does the same thing I thought table(:index,29).rows does. As for the "each_with_index", if you just mixin the Enumerable module to the Watir::Table class like this: class Watir::Table include Enumerable end before you use "each_with_index", then you should be in good shape. This seems like something that should be added to the base Watir, since rows in a table are generally an enumerable element and the current Watir::Table.each method returns the rows of the table in order. Any objections? If not, I'll open a ticket. Ethan On 5/7/07, Ian Webb wrote: > Thanks - this does look like a good approach. The table's layout doesn't > change, it just reloads to update the data within the table with the > entries that were just made in the popup window. It's a really annoying > UI, especially when you have test cases that require changing a dozen > rows and therefore opening the popup a dozen times.. hence why I'm quite > eager to get Watir doing it instead. > > However, each_with_index appears to be an undefined method for ie.table > objects. I can iterate on .each just fine, but .each_with_index is > undefined. (.rows is undefined as well; .each works fine if I leave it > out) > > I'm wondering if maybe there's a way to store the indices of the buttons > it's going to click on within the array, rather than the rows > themselves. I tried buttons_to_click << row[5].link(:index,1), but that > doesn't work. > > Thanks, > Ian > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Ethan Jewett > Sent: Saturday, May 05, 2007 6:55 PM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Using an ie.table.each do |row| loop when > thepage in the ie window refreshes itself > > Ian, > > Reloading probably invalidates the table object, resulting in your > "Access denied" error when ruby goes back for the next row in the > table. > > Suggestion: Assuming that submitting and reloading doesn't affect the > table layout, use rows.each_with_index to build an array of indices of > relevant rows. Then cycle through the array clicking and submitting. > For instance (untested, unfortunately): > > rows_to_click = Array.new > > ie.table(:index, 29).rows.each_with_index do |row, i| > rows_to_click << i if (row[1].text =~ /#{journals}/) != nil > end > > rows_to_click.each do |i| > [Do the clicking and such for row i here.] > end > > This could be made substantially prettier, but hopefully it gets the job > done. > > Ethan > > On 5/4/07, Ian Webb wrote: > > Here's the code snippet that's giving me problems: > > > > ie.table(:index,29).each do |row| > > if (row[1].text =~ /#{journals}/) != nil then #If there is a match > > for that regex > > row[5].link(:index,1).click # this makes the popup window appear > > cw = Watir::IE.attach(:title,'Popup Window') # attach to the > popup > > window > > doRolesPopup(cw) # fill out and submit the form > > end > > end > > > > doRolesPopup fills out a form in the cw page, then clicks submit. The > > submit button submits the form, then closes the cw window and reloads > > the ie window. This reload of the page referenced by the ie object > > appears to break the row object, since I get the following error: > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `invoke': unknown > > property or method `rows' (WIN32OLERuntimeError) > > HRESULT error code:0x80070005 > > Access is denied. from > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `row' > > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' > > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `upto' > > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' > > from assignroles.rb:51 > > from c:/ruby/lib/ruby/1.8/csv.rb:532:in `parse' > > from c:/ruby/lib/ruby/1.8/csv.rb:560:in `each' > > from c:/ruby/lib/ruby/1.8/csv.rb:531:in `parse' > > from assignroles.rb:35 > > > > Is there any way to keep this simple .each loop, or do I need to work > > around it? > > > > Thanks, > > Ian > > _______________________________________________ > > 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 bret at pettichord.com Tue May 8 13:23:32 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 08 May 2007 12:23:32 -0500 Subject: [Wtr-general] Running multiple test concurrenty in Watir In-Reply-To: <24844110.601178622344804.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <24844110.601178622344804.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4640B214.1040709@pettichord.com> Vipul wrote: > While running multiple test concurrenty does each thread run parallel or sequentially. > Concurrent threads run in parallel. From charley.baker at gmail.com Tue May 8 16:08:01 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 8 May 2007 14:08:01 -0600 Subject: [Wtr-general] Wtr-general Digest, Vol 42, Issue 14 In-Reply-To: References: Message-ID: Not to be too blunt, but....install facets >= 1.8.54. gem install facets -c On 5/8/07, Russ DeWolfe wrote: > > Here is the message I get when I attempt to install this gem: > > ERROR: While executing gem ... (RuntimeError) > Error instaling unroller: > unroller requires facets >= 1.8.54 > > NOTE: I DID install the win32console gem > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070508/9ba0a78d/attachment.html From crasch at gmail.com Tue May 8 17:10:18 2007 From: crasch at gmail.com (Christopher Rasch) Date: Tue, 08 May 2007 14:10:18 -0700 Subject: [Wtr-general] The Plan for Watir In-Reply-To: <4640983A.30302@pettichord.com> References: <463BF71A.9020000@pettichord.com> <463FBADC.50001@gmail.com> <4640983A.30302@pettichord.com> Message-ID: <4640E73A.9080905@gmail.com> Bret Pettichord wrote: > Christopher Rasch wrote: >> I'm looking forward to ... better support for modal_dialogs on the supported platforms. > Nothing is planned in this area. What were you hoping for? > > Bret Well, ultimately, I want to be able to handle any popup that the browser throws up: attach to it, manipulate it, etc. My understanding is that better modal dialog support is one of the new features of Watir 1.5. See here: http://wiki.openqa.org/display/WTR/Watir+1.5+Summary And here: Deliver new DLL that allows us to access DOM embedded in modal web dialogs http://jira.openqa.org/browse/WTR-14 WIN32OLE patch for Modal Web Dialog Support http://jira.openqa.org/browse/WTR-2 Provide cleaner interface and more reliable support for modal windows dialogs (i.e. replace winClicker.rb) http://jira.openqa.org/browse/WTR-4 Since integration of the various watirs is also part of the roadmap, I expect that some of the better modal dialog support will also be migrated to the other watir flavors. Perhaps I have the wrong impression? Chris From crasch at gmail.com Tue May 8 17:28:27 2007 From: crasch at gmail.com (Christopher Rasch) Date: Tue, 08 May 2007 14:28:27 -0700 Subject: [Wtr-general] Community involvement with Watir In-Reply-To: <46409603.2090405@pettichord.com> References: <463FC6CF.7010903@gmail.com> <46409603.2090405@pettichord.com> Message-ID: <4640EB7B.60803@gmail.com> Bret Pettichord wrote: > Christopher Rasch wrote: >> Thanks! How should we contribute to the User Guide? It doesn't appear >> to be user editable: >> >> http://wtr.rubyforge.org/watir_user_guide.html >> > This HTML file is stored in our SVN repository. > > I think one question Zeljko needs to address is what form he wants it to > be. I think he said something about breaking it into separate files, > which is fine. Another option is to migrate it to the wiki, which would > make eat easier to get contributions from others... Okay, thanks! My vote would be to put it in the Wiki. >> > Yes this is our wiki. Anybody can edit the wiki. If you see something > that could be improved please just go ahead and make the change. If you > have bold changes you are considering, but would like review first, you > can always create a new page with the changes and then solicit review. Thanks! >> Under what license do you publish the Watir documention? >> > I suppose it is covered by the same BSD license that covers the code. > Why do you ask? Do you have suggestions or concerns? > I want to put a notice that anyone can use the documentation that I write on my blog, and I wanted to make sure that the license I chose was compatible with the license for Watir's documentation. Chris From christopher.mcmahon at gmail.com Tue May 8 17:40:34 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 8 May 2007 15:40:34 -0600 Subject: [Wtr-general] The Plan for Watir In-Reply-To: <4640E73A.9080905@gmail.com> References: <463BF71A.9020000@pettichord.com> <463FBADC.50001@gmail.com> <4640983A.30302@pettichord.com> <4640E73A.9080905@gmail.com> Message-ID: <72799cd70705081440r28f96622qf36c6d9397fc4e1e@mail.gmail.com> > Since integration of the various watirs is also part of the roadmap, I > expect that some of the better modal dialog support will also be > migrated to the other watir flavors. Perhaps I have the wrong impression? I think it's a terminology problem: "modal dialog" is an artifact of IE only. "Javascript popup" is common to all browsers. There are special problems with IE modal dialogs that are separate from the problems of addressing "javascript popups". -C From paul.rogers at shaw.ca Tue May 8 17:49:08 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 08 May 2007 15:49:08 -0600 Subject: [Wtr-general] The Plan for Watir In-Reply-To: <72799cd70705081440r28f96622qf36c6d9397fc4e1e@mail.gmail.com> References: <463BF71A.9020000@pettichord.com> <463FBADC.50001@gmail.com> <4640983A.30302@pettichord.com> <4640E73A.9080905@gmail.com> <72799cd70705081440r28f96622qf36c6d9397fc4e1e@mail.gmail.com> Message-ID: It seems like we need a seperate 'service' that runs next to watir and deals with any type of pop up Psuedo code: # this line tells the other service to expect a # Modal dialog dialog_clicker :expect => 'Windows Modal' , :click => 'ok' @ie.button(:value , 'Show Modal').click # the service now watches for dialogs and clicks them Im not sure how you would work this into actually accessing modal dialogs, maybe dialog_clicker :expect => 'Windows Modal' , :ignore you could also query it: puts dialog_clicker.last_text Paul ----- Original Message ----- From: Chris McMahon Date: Tuesday, May 8, 2007 3:40 pm Subject: Re: [Wtr-general] The Plan for Watir > > Since integration of the various watirs is also part of the > roadmap, I > > expect that some of the better modal dialog support will also be > > migrated to the other watir flavors. Perhaps I have the wrong > impression? > I think it's a terminology problem: "modal dialog" is an artifact of > IE only. "Javascript popup" is common to all browsers. There are > special problems with IE modal dialogs that are separate from the > problems of addressing "javascript popups". > > -C > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From christopher.mcmahon at gmail.com Tue May 8 20:48:04 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 8 May 2007 18:48:04 -0600 Subject: [Wtr-general] FireWater: click on link should launch new page/tab, but does not Message-ID: <72799cd70705081748u4547631aj545c18157116ce5b@mail.gmail.com> Run the script below. The script runs without error. But when you click the "Help" button manually, a new window or tab (depending on FF settings) will open; but when clicking with FireWatir, the new window does not open. I would like to be able to click the link and then to attach to the new window with FireWatir. ################################ 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") ff.link(:src,"/help/index.cgi?socialtext_documentation") From jeff.fry at gmail.com Tue May 8 22:06:36 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Tue, 08 May 2007 19:06:36 -0700 Subject: [Wtr-general] RDOC - Help determining what needs documentation Message-ID: <46412CAC.1030801@gmail.com> OK, I've learned (and documented on the wiki ) how to: create a svn working copy, edit the rdoc text, generate an rdoc using rake, and then generate a patch file. There is of course a crucial step missing there...and that's knowing what needs to be documented. Brett and I had hoped that a way to find some of what needs documenting was for me to read through his tagged Thunderbird archive of watir posts. After some wrangling, I got the mail...but not the tags. From this conversation on the Thunderbird forums, it seems like the tags can't be transfered: I'm left hoping we can find another way for me to learn what's been added but not documented in v1.5. So Brett, Charley, Paul, or others involved in building v1.5...if you were going to update the rdoc, how would you know what to edit? If you were going to be making the edits yourself, what parts are most time consuming for you? Would it be worth your time come up with a rough list of things that need documentation and pass that to someone else to document? Or does generating that list constitute the bulk of the work, after which there's not much point in delegating the writing? Alternately, is there a way that you could teach me to generate that list of things that needs documenting? One specific example - how can I determine what methods can take :class as a parameter? I know that this works for button, text_field and div...but is there a way I can find out what other methods take :class via searching source code in eclipse? I just tried reading & searching watir.rb for clues...but I got lost. I hope I can find a way through this last crucial step so that I can submit a useful rdoc patch. If I manage to get or generate a list of to-dos, I can still easily put a full day into editing the rdoc...but I'll need to do that day between now and early this Friday. After that I'm away for a weekend and then starting a new job, where I suspect I'll be too overwhelmed for a month or two to contribute significantly. Thanks, Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070508/44e95ddc/attachment.html From paul.rogers at shaw.ca Tue May 8 22:33:51 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 08 May 2007 20:33:51 -0600 Subject: [Wtr-general] RDOC - Help determining what needs documentation References: <46412CAC.1030801@gmail.com> Message-ID: <019001c791e2$7b292940$6400a8c0@laptop> not so much about what needs to go in, but more whats a good example of rdoc - look at the rails docs - api.rubyonrails.org I think the content is very good. I'll read through the latest source now, and hopefully I'll send you some more thoughts later tonight Paul ----- Original Message ----- From: Jeff Fry To: wtr-general at rubyforge.org Sent: Tuesday, May 08, 2007 8:06 PM Subject: [Wtr-general] RDOC - Help determining what needs documentation OK, I've learned (and documented on the wiki) how to: create a svn working copy, edit the rdoc text, generate an rdoc using rake, and then generate a patch file. There is of course a crucial step missing there...and that's knowing what needs to be documented. Brett and I had hoped that a way to find some of what needs documenting was for me to read through his tagged Thunderbird archive of watir posts. After some wrangling, I got the mail...but not the tags. >From this conversation on the Thunderbird forums, it seems like the tags can't be transfered: I'm left hoping we can find another way for me to learn what's been added but not documented in v1.5. So Brett, Charley, Paul, or others involved in building v1.5...if you were going to update the rdoc, how would you know what to edit? If you were going to be making the edits yourself, what parts are most time consuming for you? Would it be worth your time come up with a rough list of things that need documentation and pass that to someone else to document? Or does generating that list constitute the bulk of the work, after which there's not much point in delegating the writing? Alternately, is there a way that you could teach me to generate that list of things that needs documenting? One specific example - how can I determine what methods can take :class as a parameter? I know that this works for button, text_field and div...but is there a way I can find out what other methods take :class via searching source code in eclipse? I just tried reading & searching watir.rb for clues...but I got lost. I hope I can find a way through this last crucial step so that I can submit a useful rdoc patch. If I manage to get or generate a list of to-dos, I can still easily put a full day into editing the rdoc...but I'll need to do that day between now and early this Friday. After that I'm away for a weekend and then starting a new job, where I suspect I'll be too overwhelmed for a month or two to contribute significantly. Thanks, Jeff -- http://testingjeff.wordpress.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/20070508/2e9a36d0/attachment.html From paul.rogers at shaw.ca Tue May 8 23:47:44 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 08 May 2007 21:47:44 -0600 Subject: [Wtr-general] RDOC - Help determining what needs documentation References: <46412CAC.1030801@gmail.com> Message-ID: <020101c791ec$cd825a90$6400a8c0@laptop> In my opionion, the rdocs are really dificult to read right now. I think if I was picking up watir now and looking at the rdocs for the first time, Id be a bit disheartened. I would make sure that only relevant ( to the end user ) methods/classes/modules are in the rdoc you can switch off rdoc like this #-- # I dont get documented def foo end #++ there are lots of methods that really dont help the user as far as documenting them, eg element_tag ( Watir::xxx ) and the methods that people would care about ( click , set etc ) are kind of hidden. Id maybe also try to minimize the usage of the method descrioptions by making a really good intro section ( see the rails docs, especially ActiveRecord::Base ( http://api.rubyonrails.org/classes/ActiveRecord/Base.html ) If you do a good intro maybe broken into 1- what watir is, ( license etc ) 2 - finding objects using irb - using show_xx abd xx.show methods, flash, to_s 3 - finding objects using :index, :value :class etc 4 - methods particular to several objects ( with links to the full list of methods ) like ie.link(:id, 'x').click ie.button(:name , 'y').value 5 - then get into the rdocs like the rails docs do Hope that helps Paul ----- Original Message ----- From: Jeff Fry To: wtr-general at rubyforge.org Sent: Tuesday, May 08, 2007 8:06 PM Subject: [Wtr-general] RDOC - Help determining what needs documentation OK, I've learned (and documented on the wiki) how to: create a svn working copy, edit the rdoc text, generate an rdoc using rake, and then generate a patch file. There is of course a crucial step missing there...and that's knowing what needs to be documented. Brett and I had hoped that a way to find some of what needs documenting was for me to read through his tagged Thunderbird archive of watir posts. After some wrangling, I got the mail...but not the tags. >From this conversation on the Thunderbird forums, it seems like the tags can't be transfered: I'm left hoping we can find another way for me to learn what's been added but not documented in v1.5. So Brett, Charley, Paul, or others involved in building v1.5...if you were going to update the rdoc, how would you know what to edit? If you were going to be making the edits yourself, what parts are most time consuming for you? Would it be worth your time come up with a rough list of things that need documentation and pass that to someone else to document? Or does generating that list constitute the bulk of the work, after which there's not much point in delegating the writing? Alternately, is there a way that you could teach me to generate that list of things that needs documenting? One specific example - how can I determine what methods can take :class as a parameter? I know that this works for button, text_field and div...but is there a way I can find out what other methods take :class via searching source code in eclipse? I just tried reading & searching watir.rb for clues...but I got lost. I hope I can find a way through this last crucial step so that I can submit a useful rdoc patch. If I manage to get or generate a list of to-dos, I can still easily put a full day into editing the rdoc...but I'll need to do that day between now and early this Friday. After that I'm away for a weekend and then starting a new job, where I suspect I'll be too overwhelmed for a month or two to contribute significantly. Thanks, Jeff -- http://testingjeff.wordpress.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/20070508/3c76f9d7/attachment-0001.html From paul.rogers at shaw.ca Tue May 8 23:50:15 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 08 May 2007 21:50:15 -0600 Subject: [Wtr-general] RDOC - Help determining what needs documentation References: <46412CAC.1030801@gmail.com> <020101c791ec$cd825a90$6400a8c0@laptop> Message-ID: <021d01c791ed$27725730$6400a8c0@laptop> Ive also been meaning for ages to write up how the error checkers work. I'll try and do that between now and then end of the week. Paul ----- Original Message ----- From: Paul Rogers To: wtr-general at rubyforge.org Sent: Tuesday, May 08, 2007 9:47 PM Subject: Re: [Wtr-general] RDOC - Help determining what needs documentation In my opionion, the rdocs are really dificult to read right now. I think if I was picking up watir now and looking at the rdocs for the first time, Id be a bit disheartened. I would make sure that only relevant ( to the end user ) methods/classes/modules are in the rdoc you can switch off rdoc like this #-- # I dont get documented def foo end #++ there are lots of methods that really dont help the user as far as documenting them, eg element_tag ( Watir::xxx ) and the methods that people would care about ( click , set etc ) are kind of hidden. Id maybe also try to minimize the usage of the method descrioptions by making a really good intro section ( see the rails docs, especially ActiveRecord::Base ( http://api.rubyonrails.org/classes/ActiveRecord/Base.html ) If you do a good intro maybe broken into 1- what watir is, ( license etc ) 2 - finding objects using irb - using show_xx abd xx.show methods, flash, to_s 3 - finding objects using :index, :value :class etc 4 - methods particular to several objects ( with links to the full list of methods ) like ie.link(:id, 'x').click ie.button(:name , 'y').value 5 - then get into the rdocs like the rails docs do Hope that helps Paul ----- Original Message ----- From: Jeff Fry To: wtr-general at rubyforge.org Sent: Tuesday, May 08, 2007 8:06 PM Subject: [Wtr-general] RDOC - Help determining what needs documentation OK, I've learned (and documented on the wiki) how to: create a svn working copy, edit the rdoc text, generate an rdoc using rake, and then generate a patch file. There is of course a crucial step missing there...and that's knowing what needs to be documented. Brett and I had hoped that a way to find some of what needs documenting was for me to read through his tagged Thunderbird archive of watir posts. After some wrangling, I got the mail...but not the tags. >From this conversation on the Thunderbird forums, it seems like the tags can't be transfered: I'm left hoping we can find another way for me to learn what's been added but not documented in v1.5. So Brett, Charley, Paul, or others involved in building v1.5...if you were going to update the rdoc, how would you know what to edit? If you were going to be making the edits yourself, what parts are most time consuming for you? Would it be worth your time come up with a rough list of things that need documentation and pass that to someone else to document? Or does generating that list constitute the bulk of the work, after which there's not much point in delegating the writing? Alternately, is there a way that you could teach me to generate that list of things that needs documenting? One specific example - how can I determine what methods can take :class as a parameter? I know that this works for button, text_field and div...but is there a way I can find out what other methods take :class via searching source code in eclipse? I just tried reading & searching watir.rb for clues...but I got lost. I hope I can find a way through this last crucial step so that I can submit a useful rdoc patch. If I manage to get or generate a list of to-dos, I can still easily put a full day into editing the rdoc...but I'll need to do that day between now and early this Friday. After that I'm away for a weekend and then starting a new job, where I suspect I'll be too overwhelmed for a month or two to contribute significantly. Thanks, Jeff -- http://testingjeff.wordpress.com ---------------------------------------------------------------------------- _______________________________________________ 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/20070508/637d4a02/attachment.html From forum-watir-users at openqa.org Wed May 9 00:53:47 2007 From: forum-watir-users at openqa.org (vamsi) Date: Tue, 08 May 2007 23:53:47 CDT Subject: [Wtr-general] How to handle pop dialouge boxes by clicking on OK button Message-ID: <38233151.5801178686457584.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> My application having confirmation messages as "Pop up dialogue box". the application will not move to next page until you click on 'OK' button. the popup winodw will be like this.. -------------------------------------------------------------------- Windows intrenet explorer ------------------------------------------------------------------ Some information OK button Cancel ------------------------------------------------------------------- My Script is not recognising my instruction to click this button. Can any one help me to solve this problem? Thanks in Advance. Regards vamsi From angrez at gmail.com Wed May 9 01:10:28 2007 From: angrez at gmail.com (Angrez Singh) Date: Wed, 9 May 2007 10:40:28 +0530 Subject: [Wtr-general] FireWater: click on link should launch new page/tab, but does not In-Reply-To: <72799cd70705081748u4547631aj545c18157116ce5b@mail.gmail.com> References: <72799cd70705081748u4547631aj545c18157116ce5b@mail.gmail.com> Message-ID: Hi Chris, I was able to click on the help link which opened in new window. Currently you can connect to only new window not new tab. Make sure you have allowed popups for that site. I got error that Firefox prevented from opening a pop up from the site. When I allowed pop ups I was able to click on the link which opened in new window. Let me know if this helps. - Angrez On 5/9/07, Chris McMahon wrote: > > Run the script below. The script runs without error. > > But when you click the "Help" button manually, a new window or tab > (depending on FF settings) will open; but when clicking with > FireWatir, the new window does not open. > > I would like to be able to click the link and then to attach to the > new window with FireWatir. > > ################################ > 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") > ff.link(:src,"/help/index.cgi?socialtext_documentation") > _______________________________________________ > 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/20070509/8f5a683f/attachment.html From christopher.mcmahon at gmail.com Wed May 9 01:18:00 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 8 May 2007 23:18:00 -0600 Subject: [Wtr-general] OT: find min/max values in an array of floats Message-ID: <72799cd70705082218w7b4a6870icb19b8726ecdc121@mail.gmail.com> I can think of a couple of ways to do this, but they're all painful in one way or another. Ruby being Ruby, I wonder if there's some nifty shortcut. Given floats = [] floats << 3.456 floats << 1.53 floats << 5.123 show that the least element of the array is 1.53 and the greatest element of the array is 5.123, where the array "floats" can have an arbitrarily large number of elements, of which all are (of course) numbers with decimal values. From christopher.mcmahon at gmail.com Wed May 9 01:28:30 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 8 May 2007 23:28:30 -0600 Subject: [Wtr-general] FireWater: click on link should launch new page/tab, but does not In-Reply-To: References: <72799cd70705081748u4547631aj545c18157116ce5b@mail.gmail.com> Message-ID: <72799cd70705082228v7a5e9dbcp15d171cbf6a405b7@mail.gmail.com> > I was able to click on the help link which opened in new window. Currently > you can connect to only new window not new tab. Make sure you have allowed > popups for that site. I got error that Firefox prevented from opening a pop > up from the site. When I allowed pop ups I was able to click on the link > which opened in new window. Strange. I have Preferences/Tabs set so that "New pages should be opened in a new window" and Preferences/Content set to not block popups, but the script runs without error from either FireWatir or Firefox. Thanks for checking, it must be something in my environment preventing that new window. I'll keep looking. From shalinigupta2006 at gmail.com Wed May 9 01:33:04 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Wed, 9 May 2007 11:03:04 +0530 Subject: [Wtr-general] How to handle pop dialouge boxes by clicking on OK button In-Reply-To: <38233151.5801178686457584.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <38233151.5801178686457584.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <7523f5800705082233qe65f7fenfb902037cec6c120@mail.gmail.com> hi, U can use this code def startClicker( button , waitTime = 3) w = WinClicker.new longName = $ie.dir.gsub("/" , "\\" ) shortName = w.getShortFileName(longName) c = "start ruby #{shortName}\\watir\\clickJSDialog.rb #{button} #{waitTime} " puts "Starting #{c}" w.winsystem(c) w=nil ###end of function StartClicker end u have to call startClicker function before that object who is responsible for popup like as:- startClicker("OK",3) $ie.button(:name,"button responsible for popup") u also can use this code too:- def start_jsalert_clicker Thread.new{ system("ruby \"c:\\PSC\\jscriptExtraAlert.rb\"") } end u have to change ur windowhelper.rb file as... def push_alert_button @autoit.WinWait "Window Internet Explorer", "" text = @autoit.WinGetText "Window Internet Explorer" file = File.open("c:\\test.txt", "w") file.puts text puts text.to_s file.close @autoit.Send "{ENTER}" end This code will also give u the text on the popup tell me if this does not work u have to use start_jsalert_clicker before that button which is responsible for popup. Regards Shalini On 5/9/07, vamsi wrote: > > My application having confirmation messages as "Pop up dialogue box". the > application will not move to next page until you click on 'OK' button. > > the popup winodw will be like this.. > -------------------------------------------------------------------- > Windows intrenet explorer > ------------------------------------------------------------------ > > Some information > > OK button Cancel > > ------------------------------------------------------------------- > > My Script is not recognising my instruction to click this button. Can any > one help me to solve this problem? > > Thanks in Advance. > > Regards > vamsi > _______________________________________________ > 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/20070509/f8ba7a33/attachment-0001.html From christopher.mcmahon at gmail.com Wed May 9 01:53:44 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 8 May 2007 23:53:44 -0600 Subject: [Wtr-general] FireWater: click on link should launch new page/tab, but does not In-Reply-To: <72799cd70705082228v7a5e9dbcp15d171cbf6a405b7@mail.gmail.com> References: <72799cd70705081748u4547631aj545c18157116ce5b@mail.gmail.com> <72799cd70705082228v7a5e9dbcp15d171cbf6a405b7@mail.gmail.com> Message-ID: <72799cd70705082253j1c3f4bfva3d970d17d49e398@mail.gmail.com> Close enough. It seems like when you do Apple-R in TextMate, TextMate doesn't capture stderr, only stdout. When I ran the script from IRB, I got irb(main):020:0> ff.link(:src, "/help/index.cgi?socialtext_documentation").click FireWatir::Exception::UnknownObjectException: Unable to locate object, using src and /help/index.cgi?socialtext_documentation from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.0.2/./MozillaBaseElement.rb:881:in `assert_exists' from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.0.2/./MozillaBaseElement.rb:1027:in `click' from (irb):20 However, I was able to click the link and get the new page with ff.link(:text, "Help").click So that's FireWater 1, Selenium 0. :) On 5/8/07, Chris McMahon wrote: > > I was able to click on the help link which opened in new window. Currently > > you can connect to only new window not new tab. Make sure you have allowed > > popups for that site. I got error that Firefox prevented from opening a pop > > up from the site. When I allowed pop ups I was able to click on the link > > which opened in new window. > > Strange. I have Preferences/Tabs set so that "New pages should be > opened in a new window" and Preferences/Content set to not block > popups, but the script runs without error from either FireWatir or > Firefox. > > Thanks for checking, it must be something in my environment preventing > that new window. I'll keep looking. > From bret at pettichord.com Wed May 9 01:58:09 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 09 May 2007 00:58:09 -0500 Subject: [Wtr-general] OT: find min/max values in an array of floats In-Reply-To: <72799cd70705082218w7b4a6870icb19b8726ecdc121@mail.gmail.com> References: <72799cd70705082218w7b4a6870icb19b8726ecdc121@mail.gmail.com> Message-ID: <464162F1.9070101@pettichord.com> Chris McMahon wrote: > I can think of a couple of ways to do this, but they're all painful in > one way or another. Ruby being Ruby, I wonder if there's some nifty > shortcut. Given > > floats = [] > floats << 3.456 > floats << 1.53 > floats << 5.123 > > show that the least element of the array is 1.53 and the greatest > element of the array is 5.123, where the array "floats" can have an > arbitrarily large number of elements, of which all are (of course) > numbers with decimal values irb(main):001:0> floats = [] => [] irb(main):002:0> floats << 3.456 => [3.456] irb(main):003:0> floats << 1.53 => [3.456, 1.53] irb(main):004:0> floats << 5.123 => [3.456, 1.53, 5.123] irb(main):005:0> floats.min => 1.53 irb(main):006:0> floats.max => 5.123 These methods aren't simply part of the Array class. Rather they come from the Enumerable module (which Array uses). You can mix this module into any of your classes that implements two methods: each and the comparison operator (aka spaceship) that looks like this: <=> and thereby automatically get cool methods like this. You can also extend any objects that support these methods with the Enumerable method. I often do this with win32ole objects that implements the (COM) IEnumerable interface and therefore have an each method. Bret From bret at pettichord.com Wed May 9 02:15:19 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 09 May 2007 01:15:19 -0500 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <46412CAC.1030801@gmail.com> References: <46412CAC.1030801@gmail.com> Message-ID: <464166F7.6030000@pettichord.com> Jeff Fry wrote: > I'm left hoping we can find another way for me to learn what's been > added but not documented in v1.5. So Brett, Charley, Paul, or others > involved in building v1.5...if you were going to update the rdoc, how > would you know what to edit? If you were going to be making the edits > yourself, what parts are most time consuming for you? Would it be > worth your time come up with a rough list of things that need > documentation and pass that to someone else to document? Or does > generating that list constitute the bulk of the work, after which > there's not much point in delegating the writing? Alternately, is > there a way that you could teach me to generate that list of things > that needs documenting? In my view, the purpose of the rdoc is to provide detailed documentation of methods and classes. To the degree that we need good overview documentation (which we certainly do need), to me it is open question whether you put that in a users guide separate from the rdoc or in the header of the rdoc. Right now, the main file is pretty bad. It pulls in a todo list and yet omits the version number. So there are a lot of rather obvious changes that need to be made. Obvious to me at least, but i think that any one who looks at other well-documented Ruby packages (Rspec is another good example) will come to some quick conclusions. > One specific example - how can I determine what methods can take > :class as a parameter? I know that this works for button, text_field > and div...but is there a way I can find out what other methods take > :class via searching source code in eclipse? I just tried reading & > searching watir.rb for clues...but I got lost. Excellent question. I suggest that you focus on questions like this and then help us figure out the best way to document the answers. To me it is unclear whether it would be better to try and get the rdocs to include this information, or whether it would simply be easier to create a big table in the wiki. Please do what you think is easiest and clearest. Now to answer your question. First of all, the "how" symbols that you can use to specify an element actually directly correspond to the zero-argument methods for the Element class. (This relationship is new to Watir 1.5 -- it was much more hard-coded in 1.4). If you look at the Element class, you will see that it supports the "class_name" method. That means you do ie.button(:class_name, 'foo') to specify a particular button by class. The reason this method isn't just "class" is because that is a reserved method name in Ruby. But what we did is provide a direct (hard-coded) mapping from the :class symbol to the "class_name" method in the locator method. Bret From christopher.mcmahon at gmail.com Wed May 9 02:23:30 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 9 May 2007 00:23:30 -0600 Subject: [Wtr-general] OT: find min/max values in an array of floats In-Reply-To: <464162F1.9070101@pettichord.com> References: <72799cd70705082218w7b4a6870icb19b8726ecdc121@mail.gmail.com> <464162F1.9070101@pettichord.com> Message-ID: <72799cd70705082323re12676dqce105d3eca3451c2@mail.gmail.com> Neat. I guess I should have just written the code and tried it out. On 5/8/07, Bret Pettichord wrote: > Chris McMahon wrote: > > I can think of a couple of ways to do this, but they're all painful in > > one way or another. Ruby being Ruby, I wonder if there's some nifty > > shortcut. Given > > > > floats = [] > > floats << 3.456 > > floats << 1.53 > > floats << 5.123 > > > > show that the least element of the array is 1.53 and the greatest > > element of the array is 5.123, where the array "floats" can have an > > arbitrarily large number of elements, of which all are (of course) > > numbers with decimal values > irb(main):001:0> floats = [] > => [] > irb(main):002:0> floats << 3.456 > => [3.456] > irb(main):003:0> floats << 1.53 > => [3.456, 1.53] > irb(main):004:0> floats << 5.123 > => [3.456, 1.53, 5.123] > irb(main):005:0> floats.min > => 1.53 > irb(main):006:0> floats.max > => 5.123 > > These methods aren't simply part of the Array class. Rather they come > from the Enumerable module (which Array uses). You can mix this module > into any of your classes that implements two methods: each and the > comparison operator (aka spaceship) that looks like this: <=> and > thereby automatically get cool methods like this. > > You can also extend any objects that support these methods with the > Enumerable method. I often do this with win32ole objects that implements > the (COM) IEnumerable interface and therefore have an each method. > > Bret > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From christopher.mcmahon at gmail.com Wed May 9 02:32:43 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 9 May 2007 00:32:43 -0600 Subject: [Wtr-general] FireWatir: test/unit assertions can't be found? Message-ID: <72799cd70705082332q4d7acfdcrdaa82c430b6af796@mail.gmail.com> This is odd: 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") ff.link(:text, "Help").click sleep 5 ff.attach(:title, /Documentation/) assert_match("Help Table of Contents",ff.text) yields test.rb:13: undefined method `assert_match' for main:Object (NoMethodError) I've tried plain 'assert' also with the same result. I've got Ruby 1.8.6 installed in /usr/local (OSX), and I've removed the default ruby from my env. Why would the assert methods from 'test/unit' not be findable? The code exists in /usr/local/lib/ruby/1.8/test/unit/assertions.rb $ which ruby /usr/local/bin/ruby $ ruby -v ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1] From bret at pettichord.com Wed May 9 02:49:24 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 09 May 2007 01:49:24 -0500 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <020101c791ec$cd825a90$6400a8c0@laptop> References: <46412CAC.1030801@gmail.com> <020101c791ec$cd825a90$6400a8c0@laptop> Message-ID: <46416EF4.4080006@pettichord.com> Paul Rogers wrote: > In my opionion, the rdocs are really dificult to read right now. I > think if I was picking up watir now and looking at the rdocs for the > first time, Id be a bit disheartened. > > I would make sure that only relevant ( to the end user ) > methods/classes/modules are in the rdoc > you can switch off rdoc like this > > #-- > # I dont get documented > def foo > end > #++ > > there are lots of methods that really dont help the user as far as > documenting them, eg element_tag ( Watir::xxx ) and the methods that > people would care about ( click , set etc ) are kind of hidden. To me there are three important profiles of users of the Rdoc: 1. Testers who are new to Watir and to Ruby and who need to know what methods and arguments are available. (These are the people who i think you are referring to as "end users"). A particular challenge for these users is that they may not have experience reading Rdocs and therefore need to have many of the rdoc conventions explained that other Ruby libraries don't bother with. One example of this is that the IE class includes the Container module and therefore many of the methods available are not in the rdocs for IE, but rather for Container. Experienced Ruby programmers will be able to find this in the rdocs without trouble. Another example is whether the doc for IE#button should indicate that the method returns an instance of the Button class (with a link to the Rdoc for that class)? I don't think we did this for Watir 1.4, but doing this might actually make it so that the methods people care about aren't hidden. But it means that they need to understand a little more about how Watir works. 2. Ruby programmers who know how to read Rdocs and understand object-oriented programming. In particular, i am reluctant to say that we should only document methods and classes that the users in the first profile are interested in, because these people will appreciate more detailed information. 3. Library developers. In particular i think of the WET developers and the FireWatir/SafariWatir developers. We need to provide extension API's to allow Watir classes to be used, sometimes selectively by these other libraries. This means giving some attention to what the extension API's are and marking which are published and stable and which should not be used (private, or practically so). Again, not documenting any of these does not sound like a great idea. It is possible to specify which classes you want to generate RDOC for. One possibility would be to build a set of rdoc output (html) for the tester-user and then build another, more comprehensive collection for the serious developer. > Id maybe also try to minimize the usage of the method descrioptions by > making a really good intro section ( see the rails docs, especially > ActiveRecord::Base ( > http://api.rubyonrails.org/classes/ActiveRecord/Base.html ) > > If you do a good intro maybe broken into > 1- what watir is, ( license etc ) > > 2 - finding objects using irb > - using show_xx abd xx.show methods, flash, to_s Personally, i no longer tell people to use the show_methods. Instead, i tell them to use the Dom Explorer. In fact, we have a number of reported bugs with the show methods, no unit tests for them, and no one seems to be maintaining them. I am considering removing them from Watir 1.6. (I haven't decided yet.) > 3 - finding objects using :index, :value :class etc One of the problems with the existing doc is that this information is repeated in too many places, and therefore has not been updated in too many places. > 4 - methods particular to several objects ( with links to the full > list of methods ) like > ie.link(:id, 'x').click > ie.button(:name , 'y').value At moment i am thinking that the doc for IE#link should point to the Link class and that the Link class should provide a summary of the most popular methods (as well as the detailed list which is automatically generated.) Another idea would be steal from the watir cheat sheet. http://secretgeek.net/watir_cheatsheet.asp Bret From helder at gmail.com Wed May 9 02:52:02 2007 From: helder at gmail.com (Helder Ribeiro) Date: Wed, 9 May 2007 03:52:02 -0300 Subject: [Wtr-general] Community involvement with Watir In-Reply-To: References: <463BD6C3.7080403@pettichord.com> Message-ID: <9bb72e130705082352v5303e3e0sc169c16a6abb3d5c@mail.gmail.com> 2007/5/5, ?eljko Filipin : > On 5/5/07, Bret Pettichord wrote: > > I think i convinced Zeljko today to take the lead in updating the users > > guide. > > You certainly did. Last night I had a dream how I bribed cartoon foxes from > why's (poignant) guide to ruby to switch to Watir user guide. :) ( Bret > encouraged me to be "bold".) > > > Zeljko, how can we all help you? > > The usual. > Suggestions. What to add, what to remove, what to change. > Comments on my changes. They will be bold. > Bacon. Those foxes demanded lots of bacon. I think a section of "recipes", where people could post clear and well commented code on how to do specific tasks, would also be very useful, perhaps even some non-testing stuff like automating airline ticket searching or emptying large gmail labels. It could start with finding stuff in dzone snippets and/or asking for submissions on the list/website. Cheers, Helder > > Zeljko > -- > ZeljkoFilipin.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "Then there were the lonely few of us who moved back and forth on the strip, eating rows of beads here and there, pretending we were Turing machines." -- xkcd : http://xkcd.com/c205.html From bret at pettichord.com Wed May 9 02:53:11 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 09 May 2007 01:53:11 -0500 Subject: [Wtr-general] FireWatir: test/unit assertions can't be found? In-Reply-To: <72799cd70705082332q4d7acfdcrdaa82c430b6af796@mail.gmail.com> References: <72799cd70705082332q4d7acfdcrdaa82c430b6af796@mail.gmail.com> Message-ID: <46416FD7.1080109@pettichord.com> Chris McMahon wrote: > require 'rubygems' > require 'firewatir' > require 'test/unit' > require 'firewatir/testUnitAddons' > include FireWatir > include Test::Unit::Assertions # you need to mix in the assertion methods if you want to use them outside of a testcase. > ff = FireWatir::Firefox.new() > ff.goto("http://www.socialtext.net/stoss/index.cgi?mcmahon_test") > ff.link(:text, "Help").click > sleep 5 > ff.attach(:title, /Documentation/) > assert_match("Help Table of Contents",ff.text) > > yields > > test.rb:13: undefined method `assert_match' for main:Object (NoMethodError) > > I've tried plain 'assert' also with the same result. > > I've got Ruby 1.8.6 installed in /usr/local (OSX), and I've removed > the default ruby from my env. Why would the assert methods from > 'test/unit' not be findable? The code exists in > /usr/local/lib/ruby/1.8/test/unit/assertions.rb > > $ which ruby > /usr/local/bin/ruby > $ ruby -v > ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1] > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Wed May 9 02:57:35 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 09 May 2007 01:57:35 -0500 Subject: [Wtr-general] Community involvement with Watir In-Reply-To: <9bb72e130705082352v5303e3e0sc169c16a6abb3d5c@mail.gmail.com> References: <463BD6C3.7080403@pettichord.com> <9bb72e130705082352v5303e3e0sc169c16a6abb3d5c@mail.gmail.com> Message-ID: <464170DF.4030006@pettichord.com> Helder Ribeiro wrote: > I think a section of "recipes", where people could post clear and well > commented code on how to do specific tasks, would also be very useful, > perhaps even some non-testing stuff like automating airline ticket > searching or emptying large gmail labels. It could start with finding > stuff in dzone snippets and/or asking for submissions on the > list/website. > Just to be clear, we have always been open to having people add these to our wiki and have often encouraged this. http://wiki.openqa.org/display/WTR/Contributions Bret From forum-watir-users at openqa.org Wed May 9 03:16:16 2007 From: forum-watir-users at openqa.org (Maisonnette) Date: Wed, 09 May 2007 02:16:16 CDT Subject: [Wtr-general] Watir + Autoit + Save As In-Reply-To: <08d901c78e62$fb4aa1e0$6400a8c0@laptop> Message-ID: <33247280.6861178695006294.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Ok, But I don't want just to save the html code... When I click on a button, that open a windows popup (a 'save as' window) that I use to save a file to the HDD. I tried this but it doesn't work : From christopher.mcmahon at gmail.com Wed May 9 03:20:32 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 9 May 2007 01:20:32 -0600 Subject: [Wtr-general] FireWatir: test/unit assertions can't be found? In-Reply-To: <46416FD7.1080109@pettichord.com> References: <72799cd70705082332q4d7acfdcrdaa82c430b6af796@mail.gmail.com> <46416FD7.1080109@pettichord.com> Message-ID: <72799cd70705090020oda9a28ey61e48611751c72ba@mail.gmail.com> > include Test::Unit::Assertions # you need to mix in the assertion > methods if you want to use them outside of a testcase. Thanks, got it, I should have seen that. -C From dhrubojyotib at gmail.com Wed May 9 05:01:50 2007 From: dhrubojyotib at gmail.com (Dhrubojyoti Biswas) Date: Wed, 9 May 2007 14:31:50 +0530 Subject: [Wtr-general] Ataaching to windows on slow network connections Message-ID: Time and again I have faced issues where the WATIR attach method, that returns a handle to a popup window, has misbehaved. Specifically I have noticed this on somewhat slow connections. In Cases where the pop up windows take some time to get rendered on the client machine, the attach method throws an exception saying that it coud not find the window. I have been using WATIR 1.4.x extensively for my projects. I came up with this small solution that would grab the window no matter how slow the connection is. Can someone think of a better way to do it, or does this solution look viable? def GTools.waitForPopUp(ie, title) iePopUp = '' popupGrabber = false popupGrabberCounter = 0 #I'll wait for the popup to come up... I'll make some iterations and then I'll stop iterating #Ideally the number of iterations to be made should be made configurable (number 21) while(popupGrabber == false && popupGrabberCounter <= 21) begin rxp = Regexp.new(title) iePopUp = Watir::IE.attach(:title, rxp) # I will reach this point only if attach does not throw an exception popupGrabber = true rescue Exception => ex # If the code reaches this block it means that the pop up window that # u were trying to grab using attach was not served up by the WebServer # set the Grabber flag to false and return back into the loop print "Rescued Exception\n" popupGrabber = false end popupGrabberCounter = popupGrabberCounter + 1 if(popupGrabberCounter >= 21) raise GUIException("PopUp Timeout.... No PopUp Window having title " + title + " was found") end return iePopUp end When I use this workaround method I have noticed that the code enters the rescue block quite anumber of times before it attaches successfully to the window. I am eager to know if there is a better way to do this? -- Dhruv -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070509/bfdced9f/attachment.html From zeljko.filipin at gmail.com Wed May 9 05:58:44 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 9 May 2007 11:58:44 +0200 Subject: [Wtr-general] Community involvement with Watir In-Reply-To: <46409603.2090405@pettichord.com> References: <463FC6CF.7010903@gmail.com> <46409603.2090405@pettichord.com> Message-ID: On 5/8/07, Bret Pettichord wrote: > > I think one question Zeljko needs to address is what form he wants it to > be. I think he said something about breaking it into separate files, > which is fine. Another option is to migrate it to the wiki, which would > make eat easier to get contributions from others... I have been thinking a lot about updating Watir user guidethese days, but I did not have time to start working. I will have some time next week (if not before). I think if user guide is migrated to Watir Wikiit would make contributions much easier, so I plan to do that. If anybody would like to start working on user guide before I migrate it to Wiki, go ahead and grab it from Watir SVN repository, make Wiki page and start working. If you do not know how to get it from SVN repository or how to create Wiki page, please let me know. I received a lot of good advice about updating user guide. There is a clear need for more documentation on Watir. I do not think that everything should be in user guide. My plan is to make user guide as short as possible and provide links to more advanced topics. Something like: - Install Ruby. - Install Watir. - Open IE. - Navigate to a page. - Click a link. - Click a button. - Verify some text is there. - That was easy! - Want to learn more? - See how you can work with: - Other tags. - Various pop-up windows. - JavaScript. - AJAX. - Unit tests (running them, reading them, learning from them). - ? - There is also lots of good documentation on Watir that *is* at our site. See: - FAQ - What is Ruby? - What is Watir? - Is there a difference? - Why should I care? - ? - There is also lots of good documentation on Watir that *is not* at our site. Check it out: - Articles. - Cheat sheets. - Books. - ? - Have question? We have mailing list! When posting a question make sure that you include: - Relevant snippet of your Watir code. - Relevant snippet your HTML. - Error message that Ruby gave you (if any). - See example question. I think this short tips about posting to mailing list are very important. I just hope people will read it. I think we are ready for several Watir tutorials (at least two). Take Ruby for example. It has Pickaxebook that you can have on your desk and not be embarrassed when you boss takes a look at it. There is also Why's (Poignant) Guide to Ruby. I remember how my boss was surprised when he saw Why's book. I am sure he thought I was joking when I told him that it is a book about programming. (Hint: cartoon foxes shouting "Chunky bacon!".) Watir user guide can have "enterprise look", but I would also like to create one version with cartoon characters. I am sure there are lots of creative people here and I hope they will show their creativity. If you would not like to see cartoon characters in Watir user guide, please do let me know, I will not put it at Watir Wiki. (I will put it at my blog and smile to my jokes. Alone.) Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070509/041b5751/attachment.html From forum-watir-users at openqa.org Wed May 9 10:15:03 2007 From: forum-watir-users at openqa.org (gary) Date: Wed, 09 May 2007 09:15:03 CDT Subject: [Wtr-general] Having trouble capturing text in java alert Message-ID: <30476307.13271178720133216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi everyone, I'm having difficulty in capturing the text from a java alert, and would appreciate anyones input. Using AutoIT, for the pop up window works a treat, allowing me to capture the text, and then select the OK button to proceed with the script: require 'watir' # the controller include Watir require 'watir/WindowHelper' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'dl/win32' class TC_recorded < Test::Unit::TestCase def check_for_popups autoit = WIN32OLE.new('AutoItX3.Control') loop do sleep(3) ret = autoit.WinWait('Security Information', '', 1) text = autoit.WinGetText('Security Information', '') if (ret==1) puts text else puts "where is it?" end if (ret==1) then autoit.Send('{Yes}') end sleep(2) end end def test_1 @IE0 = IE.new @IE0.set_fast_speed @IE0.goto("http://hmvdigital.co.uk/HMV.Digital.OnlineStore.Portal/Pages/Home.aspx") @IE0.link(:text, "Sign in").click @popup = Thread.new { check_for_popups } # start popup handler @IE0.link(:href, "https://hmvdigital.co.uk/HMV.Digital.OnlineStore.Portal/Pages/HelpPopup.aspx?category=Managing_your_account&link=AboutRememberMe").click Thread.kill(@popup) # end popup handler @IE0.close end end Unfortunately I have been unable to use AutoIt in dealing with an alerts, and have been using winClicker. I am able to select the OK button to proceed, but unable to capture any text: require 'watir' # the controller include Watir require 'watir/WindowHelper' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'dl/win32' require 'watir/winClicker' class TC_recorded < Test::Unit::TestCase def startClicker( button , waitTime = 3) w = WinClicker.new longName = @IE0.dir.gsub("/" , "\\" ) shortName = w.getShortFileName(longName) c = "start ruby #{shortName }\\watir\\clickJSDialog.rb #{button } #{waitTime} " puts "Starting #{c}" w.winsystem(c) w=nil end def test_1 @IE0 = IE.new @IE0.set_fast_speed @IE0.goto("www.hmv.co.uk") @IE0.link(:text, "Sign In").click startClicker("OK" , 3) @IE0.image(:alt, "continue").click @IE0.close end end As previously mentioned, any help would be greatly appreciated, many thanks.... From christopher.mcmahon at gmail.com Wed May 9 10:25:43 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 9 May 2007 08:25:43 -0600 Subject: [Wtr-general] Ataaching to windows on slow network connections In-Reply-To: References: Message-ID: <72799cd70705090725q1d67ac05lc3ddbc5384f709d0@mail.gmail.com> Untested, but this will try to attach every two seconds forever: #################### def get_popup begin ie.attach(:title, "My Window) rescue sleep 2 get_popup end end ###################### You could put your counter in there with an exit clause. On 5/9/07, Dhrubojyoti Biswas wrote: > Time and again I have faced issues where the WATIR attach method, that > returns a handle to a popup window, has misbehaved. > > Specifically I have noticed this on somewhat slow connections. In Cases > where the pop up windows take some time to get rendered on the client > machine, the attach method throws an exception saying that it coud not find > the window. > > I have been using WATIR 1.4.x extensively for my projects. > > I came up with this small solution that would grab the window no matter how > slow the connection is. Can someone think of a better way to do it, or does > this solution look viable? > > def GTools.waitForPopUp(ie, title) > iePopUp = '' > popupGrabber = false > popupGrabberCounter = 0 > #I'll wait for the popup to come up... I'll make some iterations and > then I'll stop iterating > #Ideally the number of iterations to be made should be made > configurable (number 21) > while(popupGrabber == false && popupGrabberCounter <= 21) > begin > rxp = Regexp.new (title) > iePopUp = Watir::IE.attach(:title, rxp) > # I will reach this point only if attach does not throw an > exception > popupGrabber = true > rescue Exception => ex > # If the code reaches this block it means that the pop up window > that > # u were trying to grab using attach was not served up by the > WebServer > # set the Grabber flag to false and return back into the loop > print "Rescued Exception\n" > popupGrabber = false > end > popupGrabberCounter = popupGrabberCounter + 1 > if(popupGrabberCounter >= 21) > raise GUIException("PopUp Timeout.... No PopUp Window having > title " + title + " was found") > end > return iePopUp > end > > When I use this workaround method I have noticed that the code enters the > rescue block quite anumber of times before it attaches successfully to the > window. > > I am eager to know if there is a better way to do this? > > -- > Dhruv > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From charley.baker at gmail.com Wed May 9 11:20:19 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 9 May 2007 09:20:19 -0600 Subject: [Wtr-general] Having trouble capturing text in java alert In-Reply-To: <30476307.13271178720133216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30476307.13271178720133216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: w = WinClicker.new text = w.get_static_text('Microsoft Internet Explorer') # returns an array for each static control text.each {|t| puts t} -Charley On 5/9/07, gary wrote: > > Hi everyone, > > I'm having difficulty in capturing the text from a java alert, and would > appreciate anyones input. > > Using AutoIT, for the pop up window works a treat, allowing me to capture > the text, and then select the OK button to proceed with the script: > > require 'watir' # the controller > include Watir > require 'watir/WindowHelper' > require 'test/unit' > require 'test/unit/ui/console/testrunner' > require 'dl/win32' > > class TC_recorded < Test::Unit::TestCase > > def check_for_popups > autoit = WIN32OLE.new('AutoItX3.Control') > loop do > sleep(3) > ret = autoit.WinWait('Security Information', '', 1) > text = autoit.WinGetText('Security Information', '') > if (ret==1) > puts text > else > puts "where is it?" > end > if (ret==1) then autoit.Send('{Yes}') end > sleep(2) > end > end > > > def test_1 > @IE0 = IE.new > @IE0.set_fast_speed > @IE0.goto(" > http://hmvdigital.co.uk/HMV.Digital.OnlineStore.Portal/Pages/Home.aspx") > @IE0.link(:text, "Sign in").click > > @popup = Thread.new { check_for_popups } # start popup handler > @IE0.link(:href, " > https://hmvdigital.co.uk/HMV.Digital.OnlineStore.Portal/Pages/HelpPopup.aspx?category=Managing_your_account&link=AboutRememberMe > ").click > Thread.kill(@popup) # end popup handler > > @IE0.close > end > end > > Unfortunately I have been unable to use AutoIt in dealing with an alerts, > and have been using winClicker. I am able to select the OK button to > proceed, but unable to capture any text: > > require 'watir' # the controller > include Watir > require 'watir/WindowHelper' > require 'test/unit' > require 'test/unit/ui/console/testrunner' > require 'dl/win32' > require 'watir/winClicker' > > class TC_recorded < Test::Unit::TestCase > > def startClicker( button , waitTime = 3) > w = WinClicker.new > longName = @IE0.dir.gsub("/" , "\\" ) > shortName = w.getShortFileName(longName) > c = "start ruby #{shortName }\\watir\\clickJSDialog.rb #{button } > #{waitTime} " > puts "Starting #{c}" > w.winsystem(c) > w=nil > end > > def test_1 > @IE0 = IE.new > @IE0.set_fast_speed > @IE0.goto("www.hmv.co.uk") > @IE0.link(:text, "Sign In").click > startClicker("OK" , 3) > @IE0.image(:alt, "continue").click > @IE0.close > end > end > > As previously mentioned, any help would be greatly appreciated, many > 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/20070509/6529acc3/attachment.html From bret at pettichord.com Wed May 9 11:46:33 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 09 May 2007 10:46:33 -0500 Subject: [Wtr-general] The Plan for Watir In-Reply-To: <4640E73A.9080905@gmail.com> References: <463BF71A.9020000@pettichord.com> <463FBADC.50001@gmail.com> <4640983A.30302@pettichord.com> <4640E73A.9080905@gmail.com> Message-ID: <4641ECD9.2070902@pettichord.com> Thanks for your detailed replies. Comments inline. Christopher Rasch wrote: > Well, ultimately, I want to be able to handle any popup that the browser > throws up: attach to it, manipulate it, etc. My understanding is > that better modal dialog support is one of the new features of Watir > 1.5. See here: > > http://wiki.openqa.org/display/WTR/Watir+1.5+Summary > Right. We added support for handling the IE-specific showModalDialog() in Watir 1.5. As Chris said, there is a terminology problem. Technically, any dialog that blocks access to the main page while it is posted is modal. There are many technologies that allow this. 1. Javascript alert() and confirm() 2. The showModalDialog() mentioned above 3. Various security and authentication dialogs 4. File dialogs such as save as. 5. More recently, there are ajax modal dialogs that appear within the page. Watir 1.5 supports the modal_dialog command which supports #2 above. A good argument could be made that it needs to have a more-specific name. > And here: > > Deliver new DLL that allows us to access DOM embedded in modal web dialogs > http://jira.openqa.org/browse/WTR-14 > > WIN32OLE patch for Modal Web Dialog Support > http://jira.openqa.org/browse/WTR-2 > Both of these tickets relate to improving the existing modal web dialog support (showModalDialog). At this point, I no longer have plans to work on them and no one else has volunteered to work on them. Probably the biggest problem with our current support for showModalDialog is that it only works with Ruby 1.8.2. Fixing this would require that IEDialog.dll be rewritten as an activex component. > Provide cleaner interface and more reliable support for modal windows > dialogs (i.e. replace winClicker.rb) > http://jira.openqa.org/browse/WTR-4 > Although this is desirable and many people have talked about helping with this, we've seen few actual contributions. Personally, i have almost always found ways to avoid these dialogs, so I have never had much motivation to fix this myself. > Since integration of the various watirs is also part of the roadmap, I > expect that some of the better modal dialog support will also be > migrated to the other watir flavors. Perhaps I have the wrong impression? > The show_modal_dialog support in watir 1.5 is specific to IE. So no. It would be handy to have a better windows library for handling general windows dialogs, and if we had that, then it would also help for firefox -- you could use it there too, although I know that Angrez is focussing on features that would not be platform specific. All of the mechanisms that we currently using in Watir (autoit, winclicker, win32api) are windows specific, so known of them would be migrated to other platforms. Bret From forum-watir-users at openqa.org Wed May 9 12:16:18 2007 From: forum-watir-users at openqa.org (gary) Date: Wed, 09 May 2007 11:16:18 CDT Subject: [Wtr-general] Having trouble capturing text in java alert In-Reply-To: <30476307.13271178720133216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <35422985.14381178727409010.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for the prompt reply. I added the code but it appears to return a value of 'Google', any ideas? require 'watir' # the controller include Watir require 'watir/WindowHelper' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'dl/win32' require 'watir/winClicker' class TC_recorded < Test::Unit::TestCase def startClicker( button , waitTime = 3) w = WinClicker.new longName = @IE0.dir.gsub("/" , "\\" ) shortName = w.getShortFileName(longName) c = "start ruby #{shortName }\\watir\\clickJSDialog.rb #{button } #{waitTime} " puts "Starting #{c}" w.winsystem(c) w=nil end def test_1 @IE0 = IE.new @IE0.set_fast_speed @IE0.goto("www.hmv.co.uk") @IE0.link(:text, "Sign In").click w = WinClicker.new text = w.get_static_text('Windows Internet Explorer') # returns an array for each static control text.each {|t| puts t} startClicker("OK" , 3) @IE0.image(:alt, "continue").click @IE0.close end end From bret at pettichord.com Wed May 9 12:49:02 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 09 May 2007 11:49:02 -0500 Subject: [Wtr-general] Ataaching to windows on slow network connections In-Reply-To: References: Message-ID: <4641FB7E.80709@pettichord.com> Dhrubojyoti Biswas wrote: > I am eager to know if there is a better way to do this? Use Watir 1.5. This problem is fixed there. You can look at the repository on openqa if you want details. Bret From bret at pettichord.com Wed May 9 12:51:27 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 09 May 2007 11:51:27 -0500 Subject: [Wtr-general] Community involvement with Watir In-Reply-To: References: <463FC6CF.7010903@gmail.com> <46409603.2090405@pettichord.com> Message-ID: <4641FC0F.6070301@pettichord.com> ?eljko Filipin wrote: > > Watir user guide can have "enterprise look", but I would also like to > create one version with cartoon characters. I am sure there are lots > of creative people here and I hope they will show their creativity. If > you would not like to see cartoon characters in Watir user guide, > please do let me know, I will not put it at Watir Wiki. (I will put it > at my blog and smile to my jokes. Alone.) > Chunky Bacon! From charley.baker at gmail.com Wed May 9 12:58:48 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 9 May 2007 10:58:48 -0600 Subject: [Wtr-general] Community involvement with Watir In-Reply-To: <4641FC0F.6070301@pettichord.com> References: <463FC6CF.7010903@gmail.com> <46409603.2090405@pettichord.com> <4641FC0F.6070301@pettichord.com> Message-ID: I'm all for a Why style guide. His surreal style sucks more people in than if it was a plain old manual. Maybe a donut eating platypus instead of foxes. :) -c On 5/9/07, Bret Pettichord wrote: > > ?eljko Filipin wrote: > > > > Watir user guide can have "enterprise look", but I would also like to > > create one version with cartoon characters. I am sure there are lots > > of creative people here and I hope they will show their creativity. If > > you would not like to see cartoon characters in Watir user guide, > > please do let me know, I will not put it at Watir Wiki. (I will put it > > at my blog and smile to my jokes. Alone.) > > > Chunky Bacon! > _______________________________________________ > 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/20070509/f1e24a62/attachment.html From aidy.lewis at googlemail.com Wed May 9 14:18:04 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Wed, 9 May 2007 19:18:04 +0100 Subject: [Wtr-general] Community involvement with Watir In-Reply-To: <464170DF.4030006@pettichord.com> References: <463BD6C3.7080403@pettichord.com> <9bb72e130705082352v5303e3e0sc169c16a6abb3d5c@mail.gmail.com> <464170DF.4030006@pettichord.com> Message-ID: <7ac2300c0705091118w344feb3ehbb76cb1d2f49f7c2@mail.gmail.com> On 09/05/07, Bret Pettichord wrote: > Just to be clear, we have always been open to having people add these to > our wiki and have often encouraged this. > > http://wiki.openqa.org/display/WTR/Contributions > > Bret I think all these important links should become a footnote on Watir's main page. A page that could link to every major contribution, Watir assets have become too amorphous. Also additional user-guide sugesstions IDE's: Arachno, Eclipse, Emacs Test Frameworks: Data-driven, test DSL's?, object mapping, Test::Unit Test Reports: I have written some XML + XLST = HTML. I will put it on the FAQ's. Aidy From David_Brown at mentor.com Wed May 9 14:17:54 2007 From: David_Brown at mentor.com (Brown, David) Date: Wed, 9 May 2007 11:17:54 -0700 Subject: [Wtr-general] Sample Training Presentation and Exercises posted on Wiki In-Reply-To: Message-ID: <44B054F46C2E4E4996C27D92F9B825EE04ED46F4@SVR-ORW-EXC-07.mgc.mentorg.com> In case anyone can re-use them, I've posted a basic Watir training presentation and some associated exercises that I've developed and used a few times to train individuals & groups in my company on the basics of Watir. Feel free to re-use, modify and enhance them :). http://wiki.openqa.org/display/WTR/Watir+Training+Presentation+and+Exerc ises -David From christopher.mcmahon at gmail.com Wed May 9 14:42:05 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 9 May 2007 12:42:05 -0600 Subject: [Wtr-general] Sample Training Presentation and Exercises posted on Wiki In-Reply-To: <44B054F46C2E4E4996C27D92F9B825EE04ED46F4@SVR-ORW-EXC-07.mgc.mentorg.com> References: <44B054F46C2E4E4996C27D92F9B825EE04ED46F4@SVR-ORW-EXC-07.mgc.mentorg.com> Message-ID: <72799cd70705091142pc878a2m4ebed27f98d26f3@mail.gmail.com> On 5/9/07, Brown, David wrote: > In case anyone can re-use them, I've posted a basic Watir training > presentation and some associated exercises that I've developed and used > a few times to train individuals & groups in my company on the basics of > Watir. Feel free to re-use, modify and enhance them :). > http://wiki.openqa.org/display/WTR/Watir+Training+Presentation+and+Exerc > ises > The Scripting101 course could use some enhancement. I'm just sayin'... http://rubyforge.org/frs/?group_id=104 From crasch at gmail.com Wed May 9 15:08:38 2007 From: crasch at gmail.com (Christopher Rasch) Date: Wed, 09 May 2007 12:08:38 -0700 Subject: [Wtr-general] The Plan for Watir In-Reply-To: <4641ECD9.2070902@pettichord.com> References: <463BF71A.9020000@pettichord.com> <463FBADC.50001@gmail.com> <4640983A.30302@pettichord.com> <4640E73A.9080905@gmail.com> <4641ECD9.2070902@pettichord.com> Message-ID: <46421C36.3020101@gmail.com> Thanks for your detailed response! Bret Pettichord wrote: > Watir 1.5 supports the modal_dialog command which supports #2 above. A > good argument could be made that it needs to have a more-specific name. >> And here: >> >> Deliver new DLL that allows us to access DOM embedded in modal web dialogs >> http://jira.openqa.org/browse/WTR-14 >> >> WIN32OLE patch for Modal Web Dialog Support >> http://jira.openqa.org/browse/WTR-2 >> > Both of these tickets relate to improving the existing modal web dialog > support (showModalDialog). At this point, I no longer have plans to work > on them and no one else has volunteered to work on them. Probably the > biggest problem with our current support for showModalDialog is that it > only works with Ruby 1.8.2. Fixing this would require that IEDialog.dll > be rewritten as an activex component. Doesn't WET already handle modal dialogs pretty well? What would be involved in integrating WET's functionality into Watir? >> Provide cleaner interface and more reliable support for modal windows >> dialogs (i.e. replace winClicker.rb) >> http://jira.openqa.org/browse/WTR-4 >> > Although this is desirable and many people have talked about helping > with this, we've seen few actual contributions. Personally, i have > almost always found ways to avoid these dialogs, so I have never had > much motivation to fix this myself. I would like to help, but I don't feel competent enough yet to do any good. I'd imagine that others probably feel the same way. Perhaps it would help attract more help if there were some tutorials on the architecture of watir? >> Since integration of the various watirs is also part of the roadmap, I >> expect that some of the better modal dialog support will also be >> migrated to the other watir flavors. Perhaps I have the wrong impression? >> > The show_modal_dialog support in watir 1.5 is specific to IE. So no. It > would be handy to have a better windows library for handling general > windows dialogs, and if we had that, then it would also help for firefox > -- you could use it there too, although I know that Angrez is focussing > on features that would not be platform specific. All of the mechanisms > that we currently using in Watir (autoit, winclicker, win32api) are > windows specific, so known of them would be migrated to other platforms. Is there a design document for what such a library should have? Chris From zeljko.filipin at gmail.com Wed May 9 15:21:44 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 9 May 2007 21:21:44 +0200 Subject: [Wtr-general] how to include external script (.rb) in Watir? In-Reply-To: <30050885.721178317582534.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <72799cd70705041501ndf46120s77f72d7b0613b1bf@mail.gmail.com> <30050885.721178317582534.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 5/5/07, Alien Ruby wrote: > > How are you guys so helpful ? We get a lot of chunky bacon for every correct answer. :) Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070509/ac4c3b49/attachment.html From bret at pettichord.com Wed May 9 15:29:28 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 09 May 2007 14:29:28 -0500 Subject: [Wtr-general] Sample Training Presentation and Exercises posted on Wiki In-Reply-To: <72799cd70705091142pc878a2m4ebed27f98d26f3@mail.gmail.com> References: <44B054F46C2E4E4996C27D92F9B825EE04ED46F4@SVR-ORW-EXC-07.mgc.mentorg.com> <72799cd70705091142pc878a2m4ebed27f98d26f3@mail.gmail.com> Message-ID: <46422118.5070107@pettichord.com> Chris McMahon wrote: > The Scripting101 course could use some enhancement. I'm just sayin'... > http://rubyforge.org/frs/?group_id=104 > I am actually in the process of rewriting this using the Depot/Rails test application. Bret From bret at pettichord.com Wed May 9 15:40:19 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 09 May 2007 14:40:19 -0500 Subject: [Wtr-general] The Plan for Watir In-Reply-To: <46421C36.3020101@gmail.com> References: <463BF71A.9020000@pettichord.com> <463FBADC.50001@gmail.com> <4640983A.30302@pettichord.com> <4640E73A.9080905@gmail.com> <4641ECD9.2070902@pettichord.com> <46421C36.3020101@gmail.com> Message-ID: <464223A3.7070003@pettichord.com> Christopher Rasch wrote: >> Both of these tickets relate to improving the existing modal web dialog >> support (showModalDialog). At this point, I no longer have plans to work >> on them and no one else has volunteered to work on them. Probably the >> biggest problem with our current support for showModalDialog is that it >> only works with Ruby 1.8.2. Fixing this would require that IEDialog.dll >> be rewritten as an activex component. >> > > Doesn't WET already handle modal dialogs pretty well? Yes, i believe it does. > What would be > involved in integrating WET's functionality into Watir? > Some programming and testing. And apparently more than any one is willing to do. >>> Provide cleaner interface and more reliable support for modal windows >>> dialogs (i.e. replace winClicker.rb) >>> http://jira.openqa.org/browse/WTR-4 >>> >> Although this is desirable and many people have talked about helping >> with this, we've seen few actual contributions. Personally, i have >> almost always found ways to avoid these dialogs, so I have never had >> much motivation to fix this myself. >> > > I would like to help, but I don't feel competent enough yet to do any > good. I'd imagine that others probably feel the same way. Perhaps it > would help attract more help if there were some tutorials on the > architecture of watir? > First of all, this code has nothing to do with "the architecture of watir". It is basically standalone and separate. Your suggestion seems to assume that I am trying to attract more help. Actually, I'm mostly inclined to remove this code from Watir or else move to a separate contrib project. I think the best way to attract support would be be make it clear that this is abandoned code. For the record, i do not have a good understanding of this code. I've never worked on it. And i don't use it. But if you are able to convince somebody to write up a tutorial on how this code works (or doesn't) then that would be great. Just don't look at me. At one point (like when i opened the jira ticket) i thought i might eventually get around to cleaning up this code. I no longer think this is likely. >> The show_modal_dialog support in watir 1.5 is specific to IE. So no. It >> would be handy to have a better windows library for handling general >> windows dialogs, and if we had that, then it would also help for firefox >> -- you could use it there too, although I know that Angrez is focussing >> on features that would not be platform specific. All of the mechanisms >> that we currently using in Watir (autoit, winclicker, win32api) are >> windows specific, so known of them would be migrated to other platforms. >> > > Is there a design document for what such a library should have? > No i don't believe so. From paul.rogers at shaw.ca Wed May 9 16:04:00 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 09 May 2007 14:04:00 -0600 Subject: [Wtr-general] The Plan for Watir In-Reply-To: <464223A3.7070003@pettichord.com> References: <463BF71A.9020000@pettichord.com> <463FBADC.50001@gmail.com> <4640983A.30302@pettichord.com> <4640E73A.9080905@gmail.com> <4641ECD9.2070902@pettichord.com> <46421C36.3020101@gmail.com> <464223A3.7070003@pettichord.com> Message-ID: Id like the winclicker code to disappear and be replaced by a full windows testing library ( How you getting along with that Chris ? ). Enough people seem to want it. Paul ----- Original Message ----- From: Bret Pettichord Date: Wednesday, May 9, 2007 1:40 pm Subject: Re: [Wtr-general] The Plan for Watir > Christopher Rasch wrote: > >> Both of these tickets relate to improving the existing modal > web dialog > >> support (showModalDialog). At this point, I no longer have > plans to work > >> on them and no one else has volunteered to work on them. > Probably the > >> biggest problem with our current support for showModalDialog is > that it > >> only works with Ruby 1.8.2. Fixing this would require that > IEDialog.dll > >> be rewritten as an activex component. > >> > > > > Doesn't WET already handle modal dialogs pretty well? > Yes, i believe it does. > > What would be > > involved in integrating WET's functionality into Watir? > > > Some programming and testing. And apparently more than any one is > willing to do. > >>> Provide cleaner interface and more reliable support for modal > windows>>> dialogs (i.e. replace winClicker.rb) > >>> http://jira.openqa.org/browse/WTR-4 > >>> > >> Although this is desirable and many people have talked about > helping > >> with this, we've seen few actual contributions. Personally, i > have > >> almost always found ways to avoid these dialogs, so I have > never had > >> much motivation to fix this myself. > >> > > > > I would like to help, but I don't feel competent enough yet to > do any > > good. I'd imagine that others probably feel the same way. > Perhaps it > > would help attract more help if there were some tutorials on the > > architecture of watir? > > > First of all, this code has nothing to do with "the architecture > of > watir". It is basically standalone and separate. > > Your suggestion seems to assume that I am trying to attract more > help. > Actually, I'm mostly inclined to remove this code from Watir or > else > move to a separate contrib project. I think the best way to > attract > support would be be make it clear that this is abandoned code. > > For the record, i do not have a good understanding of this code. > I've > never worked on it. And i don't use it. > > But if you are able to convince somebody to write up a tutorial on > how > this code works (or doesn't) then that would be great. Just don't > look > at me. > > At one point (like when i opened the jira ticket) i thought i > might > eventually get around to cleaning up this code. I no longer think > this > is likely. > > >> The show_modal_dialog support in watir 1.5 is specific to IE. > So no. It > >> would be handy to have a better windows library for handling > general > >> windows dialogs, and if we had that, then it would also help > for firefox > >> -- you could use it there too, although I know that Angrez is > focussing > >> on features that would not be platform specific. All of the > mechanisms > >> that we currently using in Watir (autoit, winclicker, win32api) > are > >> windows specific, so known of them would be migrated to other > platforms.>> > > > > Is there a design document for what such a library should have? > > > No i don't believe so. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Wed May 9 16:14:58 2007 From: forum-watir-users at openqa.org (Lavanya) Date: Wed, 09 May 2007 15:14:58 CDT Subject: [Wtr-general] Problem retrieving data from an Ajax page Message-ID: <32742848.16721178741728060.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi All, I am new to watir. I am automating a web configuration page wherein I fill the contents with different values and upon running the selection, the result page pops up. However when i do a view source of the result page it doesn't show me the latest result page value however in the view source i see the contents of configuration page. The reason for this is that the result page is Ajax based. My actual aim is to verify the result that appears. How do i do it with page source not bringing up the contents? Appreciate u r help Thanks, Lavanya From renard at nc.rr.com Thu May 10 16:17:04 2007 From: renard at nc.rr.com (Bernard Kenik) Date: Thu, 10 May 2007 16:17:04 -0400 Subject: [Wtr-general] find min/max values in an array of floats In-Reply-To: References: Message-ID: <46437DC0.1010809@nc.rr.com> > Message: 4 > Date: Tue, 8 May 2007 23:18:00 -0600 > From: "Chris McMahon" > Subject: [Wtr-general] OT: find min/max values in an array of floats > To: wtr-general at rubyforge.org > Message-ID: > <72799cd70705082218w7b4a6870icb19b8726ecdc121 at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > I can think of a couple of ways to do this, but they're all painful in > one way or another. Ruby being Ruby, I wonder if there's some nifty > shortcut. Given > > floats = [] > floats << 3.456 > floats << 1.53 > floats << 5.123 > > show that the least element of the array is 1.53 and the greatest > element of the array is 5.123, where the array "floats" can have an > arbitrarily large number of elements, of which all are (of course) > numbers with decimal values. > > > floats.sort!.last should get the maximum float value From zeljko.filipin at gmail.com Wed May 9 16:37:20 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 9 May 2007 22:37:20 +0200 Subject: [Wtr-general] Problem retrieving data from an Ajax page In-Reply-To: <32742848.16721178741728060.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32742848.16721178741728060.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Try Internet Explorer Developer Toolbar ( http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en). It should show actual content of the page, not source. I have tried it, but I have not used it a lot, but I have heard that it can help with ajax pages. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070509/5443145a/attachment.html From bret at pettichord.com Wed May 9 16:37:48 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 09 May 2007 15:37:48 -0500 Subject: [Wtr-general] The Plan for Watir In-Reply-To: References: <463BF71A.9020000@pettichord.com> <463FBADC.50001@gmail.com> <4640983A.30302@pettichord.com> <4640E73A.9080905@gmail.com> <4641ECD9.2070902@pettichord.com> <46421C36.3020101@gmail.com> <464223A3.7070003@pettichord.com> Message-ID: <4642311C.2040502@pettichord.com> Paul Rogers wrote: > Id like the winclicker code to disappear and be replaced by a full windows testing library ( How you getting along with that Chris ? ). Enough people seem to want it. > I think a lot of people would like to see that. I certainly would. But last i looked Chris's project hadn't seen a commit in 18 months. Bret From tunde.jinadu at gmail.com Wed May 9 17:01:03 2007 From: tunde.jinadu at gmail.com (Tunde Jinadu) Date: Wed, 9 May 2007 22:01:03 +0100 Subject: [Wtr-general] Watir Data types exported from excel Message-ID: <1624b0140705091401o502948d9oe0ff88dfcd008c6a@mail.gmail.com> I'm running a script to read data from a spreadsheet using the following script # open the spreadsheet and get the values excel = WIN32OLE::new('excel.Application') # define the type of application to connect too workbook = excel.Workbooks.Open('d:\Smoke_Test2.xls') # spreadsheet location worksheet = workbook.Worksheets(1) #get hold of the second worksheet worksheet.Select #bring it to the front -need sometimes to run macros, not for working with a worksheet from ruby range=worksheet.range("a1", "bw50") # range of spreadsheet #~ excel['Visible'] = false #make visible, set to false to make invisible again. Don't need it to be visible for script to work the value I am picking out of the spreadsheet is a number 11111111 using the following ie.text_field (:id,/AccountNumber/).set(spreadsheetdata[:'accountnumber'].to_i) when the script enters data into the field it attempts to enter data as follows 11111111.0 (decimal place materialises.) I think ruby changes the format of the number 1111111 extracted from the spreadsheet from an integer as specified using .to_i to another format (hence the decimal place being displayed in the form field) How can I ensure the format of the data extracted from excel stays as an integer or text, allowing a leading zero as '01111111' or '11111111' -- The second half of a man's life is made up of nothing but the habits he has acquired during the first half. - Fyodor Dostoevsky -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070509/ce48c21c/attachment.html From christopher.mcmahon at gmail.com Wed May 9 17:37:33 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 9 May 2007 15:37:33 -0600 Subject: [Wtr-general] The Plan for Watir In-Reply-To: <4642311C.2040502@pettichord.com> References: <463BF71A.9020000@pettichord.com> <463FBADC.50001@gmail.com> <4640983A.30302@pettichord.com> <4640E73A.9080905@gmail.com> <4641ECD9.2070902@pettichord.com> <46421C36.3020101@gmail.com> <464223A3.7070003@pettichord.com> <4642311C.2040502@pettichord.com> Message-ID: <72799cd70705091437rbc8b851t71cf4fc7d1e165a2@mail.gmail.com> On 5/9/07, Bret Pettichord wrote: > Paul Rogers wrote: > > Id like the winclicker code to disappear and be replaced by a full windows testing library ( How you getting along with that Chris ? ). Enough people seem to want it. > > > I think a lot of people would like to see that. I certainly would. But > last i looked Chris's project hadn't seen a commit in 18 months. There might still be enough there to work with. This is a port of Perl Win32::GuiTest, btw. From bret at pettichord.com Wed May 9 18:38:56 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 09 May 2007 17:38:56 -0500 Subject: [Wtr-general] The Plan for Watir In-Reply-To: <72799cd70705091437rbc8b851t71cf4fc7d1e165a2@mail.gmail.com> References: <463BF71A.9020000@pettichord.com> <463FBADC.50001@gmail.com> <4640983A.30302@pettichord.com> <4640E73A.9080905@gmail.com> <4641ECD9.2070902@pettichord.com> <46421C36.3020101@gmail.com> <464223A3.7070003@pettichord.com> <4642311C.2040502@pettichord.com> <72799cd70705091437rbc8b851t71cf4fc7d1e165a2@mail.gmail.com> Message-ID: <46424D80.10200@pettichord.com> Chris McMahon wrote: > There might still be enough there to work with. > This is a port of Perl Win32::GuiTest, btw That is good to hear. Since a release was never made, i had assumed that it was an abandoned project. I just took another look and found i was able to run all the tests successfully. From what you say, i would say that the next step would be to package this as a gem and create some rdoc, even if it was only something simple that pointed you to the corresponding perl docs. I was also confused by the guitest020218 directory. Should i just ignore this? There are duplicates of several files (cguitest.so, guitest.rb). Which is the correct one to use? Bret From esjewett at gmail.com Wed May 9 19:04:41 2007 From: esjewett at gmail.com (Ethan Jewett) Date: Wed, 9 May 2007 18:04:41 -0500 Subject: [Wtr-general] Using an ie.table.each do |row| loop when thepagein the ie window refreshes itself In-Reply-To: <353BA7F10699794198CD75B3033E62AA0252153C@washnt57.acs.org> References: <353BA7F10699794198CD75B3033E62AA02314AA9@washnt57.acs.org> <68f4a0e80705051554l24c0f4e0t1cd6385633d2d4c4@mail.gmail.com> <353BA7F10699794198CD75B3033E62AA025212E0@washnt57.acs.org> <68f4a0e80705080618s6ad6d287j779747d504676fa3@mail.gmail.com> <353BA7F10699794198CD75B3033E62AA0252153C@washnt57.acs.org> Message-ID: <68f4a0e80705091604k6c1020e7p90b03eaff0d201b2@mail.gmail.com> Ticket entered: http://jira.openqa.org/browse/WTR-149 Ian's point about 0-indexing vs. 1-indexing is noted in the ticket. Perhaps this should only be a candidate for inclusion in Watir 1.6? Ethan On 5/8/07, Ian Webb wrote: > This worked great! I only had to make a couple of minor corrections. > > First off, each_with_index starts counting at 0, while Watir starts > counting as 1. So I had to do rows_to_click << (i+1). And when iterating > back through the table to actually click the links, I had to add ie.wait > to that loop to keep it from trying to click the link as soon as the > child window closed, before IE had even had a chance to render the > reloaded page! > > In any case, it's working now, and I learned quite a bit. I agree that > the each_with_index should be included - although I'm not sure what the > preferred index behaviour should be. Perhaps that's why it's not in > there now? > > Thanks again, > Ian > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Ethan Jewett > Sent: Tuesday, May 08, 2007 9:18 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Using an ie.table.each do |row| loop when > thepagein the ie window refreshes itself > > Ian, > > Sorry about the "rows" and "each_with_index" issues. Hopefully > that'll teach me to test suggestions : ) > > table(:index,29) clearly does the same thing I thought > table(:index,29).rows does. > > As for the "each_with_index", if you just mixin the Enumerable module > to the Watir::Table class like this: > > class Watir::Table > include Enumerable > end > > before you use "each_with_index", then you should be in good shape. > This seems like something that should be added to the base Watir, > since rows in a table are generally an enumerable element and the > current Watir::Table.each method returns the rows of the table in > order. > > Any objections? If not, I'll open a ticket. > > Ethan > > On 5/7/07, Ian Webb wrote: > > Thanks - this does look like a good approach. The table's layout > doesn't > > change, it just reloads to update the data within the table with the > > entries that were just made in the popup window. It's a really > annoying > > UI, especially when you have test cases that require changing a dozen > > rows and therefore opening the popup a dozen times.. hence why I'm > quite > > eager to get Watir doing it instead. > > > > However, each_with_index appears to be an undefined method for > ie.table > > objects. I can iterate on .each just fine, but .each_with_index is > > undefined. (.rows is undefined as well; .each works fine if I leave it > > out) > > > > I'm wondering if maybe there's a way to store the indices of the > buttons > > it's going to click on within the array, rather than the rows > > themselves. I tried buttons_to_click << row[5].link(:index,1), but > that > > doesn't work. > > > > Thanks, > > Ian > > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Ethan Jewett > > Sent: Saturday, May 05, 2007 6:55 PM > > To: wtr-general at rubyforge.org > > Subject: Re: [Wtr-general] Using an ie.table.each do |row| loop when > > thepage in the ie window refreshes itself > > > > Ian, > > > > Reloading probably invalidates the table object, resulting in your > > "Access denied" error when ruby goes back for the next row in the > > table. > > > > Suggestion: Assuming that submitting and reloading doesn't affect the > > table layout, use rows.each_with_index to build an array of indices of > > relevant rows. Then cycle through the array clicking and submitting. > > For instance (untested, unfortunately): > > > > rows_to_click = Array.new > > > > ie.table(:index, 29).rows.each_with_index do |row, i| > > rows_to_click << i if (row[1].text =~ /#{journals}/) != nil > > end > > > > rows_to_click.each do |i| > > [Do the clicking and such for row i here.] > > end > > > > This could be made substantially prettier, but hopefully it gets the > job > > done. > > > > Ethan > > > > On 5/4/07, Ian Webb wrote: > > > Here's the code snippet that's giving me problems: > > > > > > ie.table(:index,29).each do |row| > > > if (row[1].text =~ /#{journals}/) != nil then #If there is a > match > > > for that regex > > > row[5].link(:index,1).click # this makes the popup window > appear > > > cw = Watir::IE.attach(:title,'Popup Window') # attach to the > > popup > > > window > > > doRolesPopup(cw) # fill out and submit the form > > > end > > > end > > > > > > doRolesPopup fills out a form in the cw page, then clicks submit. > The > > > submit button submits the form, then closes the cw window and > reloads > > > the ie window. This reload of the page referenced by the ie object > > > appears to break the row object, since I get the following error: > > > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `invoke': unknown > > > property or method `rows' (WIN32OLERuntimeError) > > > HRESULT error code:0x80070005 > > > Access is denied. from > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `row' > > > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' > > > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `upto' > > > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' > > > from assignroles.rb:51 > > > from c:/ruby/lib/ruby/1.8/csv.rb:532:in `parse' > > > from c:/ruby/lib/ruby/1.8/csv.rb:560:in `each' > > > from c:/ruby/lib/ruby/1.8/csv.rb:531:in `parse' > > > from assignroles.rb:35 > > > > > > Is there any way to keep this simple .each loop, or do I need to > work > > > around it? > > > > > > Thanks, > > > Ian > > > _______________________________________________ > > > 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 AKuzmin at planview.com Wed May 9 18:55:19 2007 From: AKuzmin at planview.com (Andrew Kuzmin) Date: Wed, 9 May 2007 17:55:19 -0500 Subject: [Wtr-general] Using custom attributes Message-ID: Hi All, Is there any way to access an element by a custom attributes value ? In my situation, for our web development we're using 3-rd party grid control, which generates a table with lot of custom attributes for its elements. For example, the code would look like this: ... Since the rowKey is unique it could be used to uniquly identify the row. IE's devTool displays these custom attributes correctly, however they are not accessible from Watir. Any recommendations ? Could Watir be extended to do this ? Thanks, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070509/6c6892be/attachment.html From charley.baker at gmail.com Wed May 9 20:03:31 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 9 May 2007 18:03:31 -0600 Subject: [Wtr-general] Watir Data types exported from excel In-Reply-To: <1624b0140705091401o502948d9oe0ff88dfcd008c6a@mail.gmail.com> References: <1624b0140705091401o502948d9oe0ff88dfcd008c6a@mail.gmail.com> Message-ID: You're converting it to an integer with to_i. Pull the string and do what you want with it, integers don't have a leading 0, strings do. Unless anyone has a better idea, you'd be better off working with the basic string yourself and converting it. -c On 5/9/07, Tunde Jinadu wrote: > > I'm running a script to read data from a spreadsheet using the following > script > > # open the spreadsheet and get the values > excel = WIN32OLE::new('excel.Application') # define the type of > application to connect too > workbook = excel.Workbooks.Open('d:\Smoke_Test2.xls') # spreadsheet > location > worksheet = workbook.Worksheets(1) #get hold of the second worksheet > worksheet.Select #bring it to the front -need sometimes to run > macros, not for working with a worksheet from ruby > range=worksheet.range("a1", "bw50") # range of spreadsheet > #~ excel['Visible'] = false #make visible, set to false to make > invisible again. Don't need it to be visible for script to work > > > the value I am picking out of the spreadsheet is a number > > 11111111 > > using the following > > ie.text_field > (:id,/AccountNumber/).set(spreadsheetdata[:'accountnumber'].to_i) > > when the script enters data into the field it attempts to enter data as > follows 11111111.0 (decimal place materialises.) > > I think ruby changes the format of the number 1111111 extracted from the > spreadsheet from an integer as specified using .to_i to another format > (hence the decimal place being displayed in the form field) How can I ensure > the format of the data extracted from excel stays as an integer or text, > allowing a leading zero as '01111111' or '11111111' > > > > > > > > > -- > The second half of a man's life is made up of nothing but the habits he > has acquired during the first half. > - Fyodor Dostoevsky > _______________________________________________ > 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/20070509/ce147380/attachment-0001.html From paul.rogers at shaw.ca Wed May 9 23:33:01 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 09 May 2007 21:33:01 -0600 Subject: [Wtr-general] Using custom attributes References: Message-ID: <026a01c792b3$ea607620$6400a8c0@laptop> you can do it like this ( search the list if this doesnt work 'cos Im doing it by memory and I answered the same question a couple months back ) try this link(:index,1).ole_object.invoke('custom') Paul ----- Original Message ----- From: Andrew Kuzmin To: wtr-general at rubyforge.org Sent: Wednesday, May 09, 2007 4:55 PM Subject: [Wtr-general] Using custom attributes Hi All, Is there any way to access an element by a custom attributes value ? In my situation, for our web development we're using 3-rd party grid control, which generates a table with lot of custom attributes for its elements. For example, the code would look like this: . Since the rowKey is unique it could be used to uniquly identify the row. IE's devTool displays these custom attributes correctly, however they are not accessible from Watir. Any recommendations ? Could Watir be extended to do this ? Thanks, Andrew ------------------------------------------------------------------------------ _______________________________________________ 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/20070509/83c48c6b/attachment.html From paul.rogers at shaw.ca Wed May 9 23:35:31 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 09 May 2007 21:35:31 -0600 Subject: [Wtr-general] Watir Data types exported from excel References: <1624b0140705091401o502948d9oe0ff88dfcd008c6a@mail.gmail.com> Message-ID: <027901c792b4$42d32190$6400a8c0@laptop> your code doesnt show where you create spreadsheetdate but if you use either the text or attribute ( i cant remember which, and dont have excel here ) myval = worksheet.range('a2')['value'] # or ['text'] one of these will do the right thing Paul ----- Original Message ----- From: Tunde Jinadu To: Wtr-general at rubyforge.org Sent: Wednesday, May 09, 2007 3:01 PM Subject: [Wtr-general] Watir Data types exported from excel I'm running a script to read data from a spreadsheet using the following script # open the spreadsheet and get the values excel = WIN32OLE::new('excel.Application') # define the type of application to connect too workbook = excel.Workbooks.Open('d:\Smoke_Test2.xls') # spreadsheet location worksheet = workbook.Worksheets(1) #get hold of the second worksheet worksheet.Select #bring it to the front -need sometimes to run macros, not for working with a worksheet from ruby range=worksheet.range("a1", "bw50") # range of spreadsheet #~ excel['Visible'] = false #make visible, set to false to make invisible again. Don't need it to be visible for script to work the value I am picking out of the spreadsheet is a number 11111111 using the following ie.text_field(:id,/AccountNumber/).set(spreadsheetdata[:'accountnumber'].to_i) when the script enters data into the field it attempts to enter data as follows 11111111.0 (decimal place materialises.) I think ruby changes the format of the number 1111111 extracted from the spreadsheet from an integer as specified using .to_i to another format (hence the decimal place being displayed in the form field) How can I ensure the format of the data extracted from excel stays as an integer or text, allowing a leading zero as '01111111' or '11111111' -- The second half of a man's life is made up of nothing but the habits he has acquired during the first half. - Fyodor Dostoevsky ------------------------------------------------------------------------------ _______________________________________________ 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/20070509/80945941/attachment.html From forum-watir-users at openqa.org Wed May 9 23:50:16 2007 From: forum-watir-users at openqa.org (vamsi) Date: Wed, 09 May 2007 22:50:16 CDT Subject: [Wtr-general] How to handle pop dialouge boxes by clicking on OK button In-Reply-To: <7523f5800705082233qe65f7fenfb902037cec6c120@mail.gmail.com> Message-ID: <28936484.17911178769046648.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Shalini, Thank you very much for your response. How ever i couldn't able to resolve my issue with these solutions. 1 soultion : giving error message as 'NoMethodError: undefined method `dir' for nil:NilClass' and not moving to the next line '$ie.button(:name,"button responsible for popup")' 2. Solution: Problem is same.. Not handling the popup updated windowhelper.rb file too. Thanks in advance. Regards Vamsi From angrez at gmail.com Wed May 9 23:57:44 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 10 May 2007 09:27:44 +0530 Subject: [Wtr-general] Using custom attributes In-Reply-To: References: Message-ID: Hi, With Watir > 1.4.1 you can use xpath to access such elements. tr = ie.element_by_xpath("//tr[@rowkey='12345']") - Angrez On 5/10/07, Andrew Kuzmin wrote: > > Hi All, > > > > Is there any way to access an element by a custom attributes value ? > > > > In my situation, for our web development we're using 3-rd party grid > control, which generates a table with lot of custom attributes for its > elements. For example, the code would look like this: rowKey=12345>? > > Since the rowKey is unique it could be used to uniquly identify the row. > > > > IE's devTool displays these custom attributes correctly, however they are > not accessible from Watir. > > > > Any recommendations ? Could Watir be extended to do this ? > > > > Thanks, > > Andrew > > _______________________________________________ > 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/20070510/cf570245/attachment.html From shalinigupta2006 at gmail.com Thu May 10 00:59:34 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 10 May 2007 10:29:34 +0530 Subject: [Wtr-general] How to handle pop dialouge boxes by clicking on OK button In-Reply-To: <28936484.17911178769046648.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <7523f5800705082233qe65f7fenfb902037cec6c120@mail.gmail.com> <28936484.17911178769046648.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <7523f5800705092159r5d89e639q3ca8b52a5c28aca@mail.gmail.com> in second solution have u changed the path:- Thread.new{ system("ruby \"c:\\PSC\\jscriptExtraAlert.rb\"") } i mean to say jscriptExtraAlert...path.. search this file and specy path there... On 5/10/07, vamsi wrote: > > Hi Shalini, > > Thank you very much for your response. > > How ever i couldn't able to resolve my issue with these solutions. > > 1 soultion : giving error message as 'NoMethodError: undefined method > `dir' for nil:NilClass' > and not moving to the next line '$ie.button(:name,"button > responsible for popup")' > 2. Solution: Problem is same.. Not handling the popup > updated windowhelper.rb file too. > > Thanks in advance. > > > Regards > Vamsi > _______________________________________________ > 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/20070510/0ae8b886/attachment.html From shalinigupta2006 at gmail.com Thu May 10 01:01:57 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 10 May 2007 10:31:57 +0530 Subject: [Wtr-general] Having trouble capturing text in java alert In-Reply-To: <35422985.14381178727409010.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30476307.13271178720133216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <35422985.14381178727409010.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <7523f5800705092201o51f5dedcn46affdd9604240c0@mail.gmail.com> hi u can use this code.. def start_jsalert_clicker Thread.new{ system("ruby \"c:\\PSC\\jscriptExtraAlert.rb\"") } #please specify ur path of jscriptExtraAlert end u have to change ur windowhelper.rb file as... def push_alert_button @autoit.WinWait "Window Internet Explorer", "" text = @autoit.WinGetText "Window Internet Explorer" file = File.open("c:\\test.txt", "w") file.puts text puts text.to_s file.close @autoit.Send "{ENTER}" end after then u can read content of these file......ok... Regards Shalini Gupta On 5/9/07, gary wrote: > > Thanks for the prompt reply. > > I added the code but it appears to return a value of 'Google', any ideas? > > require 'watir' # the controller > include Watir > require 'watir/WindowHelper' > require 'test/unit' > require 'test/unit/ui/console/testrunner' > require 'dl/win32' > require 'watir/winClicker' > > class TC_recorded < Test::Unit::TestCase > > def startClicker( button , waitTime = 3) > w = WinClicker.new > longName = @IE0.dir.gsub("/" , "\\" ) > shortName = w.getShortFileName(longName) > c = "start ruby #{shortName }\\watir\\clickJSDialog.rb #{button } > #{waitTime} " > puts "Starting #{c}" > w.winsystem(c) > w=nil > end > > def test_1 > @IE0 = IE.new > @IE0.set_fast_speed > @IE0.goto("www.hmv.co.uk") > @IE0.link(:text, "Sign In").click > > w = WinClicker.new > text = w.get_static_text('Windows Internet Explorer') # returns an array > for each static control > text.each {|t| puts t} > > startClicker("OK" , 3) > @IE0.image(:alt, "continue").click > > > @IE0.close > end > end > _______________________________________________ > 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/20070510/376c9cb7/attachment-0001.html From shalinigupta2006 at gmail.com Thu May 10 01:03:12 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 10 May 2007 10:33:12 +0530 Subject: [Wtr-general] Having trouble capturing text in java alert In-Reply-To: <7523f5800705092201o51f5dedcn46affdd9604240c0@mail.gmail.com> References: <30476307.13271178720133216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <35422985.14381178727409010.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <7523f5800705092201o51f5dedcn46affdd9604240c0@mail.gmail.com> Message-ID: <7523f5800705092203u5e43251fu13356563608a2f08@mail.gmail.com> once again..use this function start_jsalert_clicker...before the object who is responsible for java alert popup.. On 5/10/07, SHALINI GUPTA wrote: > > hi > u can use this code.. > def start_jsalert_clicker > Thread.new{ system("ruby \"c:\\PSC\\jscriptExtraAlert.rb\"") } > #please specify ur path of jscriptExtraAlert > end > u have to change ur windowhelper.rb file as... > def push_alert_button > @autoit.WinWait "Window Internet Explorer", "" > text = @ autoit.WinGetText "Window Internet Explorer" > file = File.open("c:\\test.txt", "w") > file.puts text > puts text.to_s > file.close > @autoit.Send "{ENTER}" > end > > after then u can read content of these file......ok... > Regards > Shalini Gupta > > > > On 5/9/07, gary wrote: > > > > Thanks for the prompt reply. > > > > I added the code but it appears to return a value of 'Google', any > > ideas? > > > > require 'watir' # the controller > > include Watir > > require 'watir/WindowHelper' > > require 'test/unit' > > require 'test/unit/ui/console/testrunner' > > require 'dl/win32' > > require 'watir/winClicker' > > > > class TC_recorded < Test::Unit::TestCase > > > > def startClicker( button , waitTime = 3) > > w = WinClicker.new > > longName = @IE0.dir.gsub("/" , "\\" ) > > shortName = w.getShortFileName(longName) > > c = "start ruby #{shortName }\\watir\\clickJSDialog.rb #{button } > > #{waitTime} " > > puts "Starting #{c}" > > w.winsystem(c) > > w=nil > > end > > > > def test_1 > > @IE0 = IE.new > > @IE0.set_fast_speed > > @IE0.goto("www.hmv.co.uk") > > @IE0.link(:text, "Sign In").click > > > > w = WinClicker.new > > text = w.get_static_text('Windows Internet Explorer') # returns an > > array for each static control > > text.each {|t| puts t} > > > > startClicker("OK" , 3) > > @IE0.image(:alt, "continue").click > > > > > > @IE0.close > > end > > end > > _______________________________________________ > > 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/20070510/96b1065c/attachment.html From WKruse at multichoice.co.za Thu May 10 02:16:44 2007 From: WKruse at multichoice.co.za (Walter Kruse) Date: Thu, 10 May 2007 08:16:44 +0200 Subject: [Wtr-general] The Plan for Watir In-Reply-To: <46424D80.10200@pettichord.com> References: <463BF71A.9020000@pettichord.com><463FBADC.50001@gmail.com> <4640983A.30302@pettichord.com><4640E73A.9080905@gmail.com> <4641ECD9.2070902@pettichord.com><46421C36.3020101@gmail.com> <464223A3.7070003@pettichord.com> <4642311C.2040502@pettichord.com><72799cd70705091437rbc8b851t71cf4fc7d1e165a2@mail.gmail.com> <46424D80.10200@pettichord.com> Message-ID: I am very keen to have this done, but leeching isn't nice and I can't write C. If there is forward movement on win32guitest, I volunteer to do a document for it, either a user guide, or something in the style of this: http://www.piotrkaluski.com/files/winguitest/docs/winguitest.html I have made extensive use of Perl's equivalent at a previous client. Walter -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 10 May 2007 12:39 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] The Plan for Watir Chris McMahon wrote: > There might still be enough there to work with. > This is a port of Perl Win32::GuiTest, btw That is good to hear. Since a release was never made, i had assumed that it was an abandoned project. I just took another look and found i was able to run all the tests successfully. From what you say, i would say that the next step would be to package this as a gem and create some rdoc, even if it was only something simple that pointed you to the corresponding perl docs. I was also confused by the guitest020218 directory. Should i just ignore this? There are duplicates of several files (cguitest.so, guitest.rb). Which is the correct one to use? Bret _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ************************************************************************************************************************** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. ************************************************************************************************************************** From christopher.mcmahon at gmail.com Thu May 10 02:30:30 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 10 May 2007 00:30:30 -0600 Subject: [Wtr-general] The Plan for Watir In-Reply-To: References: <463BF71A.9020000@pettichord.com> <4640E73A.9080905@gmail.com> <4641ECD9.2070902@pettichord.com> <46421C36.3020101@gmail.com> <464223A3.7070003@pettichord.com> <4642311C.2040502@pettichord.com> <72799cd70705091437rbc8b851t71cf4fc7d1e165a2@mail.gmail.com> <46424D80.10200@pettichord.com> Message-ID: <72799cd70705092330y3b5e7cebx34955094c15a1d89@mail.gmail.com> On 5/10/07, Walter Kruse wrote: > I am very keen to have this done, but leeching isn't nice and I can't > write C. If there is forward movement on win32guitest, I volunteer to do > a document for it, either a user guide, or something in the style of > this: http://www.piotrkaluski.com/files/winguitest/docs/winguitest.html As the Official Cheerleader for GuiTest in Ruby: go for it. I think that there is useful stuff there, but Wayne Vucenic and I both lost interest not long after Wayne wrote the code, and I'm not exactly sure how far he got. Someday I'll get back to it, but not anytime soon. I don't remember that there is a lot of C involved. I think it's mostly negotiating the Win32 interfaces. Let me know if you need any privileged access. I'm pretty sure I'm still set up to make that happen. From aidy.lewis at googlemail.com Thu May 10 03:08:09 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Thu, 10 May 2007 08:08:09 +0100 Subject: [Wtr-general] Community involvement with Watir Message-ID: <7ac2300c0705100008q3eb8c065y67845cfd288a9635@mail.gmail.com> On 09/05/07, Bret Pettichord wrote: > Just to be clear, we have always been open to having people add these to > our wiki and have often encouraged this. > > http://wiki.openqa.org/display/WTR/Contributions > > Bret I think all these important links should become a footnote on Watir's main page (or a page in themselves). A page that could link to every major contribution. Watir assets have become too amorphous. Also additional user-guide sugesstions IDE's: Arachno, Eclipse, Emacs Test Frameworks: Data-driven, test DSL's?, object mapping, Test::Unit Test Reports: I have written some XML + XLST = HTML. I will put it on the FAQ's. aidy From tunde.jinadu at gmail.com Thu May 10 04:49:13 2007 From: tunde.jinadu at gmail.com (Tunde Jinadu) Date: Thu, 10 May 2007 09:49:13 +0100 Subject: [Wtr-general] Watir Data types exported from excel In-Reply-To: <027901c792b4$42d32190$6400a8c0@laptop> References: <1624b0140705091401o502948d9oe0ff88dfcd008c6a@mail.gmail.com> <027901c792b4$42d32190$6400a8c0@laptop> Message-ID: <1624b0140705100149w52d8939ev67e59308c778c4c9@mail.gmail.com> Brilliant, changing spreadsheetdata[:accountnumber] = row.cells(4,57)['value'] to spreadsheetdata[:accountnumber] = row.cells(4,57)['text'] sorted me out, so what is the difference between the two ? thanks for the solution On 5/10/07, Paul Rogers wrote: > > your code doesnt show where you create spreadsheetdate but if you use > either the text or attribute ( i cant remember which, and dont have excel > here ) > > myval = worksheet.range('a2')['value'] # or ['text'] > > > one of these will do the right thing > > Paul > > ----- Original Message ----- > *From:* Tunde Jinadu > *To:* Wtr-general at rubyforge.org > *Sent:* Wednesday, May 09, 2007 3:01 PM > *Subject:* [Wtr-general] Watir Data types exported from excel > > I'm running a script to read data from a spreadsheet using the following > script > > # open the spreadsheet and get the values > excel = WIN32OLE::new('excel.Application') # define the type of > application to connect too > workbook = excel.Workbooks.Open('d:\Smoke_Test2.xls') # spreadsheet > location > worksheet = workbook.Worksheets(1) #get hold of the second worksheet > worksheet.Select #bring it to the front -need sometimes to run > macros, not for working with a worksheet from ruby > range=worksheet.range("a1", "bw50") # range of spreadsheet > #~ excel['Visible'] = false #make visible, set to false to make > invisible again. Don't need it to be visible for script to work > > > the value I am picking out of the spreadsheet is a number > > 11111111 > > using the following > > ie.text_field > (:id,/AccountNumber/).set(spreadsheetdata[:'accountnumber'].to_i) > > when the script enters data into the field it attempts to enter data as > follows 11111111.0 (decimal place materialises.) > > I think ruby changes the format of the number 1111111 extracted from the > spreadsheet from an integer as specified using .to_i to another format > (hence the decimal place being displayed in the form field) How can I ensure > the format of the data extracted from excel stays as an integer or text, > allowing a leading zero as '01111111' or '11111111' > > > > > > > > > -- > The second half of a man's life is made up of nothing but the habits he > has acquired during the first half. > - Fyodor Dostoevsky > > ------------------------------ > > _______________________________________________ > 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 > -- The second half of a man's life is made up of nothing but the habits he has acquired during the first half. - Fyodor Dostoevsky -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070510/a1a83b34/attachment.html From forum-watir-users at openqa.org Thu May 10 08:12:01 2007 From: forum-watir-users at openqa.org (Vipul) Date: Thu, 10 May 2007 07:12:01 CDT Subject: [Wtr-general] How to selecting Menu item in Watir In-Reply-To: <25203840.831178623083747.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <27164296.21491178799151325.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> hi i tried calling parent span using ie.span(:id, "Sessions").click ie.span(:id, "Sessions").fire_event("onsubmenu_click") but this gives the error the following error WIN32OLERuntimeError: fireEvent OLE error code:80070057 in htmlfile Invalid argument. HRESULT error code:0x80020009 Exception occurred. c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2039:in `method_missing' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2039:in `fire_event' this error is may be because "onsubmenu_click" is user-defined java event. From forum-watir-users at openqa.org Thu May 10 09:03:29 2007 From: forum-watir-users at openqa.org (Eoin) Date: Thu, 10 May 2007 08:03:29 CDT Subject: [Wtr-general] FireWatir doesn't ignore if it doesn't exists but In-Reply-To: <463BD992.2000404@pettichord.com> Message-ID: <29533472.22171178802239722.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Bret, Error is: FireWatir::Exception::UnknownObjectException: Unable to locate object, using name and LoginButton c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.0.2/./MozillaBaseElement.rb:881:in `assert_exists' c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.0.2/./MozillaBaseElement.rb:1027:in `click' scripts/companies/search/CompanyAndCountry.rb:38:in `test_companiesSearch' Details of Page is: Hello eoin.oconghaile at hp.com. Click the button to log in: [Login >>] [] entails a button. The title of the page is "Remote Access Portal | Login - Mozilla Firefox Thanks, Eoin From forum-watir-users at openqa.org Thu May 10 12:07:15 2007 From: forum-watir-users at openqa.org (gary) Date: Thu, 10 May 2007 11:07:15 CDT Subject: [Wtr-general] Having trouble capturing text in java alert In-Reply-To: <30476307.13271178720133216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <29686707.23461178813265201.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi still no luck I'm afraid, this is the closest I can get to what I want but with odd behaviour. For some reason the first alert does not appear to be recognised, but if I select this manually and then select the continue button again then the script kicks in again, extracts the text, puts the text out to the console, and then closes the alert as per the script. I'm just struggling to understand why it's not recognised the first time round. Any ideas? See script below: require 'watir' # the controller include Watir require 'watir/WindowHelper' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'dl/win32' require 'watir/winClicker' class TC_recorded < Test::Unit::TestCase def captureText autoit = WIN32OLE.new('AutoItX3.Control') ret = autoit.WinWait "Windows Internet Explorer", "" text = autoit.WinGetText "Windows Internet Explorer", "" puts text.to_s autoit.Send "{enter}" end def test_1 @IE0 = IE.new @IE0.set_fast_speed @IE0.goto("www.hmv.co.uk") @IE0.link(:text, "Sign In").click @IE0.image(:alt, "continue").click captureText @IE0.close end end From bret at pettichord.com Thu May 10 14:33:46 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 10 May 2007 13:33:46 -0500 Subject: [Wtr-general] FireWatir doesn't ignore if it doesn't exists but In-Reply-To: <29533472.22171178802239722.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <29533472.22171178802239722.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4643658A.9090508@pettichord.com> Eoin wrote: > Hi Bret, > > Error is: > FireWatir::Exception::UnknownObjectException: Unable to locate object, using name and LoginButton > c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.0.2/./MozillaBaseElement.rb:881:in `assert_exists' > c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.0.2/./MozillaBaseElement.rb:1027:in `click' > scripts/companies/search/CompanyAndCountry.rb:38:in `test_companiesSearch' > > Details of Page is: > Hello eoin.oconghaile at hp.com. Click the button to log in: [Login >>] > [] entails a button. The title of the page is "Remote Access Portal | Login - Mozilla Firefox > > What does the html of the page look like? Bret From forum-watir-users at openqa.org Thu May 10 16:34:04 2007 From: forum-watir-users at openqa.org (Edwin Taquichiri) Date: Thu, 10 May 2007 15:34:04 CDT Subject: [Wtr-general] How to handle pop menu clicking on right mouse button? Message-ID: <29783945.25771178829274524.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I'm new in ruby and watir,please anybody help me, I want know how to handle the options of popup menu click on right mouse button, Thanks in advance From forum-watir-users at openqa.org Thu May 10 18:46:25 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Thu, 10 May 2007 17:46:25 CDT Subject: [Wtr-general] Cannot click Cancel button in download file window Message-ID: <30366079.25831178837215993.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I have a test to do the followings: login to web application and click button to open file download window. Then, click Cancel button to close download file window. The code below for download file window works fine in autoit. But, is not working in Watir script. The download window is open and no clicking Cancel button action is performed. Any thing is missing from my script? Please help. Code: autoit = WIN32OLE.new('AutoItX3.Control') autoit.WinWait("Choose file", nil, 5) autoit.WinActive("Choose file") autoit.ControlFocus("Choose file","","1138") #Puts Focus on Cancel button autoit.ControlClick("Choose file","","1138") #clicks Cancel button Thanks! Kui From forum-watir-users at openqa.org Thu May 10 19:45:28 2007 From: forum-watir-users at openqa.org (barry) Date: Thu, 10 May 2007 18:45:28 CDT Subject: [Wtr-general] Web Service client call from Ruby. Message-ID: <39577334.26011178840758355.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> When i try to setup web service connection via SOAP WSDLDriverFactory, I got the following error. c = SOAP::WSDLDriverFactory.new("http://localhost/test.asmx") I believe the web service call requires basic authentication. Does anyone know how this work? WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {}html from c:/ruby/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:116:in `decode_tag' from c:/ruby/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:82:in `start_element' from c:/ruby/lib/ruby/1.8/xsd/xmlparser/parser.rb:67:in `start_element' from c:/ruby/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:34:in `do_parse' from c:/ruby/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:31:in `parse' from c:/ruby/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:31:in `do_parse' from c:/ruby/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:63:in `parse' from c:/ruby/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:42:in `parse' from c:/ruby/lib/ruby/1.8/wsdl/importer.rb:31:in `parse' from c:/ruby/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:30:in `import' from c:/ruby/lib/ruby/1.8/wsdl/importer.rb:18:in `import' from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:124:in `import' from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:28:in `initialize' from (irb):11:in `new' from (irb):11 From christopher.mcmahon at gmail.com Thu May 10 20:17:33 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 10 May 2007 18:17:33 -0600 Subject: [Wtr-general] Web Service client call from Ruby. In-Reply-To: <39577334.26011178840758355.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <39577334.26011178840758355.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70705101717k50be98c0vc0b6a392205a19a8@mail.gmail.com> On 5/10/07, barry wrote: > When i try to setup web service connection via SOAP WSDLDriverFactory, I got the following error. > > c = SOAP::WSDLDriverFactory.new("http://localhost/test.asmx") > > I believe the web service call requires basic authentication. Does anyone know how this work? http://chrismcmahonsblog.blogspot.com/2006/03/soap-basic-authentication-in-ruby.html From forum-watir-users at openqa.org Thu May 10 21:30:06 2007 From: forum-watir-users at openqa.org (caesar) Date: Thu, 10 May 2007 20:30:06 CDT Subject: [Wtr-general] issue for open IE in the background Message-ID: <34209832.26421178847036555.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have to test multiple sites and capture screenshot with watir. But I am just wondering if there is a way to have watir open IE browser in the background and capture screenshot of each URL instead of opening IE in the foreground. It would be very grateful if somebody let me know how to do it. I have been poking around to find a script which does this task. thanks. From christopher.mcmahon at gmail.com Thu May 10 22:18:10 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 10 May 2007 20:18:10 -0600 Subject: [Wtr-general] Watir/FireWatir merge/refactoring suggestion: down_load_time Message-ID: <72799cd70705101918k619c8e7fuff13df6f43242bec@mail.gmail.com> I had occasion today to measure page load times in anger using FireWatir. I don't have a regular Watir installation handy, but I know Watir tracks the latest page load times in a variable called "down_load_time" or "download_time" or something similar. FireWatir doesn't have this feature. I used the venerable wrap-a-timer-around-the-click technique stolen from Mike Kelly, which is pretty painless, but it made me think. I'd like to make two suggestions: first, that the value be renamed "page_load_time" instead of "down_load_time", because "page loads" and "downloads" are different things. Second, that this value be added to FireWatir at the same time that it's refactored in Watir. And, it would be really nifty if Watir and FireWatir could actually share the same physical code files, such that a change to the function of "page_load_time" would be instantly available to both platforms. It seems to me that this would be a good spike to explore merging the shared code between the two platforms. I could, of course, be wrong, but I thought making the suggestion was worthwhile. From shalinigupta2006 at gmail.com Fri May 11 01:03:40 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Fri, 11 May 2007 10:33:40 +0530 Subject: [Wtr-general] Having trouble capturing text in java alert In-Reply-To: <29686707.23461178813265201.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30476307.13271178720133216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <29686707.23461178813265201.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <7523f5800705102203h5f39a8adu300b4630e4800405@mail.gmail.com> hi, Tell me is 'continue' is responsible for popup... if yes..then how it will take text..u didnot define any function for popup hadling...include this function too.. def start_jsalert_clicker Thread.new{ system("ruby \"c:\\PSC\\jscriptExtraAlert.rb\"") }### please take care of this path...this path belongs to jscriptExtraAlert file according to my machine..u specify this as yours... end @IE0.link(:text, "Sign In").click start_jsalert_clicker @IE0.image(:alt, "continue").click captureText i mean call this function 'start_jsalert_clicker' before that object who is responsible for popup.. tell me if its helps u or not.... Regards and Thanks Shalini Gupta and use this as.. On 5/10/07, gary wrote: > > Hi still no luck I'm afraid, this is the closest I can get to what I want > but with odd behaviour. > > For some reason the first alert does not appear to be recognised, but if I > select this manually and then select the continue button again then the > script kicks in again, extracts the text, puts the text out to the console, > and then closes the alert as per the script. I'm just struggling to > understand why it's not recognised the first time round. Any ideas? See > script below: > > require 'watir' # the controller > include Watir > require 'watir/WindowHelper' > require 'test/unit' > require 'test/unit/ui/console/testrunner' > require 'dl/win32' > require 'watir/winClicker' > > class TC_recorded < Test::Unit::TestCase > > def captureText > autoit = WIN32OLE.new('AutoItX3.Control') > ret = autoit.WinWait "Windows Internet Explorer", "" > text = autoit.WinGetText "Windows Internet Explorer", "" > puts text.to_s > autoit.Send "{enter}" > end > > > def test_1 > @IE0 = IE.new > @IE0.set_fast_speed > @IE0.goto("www.hmv.co.uk") > @IE0.link(:text, "Sign In").click > @IE0.image(:alt, "continue").click > captureText > > @IE0.close > end > end > _______________________________________________ > 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/20070511/3d82f90d/attachment.html From forum-watir-users at openqa.org Fri May 11 02:06:06 2007 From: forum-watir-users at openqa.org (Vipul) Date: Fri, 11 May 2007 01:06:06 CDT Subject: [Wtr-general] Solution for FAQ "Using key/value pairs" not working Message-ID: <30562390.27371178863596530.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> hi i have tried following class initialValues @@user_name = 'atilla' @@last_name = 'ozgur' end save in intial.rb file. But when i use intial.rb file in main file i get syntax error ' class/modulename must be a constant.' Also @@ means global variable inside class? From aidy.lewis at googlemail.com Fri May 11 04:16:51 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Fri, 11 May 2007 09:16:51 +0100 Subject: [Wtr-general] Solution for FAQ "Using key/value pairs" not working In-Reply-To: <30562390.27371178863596530.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30562390.27371178863596530.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <7ac2300c0705110116o48efa908i39e445b16d44412d@mail.gmail.com> > class initialValues Use an upper case 'I' for class name. @@ means class variable. Aidy On 11/05/07, Vipul wrote: > hi > > i have tried following > > class initialValues > @@user_name = 'atilla' > @@last_name = 'ozgur' > end > save in intial.rb file. > > But when i use intial.rb file in main file i get syntax error ' class/modulename must be a constant.' > > Also @@ means global variable inside class? > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From zeljko.filipin at gmail.com Fri May 11 04:18:54 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 11 May 2007 10:18:54 +0200 Subject: [Wtr-general] How to handle pop menu clicking on right mouse button? In-Reply-To: <29783945.25771178829274524.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <29783945.25771178829274524.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Edwin, Please send part of HTML that causes popup menu to appear. ?eljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070511/63065360/attachment.html From forum-watir-users at openqa.org Fri May 11 04:29:24 2007 From: forum-watir-users at openqa.org (gary) Date: Fri, 11 May 2007 03:29:24 CDT Subject: [Wtr-general] Having trouble capturing text in java alert In-Reply-To: <30476307.13271178720133216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <28006143.28491178872195011.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks again for your help. i am getting the following load error - ubygems.8gemswatir-1.5.1.1164unittestsjscriptExtraAlert.rb (LoadError) require 'watir' # the controller include Watir require 'watir/WindowHelper' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'dl/win32' require 'watir/winClicker' class TC_recorded < Test::Unit::TestCase def start_jsalert_clicker Thread.new{ system("ruby \"C:\\ruby\lib\ruby\gems\1.8\gems\watir-1.5.1.1164\unittests\jscriptExtraAlert.rb\"") } end def captureText autoit = WIN32OLE.new('AutoItX3.Control') ret = autoit.WinWait "Windows Internet Explorer", "" text = autoit.WinGetText "Windows Internet Explorer", "" puts text.to_s autoit.Send "{ENTER}" end def test_1 @IE0 = IE.new @IE0.set_fast_speed @IE0.goto("www.hmv.co.uk") @IE0.link(:text, "Sign In").click start_jsalert_clicker @IE0.image(:alt, "continue").click captureText @IE0.close end end From angrez at gmail.com Fri May 11 04:55:10 2007 From: angrez at gmail.com (Angrez Singh) Date: Fri, 11 May 2007 14:25:10 +0530 Subject: [Wtr-general] Having trouble capturing text in java alert In-Reply-To: <28006143.28491178872195011.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30476307.13271178720133216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <28006143.28491178872195011.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi, Make sure you escape '\' character in the file name by putting another '\' character in front of it. - Angrez On 5/11/07, gary wrote: > > Thanks again for your help. > > i am getting the following load error - ubygems.8gemswatir- > 1.5.1.1164unittestsjscriptExtraAlert.rb (LoadError) > > require 'watir' # the controller > include Watir > require 'watir/WindowHelper' > require 'test/unit' > require 'test/unit/ui/console/testrunner' > require 'dl/win32' > require 'watir/winClicker' > > class TC_recorded < Test::Unit::TestCase > > def start_jsalert_clicker > Thread.new{ system("ruby \"C:\\ruby\lib\ruby\gems\1.8\gems\watir- > 1.5.1.1164\unittests\jscriptExtraAlert.rb\"") } > end > > > def captureText > autoit = WIN32OLE.new('AutoItX3.Control') > ret = autoit.WinWait "Windows Internet Explorer", "" > text = autoit.WinGetText "Windows Internet Explorer", "" > puts text.to_s > autoit.Send "{ENTER}" > end > > def test_1 > @IE0 = IE.new > @IE0.set_fast_speed > @IE0.goto("www.hmv.co.uk") > @IE0.link(:text, "Sign In").click > start_jsalert_clicker > @IE0.image(:alt, "continue").click > captureText > > @IE0.close > end > end > _______________________________________________ > 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/20070511/0923cb29/attachment.html From forum-watir-users at openqa.org Fri May 11 07:14:15 2007 From: forum-watir-users at openqa.org (Vipul) Date: Fri, 11 May 2007 06:14:15 CDT Subject: [Wtr-general] Solution for FAQ "Using key/value pairs" not working In-Reply-To: <30562390.27371178863596530.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <30288948.1491178882085368.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> now i am getting following exception 'undefined method `user_Name' for LoginInput:Class (NoMethodError)' in main source file contains the code require 'Input.rb' $ie = IE.new() $ie.goto(test_site) $ie.text_field(:id,"txtLoginID").set(LoginInput.user_Name) From forum-watir-users at openqa.org Fri May 11 07:26:24 2007 From: forum-watir-users at openqa.org (gary) Date: Fri, 11 May 2007 06:26:24 CDT Subject: [Wtr-general] Having trouble capturing text in java alert In-Reply-To: <30476307.13271178720133216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <31894778.1821178882814760.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Great thanks. That's got rid of the error message, but it still appears to be running through twice and therefore stopping midway through. The 'sign in' click takes you through to sign in page. Th continue button should cause the alert to appear. I then need to capture the text within the popup. Then select ok to deal with alert. Then finally close IE. What appears to be happening is The 'sign in' click takes you through to sign in page. Th continue button should cause the alert to appear. the jsalert_clicker selects the ok to deal with the alert I need to manually select the continue button again which causes the alert to appear again the capureText extracts the text (text = autoit.WinGetText "Windows Internet Explorer", "") and also deals with the alert (autoit.Send "{ENTER}"). require 'watir' # the controller include Watir require 'watir/WindowHelper' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'dl/win32' require 'watir/winClicker' class TC_recorded < Test::Unit::TestCase def start_jsalert_clicker Thread.new{ system("ruby \"C:\\ruby\\lib\\ruby\\gems\\1.8\\gems\\watir-1.5.1.1164\\unittests\\jscriptExtraAlert.rb\"") } end def captureText autoit = WIN32OLE.new('AutoItX3.Control') ret = autoit.WinWait "Windows Internet Explorer", "" text = autoit.WinGetText "Windows Internet Explorer", "" puts text.to_s autoit.Send "{ENTER}" end def test_1 @IE0 = IE.new @IE0.set_fast_speed @IE0.goto("www.hmv.co.uk") @IE0.link(:text, "Sign In").click start_jsalert_clicker @IE0.image(:alt, "continue").click captureText @IE0. close end end From forum-watir-users at openqa.org Fri May 11 07:32:00 2007 From: forum-watir-users at openqa.org (Eoin) Date: Fri, 11 May 2007 06:32:00 CDT Subject: [Wtr-general] FireWatir doesn't ignore if it doesn't exists but In-Reply-To: <4643658A.9090508@pettichord.com> Message-ID: <35273878.1881178883150498.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> html of the login page looks like: Remote Access Portal | Login

    Hello eoin.oconghaile at hp.com. Click the button to log in:
    From forum-watir-users at openqa.org Fri May 11 07:50:33 2007 From: forum-watir-users at openqa.org (Vipul) Date: Fri, 11 May 2007 06:50:33 CDT Subject: [Wtr-general] Running test script once for each datarow in excel Message-ID: <32496347.2281178884263960.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> i am testing a site which has login page. i want to automate login with different user credentials each time. i want username and pwd values to come from excel sheet or input.rb whichever possible. Does anyone has the code or suggestion for implementing this. From forum-watir-users at openqa.org Fri May 11 07:52:37 2007 From: forum-watir-users at openqa.org (Zeljko) Date: Fri, 11 May 2007 06:52:37 CDT Subject: [Wtr-general] xpath question (not Watir related) Message-ID: <37804933.2341178884387963.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have xml that looks like this. I need to get value of "hash" attribute (BF8E8F60E722E92C7ED8303916591AB4). I know the value of "m" url parameter (inside "url" attribute) (7fb83717-9606-4022-bd4e-67b6f6582ada), but I do not know the value of "code" url parameter. I know how to get attribute of a tag when I know another attribute of that tag. For example, if I knew "hash" attribute and needed "url" attribute, I would do it like this: e = REXML::Document.new(ie.text).root.elements e["/tokens/ShortUrl[@hash='BF8E8F60E722E92C7ED8303916591AB4']"].attributes["url"] => "resetpassword.aspx?m=7fb83717-9606-4022-bd4e-67b6f6582ada&code=2271ad0e-d627-4e6c-bdfb-2b11d354e9ac" But, I know only part of "url" attribute. Of course, this does not work (because e[...] returns nil). e["/tokens/ShortUrl[@url='resetpassword.aspx?m=7fb83717-9606-4022-bd4e-67b6f6582ada&code=']"].attributes["hash"] => NoMethodError: undefined method `attributes' for nil:NilClass I have heard that there are xpath string functions (http://www.w3.org/TR/xpath#section-String-Functions), but I did not understand how to use them, or would it even help in this case. I have solved this problem with regular expressions, but I guess there must be xpath solution. Also, I have already asked my developer to simplify that xml, so I can use it, but that has low priority because I have already solved the problem. Does anybody know how to do this using xpath? Zeljko -- ZeljkoFilipin.com From zeljko.filipin at gmail.com Fri May 11 08:06:02 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 11 May 2007 14:06:02 +0200 Subject: [Wtr-general] New Version of Internet Explorer Developer Toolbar Message-ID: Read more: http://blogs.msdn.com/ie/archive/2007/05/10/Internet-Explorer-Developer-Toolbar-_2D00_-Get-It-Now_2100_.aspx Get it: http://www.microsoft.com/downloads/details.aspx?FamilyId=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070511/4b8a8f0b/attachment.html From angrez at gmail.com Fri May 11 09:57:47 2007 From: angrez at gmail.com (Angrez Singh) Date: Fri, 11 May 2007 19:27:47 +0530 Subject: [Wtr-general] xpath question (not Watir related) In-Reply-To: <37804933.2341178884387963.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <37804933.2341178884387963.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi, Can you give this a try? e = REXML::Document.new(ie.text).root.elements e["/tokens/ShortUrl[starts-with(@url, "resetpassword.aspx?m=7fb83717-9606-4022-bd4e-67b6f6582ada"].attributes["url"] As you already know value of 'm' in query string you can create a string a give it a try. - Angrez On 5/11/07, Zeljko wrote: > > I have xml that looks like this. > > > hash="BF8E8F60E722E92C7ED8303916591AB4" /> > > > I need to get value of "hash" attribute > (BF8E8F60E722E92C7ED8303916591AB4). I know the value of "m" url parameter > (inside "url" attribute) (7fb83717-9606-4022-bd4e-67b6f6582ada), but I do > not know the value of "code" url parameter. > > I know how to get attribute of a tag when I know another attribute of that > tag. For example, if I knew "hash" attribute and needed "url" attribute, I > would do it like this: > > e = REXML::Document.new (ie.text).root.elements > > e["/tokens/ShortUrl[@hash='BF8E8F60E722E92C7ED8303916591AB4']"].attributes["url"] > => "resetpassword.aspx?m=7fb83717-9606-4022-bd4e-67b6f6582ada&code=2271ad0e-d627-4e6c-bdfb-2b11d354e9ac" > > > But, I know only part of "url" attribute. Of course, this does not work > (because e[...] returns nil). > > e["/tokens/ShortUrl[@url='resetpassword.aspx?m=7fb83717-9606-4022-bd4e-67b6f6582ada&code=']"].attributes["hash"] > > => NoMethodError: undefined method `attributes' for nil:NilClass > > I have heard that there are xpath string functions (http://www.w3.org/TR/xpath#section-String-Functions > ), but I did not understand how to use them, or would it even help in this > case. > > I have solved this problem with regular expressions, but I guess there > must be xpath solution. > > Also, I have already asked my developer to simplify that xml, so I can use > it, but that has low priority because I have already solved the problem. > > Does anybody know how to do this using xpath? > > Zeljko > -- > ZeljkoFilipin.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/20070511/0c8d347e/attachment-0001.html From charley.baker at gmail.com Fri May 11 10:34:56 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 11 May 2007 08:34:56 -0600 Subject: [Wtr-general] Solution for FAQ "Using key/value pairs" not working In-Reply-To: <30288948.1491178882085368.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30562390.27371178863596530.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <30288948.1491178882085368.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Looks like user_Name is not defined for your LoginInput class. Check your casing and make sure it exists there. Might be something like user_name, not user_Name. Otherwise we'd have to have more information on your LoginInput class. -Charley On 5/11/07, Vipul wrote: > > now i am getting following exception > > 'undefined method `user_Name' for LoginInput:Class (NoMethodError)' > > in main source file contains the code > > require 'Input.rb' > $ie = IE.new() > $ie.goto(test_site) > $ie.text_field(:id,"txtLoginID").set(LoginInput.user_Name) > _______________________________________________ > 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/20070511/ae68cacb/attachment.html From charley.baker at gmail.com Fri May 11 10:38:38 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 11 May 2007 08:38:38 -0600 Subject: [Wtr-general] Running test script once for each datarow in excel In-Reply-To: <32496347.2281178884263960.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32496347.2281178884263960.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: David Brown posted an interface to Excel on the Watir user contributions area with an example usage case that steps through rows: http://wiki.openqa.org/display/WTR/Excel+interface+class -Charley On 5/11/07, Vipul wrote: > > i am testing a site which has login page. > > i want to automate login with different user credentials each time. > > i want username and pwd values to come from excel sheet or input.rbwhichever possible. > > Does anyone has the code or suggestion for implementing this. > _______________________________________________ > 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/20070511/cccb3c1f/attachment.html From I_Webb at acs.org Fri May 11 10:46:05 2007 From: I_Webb at acs.org (Ian Webb) Date: Fri, 11 May 2007 10:46:05 -0400 Subject: [Wtr-general] Running test script once for each datarow in excel In-Reply-To: <32496347.2281178884263960.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32496347.2281178884263960.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <353BA7F10699794198CD75B3033E62AA025219FD@washnt57.acs.org> This is very simple with a CSV file: require 'csv' CSV::Reader.parse(File.open(ARGV[0], 'rb')) do |row| #open the filename given as first command line argument userid = row[0] #note that the CSV module index starts at 0 passwd = row[1] loginToSite(userid,passwd) #whatever your login code is End Cheers, Ian -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Vipul Sent: Friday, May 11, 2007 7:51 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Running test script once for each datarow in excel i am testing a site which has login page. i want to automate login with different user credentials each time. i want username and pwd values to come from excel sheet or input.rb whichever possible. Does anyone has the code or suggestion for implementing this. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From David_Brown at mentor.com Fri May 11 11:12:31 2007 From: David_Brown at mentor.com (Brown, David) Date: Fri, 11 May 2007 08:12:31 -0700 Subject: [Wtr-general] Running test script once for each datarow in In-Reply-To: Message-ID: <44B054F46C2E4E4996C27D92F9B825EE04ED49C3@SVR-ORW-EXC-07.mgc.mentorg.com> Vipul, You can find examples of working with excel here: http://wiki.rubygarden.org/ruby/page/show/ScriptingExcel Or, there's a library with an example watir test script I posted on the watir contributions wiki which hides some of the complexities of working with excel: http://wiki.openqa.org/display/WTR/Excel+interface+class -David ------------------------------ Message: 7 Date: Fri, 11 May 2007 06:50:33 CDT From: Vipul Subject: [Wtr-general] Running test script once for each datarow in excel To: wtr-general at rubyforge.org Message-ID: <32496347.2281178884263960.JavaMail.oqa-j2ee at openqa01.managed.contegix.c om> Content-Type: text/plain; charset=ISO-8859-1 i am testing a site which has login page. i want to automate login with different user credentials each time. i want username and pwd values to come from excel sheet or input.rb whichever possible. Does anyone has the code or suggestion for implementing this. ------------------------------ From forum-watir-users at openqa.org Fri May 11 12:16:43 2007 From: forum-watir-users at openqa.org (barry) Date: Fri, 11 May 2007 11:16:43 CDT Subject: [Wtr-general] Web Service client call from Ruby. In-Reply-To: <72799cd70705101717k50be98c0vc0b6a392205a19a8@mail.gmail.com> Message-ID: <28666169.9251178900234511.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I tried the approach mentioned in the link before. It didn't really work. Right calling "create_rpc_driver". i got following error. (before I event have chance to set the basic auth information) irb(main):009:0> @soap=SOAP::WSDLDriverFactory.new(url).create_rpc_driver warning: peer certificate won't be verified in this SSL session WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {}html from c:/ruby/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:116:in `decode_ta from c:/ruby/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:82:in `start_elem from c:/ruby/lib/ruby/1.8/xsd/xmlparser/parser.rb:67:in `start_eleme from c:/ruby/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:34:in `do_parse from c:/ruby/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:31:in `parse' from c:/ruby/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:31:in `do_parse from c:/ruby/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:63:in `parse' from c:/ruby/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:42:in `parse' from c:/ruby/lib/ruby/1.8/wsdl/importer.rb:31:in `parse' from c:/ruby/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:30:in `import' from c:/ruby/lib/ruby/1.8/wsdl/importer.rb:18:in `import' from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:124:in `import' from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:28:in `initialize' from (irb):9:in `new' from (irb):9 From paul.rogers at shaw.ca Fri May 11 12:22:08 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 11 May 2007 10:22:08 -0600 Subject: [Wtr-general] Web Service client call from Ruby. References: <28666169.9251178900234511.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <046501c793e8$86072760$6400a8c0@laptop> the unknown element : {} html probably means you are getting an html response back from the server - visit the url with a browser to make sure you are not getting an error message Paul ----- Original Message ----- From: "barry" To: Sent: Friday, May 11, 2007 10:16 AM Subject: Re: [Wtr-general] Web Service client call from Ruby. >I tried the approach mentioned in the link before. It didn't really work. >Right calling "create_rpc_driver". i got following error. (before I event >have chance to set the basic auth information) > > irb(main):009:0> @soap=SOAP::WSDLDriverFactory.new(url).create_rpc_driver > warning: peer certificate won't be verified in this SSL session > WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {}html > from c:/ruby/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:116:in > `decode_ta > from c:/ruby/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:82:in > `start_elem > > from c:/ruby/lib/ruby/1.8/xsd/xmlparser/parser.rb:67:in > `start_eleme > from c:/ruby/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:34:in > `do_parse > from c:/ruby/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:31:in `parse' > from c:/ruby/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:31:in > `do_parse > from c:/ruby/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:63:in `parse' > from c:/ruby/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:42:in `parse' > from c:/ruby/lib/ruby/1.8/wsdl/importer.rb:31:in `parse' > from c:/ruby/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:30:in `import' > from c:/ruby/lib/ruby/1.8/wsdl/importer.rb:18:in `import' > from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:124:in `import' > from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:28:in `initialize' > from (irb):9:in `new' > from (irb):9 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Fri May 11 12:27:47 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 11 May 2007 11:27:47 -0500 Subject: [Wtr-general] Watir/FireWatir merge/refactoring suggestion: down_load_time In-Reply-To: <72799cd70705101918k619c8e7fuff13df6f43242bec@mail.gmail.com> References: <72799cd70705101918k619c8e7fuff13df6f43242bec@mail.gmail.com> Message-ID: <46449983.6030603@pettichord.com> Please submit this in Jira. I plan to start making changes such as this (i.e. that will cause compatability problems with prior versions) in Watir 1.6. Chris McMahon wrote: > I had occasion today to measure page load times in anger using > FireWatir. I don't have a regular Watir installation handy, but I > know Watir tracks the latest page load times in a variable called > "down_load_time" or "download_time" or something similar. > > FireWatir doesn't have this feature. I used the venerable > wrap-a-timer-around-the-click technique stolen from Mike Kelly, which > is pretty painless, but it made me think. > > I'd like to make two suggestions: first, that the value be renamed > "page_load_time" instead of "down_load_time", because "page loads" and > "downloads" are different things. > Second, that this value be added to FireWatir at the same time that > it's refactored in Watir. > > And, it would be really nifty if Watir and FireWatir could actually > share the same physical code files, such that a change to the function > of "page_load_time" would be instantly available to both platforms. > That is the plan. > It seems to me that this would be a good spike to explore merging the > shared code between the two platforms. > > I could, of course, be wrong, but I thought making the suggestion was > worthwhile. > Bret From bret at pettichord.com Fri May 11 12:38:52 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 11 May 2007 11:38:52 -0500 Subject: [Wtr-general] FireWatir doesn't ignore if it doesn't exists but In-Reply-To: <35273878.1881178883150498.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <35273878.1881178883150498.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <46449C1C.2040306@pettichord.com> I was confused about your problem. It now looks like this is a FireWatir bug. Bret From bret at pettichord.com Fri May 11 12:43:25 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 11 May 2007 11:43:25 -0500 Subject: [Wtr-general] Using an ie.table.each do |row| loop when thepagein the ie window refreshes itself In-Reply-To: <68f4a0e80705091604k6c1020e7p90b03eaff0d201b2@mail.gmail.com> References: <353BA7F10699794198CD75B3033E62AA02314AA9@washnt57.acs.org> <68f4a0e80705051554l24c0f4e0t1cd6385633d2d4c4@mail.gmail.com> <353BA7F10699794198CD75B3033E62AA025212E0@washnt57.acs.org> <68f4a0e80705080618s6ad6d287j779747d504676fa3@mail.gmail.com> <353BA7F10699794198CD75B3033E62AA0252153C@washnt57.acs.org> <68f4a0e80705091604k6c1020e7p90b03eaff0d201b2@mail.gmail.com> Message-ID: <46449D2D.4070907@pettichord.com> Ethan Jewett wrote: > Ticket entered: http://jira.openqa.org/browse/WTR-149 > > Ian's point about 0-indexing vs. 1-indexing is noted in the ticket. > Perhaps this should only be a candidate for inclusion in Watir 1.6? > I concur. Thanks for the suggestion. Bret From forum-watir-users at openqa.org Fri May 11 13:13:51 2007 From: forum-watir-users at openqa.org (Jason) Date: Fri, 11 May 2007 12:13:51 CDT Subject: [Wtr-general] Unable to locate object using :url => /{variable}/ Message-ID: <24282014.9411178903661946.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Really quick one... Trying to identify and click a link on a page, using the following: $ie.link(:url => /testing_URL/, :text => /More.../).click Where "testing_URL" is a variable I'm passing the script in a loop. In the first instance, the variable value is *search-requests*. The actual links in the code look something like: More... I'm receiving the following error: "Unable to locate object, using text(?-mix:More...)urlsearch-24hours and" It's probably quite simple, I suspect my understanding of the "/" characters and use of the variable is making life difficult for myself. Any quick assistance? (Sorry, google searching for this proved very difficult, so apologies.) From forum-watir-users at openqa.org Fri May 11 13:45:48 2007 From: forum-watir-users at openqa.org (Ravi) Date: Fri, 11 May 2007 12:45:48 CDT Subject: [Wtr-general] Unable to locate object using :url => /{variable}/ In-Reply-To: <24282014.9411178903661946.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36561750.9831178905578105.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> If testing_URL is a variable, I guess, it should be used without the slashes "//". Or, this also may work: $ie.link(:url => /#{testing_URL}/, :text => /More.../).click From christopher.mcmahon at gmail.com Fri May 11 13:48:56 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 11 May 2007 11:48:56 -0600 Subject: [Wtr-general] Web Service client call from Ruby. In-Reply-To: <046501c793e8$86072760$6400a8c0@laptop> References: <28666169.9251178900234511.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <046501c793e8$86072760$6400a8c0@laptop> Message-ID: <72799cd70705111048y5dfb6fa0i80cb91669bb7bea0@mail.gmail.com> On 5/11/07, Paul Rogers wrote: > the unknown element : {} html probably means you are getting an html > response back from the server - visit the url with a browser to make sure > you are not getting an error message Yes. The target for your connection should point to an XML page containing a WSDL spec for the SOAP API in question. -C "how 'bout them acronyms" M From forum-watir-users at openqa.org Fri May 11 14:57:07 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Fri, 11 May 2007 13:57:07 CDT Subject: [Wtr-general] Unable to load watir/contrib/enabled_popup In-Reply-To: <34042383.4291174041765257.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <34240143.10111178909858624.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello, After I installed watir-1.5.1.1164.gem, I still see this error message:c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- enabled_popup (LoadError). Need help. Thanks! Kui From charley.baker at gmail.com Fri May 11 15:25:35 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 11 May 2007 13:25:35 -0600 Subject: [Wtr-general] Unable to load watir/contrib/enabled_popup In-Reply-To: <34240143.10111178909858624.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <34042383.4291174041765257.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <34240143.10111178909858624.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: looks like you didn't uninstall watir 1.4.1, the error is coming from site_ruby where that's installed. Uninstall Watir 1.4.1 and try it again. -c On 5/11/07, Kui Zhang wrote: > > Hello, > > After I installed watir-1.5.1.1164.gem, I still see this error > message:c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require': no such file to load -- enabled_popup (LoadError). > > Need help. > > Thanks! > Kui > _______________________________________________ > 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/20070511/d765ad1d/attachment.html From forum-watir-users at openqa.org Fri May 11 16:26:44 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Fri, 11 May 2007 15:26:44 CDT Subject: [Wtr-general] Unable to load watir/contrib/enabled_popup In-Reply-To: Message-ID: <41379592.631178915234108.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks charley! Here is what I did: 1. Uninstall Watir 1.4 2. Uninstall Ruby 3. Restart machine 4. Install Ruby 5. gem install --local watir to install gem 1.5 After restart machine, I still see the same error. Did I miss something? Kui From charley.baker at gmail.com Fri May 11 17:04:08 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 11 May 2007 15:04:08 -0600 Subject: [Wtr-general] Unable to load watir/contrib/enabled_popup In-Reply-To: <41379592.631178915234108.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <41379592.631178915234108.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Where are you running the last command from and where is your watir gem? open up irb at the command line and type the following: irb>require 'watir' irb>puts Watir::IE::VERSION My guess is it's still 1.4 something. Exit irb and type this: gem list --local watir or check your path, at the command prompt type set path Perhaps you're refering to a different ruby install on your path? These are my best guesstimates and troubleshooting guidelines. -Charley On 5/11/07, Kui Zhang wrote: > > Thanks charley! > > Here is what I did: > 1. Uninstall Watir 1.4 > 2. Uninstall Ruby > 3. Restart machine > 4. Install Ruby > 5. gem install --local watir to install gem 1.5 > > After restart machine, I still see the same error. Did I miss something? > > Kui > _______________________________________________ > 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/20070511/cd5c0c9f/attachment.html From forum-watir-users at openqa.org Fri May 11 17:56:58 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Fri, 11 May 2007 16:56:58 CDT Subject: [Wtr-general] Unable to load watir/contrib/enabled_popup In-Reply-To: Message-ID: <38052139.1021178920648418.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> My water gem is installed in C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.1.1164\Watir I verified the water version and ruby path. They looked correct. I restarted machine again and now seems working. When run script with: require 'watir' require 'watir\contrib\enabled_popup' Do not receive the error message ?enabled_popup (LoadError).? anymore. I think I am ok for now. Thanks so much for your help! Have a great weekend. Kui From forum-watir-users at openqa.org Fri May 11 19:35:44 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Fri, 11 May 2007 18:35:44 CDT Subject: [Wtr-general] Handling popup message In-Reply-To: Message-ID: <22509463.1361178926574606.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello Charley, I am having a difficult time with handling popup window too. I followed your suggestion and used the second example. I just want to click cancel button on the file download window to close it. The script run complete with Exit code: 0 (please see the code below), but the file download window is still open. Any suggestions, please. I really appreciate your help. Kui # A Better Popup Handler using the latest Watir version. Posted by Mark_cain at rl.gov # require 'watir' require 'watir\contrib\enabled_popup' # def startClicker( button , waitTime= 9, user_input=nil ) # get a handle if one exists hwnd = $ie.enabled_popup(waitTime) if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) w.setTextValueForFileNameField( hwnd, "#{user_input}" ) end # I put this in to see the text being input it is not necessary to work sleep 3 # "OK" or whatever the name on the button is w.clickWindowsButton_hwnd( hwnd, "#{button}" ) # # this is just cleanup w=nil end end # # MAIN APPLICATION CODE # $ie = Watir::IE.start( "http://localhost:8080/cc/ClaimCenter.do" ) # This is whatever object that uses the click method. # You MUST use the click_no_wait method. $ie.frame(:name, "top_frame").button(:id, "ClaimNewDocumentLinkedWorksheet:NewDocumentLinkedScreen:DocumentAttachmentDV:Attachment").click_no_wait # # 3rd parameter is optional and is used for input and file dialog boxes. startClicker( "Calcel", 7 , "" ) # # Main application code follows From jeff.fry at gmail.com Fri May 11 22:14:53 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Fri, 11 May 2007 19:14:53 -0700 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <464166F7.6030000@pettichord.com> References: <46412CAC.1030801@gmail.com> <464166F7.6030000@pettichord.com> Message-ID: <4645231D.9000608@gmail.com> Hey all, I think it's time for an rdoc progress report. *Done:* changes.rb - split out from readme.rb, and updated from Jira license.rb - split out from readme.rb readme.rb * Deleted changes, license, and to-do list. * Added examples of identifying elements with 2 identifying characteristics. watir.rb * Updated button method with additional hows (:class, :text), additional Typical Usage, examples of accessing an element with multiple attributes, and an example of accessing a button nested within another element. (I am considering whether to do this for all Elements, or to use a different tactic. See my questions, below.) * Other minor, mostly typographical changes *Questions: *changes.rb and license.rb * What do I need to do so that these will be listed in the rdoc (as they are for rspec and rails)? When I rolled my own rdoc, I don't see these under Files. changes.rb * This list is all features, improvements, and bugs listed in Jira for Watir 1.5, with a resolution of fixed + unresolved ones. It excludes tasks, sub-tasks, and anything with a resolution other than fixed. Is this what we want? * All all our new features included on this list? (e.g. It seems that modal dialog support is NOT obviously a part of any of these features or improvements. Do we have new features without corresponding Jira items?) watir.rb * :method and :action are listed as permissible 'how' types for the initialize method. What do they mean? Where else are they usable? * Think about how best to lay out hows & whats. Please comment. o The current strategy is to list every how value for each element, with usage hints. (My edits to button are in keeping with this strategy.) + Benefits: This has the benefit of having a lot of information right by each Element method, including examples specific to that Element. + Downside: more work to maintain in multiple places, and more opportunities for information to get out of sync. o An alternate strategy (mentioned by Brett in an earlier email) would be to centralize this information - somewhere in the rdoc or on the wiki - with links to it from each Element. + Benefit: easier to maintain, can't get out of sync. Also a less verbose rdoc. + Possibly not as clear for someone unfamiliar with Watir. I've attached a patch of all the changes I've made so far so that interested folks can check it out. (BTW, this is the first patch I've created, and I was surprised to see that it's just a txt file. If this /isn't /correct, please let me know. I created it using these instructions .) Cheers, Jeff http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070511/84cab476/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: doc-patch-070511.zip Type: application/x-zip-compressed Size: 8345 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20070511/84cab476/attachment-0001.bin From forum-watir-users at openqa.org Sat May 12 03:03:58 2007 From: forum-watir-users at openqa.org (qadude123) Date: Sat, 12 May 2007 02:03:58 CDT Subject: [Wtr-general] Does anyone know how to capture an entire screen and compare with image? Message-ID: <38450891.1471178953468982.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I'm a newbie with Watir and Ruby. I would like to capture the entire page and compare it to another image. I've seen that there is a ruby file called screen_capture.rb. How do I get this file? Does anyone have any working code to capture the entire screen ....including the part that's scrolled off the screen? Thanks for any suggestions From forum-watir-users at openqa.org Sat May 12 08:08:10 2007 From: forum-watir-users at openqa.org (Jason) Date: Sat, 12 May 2007 07:08:10 CDT Subject: [Wtr-general] Unable to locate object using :url => /{variable}/ In-Reply-To: <36561750.9831178905578105.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36416348.1881178971720290.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I've definitely tried it with and without the slashes "//". I also tried these slashes within the variable itself, and even tried escaping the slashes with "\", with no luck. I'll be certain to try the "{}" and "#" on Monday - hopefully will do the trick. From areed at relocationcentral.com Sat May 12 11:03:32 2007 From: areed at relocationcentral.com (Adam Reed) Date: Sat, 12 May 2007 10:03:32 -0500 Subject: [Wtr-general] Does anyone know how to capture an entire screen and compare with image? In-Reply-To: <38450891.1471178953468982.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <38450891.1471178953468982.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36B5DBA88E027F47812ED877C6A978D801372DCF@rc-mail.relocationcentral.com> Screen_capture.rb is in your watir/unitTests directory when you install watir. As for taking a screenshot and automatically comparing that to another image -- I don't think that's possible with today's technology. Your probably meant manually. The first thing that comes to mind for capturing the entire screen including the portion underneath the current view, you would have to use anchor tags within the lower section of the page, and then hit each of those anchors and take a screenshot. Adam -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of qadude123 Sent: Saturday, May 12, 2007 2:04 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Does anyone know how to capture an entire screen and compare with image? Hi, I'm a newbie with Watir and Ruby. I would like to capture the entire page and compare it to another image. I've seen that there is a ruby file called screen_capture.rb. How do I get this file? Does anyone have any working code to capture the entire screen ....including the part that's scrolled off the screen? Thanks for any suggestions _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From sergio.pinon at us.g4s.com Sat May 12 14:21:43 2007 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Sat, 12 May 2007 11:21:43 -0700 Subject: [Wtr-general] Does anyone know how to capture an entire screen and compare with image? Message-ID: <007901c794c2$c4db5be8$0901a8c0@ems.securicor.com> Back in February I attended the dt/td summit. There someone presented on how they captured screens and diffed them using a software called Eggplant. I can see if I can find the information. Chris McMahon might also have it. -----Original Message----- From: "qadude123" To: "wtr-general at rubyforge.org" Sent: 5/12/2007 12:07 AM Subject: [Wtr-general] Does anyone know how to capture an entire screen and compare with image? Hi, I'm a newbie with Watir and Ruby. I would like to capture the entire page and compare it to another image. I've seen that there is a ruby file called screen_capture.rb. How do I get this file? Does anyone have any working code to capture the entire screen ....including the part that's scrolled off the screen? Thanks for any suggestions _______________________________________________ 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/20070512/a92cf733/attachment.html From sergio.pinon at us.g4s.com Sat May 12 15:06:34 2007 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Sat, 12 May 2007 12:06:34 -0700 Subject: [Wtr-general] Does anyone know how to capture an entire screenand compare with image? References: <007901c794c2$c4db5be8$0901a8c0@ems.securicor.com> Message-ID: <4D7FC2322B85B848A0A766D1D364D43607EFEE@bugatti.ems.securicor.com> Ok here is the information that I was talking about. I don't actually have working samples but in the pdf he talks about the comparisons that he did and what he used to compare them. I don't know how you would automate it but here is the information. http://model.based.testing.googlepages.com/exploratory-automation.pdf Hope this helps! -----Original Message----- From: wtr-general-bounces at rubyforge.org on behalf of Sergio Pinon Sent: Sat 5/12/2007 11:21 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Does anyone know how to capture an entire screenand compare with image? Back in February I attended the dt/td summit. There someone presented on how they captured screens and diffed them using a software called Eggplant. I can see if I can find the information. Chris McMahon might also have it. -----Original Message----- From: "qadude123" To: "wtr-general at rubyforge.org" Sent: 5/12/2007 12:07 AM Subject: [Wtr-general] Does anyone know how to capture an entire screen and compare with image? Hi, I'm a newbie with Watir and Ruby. I would like to capture the entire page and compare it to another image. I've seen that there is a ruby file called screen_capture.rb. How do I get this file? Does anyone have any working code to capture the entire screen ....including the part that's scrolled off the screen? Thanks for any suggestions _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3594 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20070512/f81d8975/attachment.bin From jeff.fry at gmail.com Sat May 12 16:54:45 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Sat, 12 May 2007 13:54:45 -0700 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <464166F7.6030000@pettichord.com> References: <46412CAC.1030801@gmail.com> <464166F7.6030000@pettichord.com> Message-ID: <46462995.7090207@gmail.com> Hmm. I tried sending this yesterday (with a draft of a patch attached) but it seems like it didn't make it through. Apologies if both versions somehow /do /come through. This time I just uploaded the patch of my changes so far to here: http://wiki.openqa.org/pages/viewpageattachments.action?pageId=2068 ================================================== Hey all, I think it's time for an rdoc progress report. * **Done:* changes.rb - split out from readme.rb, and updated from Jira license.rb - split out from readme.rb readme.rb * Deleted changes, license, and to-do list. * Added examples of identifying elements with 2 identifying characteristics. watir.rb * Updated button method with additional hows (:class, :text), additional Typical Usage, examples of accessing an element with multiple attributes, and an example of accessing a button nested within another element. (I am considering whether to do this for all Elements, or to use a different tactic. See my questions, below.) * Other minor, mostly typographical changes *Questions: *changes.rb and license.rb * What do I need to do so that these will be listed in the rdoc (as they are for rspec and rails)? When I rolled my own rdoc, I don't see these under Files. changes.rb * This list is all features, improvements, and bugs listed in Jira for Watir 1.5, with a resolution of fixed + unresolved ones. It excludes tasks, sub-tasks, and anything with a resolution other than fixed. Is this what we want? * All all our new features included on this list? (e.g. It seems that modal dialog support is NOT obviously a part of any of these features or improvements. Do we have new features without corresponding Jira items?) watir.rb * :method and :action are listed as permissible 'how' types for the initialize method. What do they mean? Where else are they usable? * Think about how best to lay out hows & whats. Please comment. o The current strategy is to list every how value for each element, with usage hints. (My edits to button are in keeping with this strategy.) + Benefits: This has the benefit of having a lot of information right by each Element method, including examples specific to that Element. + Downside: more work to maintain in multiple places, and more opportunities for information to get out of sync. o An alternate strategy (mentioned by Brett in an earlier email) would be to centralize this information - somewhere in the rdoc or on the wiki - with links to it from each Element. + Benefit: easier to maintain, can't get out of sync. Also a less verbose rdoc. + Possibly not as clear for someone unfamiliar with Watir. readme.rb * Zeljko, do you know where the new User Guide will live? For now I'm linking to Jonathan's old one at: http://wtr.rubyforge.org/watir_user_guide.html I've attached a patch of all the changes I've made so far so that interested folks can check it out. (BTW, this is the first patch I've created, and I was surprised to see that it's just a txt file. If this /isn't /correct, please let me know. I created it using these instructions .) Cheers, Jeff http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070512/a0cffe22/attachment-0001.html From zeljko.filipin at gmail.com Sat May 12 17:32:00 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Sat, 12 May 2007 23:32:00 +0200 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <46462995.7090207@gmail.com> References: <46412CAC.1030801@gmail.com> <464166F7.6030000@pettichord.com> <46462995.7090207@gmail.com> Message-ID: On 5/12/07, Jeff Fry wrote: > Zeljko, do you know where the new User Guide will live? Somewhere in the wiki. I will have some time at Tuesday. -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070512/04ed3155/attachment.html From rdewolfe at Credant.com Sat May 12 18:39:21 2007 From: rdewolfe at Credant.com (Russ DeWolfe) Date: Sat, 12 May 2007 17:39:21 -0500 Subject: [Wtr-general] script does not run when converted to test unit, etc. Message-ID: Since I put my script in to a test_ file and attempted to run it from a run_all_tests script w/ class, etc. like the example in the unittests directory, I get the following error, and I cannot figure out what the problem is??: >ruby all_cmg_tests.rb Action: Open Internet Explorer and go to the test site: https://qa2.ctdev.com:8082/ Action: Open file: C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.1.1164\CMG_tests\Policy_Informa tion.xls Action: Enter superadmin in the 'username' text field Action: Enter changeit in the 'password' text field Action: Click the 'Log In' button Action: Check that the 'Home' link appears on the page and return true/false Loaded suite all_cmg_tests Started Action: Go to windows sheet Action: Verify default local values for device: windows Action: Click default policies 'Menu Item' E. Finished in 0.031 seconds. 1) Error: test_Policy_Drop_Down_Possible_Values(TC_Policies): WIN32OLERuntimeError: unknown property or method `document' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1775:in `method_missing' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1775:in `document' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1157:in `each_element' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1166:in `locate' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1123:in `locate_tagged_element' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:3201:in `locate' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:2412:in `assert_exists' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:3260:in `[]' ./utilities.rb:97:in `clickMenuItem' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./CMG_tests/policy_test. rb:22:in `test_Policy_Drop_Down_Possible_Values' 2 tests, 0 assertions, 0 failures, 1 errors >Exit code: 0 Here is my code(NOTE: everything works fine in it's own script) policy_test: #includes: require 'rubygems' gem 'watir' require 'watir' require 'pp' require 'utilities' require 'test/unit/testcase' require 'win32ole' require 'unittests/setup' class TC_Policies < Test::Unit::TestCase include Watir def setup #~ clickMenuItem($ie, "default policies") end def test_Policy_Drop_Down_Possible_Values() sheet = selectPolicyExcelSheet('windows') puts " Action: Verify default local values for device: " + 'windows' clickMenuItem($ie, "default policies") clickPolicyTab($ie, 'windows') allPopulatedCells = sheet.Range('a2:a200').value# The data is in the cell(s) listed for i in 2..allPopulatedCells.length+1 #~ debugfor i in 2..2+1 currentCell = (i).to_s indexCell = INDEX_COLUMN + currentCell index = sheet.Range(indexCell).value.to_s #get value of single cell controlTypeCell = CONTROL_TYPE_COLUMN + currentCell controlType = sheet.Range(controlTypeCell).value.to_s #get value of single cell if index != "" and controlType == "drop down" index = index.strip.sub(/\.0+$/,'') policyCell = POLICY_NAME_COLUMN + (i).to_s policyName = sheet.Range(policyCell).value.to_s #get value of single cell possibleValuesCell = POSSIBLE_VALUES_COLUMN + (i).to_s expectedValue = sheet.Range(possibleValuesCell).value.to_s #get value of single cell expectedValue = expectedValue.strip.sub(/\.0+$/,'') deviceName = convertToUIName('windows')# strip off junk actualValue = $ie.select_list(:id, deviceName + '.' + index + '.input_value').text.to_s while actualValue.rindex("\r") actualValue = actualValue.strip.sub(/\r/,'') end assert_equal( expectedValue, actualValue ) #~ if expectedValue == actualValue #~ tc_Pass = true #~ puts "PASS" #~ else #~ tc_Pass = false #~ puts "FAIL" #~ end #~ puts 'Excel Row: ' + (i).to_s #~ puts 'Policy Name: (' + 'deviceName' + ') ' + policyName #~ puts ' Expected default value: ' + expectedValue.inspect #~ puts ' Actual drop down value(s):' + actualValue.inspect end end return tc_Pass end def test_new end end ######################################################################## ########################### all_cmg_tests: require 'rubygems' gem 'watir' require 'utilities' #~ require 'test/unit/testcase' require 'test/unit' require 'win32ole' include Watir require 'LoginSuperadmin' require 'PolicyNoExtraPolicies' require 'PolicyDropDownPossibleValues' require 'PolicyDefaultLocalValues' require 'PolicyToolTipValues' TOPDIR = File.join(File.dirname(__FILE__), '..') $LOAD_PATH.unshift TOPDIR deviceList = ['windows', 'Pocket PC', 'Smartphone', 'Symbian', 'Blackberry' ] #Excel File Column Constants POLICY_NAME_COLUMN = 'a' POSSIBLE_VALUES_COLUMN='b' DEFAULT_VALUES_COLUMN = 'c' TOOL_TIP_COLUMN = 'e' INDEX_COLUMN = 'g' CONTROL_TYPE_COLUMN = 'h' cmgServerName = 'qa2' openCMGServer(cmgServerName) openPolicyExcelFile() login("superadmin","changeit") topdir = File.join(File.dirname(__FILE__), '..') Dir.chdir topdir do $all_tests = Dir["CMG_tests/*_test.rb"] end Dir.chdir TOPDIR $all_tests.each {|x| require x} -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070512/9935a36c/attachment.html From tunde.jinadu at gmail.com Sat May 12 19:01:15 2007 From: tunde.jinadu at gmail.com (Tunde Jinadu) Date: Sun, 13 May 2007 00:01:15 +0100 Subject: [Wtr-general] reading cell data into an array Message-ID: <1624b0140705121601m2cbb02bci51edd3c87f822c1c@mail.gmail.com> Hi, I'm looking to read the data from a spreadsheet cell into an array, a series of five digits. I need data in an array to enable me read the values according to a random prompt for two of the five digits that will be in the array with respect to their positions in the array. The problem I have is the data/values captured from the cell are indexed as one group, not distinct values... any help will do in achieving indexing a number of digits from an individual spreadsheet cell into an array and each digit referenced. thanks. -- The second half of a man's life is made up of nothing but the habits he has acquired during the first half. - Fyodor Dostoevsky -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070513/b7bf95be/attachment.html From crasch at gmail.com Mon May 14 00:28:55 2007 From: crasch at gmail.com (Christopher Rasch) Date: Sun, 13 May 2007 21:28:55 -0700 Subject: [Wtr-general] Watir user groups? Message-ID: <4647E587.7010405@gmail.com> Hi, Are there any watir user groups? If so, are there any in the Bay Area? Thanks! Chris From forum-watir-users at openqa.org Mon May 14 01:36:59 2007 From: forum-watir-users at openqa.org (Vipul) Date: Mon, 14 May 2007 00:36:59 CDT Subject: [Wtr-general] Solution for FAQ "Using key/value pairs" not working In-Reply-To: Message-ID: <37560377.4581179121049988.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> yes i have checked the casing input.rb class LoginInput @@userName = "Vipul.Goyal" end main.rb $ie.text_field(:id,"txtLoginID").set(LoginInput.userName) exception 'undefined method `userName' for LoginInput:Class (NoMethodError)' From forum-watir-users at openqa.org Mon May 14 01:46:25 2007 From: forum-watir-users at openqa.org (Vipul) Date: Mon, 14 May 2007 00:46:25 CDT Subject: [Wtr-general] Load testing with Watir Message-ID: <26602179.4641179121615395.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi we have 'concurrent_search.rb" example in Watir example folder. this example open 3 concurrent browser and perform the same action ie search string "pickaxe" on google page. i want different search string to be passed for each thread being executed. Is it possible?? For eg - define an array search = {"google","microsoft" , "excel"} now for each thread pass one of the array element like thread1 pass seach[1] , for thread2 pass search[2] and so on. this scenario is imp. when we putting load on authentication screen and need different login credentials for each thread. From forum-watir-users at openqa.org Mon May 14 02:47:31 2007 From: forum-watir-users at openqa.org (Vipul) Date: Mon, 14 May 2007 01:47:31 CDT Subject: [Wtr-general] Watir - Asserting pop-up appears on click a button. Message-ID: <31565912.4701179125281058.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> hi i want to assert whether pop screen appear or not on clicking a button. Can anybody suggest a way to do this. From peter at rubyrailways.com Mon May 14 03:26:52 2007 From: peter at rubyrailways.com (Peter Szinek) Date: Mon, 14 May 2007 09:26:52 +0200 Subject: [Wtr-general] scrolling? Message-ID: <46480F3C.60009@rubyrailways.com> Hey guys, First of all, thanks for this really great tool! I would like to take a snapshot of the whole page currently rendered inside the browser. Of course if the page 'does not fit' inside the browser window, scrolling is needed to view the whole page. Is this possible currently? If yes, how? More specifically, is it possible with FireWatir? Cheers, Peter From aidy.lewis at googlemail.com Mon May 14 04:25:16 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Mon, 14 May 2007 09:25:16 +0100 Subject: [Wtr-general] Solution for FAQ "Using key/value pairs" not working In-Reply-To: <37560377.4581179121049988.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <37560377.4581179121049988.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <7ac2300c0705140125g359acf42ya98e12de23554134@mail.gmail.com> On 14/05/07, Vipul wrote: > class LoginInput > @@userName = "Vipul.Goyal" > end > $ie.text_field(:id,"txtLoginID").set(LoginInput.userName) I think the OO idea is that the client should not be able to directly access a variable outside a class. class Login_Input attr_reader :user_name def initialize @user_name = "Vipul.Goyal" end end login_input = Login_Input.new p login_input.user_name Though, I would be interested in other opinions on this. aidy From forum-watir-users at openqa.org Mon May 14 05:16:57 2007 From: forum-watir-users at openqa.org (Maloy kanti debnath) Date: Mon, 14 May 2007 04:16:57 CDT Subject: [Wtr-general] Not able to identify a pop up Message-ID: <31900620.6351179134247234.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> hi all, I have a problem i have to click a pop up ok button after i select a item from a select list ... now the problem is i am not able to click that ok button...i tried with cilck_no_wait....... i am not able to use click_no_wait because i am not actually clicking anyting ....how can i make watir recognize the pop up thanks in advance, maloy From forum-watir-users at openqa.org Mon May 14 05:22:00 2007 From: forum-watir-users at openqa.org (reinier) Date: Mon, 14 May 2007 04:22:00 CDT Subject: [Wtr-general] length not recognized for array within a class Message-ID: <35533066.6411179134550280.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi all, I receive an error stating that the method 'length' is not recognized. I am using it at an array that exists within a class. The error occurs at the line stating: nLength = @aObjects.length within the method of addObject(object) I think that it doesn't see @aObjects as an array, but I can't figure out why. Any help? Code: class CLWindow @strWindowName @aObjects = Array.new def setWindowName(windowname) @strWindowName = windowname end def getWindowName() return @strWindowName end def addObject(object) nLength = @aObjects.length @aObjects.insert(nLength, object) end def getObject(strName, strType, strFysDes) i = 0; if (strName!='') then while (aObjects[i].getObjectName()!=strName)and(i<=aObjects.length) i=i+1 end else if (strType!='') then while (aObjects[i].getObjectType()!=strType)and(i<=aObjects.length) i=i+1 end else if (strFysDes!='') then while (aObjects[i].getFysicalDescription()!=strFysDes)and(i<=aObjects.length) i=i+1 end else return -1 end end end if (i>aObjects.length) then return -1 else return aObjects[i] end end end From forum-watir-users at openqa.org Mon May 14 05:28:29 2007 From: forum-watir-users at openqa.org (vijay) Date: Mon, 14 May 2007 04:28:29 CDT Subject: [Wtr-general] Need to check whether a message indicating whether Message-ID: <30496743.6471179134939180.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello people, In our application, there are a few text_fields and a save button. When the 'save' button is clicked without giving any input for any of these text fields, the application would display a text, ' * Required' besides the appropriate text field but in the same window. Now, I want to check whether this ' * Required' text is given out besides a text field when the 'save' button is clicked without giving input for that text field. How can I do that? The ' * Required' text is always present in the fourth column of the table cell in which each of the text fields are present. It is present as a 'span' with a few properties, including the 'id' property. No matter whether the ' * Required' text is present or not on the screen, the command 'ie.text' outputs the ' * Required' text because it is permanently present in a table cell. The only indication for the presence of the ' * Required' text is that the change of values for two of the enclosing span's properties named "display(css)" and "isValid". When the ' * Required' text is present, the enclosing span's "display(css)" property has a value "none" and the enclosing span's "isValid" property has a value "0". When the ' * Required' text is present, the enclosing span's "display(css)" property has a value "inline" and the enclosing span's "isValid" property has a value "-1". In this situation, how do I check whether the ' * Required' text is actually given out or not? Thanks in Advance, Vijay From forum-watir-users at openqa.org Mon May 14 05:40:09 2007 From: forum-watir-users at openqa.org (gary) Date: Mon, 14 May 2007 04:40:09 CDT Subject: [Wtr-general] Having trouble capturing text in java alert In-Reply-To: <30476307.13271178720133216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <27840209.6531179135640008.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Any more ideas anyone, surely I'm not the only one with this problem? From forum-watir-users at openqa.org Mon May 14 05:51:10 2007 From: forum-watir-users at openqa.org (gary) Date: Mon, 14 May 2007 04:51:10 CDT Subject: [Wtr-general] Can't seem to get ".equal?" to work Message-ID: <38740862.6761179136300893.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, assert_equal works a treat but .equal? always fails, any ideas? signin = @IE0.frame("mainframe").link( :id, @header.signinLink) signintext = signin.text # test 1 - assert assert_equal(signintext, "Sign In") # test 2 - if & then if signintext.equal?("Sign In") puts 'pass' else puts 'fail' end stop From forum-watir-users at openqa.org Mon May 14 06:16:00 2007 From: forum-watir-users at openqa.org (gary) Date: Mon, 14 May 2007 05:16:00 CDT Subject: [Wtr-general] Can't seem to get ".equal?" to work In-Reply-To: <38740862.6761179136300893.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <26634373.7341179137790868.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> A bit slow this morning. Please ignore. From aidy.lewis at googlemail.com Mon May 14 06:22:29 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Mon, 14 May 2007 11:22:29 +0100 Subject: [Wtr-general] Solution for FAQ "Using key/value pairs" not working Message-ID: <7ac2300c0705140322r26261c5cue91811638ab6478d@mail.gmail.com> >On 14/05/07, Vipul wrote: > class LoginInput > @@userName = "Vipul.Goyal" > end > $ie.text_field(:id,"txtLoginID").set(LoginInput.userName) I think the OO idea is that the client should not be able to directly access a variable outside a class. class Login_Input attr_reader :user_name def initialize @user_name = "Vipul.Goyal" end end login_input = Login_Input.new p login_input.user_name Though, I would be interested in other opinions on this. aidy From Mark_Cain at RL.gov Mon May 14 09:55:53 2007 From: Mark_Cain at RL.gov (Cain, Mark) Date: Mon, 14 May 2007 06:55:53 -0700 Subject: [Wtr-general] Handling popup message In-Reply-To: <22509463.1361178926574606.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <22509463.1361178926574606.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A37C6@EX01-2.rl.gov> You misspelled Cancel startClicker( "Calcel", 7 , "" ) --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Kui Zhang Sent: Friday, May 11, 2007 4:36 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Handling popup message Hello Charley, I am having a difficult time with handling popup window too. I followed your suggestion and used the second example. I just want to click cancel button on the file download window to close it. The script run complete with Exit code: 0 (please see the code below), but the file download window is still open. Any suggestions, please. I really appreciate your help. Kui # A Better Popup Handler using the latest Watir version. Posted by Mark_cain at rl.gov # require 'watir' require 'watir\contrib\enabled_popup' # def startClicker( button , waitTime= 9, user_input=nil ) # get a handle if one exists hwnd = $ie.enabled_popup(waitTime) if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) w.setTextValueForFileNameField( hwnd, "#{user_input}" ) end # I put this in to see the text being input it is not necessary to work sleep 3 # "OK" or whatever the name on the button is w.clickWindowsButton_hwnd( hwnd, "#{button}" ) # # this is just cleanup w=nil end end # # MAIN APPLICATION CODE # $ie = Watir::IE.start( "http://localhost:8080/cc/ClaimCenter.do" ) # This is whatever object that uses the click method. # You MUST use the click_no_wait method. $ie.frame(:name, "top_frame").button(:id, "ClaimNewDocumentLinkedWorksheet:NewDocumentLinkedScreen:DocumentAttachm entDV:Attachment").click_no_wait # # 3rd parameter is optional and is used for input and file dialog boxes. startClicker( "Calcel", 7 , "" ) # # Main application code follows _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Mark_Cain at RL.gov Mon May 14 10:12:52 2007 From: Mark_Cain at RL.gov (Cain, Mark) Date: Mon, 14 May 2007 07:12:52 -0700 Subject: [Wtr-general] Not able to identify a pop up In-Reply-To: <31900620.6351179134247234.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <31900620.6351179134247234.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A37C7@EX01-2.rl.gov> <-- other requires omitted --> require 'watir/contrib/enabled_popup' reguire 'thread' def startClicker(ie, button) # Strart a new thread that will dismiss the JSPopup. t = Thread.new { w = WinClicker.new hwnd = $ie.enabled_popup(10) if nil == hwnd w.clickWindowsButton_hwnd(hwnd, button) t.join w = nil } End ... # Start the thread before it gets locked by the JSPopup startClicker( $ie, 'OK') # The set spawns a JSPopup $ie.checkBox( :name, "read_instructions").set --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Maloy kanti debnath Sent: Monday, May 14, 2007 2:17 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Not able to identify a pop up hi all, I have a problem i have to click a pop up ok button after i select a item from a select list ... now the problem is i am not able to click that ok button...i tried with cilck_no_wait....... i am not able to use click_no_wait because i am not actually clicking anyting ....how can i make watir recognize the pop up thanks in advance, maloy _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From charley.baker at gmail.com Mon May 14 11:37:07 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 14 May 2007 09:37:07 -0600 Subject: [Wtr-general] Solution for FAQ "Using key/value pairs" not working In-Reply-To: <7ac2300c0705140322r26261c5cue91811638ab6478d@mail.gmail.com> References: <7ac2300c0705140322r26261c5cue91811638ab6478d@mail.gmail.com> Message-ID: Ah, you're using a class variable and you have no accessor methods so it's only available to . You'll need to add a class accessor or an instance method if you're creating object of type LoginInput to get at the value: class LoginInput @@user_name = "Vipul.Goyal" def LoginInput.user_name @@user_name end end puts LoginInput.user_name => "Vipul.Goyal" # Now with instance: class LoginInput @@user_name = "Vipul.Goyal" def user_name @@user_name end end l = LoginInput.new puts l.user_name => "Vipul.Goyal" -Charley On 5/14/07, aidy lewis wrote: > > >On 14/05/07, Vipul wrote: > > > class LoginInput > > @@userName = "Vipul.Goyal" > > end > > > > $ie.text_field(:id,"txtLoginID").set(LoginInput.userName) > > > I think the OO idea is that the client should not be able to directly > access a variable outside a class. > > > class Login_Input > attr_reader :user_name > def initialize > @user_name = "Vipul.Goyal" > end > end > > login_input = Login_Input.new > p login_input.user_name > > > Though, I would be interested in other opinions on this. > > > aidy > _______________________________________________ > 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/20070514/f42758bb/attachment-0001.html From charley.baker at gmail.com Mon May 14 12:04:09 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 14 May 2007 10:04:09 -0600 Subject: [Wtr-general] length not recognized for array within a class In-Reply-To: <35533066.6411179134550280.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <35533066.6411179134550280.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi there, In this case you've created @aObjects as a class instance variable, which means it's not visible to instance methods. Add a constructor to set it up instead: class CLWindow def initialize @aObjects = Array.new end def add_object puts @aObjects.length end end cl = CLWindow.new cl.add_object => 0 Also watch out in your getObject method, it looks like you're using aObjects - which will now be a local method variable - instead of @aObjects. -Charley On 5/14/07, reinier wrote: > > Hi all, > > I receive an error stating that the method 'length' is not recognized. I > am using it at an array that exists within a class. > The error occurs at the line stating: nLength = @aObjects.length within > the method of addObject(object) > > I think that it doesn't see @aObjects as an array, but I can't figure out > why. > Any help? > > Code: > class CLWindow > @strWindowName > @aObjects = Array.new > > def setWindowName(windowname) > @strWindowName = windowname > end > def getWindowName() > return @strWindowName > end > def addObject(object) > nLength = @aObjects.length > @aObjects.insert(nLength, object) > end > def getObject(strName, strType, strFysDes) > i = 0; > if (strName!='') then > while > (aObjects[i].getObjectName()!=strName)and(i<=aObjects.length) > i=i+1 > end > else > if (strType!='') then > while > (aObjects[i].getObjectType()!=strType)and(i<=aObjects.length) > i=i+1 > end > else > if (strFysDes!='') then > while > (aObjects[i].getFysicalDescription()!=strFysDes)and(i<=aObjects.length) > i=i+1 > end > else > return -1 > end > end > end > if (i>aObjects.length) then > return -1 > else > return aObjects[i] > end > end > end > _______________________________________________ > 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/20070514/3736b1a5/attachment.html From charley.baker at gmail.com Mon May 14 12:10:14 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 14 May 2007 10:10:14 -0600 Subject: [Wtr-general] reading cell data into an array In-Reply-To: <1624b0140705121601m2cbb02bci51edd3c87f822c1c@mail.gmail.com> References: <1624b0140705121601m2cbb02bci51edd3c87f822c1c@mail.gmail.com> Message-ID: Can you give us an example of some of the data in the cell you're trying to collect into an array? You should be able to do something like splitting it into different strings possibly, depends on what you're getting from your cell. -Charley On 5/12/07, Tunde Jinadu wrote: > > Hi, > > I'm looking to read the data from a spreadsheet cell into an array, a > series of five digits. > I need data in an array to enable me read the values according to a random > prompt for two of the five digits that will be in the array with respect to > their positions in the array. > The problem I have is the data/values captured from the cell are indexed > as one group, not distinct values... any help will do in achieving indexing > a number of digits from an individual spreadsheet cell into an array and > each digit referenced. > thanks. > > -- > The second half of a man's life is made up of nothing but the habits he > has acquired during the first half. > - Fyodor Dostoevsky > _______________________________________________ > 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/20070514/3335c3d8/attachment.html From forum-watir-users at openqa.org Mon May 14 12:22:18 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Mon, 14 May 2007 11:22:18 CDT Subject: [Wtr-general] Handling popup message In-Reply-To: <4440693B7CFF2440ABC2E0BE480DABA10A37C6@EX01-2.rl.gov> Message-ID: <33777927.13931179159768080.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks Mark! After correcting the misspelled word, the script works now. Kui From forum-watir-users at openqa.org Mon May 14 13:07:27 2007 From: forum-watir-users at openqa.org (Eoin) Date: Mon, 14 May 2007 12:07:27 CDT Subject: [Wtr-general] Watir unit tests Message-ID: <29250063.14151179162477467.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have installed the Windows installer for Watir 1.4.1 I ran the unit tests and a lot of them failed. Are these bugs in Watir or is it something wrong with my environment? *-----------------------------------------------------------------------------------------------------------------------------------------------------* *core_tests.rb results* Finished in 85.581 seconds. 1) Failure: test_http_errors(TC_Navigate) [C:/Program Files/Watir/unittests/../unittests/navigate_test.rb:50]: exception expected but none was thrown. 2) Failure: test_navigation(TC_Navigate) [C:/Program Files/Watir/unittests/../unittests/navigate_test.rb:19]: <"file://c:/program%20files/watir/unittests/html/buttons1.html"> expected but was <"file://c:/program files/watir/unittests/html/buttons1.html">. 3) Failure: test_links_and_images_in_table(TC_Tables) [C:/Program Files/Watir/unittests/../unittests/table_test.rb:165]: <"106"> expected but was<"28">. 4) Failure: test_showLinks(TC_showlinks) [C:/Program Files/Watir/unittests/../unittests/links_test.rb:163:in `test_showLinks' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:963:in `each_with_index' C:/Program Files/Watir/unittests/../unittests/links_test.rb:163:in `each' C:/Program Files/Watir/unittests/../unittests/links_test.rb:163:in `each_with_index' C:/Program Files/Watir/unittests/../unittests/links_test.rb:163:in `test_showLinks']: <"1 file:///c:/program%20files/watir/unittests/html/links2.html test1"> expected to be =~ . 154 tests, 928 assertions, 4 failures, 0 errors *-----------------------------------------------------------------------------------------------------------------------------------------------------* *non_core_tests.rb results* Hangs and have to click about 11 different dialog boxes for the tests to run through Finished in 176.788 seconds. 1) Failure: test_imageHasLoaded(TC_Images) [C:/Program Files/Watir/unittests/../unittests/images_test.rb:76]: is not true. 2) Failure: test_image_properties(TC_Images) [C:/Program Files/Watir/unittests/../unittests/images_test.rb:104]: <"88"> expected but was<"30">. 3) Error: test_save_local_image(TC_Images): WIN32OLERuntimeError: navigate OLE error code:800704C7 in HRESULT error code:0x80020009 Exception occurred. c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1253:in `method_missing' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1253:in `goto' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2797:in `save' C:/Program Files/Watir/unittests/../unittests/images_test.rb:160:in `safe_file_block' C:/Program Files/Watir/unittests/../unittests/images_test.rb:160:in `each' C:/Program Files/Watir/unittests/../unittests/images_test.rb:160:in `safe_file_block' C:/Program Files/Watir/unittests/../unittests/images_test.rb:143:in `test_save_local_image' 4) Error: test_save_local_image_returns_original_page(TC_Images): WIN32OLERuntimeError: navigate OLE error code:800704C7 in HRESULT error code:0x80020009 Exception occurred. c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1253:in `method_missing' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1253:in `goto' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2797:in `save' C:/Program Files/Watir/unittests/../unittests/images_test.rb:160:in `safe_file_block' C:/Program Files/Watir/unittests/../unittests/images_test.rb:160:in `each' C:/Program Files/Watir/unittests/../unittests/images_test.rb:160:in `safe_file_block' C:/Program Files/Watir/unittests/../unittests/images_test.rb:153:in `test_save_local_image_returns_original_page' 5) Failure: test_confirm(TC_PopUps) [C:/Program Files/Watir/unittests/../unittests/popups_test.rb:36]: is not true. 28 tests, 107 assertions, 3 failures, 2 errors From forum-watir-users at openqa.org Mon May 14 13:50:14 2007 From: forum-watir-users at openqa.org (barry) Date: Mon, 14 May 2007 12:50:14 CDT Subject: [Wtr-general] Web Service client call from Ruby. In-Reply-To: <72799cd70705111048y5dfb6fa0i80cb91669bb7bea0@mail.gmail.com> Message-ID: <32394409.14211179165044775.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I now used this code snippet. From my WSDL, it clearly says my "createsite" function takes 4 argument. However, when I provide 4 arguments, Ruby errors out and say it only needs 1 argument. What is wrong here? require 'soap/wsdlDriver' wsdl_url = "https://staging-buzzsaw.buzzsaw.com/_bz_web/WebServices/SiteCreate/SiteCreateService.asmx?WSDL" soap = SOAP::WSDLDriverFactory.new(wsdl_url).create_rpc_driver result = soap.CreateSite("site_test0514","admin","Changeme1","test1234 at yahoo.com") ArgumentError: wrong number of arguments (4 for 1) from c:/ruby/lib/ruby/1.8/soap/rpc/driver.rb:230:in `createSite' from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:117:in `__send__' from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:117:in `CreateSite' from (irb):5 From forum-watir-users at openqa.org Mon May 14 15:06:08 2007 From: forum-watir-users at openqa.org (Lavanya) Date: Mon, 14 May 2007 14:06:08 CDT Subject: [Wtr-general] Problem retrieving data from an Ajax page In-Reply-To: <32742848.16721178741728060.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <28103736.401179169598861.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I was able to resolve the issue with ie.contains_text ("") Thanks for inputs on IE developer toolbar. From christopher.mcmahon at gmail.com Mon May 14 15:18:30 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 14 May 2007 13:18:30 -0600 Subject: [Wtr-general] Web Service client call from Ruby. In-Reply-To: <32394409.14211179165044775.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <72799cd70705111048y5dfb6fa0i80cb91669bb7bea0@mail.gmail.com> <32394409.14211179165044775.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70705141218k1e1f04cdj1af701b69ebab75d@mail.gmail.com> On 5/14/07, barry wrote: > I now used this code snippet. From my WSDL, it clearly says my "createsite" function takes 4 argument. However, when I provide 4 arguments, Ruby errors out and say it only needs 1 argument. What is wrong here? I'm going to suggest you take this to the soap4r mail list: http://groups.google.com/group/soap4r?hl=en From aidy.lewis at googlemail.com Mon May 14 16:20:05 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Mon, 14 May 2007 21:20:05 +0100 Subject: [Wtr-general] Solution for FAQ "Using key/value pairs" not working In-Reply-To: References: <7ac2300c0705140322r26261c5cue91811638ab6478d@mail.gmail.com> Message-ID: <7ac2300c0705141320o600ae7b5s99c465017044a9ab@mail.gmail.com> On 14/05/07, Charley Baker wrote: > class LoginInput > @@user_name = "Vipul.Goyal" > > def LoginInput.user_name > @@user_name > end > end > > puts LoginInput.user_name > => "Vipul.Goyal" > > # Now with instance: > class LoginInput > @@user_name = "Vipul.Goyal" > > def user_name > @@user_name > end > end > > l = LoginInput.new > puts l.user_name > => "Vipul.Goyal" Hi Charley, I looked at this http://www.rubycentral.com/book/tut_classes.html and it seems to validate the structure of your code. My question then is; does Ruby not allow short-cut accessor methods (attr_reader, attr_writer, attr_accessor) for class variables? And if so, why are they created and used only for instance variables? cheers aidy From bret at pettichord.com Mon May 14 17:09:02 2007 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 14 May 2007 16:09:02 -0500 Subject: [Wtr-general] Watir Development Gem 1.5.1.1166 Released Message-ID: A new gem is ready for download. This is the latest pull from Subversion source, tagged at 1.5.1.1166. Changes in this release include: * The "wait" method was completely rewritten. This should fix various errors seen in 1.5.1.1165 and 1.5.1.1158. * Removed the "spinner". http://wiki.openqa.org/display/WTR/Development+Builds Please take a look at this if you have seen the various errors associated with frames in the recent releases. The next release will probably include Jeff's Rdoc changes and a significant reworking of Watir that should prevent the dreaded RPC unavailable errors. We are getting very close to putting our releases directly on Rubyforge (again). But i would first like some confirmation that these fairly drastic changes have not introduced compatibility errors. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070514/1d683fa9/attachment.html From paul.rogers at shaw.ca Mon May 14 17:54:42 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 14 May 2007 15:54:42 -0600 Subject: [Wtr-general] Watir Development Gem 1.5.1.1166 Released References: Message-ID: <064a01c79672$7a34b060$6400a8c0@laptop> will you be providing some call back mechanism so I am able to add my own spinner when the page is loading? ----- Original Message ----- From: Bret Pettichord To: wtr-general at rubyforge.org Sent: Monday, May 14, 2007 3:09 PM Subject: [Wtr-general] Watir Development Gem 1.5.1.1166 Released A new gem is ready for download. This is the latest pull from Subversion source, tagged at 1.5.1.1166. Changes in this release include: * The "wait" method was completely rewritten. This should fix various errors seen in 1.5.1.1165 and 1.5.1.1158. * Removed the "spinner". http://wiki.openqa.org/display/WTR/Development+Builds Please take a look at this if you have seen the various errors associated with frames in the recent releases. The next release will probably include Jeff's Rdoc changes and a significant reworking of Watir that should prevent the dreaded RPC unavailable errors. We are getting very close to putting our releases directly on Rubyforge (again). But i would first like some confirmation that these fairly drastic changes have not introduced compatibility errors. 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/20070514/662febee/attachment.html From charley.baker at gmail.com Mon May 14 18:22:32 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 14 May 2007 16:22:32 -0600 Subject: [Wtr-general] Solution for FAQ "Using key/value pairs" not working In-Reply-To: <7ac2300c0705141320o600ae7b5s99c465017044a9ab@mail.gmail.com> References: <7ac2300c0705140322r26261c5cue91811638ab6478d@mail.gmail.com> <7ac2300c0705141320o600ae7b5s99c465017044a9ab@mail.gmail.com> Message-ID: Hey aidy, There aren't any attribute accessors for class variables. Why? You could I suppose, but you'd want to keep them accessible only by methods in the class. I think I'm starting to understand your general question or I could be totally offbase. Say for instance to take a classic example you want to figure out how many times your class is being used. This is a pretty trivial example but I hope will illustrate the point. class MyClass @@users = 0 def initialize @@users +=1 puts "This could do something more useful" if @@users > 1 # this could exit refuse new instances, etc end def count puts @@users end end m1 = MyClass.new m1.count => 1 m2 = MyClass.new => "This could do something more useful" The class itself in this case is responsible for it's own information. What if you were able to set it from some other code through accessors? some code.... MyClass.users += 1 ...oops, my code died, i didn't have the chance to remove myself as a user ...worse yet, i maxed the connections to the MyClass and it's not creating new instances from other people's code. Hope that makes some sense. -Charley On 5/14/07, aidy lewis wrote: > > On 14/05/07, Charley Baker wrote: > > class LoginInput > > @@user_name = "Vipul.Goyal" > > > > def LoginInput.user_name > > @@user_name > > end > > end > > > > puts LoginInput.user_name > > => "Vipul.Goyal" > > > > # Now with instance: > > class LoginInput > > @@user_name = "Vipul.Goyal" > > > > def user_name > > @@user_name > > end > > end > > > > l = LoginInput.new > > puts l.user_name > > => "Vipul.Goyal" > > Hi Charley, > > I looked at this http://www.rubycentral.com/book/tut_classes.html and > it seems to validate the structure of your code. My question then is; > does Ruby not allow short-cut accessor methods (attr_reader, > attr_writer, attr_accessor) for class variables? And if so, why are > they created and used only for instance variables? > > cheers > > aidy > _______________________________________________ > 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/20070514/8fc8c4d4/attachment.html From tunde.jinadu at gmail.com Mon May 14 18:53:09 2007 From: tunde.jinadu at gmail.com (Tunde Jinadu) Date: Mon, 14 May 2007 23:53:09 +0100 Subject: [Wtr-general] reading cell data into an array In-Reply-To: References: <1624b0140705121601m2cbb02bci51edd3c87f822c1c@mail.gmail.com> Message-ID: <1624b0140705141553i69813348s4280381bbaf2fb4a@mail.gmail.com> The series of digits is being read from a cell in excel using the following, spreadsheetdata[:pinnumber] = row.cells(4,13) ['text'] the cell will contain 5 digits, (pin number) I need to place the digits into an array to be used later in the script during pin number validation e.g 'what is the second and third digit of your five digit pin number' On 5/14/07, Charley Baker wrote: > > Can you give us an example of some of the data in the cell you're trying > to collect into an array? You should be able to do something like splitting > it into different strings possibly, depends on what you're getting from your > cell. > > -Charley > > On 5/12/07, Tunde Jinadu wrote: > > > Hi, > > > > I'm looking to read the data from a spreadsheet cell into an array, a > > series of five digits. > > I need data in an array to enable me read the values according to a > > random prompt for two of the five digits that will be in the array with > > respect to their positions in the array. > > The problem I have is the data/values captured from the cell are indexed > > as one group, not distinct values... any help will do in achieving indexing > > a number of digits from an individual spreadsheet cell into an array and > > each digit referenced. > > thanks. > > > > -- > > The second half of a man's life is made up of nothing but the habits he > > has acquired during the first half. > > - Fyodor Dostoevsky > > _______________________________________________ > > 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 > -- Why is it that our memory is good enough to retain the least triviality that happens to us, and yet not good enough to recollect how often we have told it to the same person? - Francois de La Rochefoucauld -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070514/d728e3b7/attachment.html From bret at pettichord.com Mon May 14 19:09:08 2007 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 14 May 2007 18:09:08 -0500 Subject: [Wtr-general] Watir Development Gem 1.5.1.1166 Released In-Reply-To: <064a01c79672$7a34b060$6400a8c0@laptop> References: <064a01c79672$7a34b060$6400a8c0@laptop> Message-ID: <4648EC14.3040806@pettichord.com> Paul Rogers wrote: > will you be providing some call back mechanism so I am able to add my > own spinner when the page is loading? I didn't realize that anyone was still using this. The main reason that i removed it was simply because we did not have good unit tests for the wait code and therefore we need to rely on visual inspection to validate this code. Since we had at least two cases where visual inspection had failed in the past, I decided that removing code that wasn't being used might help. Who else is using the spinner? Bret From charley.baker at gmail.com Mon May 14 20:22:22 2007 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 14 May 2007 18:22:22 -0600 Subject: [Wtr-general] reading cell data into an array In-Reply-To: <1624b0140705141553i69813348s4280381bbaf2fb4a@mail.gmail.com> References: <1624b0140705121601m2cbb02bci51edd3c87f822c1c@mail.gmail.com> <1624b0140705141553i69813348s4280381bbaf2fb4a@mail.gmail.com> Message-ID: How about pin_array = spreadsheetdata[:pinnumber].to_a -Charley On 5/14/07, Tunde Jinadu wrote: > > The series of digits is being read from a cell in excel using the > following, > > spreadsheetdata[:pinnumber] = row.cells(4,13) ['text'] > > the cell will contain 5 digits, (pin number) > I need to place the digits into an array to be used later in the script > during pin number validation e.g 'what is the second and third digit of > your five digit pin number' > > > On 5/14/07, Charley Baker < charley.baker at gmail.com> wrote: > > > > Can you give us an example of some of the data in the cell you're trying > > to collect into an array? You should be able to do something like splitting > > it into different strings possibly, depends on what you're getting from your > > cell. > > > > -Charley > > > > On 5/12/07, Tunde Jinadu < tunde.jinadu at gmail.com> wrote: > > > > > Hi, > > > > > > I'm looking to read the data from a spreadsheet cell into an array, a > > > series of five digits. > > > I need data in an array to enable me read the values according to a > > > random prompt for two of the five digits that will be in the array with > > > respect to their positions in the array. > > > The problem I have is the data/values captured from the cell are > > > indexed as one group, not distinct values... any help will do in achieving > > > indexing a number of digits from an individual spreadsheet cell into an > > > array and each digit referenced. > > > thanks. > > > > > > -- > > > The second half of a man's life is made up of nothing but the habits > > > he has acquired during the first half. > > > - Fyodor Dostoevsky > > > _______________________________________________ > > > 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 > > > > > > -- > Why is it that our memory is good enough to retain the least triviality > that happens to us, and yet not good enough to recollect how often we have > told it to the same person? > - Francois de La Rochefoucauld > _______________________________________________ > 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/20070514/6c9da37e/attachment-0001.html From paul.rogers at shaw.ca Mon May 14 21:42:54 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 14 May 2007 19:42:54 -0600 Subject: [Wtr-general] Watir Development Gem 1.5.1.1166 Released References: <064a01c79672$7a34b060$6400a8c0@laptop> <4648EC14.3040806@pettichord.com> Message-ID: <06ab01c79692$5bdeace0$6400a8c0@laptop> I suspect a call back type mechanism ( like the error checkers that can be called when a page is downloaded ) would be more flexible anyway. Although right now I cant think of anything else useful that you could do while waiting for a page to download Paul ----- Original Message ----- From: "Bret Pettichord" To: Sent: Monday, May 14, 2007 5:09 PM Subject: Re: [Wtr-general] Watir Development Gem 1.5.1.1166 Released > Paul Rogers wrote: >> will you be providing some call back mechanism so I am able to add my >> own spinner when the page is loading? > I didn't realize that anyone was still using this. The main reason that > i removed it was simply because we did not have good unit tests for the > wait code and therefore we need to rely on visual inspection to validate > this code. Since we had at least two cases where visual inspection had > failed in the past, I decided that removing code that wasn't being used > might help. > > Who else is using the spinner? > > Bret > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From Derek.Wong at orionhealth.com Mon May 14 22:13:11 2007 From: Derek.Wong at orionhealth.com (Derek Wong) Date: Tue, 15 May 2007 14:13:11 +1200 Subject: [Wtr-general] Use of attribute_value() under WATIR 1.5.1.1145 Message-ID: <4649BFF6.3702.00B7.0@orionhealth.com> Hi, I'm trying to write some tests that test various attribute keys in
    elements for particular values. The
    in question has a "class" attribute but even though I know the attribute is defined, invoking attribute_value("class") always returns nil. I've tried this on other elements aside from
    and I've also seen similar issues. Is there something I'm missing here? Example (non
    tag example actually an image): type: id: name: value: disabled: false src: http://blahmachine/blahapplication/blahicons/blah.gif file date: 04/23/2007 file size: 1246 width: 17 height: 17 alt: And from IRB if I type: irb(main):135:0> puts fr.images[1].attribute_value("file date") nil => nil irb(main):136:0> puts fr.images[1].attribute_value("src") http://blahmachine/blahapplication/blahicons/blah.gif => nil irb(main):137:0> puts fr.images[1].attribute_value("file size") nil => nil irb(main):138:0> puts fr.images[1].attribute_value("width") 17 => nil irb(main):139:0> puts fr.images[1].attribute_value("height") 17 => nil So as you can see, "file date" and "file size" are nil but by my reckoning shouldn't be. I haven't tried this on 1158 yet, as there's something (frames related) that caused me to revert to 1145 a few days ago so that I could get some tests going. Thanks very much for shedding any light on this. Regards, Derek Wong. From dkurtz at olenick.com Mon May 14 23:06:20 2007 From: dkurtz at olenick.com (Daniel Kurtz) Date: Mon, 14 May 2007 22:06:20 -0500 Subject: [Wtr-general] 'method_missing': document (WIN32OLERuntimeError) In-Reply-To: <461F2AAA.1000609@gs-lab.com> References: <7ac2300c0704050514x1eb951c7q7296ac95fddd5b58@mail.gmail.com><461F035C.4010000@pettichord.com> <461F2AAA.1000609@gs-lab.com> Message-ID: <82E50B4081E1354AAC1F917519B13F0D012AE5C7@olenick-01-ex.atlarge.net> I'm seeing this issue when I'm trying to run a script in Ruby and this build of Watir installed onto a jump drive. The same script runs OK on another computer that has the same versions installed on the hard drive. I was thinking it might have something to do with environment settings. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Manish Sapariya Sent: Friday, April 13, 2007 02:01 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] 'method_missing': document (WIN32OLERuntimeError) Hi, I am facing same problem in 1.5, not sure if its the same. I had sent query regarding this on list, but had no replies. It happens always when I do goto ("www.hotmail.com") Is there any known bug in 1.5 latest gem? Any directions so that I can give more inputs to debug problem. Watir Version: watir-1.5.1.1158. Thanks and Regards, Manish Bret Pettichord wrote: > aidy lewis wrote: > >> I am getting this error: >> >> 'method_missing': document (WIN32OLERuntimeError) >> >> that lies @ie.document >> >> I am using 1.4.1. >> >> Here is my code >> >> >> >> require 'watir' >> include Watir >> require 'test\unit' >> >> $ie = Watir::IE.new >> def browser;$ie;end >> >> module Login >> USERNAME = browser.text_field(:name, 'user_name') >> PASSWORD = browser.text_field(:name, 'password') >> REMEMBER_ME = browser.checkbox(:name, 'remember_me') >> SIGN_IN = browser.button(:value, 'Sign in') end >> >> module Mission >> LOG_OUT = browser.link(:text, /Log-out/) end >> >> class TC_Mission < Test::Unit::TestCase >> include Login >> >> >> def setup >> browser.goto('www.something.com') >> >> > Right here add: > browser.wait > > This bug is fixed in 1.5. > > >> browser.bring_to_front >> browser.maximize >> end >> >> > > _______________________________________________ > 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 bret at pettichord.com Tue May 15 01:14:55 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 15 May 2007 00:14:55 -0500 Subject: [Wtr-general] Use of attribute_value() under WATIR 1.5.1.1145 In-Reply-To: <4649BFF6.3702.00B7.0@orionhealth.com> References: <4649BFF6.3702.00B7.0@orionhealth.com> Message-ID: <464941CF.6040103@pettichord.com> Derek Wong wrote: > Hi, > > I'm trying to write some tests that test various attribute keys in
    elements for particular values. The
    in question has a "class" attribute but even though I know the attribute is defined, invoking attribute_value("class") always returns nil. I've tried this on other elements aside from
    and I've also seen similar issues. Is there something I'm missing here? > I don't really know how attribute_value works. But you should be able to get the class using ie.div(:name, 'foo').class_name > I haven't tried this on 1158 yet, as there's something (frames related) that caused me to revert to 1145 a few days ago so that I could get some tests going. > I don't think it will help with this issue, but i would appreciate it if you could take a look at 1166. I believe the frames problems should be licked and would like some confirmation. Bret From bret at pettichord.com Tue May 15 01:16:15 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 15 May 2007 00:16:15 -0500 Subject: [Wtr-general] Watir unit tests In-Reply-To: <29250063.14151179162477467.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <29250063.14151179162477467.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4649421F.6010707@pettichord.com> Eoin wrote: > I have installed the Windows installer for Watir 1.4.1 > I ran the unit tests and a lot of them failed. Are these bugs in Watir or is it something wrong with my environment? > I don't see anything to worry about. But you may find Watir 1.5 to work better for you. Bret From angrez at gmail.com Tue May 15 01:35:54 2007 From: angrez at gmail.com (Angrez Singh) Date: Tue, 15 May 2007 11:05:54 +0530 Subject: [Wtr-general] Use of attribute_value() under WATIR 1.5.1.1145 In-Reply-To: <4649BFF6.3702.00B7.0@orionhealth.com> References: <4649BFF6.3702.00B7.0@orionhealth.com> Message-ID: Hi, type: > id: > name: > value: > disabled: false > src: http://blahmachine/blahapplication/blahicons/blah.gif > file date: 04/23/2007 > file size: 1246 > width: 17 > height: 17 > alt: > > And from IRB if I type: > > irb(main):135:0> puts fr.images[1].attribute_value("file date") > nil > => nil > irb(main):137:0> puts fr.images[1].attribute_value("file size") > nil > => nil > The name shown by to_s method doesn't have one to one mapping with the attributes of the element. For e.g: file size, actual attribute name is fileSize. You can look for the attributes supported by ImageElement here. http://msdn2.microsoft.com/en-us/library/ms535259.aspx I hope this helps you in getting correct value of attribute using correct attribute name supported by element. - Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070515/a473ed28/attachment.html From zeljko.filipin at gmail.com Tue May 15 04:45:36 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 15 May 2007 10:45:36 +0200 Subject: [Wtr-general] xpath question (not Watir related) In-Reply-To: References: <37804933.2341178884387963.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Angrez, Thanks a lot! It works. irb(main):021:0> e["/tokens/ShortUrl[starts-with(@url, 'resetpassword.aspx ?m=7fb83717-9606-4022-bd4e-67b6f6582ada&code=')]"].attributes["hash"] => "BF8E8F60E722E92C7ED8303916591AB4" Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070515/45994d63/attachment.html From forum-watir-users at openqa.org Tue May 15 06:10:13 2007 From: forum-watir-users at openqa.org (gary) Date: Tue, 15 May 2007 05:10:13 CDT Subject: [Wtr-general] Having trouble capturing text in java alert In-Reply-To: <30476307.13271178720133216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <28021749.51179223844385.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> OK, now here's the latest update. Once again any help would be greatly appreciated as I'm having difficulty in extracting the text from an alert. Coming from a qa background rather than developer, I feel like a fish out of watir. Anyway, I've figured out how to deal with the script halting part way through but now I am no longer getting the text in the alert but a '1' instead: require 'watir' # the controller include Watir require 'watir/WindowHelper' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'dl/win32' require 'watir/winClicker' class TC_recorded < Test::Unit::TestCase def captureText autoit = WIN32OLE.new('AutoItX3.Control') ret = autoit.WinWait "Windows Internet Explorer", "", 1 text = autoit.WinGetText "Windows Internet Explorer" puts text.to_s autoit.Send "{ENTER}" end def start_jsalert_clicker Thread.new{ system("ruby \"C:\\ruby\\lib\\ruby\\gems\\1.8\\gems\\watir-1.5.1.1164\\unittests\\jscriptExtraAlert.rb\"") } end def test_1 @IE0 = IE.new @IE0.set_fast_speed @IE0.goto("www.hmv.co.uk") @IE0.link(:text, "Sign In").click start_jsalert_clicker @IE0.image(:alt, "continue").click captureText @IE0. close end end From angrez at gmail.com Tue May 15 06:21:56 2007 From: angrez at gmail.com (Angrez Singh) Date: Tue, 15 May 2007 15:51:56 +0530 Subject: [Wtr-general] Having trouble capturing text in java alert In-Reply-To: <28021749.51179223844385.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30476307.13271178720133216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <28021749.51179223844385.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Gary, Since you are starting a new thread for handling pop up. The text that you are sending to console will not be available to you. Also the captureText that you are writing won't be able to help you because the pop up will already be closed by start_js_clicker. If you look at the file 'jscriptextralert.rb' which you are calling in thread in function start_js_clicker, it creates new instance of WindowHelper class and then call function push_alert_button. Now in file 'watir/windowhelper.rb' go to function push_alert_button function, in that function you write the functionality to capture the text. In that function you can open a file, write the text of pop up to that file. Now instead of calling 'captureText', open the file and read text from that file. Hope this helps. You can go through following threads for more information. http://rubyforge.org/pipermail/wtr-general/2007-April/010466.html http://rubyforge.org/pipermail/wtr-general/2007-April/010512.html http://rubyforge.org/pipermail/wtr-general/2007-April/010523.html - Angrez On 5/15/07, gary wrote: > > OK, now here's the latest update. Once again any help would be greatly > appreciated as I'm having difficulty in extracting the text from an alert. > Coming from a qa background rather than developer, I feel like a fish out of > watir. > Anyway, > > I've figured out how to deal with the script halting part way through but > now I am no longer getting the text in the alert but a '1' instead: > > require 'watir' # the controller > include Watir > require 'watir/WindowHelper' > > require 'test/unit' > require 'test/unit/ui/console/testrunner' > require 'dl/win32' > require 'watir/winClicker' > > class TC_recorded < Test::Unit::TestCase > > def captureText > autoit = WIN32OLE.new('AutoItX3.Control') > ret = autoit.WinWait "Windows Internet Explorer", "", 1 > text = autoit.WinGetText "Windows Internet Explorer" > puts text.to_s > autoit.Send "{ENTER}" > end > > def start_jsalert_clicker > > Thread.new{ system("ruby \"C:\\ruby\\lib\\ruby\\gems\\1.8\\gems\\watir- > 1.5.1.1164\\unittests\\jscriptExtraAlert.rb\"") } > > end > > def test_1 > @IE0 = IE.new > @IE0.set_fast_speed > @IE0.goto("www.hmv.co.uk") > @IE0.link(:text, "Sign In").click > start_jsalert_clicker > @IE0.image(:alt, "continue").click > captureText > > @IE0. close > end > end > _______________________________________________ > 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/20070515/c50f12ea/attachment-0001.html From forum-watir-users at openqa.org Tue May 15 08:41:55 2007 From: forum-watir-users at openqa.org (Eoin) Date: Tue, 15 May 2007 07:41:55 CDT Subject: [Wtr-general] Watir unit tests In-Reply-To: <4649421F.6010707@pettichord.com> Message-ID: <40135166.1991179232945771.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Decided to install the latest gem 1.5.1.1166 since the one click installer seems to be a good bit out of date Still get failures/errors when I run the all_tests.rb script in the unittests area. However when I run the scripts that are failing individually they seem to run fine. Is this an issue in my environment I wonder or should I worry about them too much? *Test Output* 128) Error: test_textarea_field_exists(TC_TextArea): WIN32OLERuntimeError: navigate OLE error code:800700AA in HRESULT error code:0x80020009 Exception occurred. C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/unittests/../watir.rb:1687:in `method_missing' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/unittests/../watir.rb:1687:in `goto' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/unittests/../unittests/textarea_test.rb:11:in `goto_page' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/unittests/../unittests/textarea_test.rb:15:in `test_textarea_field_exists' 129) Failure: test_textarea_to_s(TC_TextArea) [C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/unittests/../unittests/textarea_test.rb:33]: Exception raised: Class: Message: <"Unable to locate object, using id and txtMultiLine3"> ---Backtrace--- C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/unittests/../watir.rb:2413:in `assert_exists' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/unittests/../watir.rb:3924:in `to_s' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/unittests/../unittests/textarea_test.rb:33:in `test_textarea_to_s' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/unittests/../unittests/textarea_test.rb:33:in `test_textarea_to_s' --------------- 139) Failure: test_simple_checker(TC_error_checker) [C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/unittests/../unittests/errorchecker_test.rb:20]: exception expected but was Class: Message: <"navigate\n OLE error code:800700AA in \n \n HRESULT error code:0x80020009\n Exception occurred."> ---Backtrace--- C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/unittests/../watir.rb:1687:in `method_missing' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/unittests/../watir.rb:1687:in `goto' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/unittests/../unittests/errorchecker_test.rb:11:in `goto_page' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/unittests/../unittests/errorchecker_test.rb:20:in `test_simple_checker' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/unittests/../unittests/errorchecker_test.rb:20:in `test_simple_checker' --------------- 341 tests, 1031 assertions, 5 failures, 138 errors From forum-watir-users at openqa.org Tue May 15 09:42:52 2007 From: forum-watir-users at openqa.org (Ken) Date: Tue, 15 May 2007 08:42:52 CDT Subject: [Wtr-general] Common functions Message-ID: <30367691.2851179236602791.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I know this is probably a dumb question but im sort of new at this. I am writing a suite of tests and in each script I want to login to my app. I wrote a login function to do this. What is the easiest way for me to re-use this function so that I dont have to include it in every script that i write? Since it isnt a complicated function (or very long) I could just plop it into my script every time but I know there has to be a way that I could just call it without having to include the code every time. Thanks. From zeljko.filipin at gmail.com Tue May 15 09:55:07 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 15 May 2007 15:55:07 +0200 Subject: [Wtr-general] Common functions In-Reply-To: <30367691.2851179236602791.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30367691.2851179236602791.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Ken, Extract a method that you need in multiple files in a separate file (my_script.rb for example), and then at the top of every file that needs that script write require "my_script" For now just make sure that all files are in the same folder. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070515/e193defe/attachment.html From forum-watir-users at openqa.org Tue May 15 10:08:30 2007 From: forum-watir-users at openqa.org (Ken) Date: Tue, 15 May 2007 09:08:30 CDT Subject: [Wtr-general] Common functions In-Reply-To: Message-ID: <28461129.2961179238140565.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for the idea, I knew it had to be something easy like that. From aidy.lewis at googlemail.com Tue May 15 10:33:10 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Tue, 15 May 2007 15:33:10 +0100 Subject: [Wtr-general] Common functions In-Reply-To: <30367691.2851179236602791.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30367691.2851179236602791.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <7ac2300c0705150733h6920b8fdp5b790aff4dafec4c@mail.gmail.com> On 15/05/07, Ken wrote: > What is the easiest way for me to re-use this function so that I dont have to > include it in every script that i write? You could use Ruby Test::Unit. class Test_Suite < Test::Unit::TestCase #the setup method is executed before each test method def setup login(usr, pswd) end def test_1 end def test_2 end end From bret at pettichord.com Tue May 15 11:11:05 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 15 May 2007 10:11:05 -0500 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <4645231D.9000608@gmail.com> References: <46412CAC.1030801@gmail.com> <464166F7.6030000@pettichord.com> <4645231D.9000608@gmail.com> Message-ID: <4649CD89.4040103@pettichord.com> Jeff, Thank you for the patch. I have committed to SVN. Your changes will be included in the next development gem. In your note, you call this a project report, suggesting that you plan to continue this work. But i also seem to recall you making a statement earlier that you were starting a new job and might not have much more time for this. Could you clarify? Further comments are contained inline below. Jeff Fry wrote: > ** > watir.rb > > * Updated button method with additional hows (:class, :text), > additional Typical Usage, examples of accessing an element with > multiple attributes, and an example of accessing a button nested > within another element. (I am considering whether to do this for > all Elements, or to use a different tactic. See my questions, > below.) > I don't think this example works. Specifically, multiple attribute support is currently only implemented for non-input elements. Please let me know if you would like to change this? > > * Other minor, mostly typographical changes > > > *Questions: > *changes.rb and license.rb > > * What do I need to do so that these will be listed in the rdoc > (as they are for rspec and rails)? When I rolled my own rdoc, I > don't see these under Files. > This is controlled by the rdoc task definition in the rakefile.rb. Note that some of this is defined indirectly, ensuring that the gem creates rdoc that looks the same as that created by the rakefile. > > changes.rb > > * This list is all features, improvements, and bugs listed in Jira > for Watir 1.5, with a resolution of fixed + unresolved ones. It > excludes tasks, sub-tasks, and anything with a resolution other > than fixed. Is this what we want? > We have also been detailing change information in the Wiki News section. http://wiki.openqa.org/pages/viewrecentblogposts.action?key=WTR It would be nice if this information were folded with the information you pulled from Jira. > > * All all our new features included on this list? (e.g. It seems > that modal dialog support is NOT obviously a part of any of > these features or improvements. Do we have new features without > corresponding Jira items?) > Yes we do. We actually create the change reports for the 1.5 development gems from the commit logs, not directly from Jira. If you want to go back before 1100, you can look at the commit logs. Everything is actually in there. > > watir.rb > > * :method and :action are listed as permissible 'how' types for > the initialize method. What do they mean? Where else are they > usable? > I believe these only apply to Form elements. > > * Think about how best to lay out hows & whats. Please comment. > o The current strategy is to list every how value for each > element, with usage hints. (My edits to button are in > keeping with this strategy.) > + Benefits: This has the benefit of having a lot of > information right by each Element method, including > examples specific to that Element. > + Downside: more work to maintain in multiple places, > and more opportunities for information to get out of > sync. > o An alternate strategy (mentioned by Brett in an earlier > email) would be to centralize this information - somewhere > in the rdoc or on the wiki - with links to it from each > Element. > + Benefit: easier to maintain, can't get out of sync. > Also a less verbose rdoc. > + Possibly not as clear for someone unfamiliar with Watir. > Unless someone volunteers manually keep all the duplication in sync (Maybe you are volunteering to do this -- it's not clear to me), then I plan to consolidate it so that it is at least accurate. Right now, it is easy to read (somewhat) but incomplete, which is pretty bad. > > I've attached a patch of all the changes I've made so far so that > interested folks can check it out. (BTW, this is the first patch I've > created, and I was surprised to see that it's just a txt file. If this > /isn't /correct, please let me know. I created it using these > instructions > . BTW, the best way to post a patch file is to attach it to a Jira ticket -- either an existing one or a new one. Then the ticket can be used to track progress on the patch. When we have commits based on tickets, we include a link to the ticket in the commit message, which helps keep everything easy to track. One final comment. I saw you included an example for :afterText. But i'm not really sure how and when :afterText works, have seen some complaints about it, and am unsure whether we should be encouraging people to use it. Bret From bret at pettichord.com Tue May 15 11:33:01 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 15 May 2007 10:33:01 -0500 Subject: [Wtr-general] Watir unit tests In-Reply-To: <40135166.1991179232945771.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <40135166.1991179232945771.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4649D2AD.7080707@pettichord.com> Eoin wrote: > Decided to install the latest gem 1.5.1.1166 since the one click installer seems to be a good bit out of date > > Still get failures/errors when I run the all_tests.rb script in the unittests area. However when I run the scripts that are failing individually they seem to run fine. > > Is this an issue in my environment I wonder or should I worry about them too much? > The core-tests are the tests that run reliably and quickly. The rest are sensitive to various things, some are unreliable because of the way the tests are written. Others are unreliable because of the unreliability of the targeted code. My general plan is to either get this working right, or take it out of Watir. This will probably happen in 1.6, and i have to say that most will simply be taken out -- probably migrated to a new watir-contrib gem that users can use at their own risk. Bret From bret at pettichord.com Tue May 15 11:43:30 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 15 May 2007 10:43:30 -0500 Subject: [Wtr-general] 'method_missing': document (WIN32OLERuntimeError) In-Reply-To: <82E50B4081E1354AAC1F917519B13F0D012AE5C7@olenick-01-ex.atlarge.net> References: <7ac2300c0704050514x1eb951c7q7296ac95fddd5b58@mail.gmail.com><461F035C.4010000@pettichord.com> <461F2AAA.1000609@gs-lab.com> <82E50B4081E1354AAC1F917519B13F0D012AE5C7@olenick-01-ex.atlarge.net> Message-ID: <4649D522.9040408@pettichord.com> This issue could be affected by timing, which could explain why you are seeing a difference when you run from a jump drive. Regardless of environment, I claim this issue is fixed with 1166. Please try it out and report back. Bret Daniel Kurtz wrote: > I'm seeing this issue when I'm trying to run a script in Ruby and this > build of Watir installed onto a jump drive. The same script runs OK on > another computer that has the same versions installed on the hard drive. > I was thinking it might have something to do with environment settings. > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Manish Sapariya > Sent: Friday, April 13, 2007 02:01 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] 'method_missing': document > (WIN32OLERuntimeError) > > Hi, > I am facing same problem in 1.5, not sure if its the same. I had sent > query regarding this on list, but had no replies. It happens always when > I do > > goto ("www.hotmail.com") > > Is there any known bug in 1.5 latest gem? > Any directions so that I can give more inputs to debug problem. > > Watir Version: watir-1.5.1.1158. > > > Thanks and Regards, > Manish > > > Bret Pettichord wrote: > >> aidy lewis wrote: >> >> >>> I am getting this error: >>> >>> 'method_missing': document (WIN32OLERuntimeError) >>> >>> that lies @ie.document >>> >>> I am using 1.4.1. >>> >>> Here is my code >>> >>> >>> >>> require 'watir' >>> include Watir >>> require 'test\unit' >>> >>> $ie = Watir::IE.new >>> def browser;$ie;end >>> >>> module Login >>> USERNAME = browser.text_field(:name, 'user_name') >>> PASSWORD = browser.text_field(:name, 'password') >>> REMEMBER_ME = browser.checkbox(:name, 'remember_me') >>> SIGN_IN = browser.button(:value, 'Sign in') end >>> >>> module Mission >>> LOG_OUT = browser.link(:text, /Log-out/) end >>> >>> class TC_Mission < Test::Unit::TestCase >>> include Login >>> >>> >>> def setup >>> browser.goto('www.something.com') >>> >>> >>> >> Right here add: >> browser.wait >> >> This bug is fixed in 1.5. >> >> >> >>> browser.bring_to_front >>> browser.maximize >>> end >>> >>> >>> >> _______________________________________________ >> 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 forum-watir-users at openqa.org Tue May 15 12:23:13 2007 From: forum-watir-users at openqa.org (Eoin) Date: Tue, 15 May 2007 11:23:13 CDT Subject: [Wtr-general] Watir unit tests In-Reply-To: <4649D2AD.7080707@pettichord.com> Message-ID: <33811727.4251179246223427.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks Bret.That's fine From forum-watir-users at openqa.org Tue May 15 12:42:50 2007 From: forum-watir-users at openqa.org (gary) Date: Tue, 15 May 2007 11:42:50 CDT Subject: [Wtr-general] Having trouble capturing text in java alert In-Reply-To: <30476307.13271178720133216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36112139.4321179247400436.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Fantastic, works a treat. If we were down the pub I'd buy you a drink. Thanks. Gary From rdewolfe at Credant.com Tue May 15 12:47:43 2007 From: rdewolfe at Credant.com (Russ DeWolfe) Date: Tue, 15 May 2007 11:47:43 -0500 Subject: [Wtr-general] Where is reporter.rb Message-ID: Where can I get reporter.rb, I don't see it in "test/unit/ui" ?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070515/2b40823e/attachment-0001.html From charley.baker at gmail.com Tue May 15 13:03:07 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 15 May 2007 11:03:07 -0600 Subject: [Wtr-general] Where is reporter.rb In-Reply-To: References: Message-ID: test-reporter has been deleted from rubyforge, it's successor being ci_reporter by Nick Sieger. Follow this thread for more information: http://www.mail-archive.com/wtr-general at rubyforge.org/msg07217.html -Charley On 5/15/07, Russ DeWolfe wrote: > > Where can I get reporter.rb, I don't see it in "test/unit/ui" > > ?? > > _______________________________________________ > 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/20070515/6c8a04df/attachment.html From forum-watir-users at openqa.org Tue May 15 13:53:26 2007 From: forum-watir-users at openqa.org (Ken) Date: Tue, 15 May 2007 12:53:26 CDT Subject: [Wtr-general] File problems Message-ID: <25856239.5121179251636355.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have a file lets call it x.rb. I included my common file with my login function and it works fine. I copied x.rb and renamed it y.rb. I ran y.rb and got these 2 errors: warning: don't put space before argument parentheses and undefined local variable or method `sURL' for main:Object I have sURL defined: # set login variables sURL= "x" sUserName = "x" sPass = "x" I call my Login function from x.rb and y.rb as follows: Login (sURL, sUserName, sPass) I dont understand why the script runs fine when i called it from x but when I call it from y i get the above 2 errors. Does anybody have any ideas why I am having this problem? I also tried renaming x and then running it as the new name and I still got the errors. The one with the space before the parentheses is puzzling because it didnt have a problem with that when i originally ran the script. From charley.baker at gmail.com Tue May 15 14:01:32 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 15 May 2007 12:01:32 -0600 Subject: [Wtr-general] File problems In-Reply-To: <25856239.5121179251636355.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <25856239.5121179251636355.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hard to say, if you did a copy in the filesystem then everything should be ok. The first is a warning from ruby, if you're not getting that in your run with x.rb, then likely the file contents have changed - you've got a space before a method call. Have the contents of the file changed? Is it in the same directory? It sounds like a simple error but without more details, I can't tell. -Charley On 5/15/07, Ken wrote: > > I have a file lets call it x.rb. I included my common file with my login > function and it works fine. I copied x.rb and renamed it y.rb. I ran > y.rb and got these 2 errors: > > warning: don't put space before argument parentheses > > and > > undefined local variable or method `sURL' for main:Object > > I have sURL defined: > > # set login variables > sURL= "x" > sUserName = "x" > sPass = "x" > > I call my Login function from x.rb and y.rb as follows: > > Login (sURL, sUserName, sPass) > > I dont understand why the script runs fine when i called it from x but > when I call it from y i get the above 2 errors. Does anybody have any ideas > why I am having this problem? I also tried renaming x and then running it > as the new name and I still got the errors. The one with the space before > the parentheses is puzzling because it didnt have a problem with that when i > originally ran the script. > _______________________________________________ > 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/20070515/aec876ac/attachment.html From forum-watir-users at openqa.org Tue May 15 14:07:58 2007 From: forum-watir-users at openqa.org (Ken) Date: Tue, 15 May 2007 13:07:58 CDT Subject: [Wtr-general] File problems In-Reply-To: Message-ID: <32627476.5231179252508559.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Yea, I did the maintenance in the file system. I didnt make any changes to x or y but I did add some code to my common file that I am referencing the Login function code in. I added the code and then copied x and created y. Is that the problem? Since x still works fine that is why Im going crazy. I did notice though that the new code I added to my common file is not being looked at. I have a puts statement inside an if/else that should work and that doesnt get printed when i run x.rb. Is there any documentation anywhere that describes file name and usage? I couldnt find anything. From charley.baker at gmail.com Tue May 15 14:12:22 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 15 May 2007 12:12:22 -0600 Subject: [Wtr-general] File problems In-Reply-To: <32627476.5231179252508559.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32627476.5231179252508559.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Make sure your load path is referring to the right place. You might want to print out your load path in x or y. puts $: and check that you're not working with duplicate common files. -c On 5/15/07, Ken wrote: > > Yea, I did the maintenance in the file system. I didnt make any changes > to x or y but I did add some code to my common file that I am referencing > the Login function code in. I added the code and then copied x and created > y. Is that the problem? Since x still works fine that is why Im going > crazy. I did notice though that the new code I added to my common file is > not being looked at. I have a puts statement inside an if/else that should > work and that doesnt get printed when i run x.rb. Is there any > documentation anywhere that describes file name and usage? I couldnt find > anything. > _______________________________________________ > 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/20070515/924b0cfe/attachment.html From forum-watir-users at openqa.org Tue May 15 14:29:36 2007 From: forum-watir-users at openqa.org (Ken) Date: Tue, 15 May 2007 13:29:36 CDT Subject: [Wtr-general] File problems In-Reply-To: Message-ID: <33022289.5501179253806413.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> It didnt even display the load path in x or in y. It skipped right over that command. I have a puts right after the puts $: and that was printed. I know this has to be a simple problem but its becoming a Pain in the... From forum-watir-users at openqa.org Tue May 15 14:37:22 2007 From: forum-watir-users at openqa.org (Tiffany Fodor) Date: Tue, 15 May 2007 13:37:22 CDT Subject: [Wtr-general] Need help with excel interface class Message-ID: <30165600.5561179254272985.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi! I'm new to Watir, but I've come as far as creating my first test case. I'd like to start using data from an excel spreadsheet for my tests, so I've installed the new excel interface class. However, I'm having trouble getting the example tests to run. I get the following error message: C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.1.1166\examples>XLS_usage_example.rb c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- xls (LoadError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/examples/XLS_usage_example.rb:1 I suspect that I just don't have the right files in the right places, but I'm not sure where everything should be. The test case requires Xls, test/unit, and pp. I've put the Xls.rb file in the C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.1.1166\watir\contrib directory. I couldn't find test/unit, but it looks like it may be the test-unit patch, which I've saved as C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.1.1166\watir\contrib\testcase.rb (I updated the test case to require 'testcase'). I verified that pp.rb exists at C:\ruby\lib\ruby\1.8. Here is the code around line 27 of custom_require.rb (line 27 is: gem_original_require path) def require(path) # :nodoc: gem_original_require path rescue LoadError => load_error begin if spec = Gem.searcher.find(path) Gem.activate(spec.name, false, "= #{spec.version}") gem_original_require path else raise load_error end end end After this, I'm at a loss as to what I need to do. Any help would be greatly appreciated! From charley.baker at gmail.com Tue May 15 14:44:03 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 15 May 2007 12:44:03 -0600 Subject: [Wtr-general] File problems In-Reply-To: <33022289.5501179253806413.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <33022289.5501179253806413.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Are you running through command line? Somewhere there's a disjoint, hard to figure out where. Open up irb and try puts $: and check your scripts for how they're dealing with the path or modifying it. -c On 5/15/07, Ken wrote: > > It didnt even display the load path in x or in y. It skipped right over > that command. I have a puts right after the puts $: and that was > printed. I know this has to be a simple problem but its becoming a Pain in > the... > _______________________________________________ > 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/20070515/a9ef060f/attachment.html From forum-watir-users at openqa.org Tue May 15 15:05:39 2007 From: forum-watir-users at openqa.org (Ken) Date: Tue, 15 May 2007 14:05:39 CDT Subject: [Wtr-general] File problems In-Reply-To: Message-ID: <26526672.5841179255969485.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Yes I am running it through the command line From charley.baker at gmail.com Tue May 15 15:22:26 2007 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 15 May 2007 13:22:26 -0600 Subject: [Wtr-general] File problems In-Reply-To: <26526672.5841179255969485.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <26526672.5841179255969485.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: I often feel like I spend more time on the simple problems than the larger ones. My only guess is that you're not running the right files since your print statements aren't showing up. Get a second pair of eyes to look at it if you can, otherwise if anyone else on the list has suggestions? It's not easy to troubleshoot remotely. :) -c On 5/15/07, Ken wrote: > > Yes I am running it through the command line > _______________________________________________ > 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/20070515/7e35a3fa/attachment-0001.html From forum-watir-users at openqa.org Tue May 15 15:58:38 2007 From: forum-watir-users at openqa.org (Steven List) Date: Tue, 15 May 2007 14:58:38 CDT Subject: [Wtr-general] WATIR on Windows Vista 64? Message-ID: <27690519.6371179259148491.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> We're running Eclipse with appropriate Ruby plug-ins on several machines. Everything works great on my machine (XP, 32-bit) and on one of our Vista machines (running in 32-bit on the 64-bit processor). But things just won't work on the machine running Vista in 64-bit mode on the 64-bit processor. Has anyone got any ideas? Has anyone else gotten WATIR running on Windows Vista in 64-bit mode? From forum-watir-users at openqa.org Tue May 15 16:01:14 2007 From: forum-watir-users at openqa.org (Ken) Date: Tue, 15 May 2007 15:01:14 CDT Subject: [Wtr-general] File problems In-Reply-To: Message-ID: <28277937.6431179259304497.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Yea the small ones always seem to be the biggest pains. I know that I am running the right files. It has got to be something to do with changing content in 1 or more files. Probably some stupid thing that Im unaware of. Hopefully someone out there can offer some more insight. Thanks for trying to help, Charley. From christopher.mcmahon at gmail.com Tue May 15 16:27:00 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 15 May 2007 14:27:00 -0600 Subject: [Wtr-general] WATIR on Windows Vista 64? In-Reply-To: <27690519.6371179259148491.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <27690519.6371179259148491.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70705151327o20de5b3bw6355e013663bc91e@mail.gmail.com> > Has anyone got any ideas? Has anyone else gotten WATIR running on Windows Vista in 64-bit mode? I'm interested in an academic sort of way. Does Ruby itself run? Does IRB run? What are your error messages? From Derek.Wong at orionhealth.com Tue May 15 18:38:24 2007 From: Derek.Wong at orionhealth.com (Derek Wong) Date: Wed, 16 May 2007 10:38:24 +1200 Subject: [Wtr-general] Use of attribute_value() under WATIR 1.5.1.1145 Message-ID: <464ADF20.3702.00B7.0@orionhealth.com> Hey Bret, sure enough class_name works as expected. I just checked the Element class documentation and hadn't noticed that it was one of many element attributes that I could have queried. My bad... I've just tried 1166 on some of the frame related tests that were behaving erratically under 1158. These tests dealt with frames generally nested to a depth of two (frame(:index,1).frame(:index,2)) with six or more frames contained inside the second level and a few frames at the outer level. >From a seat of the pants experiment where I repeated the test suite run 10 times I saw one occasion (not frame related) where things could have broken down but the frame tests themselves executed fine. I'll keep an eye on things but I'd say that 1166 looks to be way better behaved with frames than 1158 which behaved somewhat erratically on this class of tests that I'd been scripting last week. With my tests I couldn't categorically state however that frame interactions have been totally solved but I can say that it seems to have worked for me... ;^) Keep up the good work Watir folk... Thanks. Regards, Derek Wong. >>> Bret Pettichord 15/05/2007 5:14 p.m. >>> Derek Wong wrote: > Hi, > > I'm trying to write some tests that test various attribute keys in
    elements for particular values. The
    in question has a "class" attribute but even though I know the attribute is defined, invoking attribute_value("class") always returns nil. I've tried this on other elements aside from
    and I've also seen similar issues. Is there something I'm missing here? > I don't really know how attribute_value works. But you should be able to get the class using ie.div(:name, 'foo').class_name > I haven't tried this on 1158 yet, as there's something (frames related) that caused me to revert to 1145 a few days ago so that I could get some tests going. > I don't think it will help with this issue, but i would appreciate it if you could take a look at 1166. I believe the frames problems should be licked and would like some confirmation. Bret From forum-watir-users at openqa.org Tue May 15 18:45:25 2007 From: forum-watir-users at openqa.org (Tiffany Fodor) Date: Tue, 15 May 2007 17:45:25 CDT Subject: [Wtr-general] Need help with excel interface class In-Reply-To: <30165600.5561179254272985.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <31900625.6761179269156032.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I'm going to answer my own question in case it helps someone else out in the future... My script called the Xls interface with the following command: require 'Xls' Ruby couldn't find it, so I specified a path to Xls: require 'watir/contrib/Xls Now my script can implement the Xls interface. :) From forum-watir-users at openqa.org Tue May 15 18:58:23 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Tue, 15 May 2007 17:58:23 CDT Subject: [Wtr-general] =?iso-8859-1?q?The_test_case_should_be_failed=2C_bu?= =?iso-8859-1?q?t_it_is_not?= Message-ID: <26684126.6821179269933813.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello, I have a question for the test case below. When the Notepad window is not open, the test case run and complete without warning or error. Looks like autoit statements do not provide warning and assert is passed. I thought if the Notepad is not open, autoit statements should provide warning and assert should fail. Can you please confirm? If it should be failed, why it is not Thanks! Kui def test_file_Exists goto_page . autoit = WIN32OLE.new('AutoItX3.Control') autoit.WinWait("test.txt - Notepad", nil, 5) autoit.WinActive("test.txt - Notepad") assert(autoit.WinExists("test.txt - Notepad")) puts ("Window exist") autoit.WinKill("test.txt - Notepad") end end From bret at pettichord.com Tue May 15 23:05:16 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 15 May 2007 22:05:16 -0500 Subject: [Wtr-general] Use of attribute_value() under WATIR 1.5.1.1145 In-Reply-To: <464ADF20.3702.00B7.0@orionhealth.com> References: <464ADF20.3702.00B7.0@orionhealth.com> Message-ID: <464A74EC.4060405@pettichord.com> Derek, Thanks for the report. Bret From forum-watir-users at openqa.org Wed May 16 03:24:14 2007 From: forum-watir-users at openqa.org (Lauren) Date: Wed, 16 May 2007 02:24:14 CDT Subject: [Wtr-general] exists? method not working inside my assert - can someone explain? Message-ID: <36701193.8431179300284570.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Okay...I'm confused. The code below returns "true" when executed on it's own. span = $ie.span(:text, "title").exists? puts span However, once it's been added to an assert...it returns false and fails my test class TC_assert < Test::Unit::TestCase def test_title assert($ie.span(:text, "title").exists?) end end Can someone please explain why? Also, I need help to get my assert to "pass". Thanks! From bhavbeen_kaur at yahoo.com Wed May 16 03:21:07 2007 From: bhavbeen_kaur at yahoo.com (Bhavbeen Kaur) Date: Wed, 16 May 2007 00:21:07 -0700 (PDT) Subject: [Wtr-general] How to indentify nth link for the nth item Message-ID: <451676.86064.qm@web36512.mail.mud.yahoo.com> Hi, I have to identify the new and find link for the item employee.the page contains many new and find for different items. i have used: $ie.div(:class,"itemlist").div(:index, 24) and i am getting the error NoMethodError: undefined method `div' for nil:NilClass the source code is: /table> Please help me. Thanks Bhavbeen ____________________________________________________________________________________Get the Yahoo! toolbar and be alerted to new email wherever you're surfing. http://new.toolbar.yahoo.com/toolbar/features/mail/index.php From christopher.mcmahon at gmail.com Wed May 16 13:35:02 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 16 May 2007 11:35:02 -0600 Subject: [Wtr-general] how to manipulate this? Message-ID: <72799cd70705161035g428006f5x61aa0b5d02651189@mail.gmail.com> \r\n
    Replace this text with your own.
    I have a DIV whose class is "wiki". (It's in an iframe, but that doesn't matter.) I would like to manipulate the contents of this tag. I know it can be done with raw javascript, but I haven't been able to figure out how to do it with Watir. Any suggestions would be welcome. The full html of the iframe is below: irb(main):007:0> ie.frame(:id, "st-page-editing-wysiwyg").html => "\r\n\r\n\r\n
    Replace this te xt with your own.
    " From paul.rogers at shaw.ca Wed May 16 13:58:33 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 16 May 2007 11:58:33 -0600 Subject: [Wtr-general] how to manipulate this? In-Reply-To: <72799cd70705161035g428006f5x61aa0b5d02651189@mail.gmail.com> References: <72799cd70705161035g428006f5x61aa0b5d02651189@mail.gmail.com> Message-ID: ie.div(:class , 'wiki').ole_object.invoke('innerText' , "hi Chris") Im not entirely sure how the invoke method works with an argument, but that looks about right from the docs Paul ----- Original Message ----- From: Chris McMahon Date: Wednesday, May 16, 2007 11:35 am Subject: [Wtr-general] how to manipulate this? > \r\n >
    Replace this text with your own.
    > > > I have a DIV whose class is "wiki". (It's in an iframe, but that > doesn't matter.) > I would like to manipulate the contents of this tag. I know it > can be > done with raw javascript, but I haven't been able to figure out > how to > do it with Watir. Any suggestions would be welcome. > > The full html of the iframe is below: > > irb(main):007:0> ie.frame(:id, "st-page-editing-wysiwyg").html > => "\r\n name=GENERATOR> href=\"/static/2.11.5.2/css/st/screen.css\" type=text/css rel=STYL > ESHEET> type=text/cssrel=STYLESHEET> href=\"/static/2.11.5.2/css/st/wikiwyg.css\" t > ype=text/css rel=STYLESHEET>\r\n\r\n
    class=wiki>Replace this te > xt with your own.
    " > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Wed May 16 14:36:01 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 16 May 2007 13:36:01 -0500 Subject: [Wtr-general] Supporting IE 7 Message-ID: <464B4F11.4050602@pettichord.com> I have recently started using IE & on both my personal laptop and my company machine. And i've noticed that some of the Watir tests were failing because they were looking for IE 6. Specifically IE 6 windows are "Microsoft Internet Explorer" and IE 7 are called "Windows Internet Explorer". The simple fix was to just change the string, which will make the code work with IE7, but it will now break with IE6. Making it work with both is more complicated. Frankly, I was surprised that I hadn't heard more complaints about this. Is any one besides me actually using IE7? Does any one care about retaining support for IE6? This issue really only affects our support for popup windows and the like -- which is already pretty broken anyway. Maybe no one is using it, which is why i've seen no complaints? Please share your thoughts on this topic? This issue is being tracked under this ticket. http://jira.openqa.org/browse/WTR-125 From bret at pettichord.com Wed May 16 14:39:17 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 16 May 2007 13:39:17 -0500 Subject: [Wtr-general] how to manipulate this? In-Reply-To: References: <72799cd70705161035g428006f5x61aa0b5d02651189@mail.gmail.com> Message-ID: <464B4FD5.5030603@pettichord.com> Paul Rogers wrote: > ie.div(:class , 'wiki').ole_object.invoke('innerText' , "hi Chris") > > My guess would be ie.div(:class , 'wiki').ole_object.innerText = "hi Chris" From paul.rogers at shaw.ca Wed May 16 14:48:54 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 16 May 2007 12:48:54 -0600 Subject: [Wtr-general] how to manipulate this? In-Reply-To: <464B4FD5.5030603@pettichord.com> References: <72799cd70705161035g428006f5x61aa0b5d02651189@mail.gmail.com> <464B4FD5.5030603@pettichord.com> Message-ID: ah, of course, you only need invoke if there is a collision between an ole_method name and a ruy method name, like id ----- Original Message ----- From: Bret Pettichord Date: Wednesday, May 16, 2007 12:39 pm Subject: Re: [Wtr-general] how to manipulate this? > Paul Rogers wrote: > > ie.div(:class , 'wiki').ole_object.invoke('innerText' , "hi Chris") > > > > > My guess would be > > ie.div(:class , 'wiki').ole_object.innerText = "hi Chris" > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Wed May 16 14:55:06 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 16 May 2007 12:55:06 -0600 Subject: [Wtr-general] Supporting IE 7 In-Reply-To: <464B4F11.4050602@pettichord.com> References: <464B4F11.4050602@pettichord.com> Message-ID: I think its important to support both at the moment, as Im sure many people still havent upgraded. Id seen these problems, but Im using 1.4 and I cant remember if I did something to make it work on both ie6 and 7 or just stuck with 6. Paul ----- Original Message ----- From: Bret Pettichord Date: Wednesday, May 16, 2007 12:36 pm Subject: [Wtr-general] Supporting IE 7 > I have recently started using IE & on both my personal laptop and > my > company machine. And i've noticed that some of the Watir tests > were > failing because they were looking for IE 6. > > Specifically IE 6 windows are "Microsoft Internet Explorer" and IE > 7 are > called "Windows Internet Explorer". > > The simple fix was to just change the string, which will make the > code > work with IE7, but it will now break with IE6. Making it work with > both > is more complicated. > > Frankly, I was surprised that I hadn't heard more complaints about > this. > Is any one besides me actually using IE7? Does any one care about > retaining support for IE6? > > This issue really only affects our support for popup windows and > the > like -- which is already pretty broken anyway. Maybe no one is > using it, > which is why i've seen no complaints? > > Please share your thoughts on this topic? > > This issue is being tracked under this ticket. > http://jira.openqa.org/browse/WTR-125 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From christopher.mcmahon at gmail.com Wed May 16 15:19:36 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 16 May 2007 13:19:36 -0600 Subject: [Wtr-general] how to manipulate this? In-Reply-To: <464B4FD5.5030603@pettichord.com> References: <72799cd70705161035g428006f5x61aa0b5d02651189@mail.gmail.com> <464B4FD5.5030603@pettichord.com> Message-ID: <72799cd70705161219o65345fb2vc558df86282ad36d@mail.gmail.com> On 5/16/07, Bret Pettichord wrote: > Paul Rogers wrote: > > ie.div(:class , 'wiki').ole_object.invoke('innerText' , "hi Chris") > > > > > My guess would be > > ie.div(:class , 'wiki').ole_object.innerText = "hi Chris" Interesting, I've never hit this part of Watir before. Any chance of doing this in FireWatir? -C From dara.lillis at kiodex.com Wed May 16 15:29:35 2007 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Wed, 16 May 2007 12:29:35 -0700 Subject: [Wtr-general] Supporting IE 7 In-Reply-To: Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E0267F3B5@ehost011-27.exch011.intermedia.net> I'm strongly in favor of supporting both if possible. I got around http://jira.openqa.org/browse/WTR-115 by patching my own method with hard coded strings to match the IE 7 values. I didn't spend much time trying to figure out my own how to support IE 6 and IE 7. This issue doesn't seem to affect WinClicker from what I have seen. -D -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Wednesday, May 16, 2007 2:55 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Supporting IE 7 I think its important to support both at the moment, as Im sure many people still havent upgraded. Id seen these problems, but Im using 1.4 and I cant remember if I did something to make it work on both ie6 and 7 or just stuck with 6. Paul ----- Original Message ----- From: Bret Pettichord Date: Wednesday, May 16, 2007 12:36 pm Subject: [Wtr-general] Supporting IE 7 > I have recently started using IE & on both my personal laptop and my > company machine. And i've noticed that some of the Watir tests were > failing because they were looking for IE 6. > > Specifically IE 6 windows are "Microsoft Internet Explorer" and IE > 7 are > called "Windows Internet Explorer". > > The simple fix was to just change the string, which will make the code > work with IE7, but it will now break with IE6. Making it work with > both is more complicated. > > Frankly, I was surprised that I hadn't heard more complaints about > this. > Is any one besides me actually using IE7? Does any one care about > retaining support for IE6? > > This issue really only affects our support for popup windows and the > like -- which is already pretty broken anyway. Maybe no one is using > it, which is why i've seen no complaints? > > Please share your thoughts on this topic? > > This issue is being tracked under this ticket. > http://jira.openqa.org/browse/WTR-125 > _______________________________________________ > 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 bret at pettichord.com Wed May 16 15:55:03 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 16 May 2007 14:55:03 -0500 Subject: [Wtr-general] Supporting IE 7 In-Reply-To: References: <464B4F11.4050602@pettichord.com> Message-ID: <464B6197.2060109@pettichord.com> Paul Rogers wrote: > I think its important to support both at the moment, as Im sure many people still havent upgraded. > > If you or someone else had a patch for http://jira.openqa.org/browse/WTR-116, that would help. From christopher.mcmahon at gmail.com Wed May 16 15:58:15 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 16 May 2007 13:58:15 -0600 Subject: [Wtr-general] fireWatir guess. Re: how to manipulate this? Message-ID: <72799cd70705161258vf1593c5m536ea1661e21170@mail.gmail.com> > > ie.div(:class , 'wiki').ole_object.innerText = "hi Chris" > > Interesting, I've never hit this part of Watir before. Any chance of > doing this in FireWatir? Answering my own question, I'll bet that s/innerText/textContent/ would work. (Thanks Selenium reference page!) But I haven't tried it yet. There's another good candidate for refactoring. -C From bret at pettichord.com Wed May 16 16:00:29 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 16 May 2007 15:00:29 -0500 Subject: [Wtr-general] fireWatir guess. Re: how to manipulate this? In-Reply-To: <72799cd70705161258vf1593c5m536ea1661e21170@mail.gmail.com> References: <72799cd70705161258vf1593c5m536ea1661e21170@mail.gmail.com> Message-ID: <464B62DD.4020501@pettichord.com> Chris McMahon wrote: > Answering my own question, I'll bet that s/innerText/textContent/ > would work. (Thanks Selenium reference page!) But I haven't tried > it yet. > > There's another good candidate for refactoring. > Could you say more words about what you are suggesting. From christopher.mcmahon at gmail.com Wed May 16 16:03:01 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 16 May 2007 14:03:01 -0600 Subject: [Wtr-general] fireWatir guess. Re: how to manipulate this? In-Reply-To: <464B62DD.4020501@pettichord.com> References: <72799cd70705161258vf1593c5m536ea1661e21170@mail.gmail.com> <464B62DD.4020501@pettichord.com> Message-ID: <72799cd70705161303r2c86bbf9pf83e636dd9472098@mail.gmail.com> > Could you say more words about what you are suggesting. Quoting from the Selenium reference: storeText ( locator, variableName ) Gets the text of an element. This works for any element that contains text. This command uses either the textContent (Mozilla-like browsers) or the innerText (IE-like browsers) of the element, which is the rendered text shown to the user. So I'm guessing that since we can manipulate "innerText" with IE/Watir, I'll be we can manipulate "textContent" with fireWatir. So it might make sense to abstract both commands into a "munge_text_directly" method. From paul.rogers at shaw.ca Wed May 16 16:05:41 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 16 May 2007 14:05:41 -0600 Subject: [Wtr-general] fireWatir guess. Re: how to manipulate this? In-Reply-To: <72799cd70705161258vf1593c5m536ea1661e21170@mail.gmail.com> References: <72799cd70705161258vf1593c5m536ea1661e21170@mail.gmail.com> Message-ID: I beleive innerText is an ie only thing ( it might be thinkiig of innerHTML though) ----- Original Message ----- From: Chris McMahon Date: Wednesday, May 16, 2007 1:58 pm Subject: [Wtr-general] fireWatir guess. Re: how to manipulate this? > > > ie.div(:class , 'wiki').ole_object.innerText = "hi Chris" > > > > Interesting, I've never hit this part of Watir before. Any > chance of > > doing this in FireWatir? > > Answering my own question, I'll bet that s/innerText/textContent/ > would work. (Thanks Selenium reference page!) But I haven't tried > it yet. > > There's another good candidate for refactoring. > -C > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Wed May 16 16:41:59 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 16 May 2007 15:41:59 -0500 Subject: [Wtr-general] fireWatir guess. Re: how to manipulate this? In-Reply-To: <72799cd70705161303r2c86bbf9pf83e636dd9472098@mail.gmail.com> References: <72799cd70705161258vf1593c5m536ea1661e21170@mail.gmail.com> <464B62DD.4020501@pettichord.com> <72799cd70705161303r2c86bbf9pf83e636dd9472098@mail.gmail.com> Message-ID: <464B6C97.5060407@pettichord.com> Chris McMahon wrote: > Quoting from the Selenium reference: > storeText ( locator, variableName ) > Gets the text of an element. This works for any element that > contains text. This command uses either the textContent (Mozilla-like > browsers) or the innerText (IE-like browsers) of the element, which is > the rendered text shown to the user. > > So I'm guessing that since we can manipulate "innerText" with > IE/Watir, I'll be we can manipulate "textContent" with fireWatir. > > So it might make sense to abstract both commands into a > "munge_text_directly" method. > The Watir::IE method for storeText is "text". This amounts to a convenience method that wraps innertText. Watir does not currently directly support changing page content, although you can can do this, as this thread has discussed, using the ole_objects. Neither Watir nor Selenium nor FireWatir currently provides commands for munging text directly. To me this sounds like something that is outside the scope of a testing tool. Can you elaborate on the scenario that makes you want to do this? Is it testing related? Bret From christopher.mcmahon at gmail.com Wed May 16 16:49:53 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 16 May 2007 14:49:53 -0600 Subject: [Wtr-general] fireWatir guess. Re: how to manipulate this? In-Reply-To: <464B6C97.5060407@pettichord.com> References: <72799cd70705161258vf1593c5m536ea1661e21170@mail.gmail.com> <464B62DD.4020501@pettichord.com> <72799cd70705161303r2c86bbf9pf83e636dd9472098@mail.gmail.com> <464B6C97.5060407@pettichord.com> Message-ID: <72799cd70705161349v1cff1d0hf36ac8b1dbca0f8f@mail.gmail.com> > Neither Watir nor Selenium nor FireWatir currently provides commands for > munging text directly. To me this sounds like something that is outside > the scope of a testing tool. Can you elaborate on the scenario that > makes you want to do this? Is it testing related? Yes, it's testing. My particular application has a wysiwyg page-editing feature that I would like to manipulate for testing purposes. The mechanism by which the page is edited is direct manipulation of "innerText". The Google Blogspot wysiwyg editor works the same way, I'm pretty sure, and I'll bet other wikiesque wysiwyg editors do, also. From christopher.mcmahon at gmail.com Wed May 16 17:34:46 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 16 May 2007 14:34:46 -0700 Subject: [Wtr-general] ole_object syntax? Message-ID: <72799cd70705161434p1596d593vb3c942845512e72a@mail.gmail.com> Paul, Bret, I tried both syntax examples and got errors on both. Do you see anything wrong with ie.frame(:index,1).div(:class, 'wiki').ole_object.innerText = "McChris was here" or ie.frame(:index,1).div(:class, 'wiki').ole_object.invoke("innerText","McChris was here") I'm using the latest Watir development gem here. irb(main):005:0> ie.frame(:index,1).html => "\r\n\r\n\r\n
    Replace this te xt with your own.
    " irb(main):006:0> ie.frame(:index,1).div(:class, 'wiki').ole_object.innerText = " McChris was here" NoMethodError: undefined method `innerText=' for nil:NilClass from (irb):6 from :0 irb(main):007:0> ie.frame(:index,1).div(:class, 'wiki').ole_object.invoke("inner Text","McChris was here") NoMethodError: undefined method `invoke' for nil:NilClass from (irb):7 from :0 irb(main):008:0> From jeff.fry at gmail.com Wed May 16 17:48:05 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Wed, 16 May 2007 14:48:05 -0700 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <4649CD89.4040103@pettichord.com> References: <46412CAC.1030801@gmail.com> <464166F7.6030000@pettichord.com> <4645231D.9000608@gmail.com> <4649CD89.4040103@pettichord.com> Message-ID: <970956b0705161448l7de55a0dke43adc9cc888d5aa@mail.gmail.com> On 5/15/07, Bret Pettichord wrote: > In your note, you call this a project report, suggesting that you plan > to continue this work. But i also seem to recall you making a statement > earlier that you were starting a new job and might not have much more > time for this. Could you clarify? Hi, I did just start a new job - so far so good! - and I had initially wanted to get everything done before the change. That said, I feel like I could accomplish a good bit more in 2-4 more hours work, and I can tell that I have the time and the brainspace to do that within the next week. > watir.rb > > > > * Updated button method with additional hows (:class, :text), > > additional Typical Usage, examples of accessing an element with > > multiple attributes, and an example of accessing a button nested > > within another element. (I am considering whether to do this for > > all Elements, or to use a different tactic. See my questions, > > below.) > > > I don't think this example works. Specifically, multiple attribute > support is currently only implemented for non-input elements. Please let > me know if you would like to change this? Ahh. No, I'll change that. I figured that as we go I would learn more about what works where. > > *Questions: > > *changes.rb and license.rb > > > > * What do I need to do so that these will be listed in the rdoc > > (as they are for rspec and rails)? When I rolled my own rdoc, I > > don't see these under Files. > > > This is controlled by the rdoc task definition in the rakefile.rb. Note > that some of this is defined indirectly, ensuring that the gem creates > rdoc that looks the same as that created by the rakefile. Ok, thanks. I'll take a look at the rakefile.rb and try to add these. If I have questions I'll post'm to the list. (And once I understand it I'll note this in my rdoc how-to page on the wiki.) > > > changes.rb > > > > * This list is all features, improvements, and bugs listed in Jira > > for Watir 1.5, with a resolution of fixed + unresolved ones. It > > excludes tasks, sub-tasks, and anything with a resolution other > > than fixed. Is this what we want? > > > We have also been detailing change information in the Wiki News section. > > http://wiki.openqa.org/pages/viewrecentblogposts.action?key=WTR > > It would be nice if this information were folded with the information > you pulled from Jira. Will do. > > > * All all our new features included on this list? (e.g. It seems > > that modal dialog support is NOT obviously a part of any of > > these features or improvements. Do we have new features without > > corresponding Jira items?) > > > Yes we do. We actually create the change reports for the 1.5 development > gems from the commit logs, not directly from Jira. If you want to go > back before 1100, you can look at the commit logs. Everything is > actually in there. Cool. I'll do this as well. > > > watir.rb > > > > * :method and :action are listed as permissible 'how' types for > > the initialize method. What do they mean? Where else are they > > usable? > > > I believe these only apply to Form elements. > > > > * Think about how best to lay out hows & whats. Please comment. > > o The current strategy is to list every how value for each > > element, with usage hints. (My edits to button are in > > keeping with this strategy.) > > + Benefits: This has the benefit of having a lot of > > information right by each Element method, including > > examples specific to that Element. > > + Downside: more work to maintain in multiple places, > > and more opportunities for information to get out of > > sync. > > o An alternate strategy (mentioned by Brett in an earlier > > email) would be to centralize this information - somewhere > > in the rdoc or on the wiki - with links to it from each > > Element. > > + Benefit: easier to maintain, can't get out of sync. > > Also a less verbose rdoc. > > + Possibly not as clear for someone unfamiliar with > Watir. > > > Unless someone volunteers manually keep all the duplication in sync > (Maybe you are volunteering to do this -- it's not clear to me), then I > plan to consolidate it so that it is at least accurate. Right now, it is > easy to read (somewhat) but incomplete, which is pretty bad. I think consolidating it is the right choice. If it would be helpful, I'll try to take a first whack at this by the beginning of next week as well. I'm sure whatever I make will/would contain inaccuracies (e.g. my not knowing that the multiple attribute support only for non-input elements) but if my creating a first draft would help I will see what I can put together between tonight and this coming Wednesday. BTW, the best way to post a patch file is to attach it to a Jira ticket > -- either an existing one or a new one. Then the ticket can be used to > track progress on the patch. When we have commits based on tickets, we > include a link to the ticket in the commit message, which helps keep > everything easy to track. Thanks. I'll do the next one that way. One final comment. I saw you included an example for :afterText. But i'm > not really sure how and when :afterText works, have seen some complaints > about it, and am unsure whether we should be encouraging people to use it. Ahhh. I haven't used it myself. I am happy to take out the example. Should we stop listing it altogether? I'll send a seperate email to the list to see if folks are using it, and for conversation about how much it should be supported and or removed. Thanks, Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070516/439209c5/attachment.html From Craig.Brooksby at thomson.com Wed May 16 17:37:22 2007 From: Craig.Brooksby at thomson.com (Craig.Brooksby at thomson.com) Date: Wed, 16 May 2007 16:37:22 -0500 Subject: [Wtr-general] send_keys Message-ID: <3A0B92DCADDDD64B84203938BD8DAD940FF86B35@TLRUSMNEAGMBX22.ERF.THOMSON.COM> Hi all: We love watir! I learned Ruby in order to use it, and it has been great all-round. Here's my problem: The IE I am grappling with has a helped DLL running that pops up and requires authentication before letting me back onto the webpage I am testing. I need to be able to use send-_keys or something to just populate field a, (tab) populate field b (tab) and then tab tab tab hit OK. Then the dialog box disappears and I am back talking to the DOM. Note that this isn't a popup window -- I know how to deal with those, in watir -- this is a DLL in IE that I just need to send keys to. ie.methods shows me that I have ie.send_keys but I can't seem to get this to work. For example: irb(main):015:0> ie.send_keys("{ENTER}") WIN32OLERuntimeError: unknown OLE server: `AutoItX3.Control' HRESULT error code:0x800401f3 Invalid class string from C:/Program Files/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb :1320:in `initialize' from C:/Program Files/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb :1320:in `new' from C:/Program Files/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb :1320:in `send_keys' from (irb):15 from :0 irb(main):016:0> Any ideas?? Craig R. Craig Brooksby Field Technology Manager, Western Division Thomson West (Westlaw) Office: 602-794-3849 Mobile: 623-256-8899 From bret at pettichord.com Wed May 16 17:56:54 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 16 May 2007 16:56:54 -0500 Subject: [Wtr-general] ole_object syntax? In-Reply-To: <72799cd70705161434p1596d593vb3c942845512e72a@mail.gmail.com> References: <72799cd70705161434p1596d593vb3c942845512e72a@mail.gmail.com> Message-ID: <464B7E26.3070007@pettichord.com> Chris McMahon wrote: > Paul, Bret, I tried both syntax examples and got errors on both. Do > you see anything wrong with > ie.frame(:index,1).div(:class, 'wiki').ole_object.innerText = "McChris > was here" or > ie.frame(:index,1).div(:class, > 'wiki').ole_object.invoke("innerText","McChris was here") > > I'm using the latest Watir development gem here. > > irb(main):005:0> ie.frame(:index,1).html > => "\r\n media=screen href=\"/static/2.11.5.2/css/st/screen.css\" type=text/css rel=STYL > ESHEET> rel=STYLESHEET> ype=text/css rel=STYLESHEET>\r\n\r\n
    Replace this te > xt with your own.
    " > irb(main):006:0> ie.frame(:index,1).div(:class, 'wiki').ole_object.innerText = " > McChris was here" > NoMethodError: undefined method `innerText=' for nil:NilClass > from (irb):6 > from :0 > irb(main):007:0> ie.frame(:index,1).div(:class, 'wiki').ole_object.invoke("inner > Text","McChris was here") > NoMethodError: undefined method `invoke' for nil:NilClass > from (irb):7 > from :0 > irb(main):008:0> > You are seeing bug http://jira.openqa.org/browse/WTR-139, sorry about that. Here is a workaround: div = ie.frame(:index,1).div(:class, 'wiki'). div.locate div.ole_object.innerText = "McChris was here" Bret From bret at pettichord.com Wed May 16 17:58:30 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 16 May 2007 16:58:30 -0500 Subject: [Wtr-general] fireWatir guess. Re: how to manipulate this? In-Reply-To: <72799cd70705161349v1cff1d0hf36ac8b1dbca0f8f@mail.gmail.com> References: <72799cd70705161258vf1593c5m536ea1661e21170@mail.gmail.com> <464B62DD.4020501@pettichord.com> <72799cd70705161303r2c86bbf9pf83e636dd9472098@mail.gmail.com> <464B6C97.5060407@pettichord.com> <72799cd70705161349v1cff1d0hf36ac8b1dbca0f8f@mail.gmail.com> Message-ID: <464B7E86.6020509@pettichord.com> Chris McMahon wrote: >> Neither Watir nor Selenium nor FireWatir currently provides commands for >> munging text directly. To me this sounds like something that is outside >> the scope of a testing tool. Can you elaborate on the scenario that >> makes you want to do this? Is it testing related? >> > > Yes, it's testing. My particular application has a wysiwyg > page-editing feature that I would like to manipulate for testing > purposes. The mechanism by which the page is edited is direct > manipulation of "innerText". The Google Blogspot wysiwyg editor works > the same way, I'm pretty sure, and I'll bet other wikiesque wysiwyg > editors do, also. Ok. Why don't you go ahead at put this in Jira. The implementation would be ie.div(...).text = 'Chris was here' From jeff.fry at gmail.com Wed May 16 17:58:51 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Wed, 16 May 2007 14:58:51 -0700 Subject: [Wtr-general] :beforeText and :afterText Message-ID: <970956b0705161458x5170d40bnd077f9195c361b37@mail.gmail.com> Brett mentioned in a comment on my rdoc changes that > One final comment. I saw you included an example for :afterText. But i'm > not really sure how and when :afterText works, have seen some complaints > about it, and am unsure whether we should be encouraging people to use it. I haven't played with :beforeText and :afterText myself. If you have, do you use them? Do they work well in some contexts and not in others? Do they not work at all and need to be removed. I could see them anywhere on a continuum from: Great Feature That Should Be Widely Documented - TO - Worthwhile Feature That Needs A Bit Of Work (and perhaps shouldn't be advertised much for now) - TO - Nice Idea That Doesn't Work And Should Be Removed. Any input from folks who either use or have tried unsuccessfully to use these two? Thanks, Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070516/c8802626/attachment.html From marick at testing.com Wed May 16 18:25:42 2007 From: marick at testing.com (Brian Marick) Date: Wed, 16 May 2007 18:25:42 -0400 Subject: [Wtr-general] Controlling IE popups with stock Watir: simplest way? Message-ID: <91957548-9D3E-43BA-864F-B903FB6333D0@testing.com> Here's the way I've found to control IE popups (asking for certificates, asking whether to remember passwords, etc.) on Windows Vista with Watir 1.5.1.1166 and nothing else: 1. Just before sending the click that will generate the popup, popen () a subprocess ("the watcher"). 2. Have the watcher spin, checking for a window with a given title, then send the right keys to dismiss the window. After that, create a file to signal completion and exit. 3. Have the parent process spin, waiting for that file to be created, then continue. I've not succeeded in doing it a simpler way because: 1. Putting the click() and an @autoit.WinWait in different threads always seems to lead to a hang. (I'm guessing I/O is happening when Watir is waiting for the click to finish, so the thread that wants to WinWait never gets started. Or the WinWait thread causes the click thread never to be started.) 2. Windows doesn't support fork() and derivatives, so I can't just fork a watcher, click, and wait for the child to terminate. 3. I can't even have the watcher send the "I'm done" message to its stdout because the parent hangs reading it, presumably for the same reason as threads do. My question is whether I've missed an easier or better way to do this using stock Watir. I'm assuming that if I dug into Win32api, I could find the secret to how Windows lets one process create and control another, but I find myself strangely without the desire to do so. But if someone tells me it's easy... --------------------------- Here is a sample script that logs in and deals with a demand for a digital certificate. Because I want to be cool, I made a little Domain! Specific! Language! for talking about popups. In the following, it's marked with # !W!O!W! require 'watir' include Watir at_exit do $ie.close end class IE def after(&block) @block = block self end def grab_window(window_title) @window_title = window_title self end def and_send(*keys) dropping = dropping_name_from(@window_title) File.delete(dropping) if File.exist?(dropping) commandline = ["/ruby/bin/ruby", "watcher.rb", "'" + @window_title + "'", dropping] + keys IO.popen(commandline.join(' ')) instance_eval(&@block) if @block until File.exists?(dropping) sleep 1 end end private def dropping_name_from(title) "got-past-" + title.gsub(/\s/, '-') end end $ie = IE.new $ie.goto("https://example.com/cmd/logon") $ie.text_field(:name, "U").set("marick") $ie.text_field(:name, "P").set("not the real one") $ie.after { # !W!O!W! button(:name, "action").click }.grab_window("Choose a digital certificate"). and_send("{Tab}", "{Space}") puts "Th-th-th that's all, folks!" sleep 5 # display final page in all its glory. ==== And here's the watcher script: require 'watir' # Do this in JMock style, just because. class Watcher private_class_method :new def self.after_seeing(title) new(title) end def initialize(title) @autoit = Watir.autoit @title = title end def send(keys) @keys = keys self end def and_leave_dropping_in(dropping_file) @dropping_file = dropping_file do_await_window do_send_keys do_leave_dropping nil end private def do_await_window @autoit.WinWait @title, "" end def do_send_keys @keys.each do | key | sleep 1 # Just to watch it happen. @autoit.Send key end end def do_leave_dropping File.open(@dropping_file, "w") do | io | io.puts("Finished at #{Time.now}.") end end end if $0 == __FILE__ title = ARGV[0] dropping_file = ARGV[1] keys = ARGV[2..-1] $stderr.puts title, dropping_file, keys.inspect; $stderr.flush Watcher.after_seeing(title).send(keys). and_leave_dropping_in(dropping_file) end ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant www.exampler.com, www.exampler.com/blog ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant www.exampler.com, www.exampler.com/blog From christopher.mcmahon at gmail.com Wed May 16 19:17:42 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 16 May 2007 17:17:42 -0600 Subject: [Wtr-general] Controlling IE popups with stock Watir: simplest way? In-Reply-To: <91957548-9D3E-43BA-864F-B903FB6333D0@testing.com> References: <91957548-9D3E-43BA-864F-B903FB6333D0@testing.com> Message-ID: <72799cd70705161617j3b599c5etc937034b368eda6@mail.gmail.com> > And here's the watcher script: > def initialize(title) > @autoit = Watir.autoit > @title = title > end I don't know how interested you'd be, but if you'd like to try to build a watcher with a Ruby GuiTest instead of autoIt, I'd be interested in what happens: http://rubyforge.org/projects/guitest/ From carl.l.shaulis at convergys.com Wed May 16 15:23:00 2007 From: carl.l.shaulis at convergys.com (carl.l.shaulis at convergys.com) Date: Wed, 16 May 2007 14:23:00 -0500 Subject: [Wtr-general] Supporting IE 7 In-Reply-To: Message-ID: Howdy, We have no plans to upgrade to IE 7 anytime soon, so I concur with Paul that we need to be able to support both. Thanks, Carl From forum-watir-users at openqa.org Wed May 16 21:47:25 2007 From: forum-watir-users at openqa.org (alan) Date: Wed, 16 May 2007 20:47:25 CDT Subject: [Wtr-general] verifying contents of text_field Message-ID: <28411473.18911179366475107.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I'm doing a test where I fill in a field with : ie.text_field(:name,"track_note_0").set(testtext) it then saves this entry with a: ie.button(:value, "save").click and then logs out. I need to have the script go back to the page and make sure that field still has that text in it, how would I do this? Searching and variations on if ie.contains have not worked. Thanks From bret at pettichord.com Wed May 16 22:38:19 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 16 May 2007 21:38:19 -0500 Subject: [Wtr-general] verifying contents of text_field In-Reply-To: <28411473.18911179366475107.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28411473.18911179366475107.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <464BC01B.30205@pettichord.com> alan wrote: > I'm doing a test where I fill in a field with : > ie.text_field(:name,"track_note_0").set(testtext) > it then saves this entry with a: > ie.button(:value, "save").click > and then logs out. > > > I need to have the script go back to the page and make sure that field still has that text in it, how would I do this? Searching and variations on if ie.contains have not worked. > assert_equal testtext, ie.text_field(:name,"track_note_0").value From bret at pettichord.com Wed May 16 23:43:03 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 16 May 2007 22:43:03 -0500 Subject: [Wtr-general] Controlling IE popups with stock Watir: simplest way? In-Reply-To: <91957548-9D3E-43BA-864F-B903FB6333D0@testing.com> References: <91957548-9D3E-43BA-864F-B903FB6333D0@testing.com> Message-ID: <464BCF47.8090107@pettichord.com> Brian, Thanks for your detailed report. As you no doubt have realized, Watir's support (if it can be called that) for popups is none too good: awkward and often unreliable. So your efforts are much appreciated. Personally, I haven't had to deal with popups in my scripts, mostly finding ways to avoid them. (My latest approach was the directly modify the registry settings that control whether some of the more annoying popups appear in the first place. This approach worked OK on XP, but failed on Vista, which apparently has locked down access to the registry. But I digress.) I will comment further inline to your post. Brian Marick wrote: > Here's the way I've found to control IE popups (asking for > certificates, asking whether to remember passwords, etc.) on Windows > Vista with Watir 1.5.1.1166 and nothing else: > > 1. Just before sending the click that will generate the popup, popen > () a subprocess ("the watcher"). > > 2. Have the watcher spin, checking for a window with a given title, > then send the right keys to dismiss the window. After that, create a > file to signal completion and exit. > > 3. Have the parent process spin, waiting for that file to be created, > then continue. > I wonder whether this is really what is happening. My guess is that it is blocked... > I've not succeeded in doing it a simpler way because: > > 1. Putting the click() and an @autoit.WinWait in different threads > always seems to lead to a hang. (I'm guessing I/O is happening when > Watir is waiting for the click to finish, so the thread that wants to > WinWait never gets started. Or the WinWait thread causes the click > thread never to be started.) > Typically the click() is blocking. This amounts to a COM call and -- to get technical for a moment -- COM requires a single-threaded apartment (STA). Ruby, on the other hand, does not use windows threads, as a result, COM calls block not only their thread, but all the threads in the Ruby process. Damn! This is why you need to have separate processes (not threads). > 2. Windows doesn't support fork() and derivatives, so I can't just > fork a watcher, click, and wait for the child to terminate. > I have been looking at the win32utils set of gems on rubyforge lately. The win32-process gem includes a windows implementation of fork that may be promising. > 3. I can't even have the watcher send the "I'm done" message to its > stdout because the parent hangs reading it, presumably for the same > reason as threads do. > > My question is whether I've missed an easier or better way to do this > using stock Watir. I'm assuming that if I dug into Win32api, I could > find the secret to how Windows lets one process create and control > another, but I find myself strangely without the desire to do so. But > if someone tells me it's easy... > Like i said these win32utils seem to provide everything you need and wrap a lot of the win32api nonesense, so you really would be better looking at that. Just today i was tweaking the jscript_test.rb Watir unit test, which actually demonstrates several approaches for handling simple dialogs. You should take a look at it. I don't think you actually need to have the file polling system. The reason why is that the click method will not return until the dialog has been closed. So you don't need a second synchronization method. Thanks again for sharing this. We need to think seriously about adding this to Watir. Bret P.S. We have had some other comments on the choice of implementation technology. To me, we first need an approach that is (1) reliable and (2) intuitive and (3) supported by unit/feature tests. Once we have this, we can experiment with different control technologies, whether AutoIt or WSH or win32guitest or win32utils or wet-win32 or something else. I think this puts us on the edge of #1 and #2, so the next step is figuring a reliable way to add this to our test suite. From bret at pettichord.com Thu May 17 00:09:57 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 16 May 2007 23:09:57 -0500 Subject: [Wtr-general] FireWatir not finding buttons by id In-Reply-To: References: <72799cd70705031643t614a63b0sc3d1704eacf5cc7f@mail.gmail.com> <72799cd70705040817p75985b2ud0e40598b98b6e08@mail.gmail.com> <08c201c78e60$d4c4a450$6400a8c0@laptop> <72799cd70705041137j24752e8cyda297309fb16cfb7@mail.gmail.com> Message-ID: <464BD595.3010009@pettichord.com> Charley Baker wrote: > It's a curious bug, just saw the same thing. A bug/feature, works more > than it should. :) Chris is right we should definitely spend more time > with Angrez, Prema and the Firewatir community. I'm getting slammed by > requests for multiple browser tests and starting to abstract layers so > that it's easier. This is definitely a bug. The problem is that all of these select this button in Watir 1.5: ie.link(:id,'st-login-to-edit-button-link').flash ie.button(:id,'st-login-to-edit-button-link').flash ie.text_field(:id,'st-login-to-edit-button-link').flash ie.radio(:id,'st-login-to-edit-button-link').flash But this problem only shows up when you select by :id, not if if you select by :text. I suspect the same problem shows up for any input element when you select by name or id. I say this because we have a special performance optimization in Watir 1.5 for this case (input elements selected by id or name), and it seems that Watir is actually ignoring the type of the element. We need to get this in Jira. (But it is too late for me to do this tonight.) What we need to do to pull Firewatir and Watir for IE together is to work toward a clear, well-defined spec of expected behavior, rather than try to retain fortuitous accidents of implemenation, which is what we have here. Bret From paul.rogers at shaw.ca Thu May 17 00:36:01 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 16 May 2007 22:36:01 -0600 Subject: [Wtr-general] Supporting IE 7 References: <464B4F11.4050602@pettichord.com> <464B6197.2060109@pettichord.com> Message-ID: <08a201c7983c$df3990e0$6400a8c0@laptop> I have some code that will give the os/browser etc - I'll post it later This code can also be used to find the ie version, and may be more useful in the winclicker.rb to set the dilog titles to look for. It dislays the corrct ie version for IE6 and IE7 using iexplorer.exe, which is not how the link says it should work Paul # # Script to determine Intenet Explorer version # # from http://support.microsoft.com/kb/q164539/ # require 'win32ole' wsh = WIN32OLE.new("Scripting.FileSystemObject") if File.exists?('c:\program files\internet explorer\iexplore.exe') ver = wsh.getFileVersion('c:\program files\internet explorer\iexplore.exe') else puts "IE 7 not found" windir = ENV['Windir'] puts windir if File.exists?('#{windir}\System32\Shdocvw.dll') puts "Shdocvw.dll is there" else puts "Shdocvw.dll is not there" end end puts ver wsh = nil ----- Original Message ----- From: "Bret Pettichord" To: Sent: Wednesday, May 16, 2007 1:55 PM Subject: Re: [Wtr-general] Supporting IE 7 > Paul Rogers wrote: >> I think its important to support both at the moment, as Im sure many >> people still havent upgraded. >> >> > If you or someone else had a patch for > http://jira.openqa.org/browse/WTR-116, that would help. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From Derek.Wong at orionhealth.com Thu May 17 00:59:39 2007 From: Derek.Wong at orionhealth.com (Derek Wong) Date: Thu, 17 May 2007 16:59:39 +1200 Subject: [Wtr-general] Retrieving CSS attributes from attached style sheets. (WATIR 1.5.1.1166) Message-ID: <464C89FB.3702.00B7.0@orionhealth.com> Hi, I'm working on a test that attempts to verify if certain visual characteristics are valid on the page as displayed. Here's the scenario: Normally a given button control on the page has a particular look if it's element class is set to "Button". The HTML for this is Logout In another situation based on some settings in the application the same button has its element class set to "LogoutOverride Button". The HTML for this is Logout BTW, these lines just so happen to be enclosed by a
    tag if this is relevant. When the class of the button is "LogoutOverride Button" there is a link to an associated style sheet file that changes the button imagery to a different background image (a different image filename). I want to verify that this imagery filename is in fact the file I am expecting so I want to query the style attributes associated with the above link element to provide an automated "visual" detection. So far in IRB I have tried the following: irb> puts f.divs[7].html => nil irb> puts f.divs[7].links[1].style.ole_get_methods [ ... lists all the style properties associated with this element ... ] => nil irb> f.divs[7].links[1].style.backgroundImage => "" I wasn't expecting the last line to yield nothing, I thought it would yield the filename to the appropriate image. IE Developer Toolbar in its list of style attributes for this element indicates that this link has the associated imagery against the property 'background-image' with a value of 'url("http://machine/app/css/blah/overridebutton.gif")'. This is what I thought I'd see with the last IRB line given above. So what am I doing wrong here? It looks as if most of the properties that I have inspected so far have yielded "" with the odd exception e.g. the accelerator property was correctly reported as being false. Thanks for any help. Regards, Derek Wong. From christopher.mcmahon at gmail.com Thu May 17 01:40:47 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 16 May 2007 23:40:47 -0600 Subject: [Wtr-general] Controlling IE popups with stock Watir: simplest way? In-Reply-To: <464BCF47.8090107@pettichord.com> References: <91957548-9D3E-43BA-864F-B903FB6333D0@testing.com> <464BCF47.8090107@pettichord.com> Message-ID: <72799cd70705162240y70cfa703pb6799ba07d2eb908@mail.gmail.com> > I have been looking at the win32utils set of gems on rubyforge lately. > The win32-process gem includes a windows implementation of fork that may > be promising. I looked at this some time ago, but it turned out be really stupid. Sorry, I don't remember the details, but it quickly becomes clear that it doesn't do what you think. Windows just does not fork(), and there isn't any way around it. From forum-watir-users at openqa.org Thu May 17 03:28:10 2007 From: forum-watir-users at openqa.org (san) Date: Thu, 17 May 2007 02:28:10 CDT Subject: [Wtr-general] How To Click On The 2nd Link With The Same Img Source.... Message-ID: <30565438.19601179386920453.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Everybody... Here's The Sample html Code... Company A etc... etc..... Company B etc... etc... Company C Now If I Write[i] ie.image(:src, /pdf_small/i).click [/i]..... It Clicks On The 1st Link & Opens The Page... Next Time I Go Back...[i] ie.back [/i]... & Now I Want To Click On The 2nd Link.... In Fact I Want It In A Loop... So How Do I Do That? Thanks In Advance.. :) From zeljko.filipin at gmail.com Thu May 17 03:56:38 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 17 May 2007 09:56:38 +0200 Subject: [Wtr-general] :beforeText and :afterText In-Reply-To: <970956b0705161458x5170d40bnd077f9195c361b37@mail.gmail.com> References: <970956b0705161458x5170d40bnd077f9195c361b37@mail.gmail.com> Message-ID: On 5/16/07, Jeff Fry wrote: > > Any input from folks who either use or have tried unsuccessfully to use > these two? > I have tried to use it, but it did not work for me. As far as I am concerned, it can be removed. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070517/692edc7c/attachment.html From zeljko.filipin at gmail.com Thu May 17 04:41:47 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 17 May 2007 10:41:47 +0200 Subject: [Wtr-general] How To Click On The 2nd Link With The Same Img Source.... In-Reply-To: <30565438.19601179386920453.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30565438.19601179386920453.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi San, Try this: ie.image(:src => /pdf_small/i, :index => 1).click ie.image(:src => /pdf_small/i, :index => 2).click ... I guess that you know how to create a loop. If not, see http://www.rubycentral.com/book/tut_expressions.html There is section called Loops. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070517/e15748f1/attachment.html From forum-watir-users at openqa.org Thu May 17 04:54:33 2007 From: forum-watir-users at openqa.org (san) Date: Thu, 17 May 2007 03:54:33 CDT Subject: [Wtr-general] How To Click On The 2nd Link With The Same Img Source..... In-Reply-To: Message-ID: <30112864.20371179392103038.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks zeljko... Let Me Try It... for $i in 1 .. 3 ie.image(:src => /pdf_small/i, :index => #{$i}).click sleep 10 etc.. etc... ie.back end & Will Let You Know If It Works Or Not... Hopefully It Will :) From zeljko.filipin at gmail.com Thu May 17 05:10:28 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 17 May 2007 11:10:28 +0200 Subject: [Wtr-general] How To Click On The 2nd Link With The Same Img Source..... In-Reply-To: <30112864.20371179392103038.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30112864.20371179392103038.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 5/17/07, san wrote: > > for $i in 1 .. 3 > ie.image(:src => /pdf_small/i, :index => #{$i}).click > sleep 10 > etc.. etc... > ie.back > end > There is no need for global variable in for $i in 1 .. 3 I suggest that you change it to for i in 1 .. 3 Also, :index expects integer, not string. So, :index => #{$i} should be :index => i Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070517/d151c2f5/attachment.html From forum-watir-users at openqa.org Thu May 17 05:45:09 2007 From: forum-watir-users at openqa.org (san) Date: Thu, 17 May 2007 04:45:09 CDT Subject: [Wtr-general] How To Click On The 2nd Link With The Same Img Source...... In-Reply-To: Message-ID: <31956073.20481179395140062.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks For The Info zeljko... From bret at pettichord.com Thu May 17 10:09:47 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 17 May 2007 09:09:47 -0500 Subject: [Wtr-general] :beforeText and :afterText In-Reply-To: References: <970956b0705161458x5170d40bnd077f9195c361b37@mail.gmail.com> Message-ID: <464C622B.2010600@pettichord.com> ?eljko Filipin wrote: > On 5/16/07, *Jeff Fry* > wrote: > > Any input from folks who either use or have tried unsuccessfully > to use these two? > > > I have tried to use it, but it did not work for me. As far as I am > concerned, it can be removed. Let's pull it from the doc right now and schedule to remove the functionality from 1.6. Whatever it did do, wouldn't port to other browsers anyway, because it was an IE-specific thing. Bret From forum-watir-users at openqa.org Thu May 17 12:16:41 2007 From: forum-watir-users at openqa.org (Lauren) Date: Thu, 17 May 2007 11:16:41 CDT Subject: [Wtr-general] exists? method not working inside my assert - can someone explain? In-Reply-To: <36701193.8431179300284570.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36866129.23981179418631150.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Does nobody understand why: $ie.span(:text, "title").exists? returns true... But wrapping in assert statement around the same statement then fails? assert($ie.span(:text, "title").exists?) ...or was my question so simple nobody felt like addressing it?? I would really appreciate some guidance. I have a script with 66 test cases that I was wanting to test this way...but it's apparently not giving me the correct test results?? Again, if you have any ideas...please reply. Thanks. From christopher.mcmahon at gmail.com Thu May 17 12:28:08 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 17 May 2007 10:28:08 -0600 Subject: [Wtr-general] exists? method not working inside my assert - can someone explain? In-Reply-To: <36866129.23981179418631150.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36701193.8431179300284570.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <36866129.23981179418631150.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70705170928l7be09dd7y2e70865501eeb7e9@mail.gmail.com> > ...or was my question so simple nobody felt like addressing it?? I would really appreciate some guidance. I have a script with 66 test cases that I was wanting to test this way...but it's apparently not giving me the correct test results?? > > Again, if you have any ideas...please reply. I did a little spike. I'm going to guess that something funky is going on with the "exists?" method, but I don't know what. From aidy.lewis at googlemail.com Thu May 17 12:31:01 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Thu, 17 May 2007 17:31:01 +0100 Subject: [Wtr-general] exists? method not working inside my assert - can someone explain? In-Reply-To: <36866129.23981179418631150.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36701193.8431179300284570.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <36866129.23981179418631150.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <7ac2300c0705170931w9b0982fs18deda15b3c12651@mail.gmail.com> On 17/05/07, Lauren wrote: > Does nobody understand why: > > $ie.span(:text, "title").exists? > > returns true... > > But wrapping in assert statement around the same statement then fails? > > assert($ie.span(:text, "title").exists?) Looks OK. Could you send us the test HTML page? aidy From charley.baker at gmail.com Thu May 17 12:53:12 2007 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 17 May 2007 10:53:12 -0600 Subject: [Wtr-general] The test case should be failed, but it is not In-Reply-To: <26684126.6821179269933813.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <26684126.6821179269933813.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: WinExists returns either a 1 or a 0, both are true in ruby. You can use assert_equal instead: assert_equal(1, autoit.WinExists("test.txt - Notepad")) -Charley On 5/15/07, Kui Zhang wrote: > > Hello, > > I have a question for the test case below. When the Notepad window is not > open, the test case run and complete without warning or error. Looks like > autoit statements do not provide warning and assert is passed. > > I thought if the Notepad is not open, autoit statements should provide > warning and assert should fail. > > Can you please confirm? If it should be failed, why it is not? > > Thanks! > Kui > > > def test_file_Exists > goto_page > ?. > > autoit = WIN32OLE.new('AutoItX3.Control') > > autoit.WinWait("test.txt - Notepad", nil, 5) > autoit.WinActive("test.txt - Notepad") > assert(autoit.WinExists("test.txt - Notepad")) > puts ("Window exist") > autoit.WinKill("test.txt - Notepad") > > end > end > _______________________________________________ > 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/20070517/6cbf9d41/attachment-0001.html From forum-watir-users at openqa.org Thu May 17 12:57:16 2007 From: forum-watir-users at openqa.org (Lauren) Date: Thu, 17 May 2007 11:57:16 CDT Subject: [Wtr-general] exists? method not working inside my assert - can In-Reply-To: <7ac2300c0705170931w9b0982fs18deda15b3c12651@mail.gmail.com> Message-ID: <36996795.24191179421066325.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks aidy and cmcmahon, Here is a snippet of the source of the page I'm testing with the 'title', 'first name' and 'last name' text labels I want to verify located in a span. Can I use ie.span(:text, "xxxxxx").exists? in this case??
    My cheeks are red with embarrassment but now my first statement is returning false as well...when I swear it was returning true yesterday. So I understand why an assert statement would return false - when the statement it is asserting is false...but now I'm confused about why it is returning false...and why yesterday it was true... From forum-watir-users at openqa.org Thu May 17 13:00:11 2007 From: forum-watir-users at openqa.org (Lauren) Date: Thu, 17 May 2007 12:00:11 CDT Subject: [Wtr-general] exists? method not working inside my assert - can In-Reply-To: <36996795.24191179421066325.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <33645648.24251179421241958.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> From marick at testing.com Thu May 17 13:38:39 2007 From: marick at testing.com (Brian Marick) Date: Thu, 17 May 2007 13:38:39 -0400 Subject: [Wtr-general] Controlling IE popups with stock Watir: simplest way? In-Reply-To: <464BCF47.8090107@pettichord.com> References: <91957548-9D3E-43BA-864F-B903FB6333D0@testing.com> <464BCF47.8090107@pettichord.com> Message-ID: On May 16, 2007, at 11:43 PM, Bret Pettichord wrote: >> 3. Have the parent process spin, waiting for that file to be created, >> then continue. >> > I wonder whether this is really what is happening. My guess is that it > is blocked... > [...] > I don't think you actually need to have the file polling system. The > reason why is that the click method will not return until the > dialog has > been closed. So you don't need a second synchronization method. Well duh. Removing the creation of, and checking for, the sentinel file certainly seems to work as you describe. Much cleaner. > Like i said these win32utils seem to provide everything you need and > wrap a lot of the win32api nonesense, so you really would be better > looking at that. I'll check it out. The only advantage over using popen is that you don't have to have an executable ruby file (and know where to find it). You can just require a watcher file and do the work without any implicit or explicit exec. ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant www.exampler.com, www.exampler.com/blog From bret at pettichord.com Thu May 17 13:44:50 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 17 May 2007 12:44:50 -0500 Subject: [Wtr-general] Controlling IE popups with stock Watir: simplest way? In-Reply-To: References: <91957548-9D3E-43BA-864F-B903FB6333D0@testing.com> <464BCF47.8090107@pettichord.com> Message-ID: <464C9492.20902@pettichord.com> Brian Marick wrote: > > I'll check it out. The only advantage over using popen is that you > don't have to have an executable ruby file (and know where to find > it). You can just require a watcher file and do the work without any > implicit or explicit exec. > I seem to remember seeing a popen3 somewhere. The main advantage of this was that it gave you better control/access to the stdin, stdout, and stderr (which i presume is what the 3 refers to: these three streams). Bret From forum-watir-users at openqa.org Thu May 17 15:24:47 2007 From: forum-watir-users at openqa.org (Ken) Date: Thu, 17 May 2007 14:24:47 CDT Subject: [Wtr-general] Error message with a dropdown Message-ID: <28410778.26341179429917358.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am getting the following error: c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1336:in `method_missing': document (WIN3 2OLERuntimeError) OLE error code:80004005 in HRESULT error code:0x80020009 Exception occurred. from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:133 6:in `document' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:754:in `getContainerContent s' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:778:in `getObject' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2899:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:429:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:429:in `select_list' from C:/Documents and Settings/kcapperell/My Documents/Catalog Automatio n Scripts/ItemShopping.rb:40 Line 40 is where I am selecting the caption in the drop down: ie.select_list(:name, "frameMain:_ctl5:_ctl1:SearchType").Select("Supplier SKU") I know that the name is correct and that the selection of "Supplier SKU" is valid. I dont know why it cannot select it though. Does anybody know why I might be getting this error? From paul.rogers at shaw.ca Thu May 17 15:34:42 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 17 May 2007 13:34:42 -0600 Subject: [Wtr-general] Error message with a dropdown References: <28410778.26341179429917358.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <099501c798ba$6ad743e0$6400a8c0@laptop> which version of watir are you using? I there a page refresh when the select box is selected? Paul ----- Original Message ----- From: "Ken" To: Sent: Thursday, May 17, 2007 1:24 PM Subject: [Wtr-general] Error message with a dropdown >I am getting the following error: > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1336:in `method_missing': document > (WIN3 > 2OLERuntimeError) > OLE error code:80004005 in > > HRESULT error code:0x80020009 > Exception occurred. from > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:133 > 6:in `document' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:754:in > `getContainerContent > s' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:778:in `getObject' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2899:in `initialize' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:429:in `new' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:429:in `select_list' > from C:/Documents and Settings/kcapperell/My Documents/Catalog > Automatio > n Scripts/ItemShopping.rb:40 > > Line 40 is where I am selecting the caption in the drop down: > ie.select_list(:name, "frameMain:_ctl5:_ctl1:SearchType").Select("Supplier > SKU") > > I know that the name is correct and that the selection of "Supplier SKU" > is valid. I dont know why it cannot select it though. Does anybody know > why I might be getting this error? > _______________________________________________ > 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 17 15:34:41 2007 From: forum-watir-users at openqa.org (alan) Date: Thu, 17 May 2007 14:34:41 CDT Subject: [Wtr-general] verifying contents of text_field In-Reply-To: <464BC01B.30205@pettichord.com> Message-ID: <29284060.26971179430511039.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks, that did the trick once I got around the newb mistake of not having require 'test/unit/assertions' include Test::Unit::Assertions Now I just have to figure out how to put the results in an excel spreadsheet the same way I do with the results from an If/Else. Thanks Again! From forum-watir-users at openqa.org Thu May 17 15:44:52 2007 From: forum-watir-users at openqa.org (Ken) Date: Thu, 17 May 2007 14:44:52 CDT Subject: [Wtr-general] Error message with a dropdown In-Reply-To: <099501c798ba$6ad743e0$6400a8c0@laptop> Message-ID: <30697199.27081179431122615.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I just downloaded Watir a week ago so I assume its the latest and greatest. No, there is no refresh when the box is selected. From marick at testing.com Thu May 17 17:02:38 2007 From: marick at testing.com (Brian Marick) Date: Thu, 17 May 2007 17:02:38 -0400 Subject: [Wtr-general] Controlling IE popups with stock Watir: simplest way? In-Reply-To: <464C9492.20902@pettichord.com> References: <91957548-9D3E-43BA-864F-B903FB6333D0@testing.com> <464BCF47.8090107@pettichord.com> <464C9492.20902@pettichord.com> Message-ID: On May 17, 2007, at 1:44 PM, Bret Pettichord wrote: > I seem to remember seeing a popen3 somewhere. The main advantage of > this > was that it gave you better control/access to the stdin, stdout, and > stderr (which i presume is what the 3 refers to: these three streams). popen3 uses fork(), so it doesn't work on Windows. ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant www.exampler.com, www.exampler.com/blog From Derek.Wong at orionhealth.com Thu May 17 17:08:04 2007 From: Derek.Wong at orionhealth.com (Derek Wong) Date: Fri, 18 May 2007 09:08:04 +1200 Subject: [Wtr-general] Retrieving CSS attributes from attached style sheets. (WATIR 1.5.1.1166) Message-ID: <464D6CF4.3702.00B7.0@orionhealth.com> Okay, so I've just seen this posting from Bret on the following thread (http://www.mail-archive.com/wtr-general%40rubyforge.org/msg08637.html) which seems to clarify things a bit although it still raises some questions for a non-HTML expert still getting used to Ruby, WATIR and the ins and outs of Web testing all at once... ;^) It would seem that I have to do the following: irb> d=f.divs[7] irb> l=d.links[1] irb> l.locate (if you don't do this the following line will not work!!! Refer to http://jira.openqa.org/browse/WTR-139) irb> l.ole_object.currentStyle.backgroundImage => "url(\"http://machine/app/css/menubar/overridebutton.gif\")" After this I can grab any available property that is under currentStyle. What I can't understand is why I cannot use the style accessor handle, to get what is required by my test requires me to look under the currentStyle handle. Probably some HTML ignorance of mine coming through... Still, with this I can now expand my testing framework to verify these kinds of tests now. This is pretty cool. Derek Wong. >>> "Derek Wong" 17/05/2007 4:59 p.m. >>> Hi, I'm working on a test that attempts to verify if certain visual characteristics are valid on the page as displayed. Here's the scenario: Normally a given button control on the page has a particular look if it's element class is set to "Button". The HTML for this is Logout In another situation based on some settings in the application the same button has its element class set to "LogoutOverride Button". The HTML for this is Logout BTW, these lines just so happen to be enclosed by a
    tag if this is relevant. When the class of the button is "LogoutOverride Button" there is a link to an associated style sheet file that changes the button imagery to a different background image (a different image filename). I want to verify that this imagery filename is in fact the file I am expecting so I want to query the style attributes associated with the above link element to provide an automated "visual" detection. So far in IRB I have tried the following: irb> puts f.divs[7].html => nil irb> puts f.divs[7].links[1].style.ole_get_methods [ ... lists all the style properties associated with this element ... ] => nil irb> f.divs[7].links[1].style.backgroundImage => "" I wasn't expecting the last line to yield nothing, I thought it would yield the filename to the appropriate image. IE Developer Toolbar in its list of style attributes for this element indicates that this link has the associated imagery against the property 'background-image' with a value of 'url("http://machine/app/css/blah/overridebutton.gif")'. This is what I thought I'd see with the last IRB line given above. So what am I doing wrong here? It looks as if most of the properties that I have inspected so far have yielded "" with the odd exception e.g. the accelerator property was correctly reported as being false. Thanks for any help. Regards, Derek Wong. From bret at pettichord.com Thu May 17 17:42:25 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 17 May 2007 16:42:25 -0500 Subject: [Wtr-general] Error message with a dropdown In-Reply-To: <30697199.27081179431122615.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30697199.27081179431122615.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <464CCC41.7010703@pettichord.com> Ken wrote: > I just downloaded Watir a week ago so I assume its the latest and greatest. No, there is no refresh when the box is selected. > You are using 1.4.1. You can find more recent versions here: http://wiki.openqa.org/display/WTR/Development+Builds From jeff.fry at gmail.com Thu May 17 18:20:31 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Thu, 17 May 2007 15:20:31 -0700 Subject: [Wtr-general] :beforeText and :afterText In-Reply-To: <464C622B.2010600@pettichord.com> References: <970956b0705161458x5170d40bnd077f9195c361b37@mail.gmail.com> <464C622B.2010600@pettichord.com> Message-ID: <970956b0705171520y5729e07fsa5c8858c0ce282a7@mail.gmail.com> Cool. In that case, I will not only remove the example I added, I will also remove it anywhere it's listed as an allowed 'how' value. On 5/17/07, Bret Pettichord wrote: > > ?eljko Filipin wrote: > > On 5/16/07, *Jeff Fry* > > wrote: > > > > Any input from folks who either use or have tried unsuccessfully > > to use these two? > > > > > > I have tried to use it, but it did not work for me. As far as I am > > concerned, it can be removed. > Let's pull it from the doc right now and schedule to remove the > functionality from 1.6. Whatever it did do, wouldn't port to other > browsers anyway, because it was an IE-specific thing. > > Bret > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070517/f77bcb05/attachment-0001.html From forum-watir-users at openqa.org Thu May 17 19:08:04 2007 From: forum-watir-users at openqa.org (Lauren) Date: Thu, 17 May 2007 18:08:04 CDT Subject: [Wtr-general] exists? method not working inside my assert - can In-Reply-To: <33645648.24251179421241958.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <38107975.28781179443314503.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Okay... Here's a specific example of when the code is "true" outside of the assert, but when wrapped in an assert it returns false. Wouldn't -> assert(true) return true? Trying to be more specific... Could it be the set up of my testcase using test/unit?? ------------------------------------------------------------------------------------------------------------------- require 'watir' require 'test/unit' require 'test/unit/testcase' $ie = Watir::IE.start("http://.........") $ie.bring_to_front if $ie.span(:class=>"formText", :text=>"title").exists? puts("Found it! Title") else puts("...back to the drawing board...") end titleExist = $ie.span(:class=>"formText", :text=>"title").exists? puts titleExist class TC_personal_information < Test::Unit::TestCase include Watir def test_title assert($ie.span(:class=>"formText", :text=>"title").exists?) end end #end class $ie.close ------------------------------------------------------------------------------------ gives the following results: ------------------------------------------------------------------------------------ >ruby debug05152007.rb Found it! Title true Loaded suite debug05152007 Started F Finished in 0.046 seconds. 1) Failure: test_title(TC_personal_information) [debug05152007.rb:24]: is not true. 1 tests, 1 assertions, 1 failures, 0 errors >Exit code: 0 ---------------------------------------------------------------------------------------------------- Thanks again - Lauren From zeljko.filipin at gmail.com Thu May 17 19:15:07 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 18 May 2007 01:15:07 +0200 Subject: [Wtr-general] New Watir User Guide (beta) Message-ID: Don't you just love all those betas? There is another one! New Watir User Guide (beta). Check it out and let me know what you think about it. It is just a first draft. Please, be polite. It is just a few minutes old. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/5bc9e6e2/attachment.html From zeljko.filipin at gmail.com Thu May 17 19:17:45 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 18 May 2007 01:17:45 +0200 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: References: Message-ID: Can you tell that it is past 1 am here? I forgot the link. Here it is. http://wiki.openqa.org/display/WTR/New+Watir+User+Guide+%28beta%29 You can also find a link to it at Watir wiki home page ( http://wiki.openqa.org/display/WTR/Project+Home) under Learning Watir headline. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/baa879e8/attachment.html From christopher.mcmahon at gmail.com Thu May 17 20:02:48 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 17 May 2007 18:02:48 -0600 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: References: Message-ID: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> On 5/17/07, ?eljko Filipin wrote: > Can you tell that it is past 1 am here? I forgot the link. Here it is. > > http://wiki.openqa.org/display/WTR/New+Watir+User+Guide+%28beta%29 Clearly this is going to be iterative :) If it were me, I would have done require 'watir' include Watir (it's magic anyway, it won't hurt) ie = IE.new (let people see a blank browser) ie.goto("http://www.google.com") From zeljko.filipin at gmail.com Fri May 18 03:40:19 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 18 May 2007 09:40:19 +0200 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> Message-ID: Chris, Thanks for your suggestions. Comments are inline. On 5/18/07, Chris McMahon wrote: > > Clearly this is going to be iterative :) You don't drink the whole beer at once, right? You iterate until it is done. :) If it were me, I would have done > > require 'watir' > include Watir (it's magic anyway, it won't hurt) > ie = IE.new (let people see a blank browser) > ie.goto("http://www.google.com") My line of thought is to have as many steps as possible. As you said, at this point everything is magic anyway. What I would like is to hear from people that just started using Watir. Is this require 'watir' include Watir (it's magic anyway, it won't hurt) ie = IE.new (let people see a blank browser) ie.goto("http://www.google.com") more clear than this? require 'watir' ie = Watir::IE.start("http://www.google.com/") Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/493fabec/attachment.html From WKruse at multichoice.co.za Fri May 18 03:51:02 2007 From: WKruse at multichoice.co.za (Walter Kruse) Date: Fri, 18 May 2007 09:51:02 +0200 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> Message-ID: I vote for: require 'watir' include Watir (it's magic anyway, it won't hurt) ie = IE.new (let people see a blank browser) ie.goto("http://www.google.com ") Show people the steps and show them later how to abbreviate it with a small explanation of the Ruby idiom. It's also important to explain each line. What, I believe, it will result in is a deeper understanding as opposed to just knowing how to do tasks with canned food. A problem I have as a relative latecomer to programming is that I know how to do certain things, but not why. It makes problem solving difficult. My 2 cents. Walter ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of ?eljko Filipin Sent: 18 May 2007 09:40 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] New Watir User Guide (beta) Chris, Thanks for your suggestions. Comments are inline. On 5/18/07, Chris McMahon wrote: Clearly this is going to be iterative :) You don't drink the whole beer at once, right? You iterate until it is done. :) If it were me, I would have done require 'watir' include Watir (it's magic anyway, it won't hurt) ie = IE.new (let people see a blank browser) ie.goto(" http://www.google.com ") My line of thought is to have as many steps as possible. As you said, at this point everything is magic anyway. What I would like is to hear from people that just started using Watir. Is this require 'watir' include Watir (it's magic anyway, it won't hurt) ie = IE.new (let people see a blank browser) ie.goto("http://www.google.com ") more clear than this? require 'watir' ie = Watir::IE.start("http://www.google.com/") Zeljko ************************************************************************************************************************** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. ************************************************************************************************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/827946ef/attachment.html From zeljko.filipin at gmail.com Fri May 18 03:55:41 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 18 May 2007 09:55:41 +0200 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> Message-ID: And we have the first user contribution! Christopher Rasch added anchors for installation instructions for platforms and browsers other than Windows/IE. It is something that I do not want there, but I guess it has to be somewhere. Christopher, you can put "Certified Watir user guide contributor" text at your site if you like. :) Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/e5536ccd/attachment-0001.html From zeljko.filipin at gmail.com Fri May 18 04:00:45 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 18 May 2007 10:00:45 +0200 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: References: Message-ID: On 5/18/07, ?eljko Filipin wrote: > > http://wiki.openqa.org/display/WTR/New+Watir+User+Guide+%28beta%29 I just can not look at ugly urls. I had to change it. http://wiki.openqa.org/display/WTR/User+Guide Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/26ddf528/attachment.html From zeljko.filipin at gmail.com Fri May 18 04:53:23 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 18 May 2007 10:53:23 +0200 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> Message-ID: On 5/18/07, ?eljko Filipin wrote: > > Christopher Rasch added anchors for installation instructions for > platforms and browsers other than Windows/IE. Christopher, I have moved your contribution to http://wiki.openqa.org/display/WTR/Install+instructions and linked to it from user guide. If you think install instructions should be in user guide, please let me know. I would like to hear from others too. I hope this will not discourage you (and others) in further contributions. I have a vague vision how user guide should look, and detailed installation instructions for various platforms and browsers just did not fit at that page. I am glad that you have contributed it, but I think it should have it's own page. Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/6f052cf8/attachment.html From forum-watir-users at openqa.org Fri May 18 05:29:15 2007 From: forum-watir-users at openqa.org (Grzesiek) Date: Fri, 18 May 2007 04:29:15 CDT Subject: [Wtr-general] How to handle pop dialouge boxes by clicking on OK button In-Reply-To: <38233151.5801178686457584.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <30053365.33321179480585201.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, For me it works this way (watir-1.5.1.1166) require 'watir/contrib/enabled_popup' ie.button(:value, /#{valid_text}/).click_no_wait #pressing button after which popup shows hwnd = ie.enabled_popup(15) # get a handle if one exists if (hwnd) # yes there is a popup w = WinClicker.new w.makeWindowActive(hwnd) w.clickWindowsButton_hwnd(hwnd, "Yes") # click the "Yes" button end From zeljko.filipin at gmail.com Fri May 18 05:35:22 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 18 May 2007 11:35:22 +0200 Subject: [Wtr-general] Watir wiki Message-ID: Why is Project Home child of FAQ at Watir wiki? Is this a bug? Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/3cea090b/attachment.html From zeljko.filipin at gmail.com Fri May 18 06:39:55 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 18 May 2007 12:39:55 +0200 Subject: [Wtr-general] Watir wiki In-Reply-To: References: Message-ID: I have been browsing Watir Wiki and http://wiki.openqa.org/display/WTR/Watir+Committers has error message "Error formatting macro: userlister: java.lang.NullPointerException". Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/494e8c2c/attachment.html From zeljko.filipin at gmail.com Fri May 18 06:48:34 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 18 May 2007 12:48:34 +0200 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> Message-ID: On 5/18/07, Chris McMahon wrote: > > include Watir (it's magic anyway, it won't hurt) > ie = IE.new (let people see a blank browser) I still do not think this easier to understand than ie = Watir::IE.new I do not know how to explain what it does in few words, except "start IE", and later one is shorter. Does anybody think I should listen to Chris? :) Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/ade42862/attachment.html From zeljko.filipin at gmail.com Fri May 18 06:49:25 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 18 May 2007 12:49:25 +0200 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> Message-ID: Chris, Walter, I separated steps for starting IE and navigating to Google, as you have suggested. That means that you have become contributor of Watir user guide. Now you can put "Certified Watir user guide contributor!" text at your site (with link to user guide, if possible). :) Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/b868b8bf/attachment.html From bret at pettichord.com Fri May 18 09:13:38 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 18 May 2007 08:13:38 -0500 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> Message-ID: <464DA682.3020806@pettichord.com> Walter Kruse wrote: > > require 'watir' > include Watir (it's magic anyway, it won't hurt) > ie = IE.new (let people see a blank browser) > ie.goto("http://www.google.com ") > > Show people the steps and show them later how to abbreviate it with a > small explanation of the Ruby idiom. It?s also important to explain > each line. What, I believe, it will result in is a deeper > understanding as opposed to just knowing how to do tasks with canned > food. A problem I have as a relative latecomer to programming is that > I know how to do certain things, but not why. It makes problem solving > difficult. > My experience is that the "include Watir" line is never understood and in fact people end up thinking that it is some kind of magic. That, to me, is a reason to avoid it. The reality is that it is a shortcut that ends up being longer than what it abbreviates. I'm not going to explain right now what it does. But if you aren't perfectly clear on what it does and how you can explain it to people (who easily get it confused with "require 'watir'", then you should omit it. On the other hand, it is obvious what IE.new and ie.goto each do, and therefore it works just as well for me to break them out as it does to replace them with a "start". Bret From bret at pettichord.com Fri May 18 09:16:12 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 18 May 2007 08:16:12 -0500 Subject: [Wtr-general] Watir wiki In-Reply-To: References: Message-ID: <464DA71C.2@pettichord.com> ?eljko Filipin wrote: > I have been browsing Watir Wiki and > http://wiki.openqa.org/display/WTR/Watir+Committers has error message > "Error formatting macro: userlister: java.lang.NullPointerException". You can report this to Patrick if you like. This used to work. Bret From bret at pettichord.com Fri May 18 09:16:49 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 18 May 2007 08:16:49 -0500 Subject: [Wtr-general] Watir wiki In-Reply-To: References: Message-ID: <464DA741.3030206@pettichord.com> ?eljko Filipin wrote: > Why is Project Home child of FAQ at Watir wiki? Is this a bug? Probably. Feel free to fix it. From bret at pettichord.com Fri May 18 09:19:21 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 18 May 2007 08:19:21 -0500 Subject: [Wtr-general] :beforeText and :afterText In-Reply-To: <970956b0705171520y5729e07fsa5c8858c0ce282a7@mail.gmail.com> References: <970956b0705161458x5170d40bnd077f9195c361b37@mail.gmail.com> <464C622B.2010600@pettichord.com> <970956b0705171520y5729e07fsa5c8858c0ce282a7@mail.gmail.com> Message-ID: <464DA7D9.6050807@pettichord.com> Jeff Fry wrote: > Cool. In that case, I will not only remove the example I added, I will > also remove it anywhere it's listed as an allowed 'how' value. > Here is the jira ticket. http://jira.openqa.org/browse/WTR-154 From WKruse at multichoice.co.za Fri May 18 09:21:20 2007 From: WKruse at multichoice.co.za (Walter Kruse) Date: Fri, 18 May 2007 15:21:20 +0200 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: <464DA682.3020806@pettichord.com> References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> <464DA682.3020806@pettichord.com> Message-ID: I don't know what it does, except that you need it to load watir when using irb :-) -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 18 May 2007 03:14 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] New Watir User Guide (beta) Walter Kruse wrote: > > require 'watir' > include Watir (it's magic anyway, it won't hurt) > ie = IE.new (let people see a blank browser) > ie.goto("http://www.google.com ") > > Show people the steps and show them later how to abbreviate it with a > small explanation of the Ruby idiom. It's also important to explain > each line. What, I believe, it will result in is a deeper > understanding as opposed to just knowing how to do tasks with canned > food. A problem I have as a relative latecomer to programming is that > I know how to do certain things, but not why. It makes problem solving > difficult. > My experience is that the "include Watir" line is never understood and in fact people end up thinking that it is some kind of magic. That, to me, is a reason to avoid it. The reality is that it is a shortcut that ends up being longer than what it abbreviates. I'm not going to explain right now what it does. But if you aren't perfectly clear on what it does and how you can explain it to people (who easily get it confused with "require 'watir'", then you should omit it. On the other hand, it is obvious what IE.new and ie.goto each do, and therefore it works just as well for me to break them out as it does to replace them with a "start". Bret _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ************************************************************************************************************************** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. ************************************************************************************************************************** From zeljko.filipin at gmail.com Fri May 18 09:24:48 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 18 May 2007 15:24:48 +0200 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> <464DA682.3020806@pettichord.com> Message-ID: On 5/18/07, Walter Kruse wrote: > > I don't know what it does, except that you need it to load watir when > using irb :-) I guess that you are referring to include Watir Actually, you do not have to type it when using Watir in irb (as my user guide shows). Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/24770fdd/attachment.html From zeljko.filipin at gmail.com Fri May 18 09:29:17 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 18 May 2007 15:29:17 +0200 Subject: [Wtr-general] Watir wiki In-Reply-To: <464DA741.3030206@pettichord.com> References: <464DA741.3030206@pettichord.com> Message-ID: On 5/18/07, Bret Pettichord wrote: > > Feel free to fix it. Fixed. Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/9baef431/attachment.html From christopher.mcmahon at gmail.com Fri May 18 10:31:23 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 18 May 2007 08:31:23 -0600 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: <464DA682.3020806@pettichord.com> References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> <464DA682.3020806@pettichord.com> Message-ID: <72799cd70705180731n53d0cfb5u4cd6d81b60c2db43@mail.gmail.com> > My experience is that the "include Watir" line is never understood and > in fact people end up thinking that it is some kind of magic. That, to > me, is a reason to avoid it. Eh. I had the opposite experience. It made me go read about what a Module is. From forum-watir-users at openqa.org Fri May 18 10:34:17 2007 From: forum-watir-users at openqa.org (Ken) Date: Fri, 18 May 2007 09:34:17 CDT Subject: [Wtr-general] Error message with a dropdown In-Reply-To: <464CCC41.7010703@pettichord.com> Message-ID: <39823967.38381179498887141.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I downloaded Watir 1.5.1.1166 but I it still gives me one error: ItemShopping.rb:40: undefined method `Select' for # (NoMethodError) Again, here is the line it is referring to: ie.select_list(:name, "frameMain:_ctl5:_ctl1:SearchType").Select("Supplier SKU") I noticed that when i use the Dev tool to ensure that the name is correct, when I click on the list, it opens up the drop down and the name and ID fields are not filled in. The way I verified that I have the correct name is that in the left pane of the DOM Explorer, I clicked on the TD tag and found it in there. From bret at pettichord.com Fri May 18 10:39:48 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 18 May 2007 09:39:48 -0500 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: <72799cd70705180731n53d0cfb5u4cd6d81b60c2db43@mail.gmail.com> References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> <464DA682.3020806@pettichord.com> <72799cd70705180731n53d0cfb5u4cd6d81b60c2db43@mail.gmail.com> Message-ID: <464DBAB4.30908@pettichord.com> Chris McMahon wrote: > Eh. I had the opposite experience. It made me go read about what a > Module is. They why did you say "it's magic anyway"? From bret at pettichord.com Fri May 18 10:42:16 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 18 May 2007 09:42:16 -0500 Subject: [Wtr-general] Error message with a dropdown In-Reply-To: <39823967.38381179498887141.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <39823967.38381179498887141.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <464DBB48.7010606@pettichord.com> Ken wrote: > ItemShopping.rb:40: undefined method `Select' for # (NoMethodError) > > Again, here is the line it is referring to: > > ie.select_list(:name, "frameMain:_ctl5:_ctl1:SearchType").Select("Supplier SKU") > > I noticed that when i use the Dev tool to ensure that the name is correct, when I click on the list, it opens up the drop down and the name and ID fields are not filled in. The way I verified that I have the correct name is that in the left pane of the DOM Explorer, I clicked on the TD tag and found it in there. > Read the error message again and tell me what you think it might mean. Bret From christopher.mcmahon at gmail.com Fri May 18 10:49:46 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 18 May 2007 08:49:46 -0600 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: <464DBAB4.30908@pettichord.com> References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> <464DA682.3020806@pettichord.com> <72799cd70705180731n53d0cfb5u4cd6d81b60c2db43@mail.gmail.com> <464DBAB4.30908@pettichord.com> Message-ID: <72799cd70705180749q3e9c7fedm35b585597d976d29@mail.gmail.com> I meant "to the new user, all of this looks like magic, so we might as well break down the Watir setup commands in as granular a fashion as possible" On 5/18/07, Bret Pettichord wrote: > Chris McMahon wrote: > > Eh. I had the opposite experience. It made me go read about what a > > Module is. > They why did you say "it's magic anyway"? > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From zeljko.filipin at gmail.com Fri May 18 11:09:19 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 18 May 2007 17:09:19 +0200 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: <72799cd70705180749q3e9c7fedm35b585597d976d29@mail.gmail.com> References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> <464DA682.3020806@pettichord.com> <72799cd70705180731n53d0cfb5u4cd6d81b60c2db43@mail.gmail.com> <464DBAB4.30908@pettichord.com> <72799cd70705180749q3e9c7fedm35b585597d976d29@mail.gmail.com> Message-ID: On 5/18/07, Chris McMahon wrote: > > I meant "to the new user, all of this looks like magic, so we might as > well break down the Watir setup commands in as granular a fashion as > possible" I did not think to learn them Ruby. There are good books about it. When they see how easy it is to use Watir, they can learn Ruby if they want. If not, they can think it is magic, as far as I am concerned. Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/0ba24fd5/attachment.html From christopher.mcmahon at gmail.com Fri May 18 11:26:58 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 18 May 2007 09:26:58 -0600 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> <464DA682.3020806@pettichord.com> <72799cd70705180731n53d0cfb5u4cd6d81b60c2db43@mail.gmail.com> <464DBAB4.30908@pettichord.com> <72799cd70705180749q3e9c7fedm35b585597d976d29@mail.gmail.com> Message-ID: <72799cd70705180826s28044e38q159734d484ba9eb3@mail.gmail.com> I just think ie = IE.new is nicer than ie = Watir::IE.new On 5/18/07, ?eljko Filipin wrote: > On 5/18/07, Chris McMahon wrote: > > I meant "to the new user, all of this looks like magic, so we might as > > well break down the Watir setup commands in as granular a fashion as > > possible" > > I did not think to learn them Ruby. There are good books about it. When they > see how easy it is to use Watir, they can learn Ruby if they want. If not, > they can think it is magic, as far as I am concerned. > > Zeljko > > _______________________________________________ > 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 18 11:40:40 2007 From: forum-watir-users at openqa.org (Ken) Date: Fri, 18 May 2007 10:40:40 CDT Subject: [Wtr-general] Error message with a dropdown In-Reply-To: <464DBB48.7010606@pettichord.com> Message-ID: <28447195.39091179502870082.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Yea, I realized that about 2 min after i posted it. I fixed the "select" command and what I have suspected all along is what I am seeing in the console. Its unable to locate the object. Since the Dev Tool cannot locate it either, this is not a surprise to me. What bugs me is I have no idea why it wont recognize it. I used another product before I found this one and that one was able to identify the drop down so I know that the problem likes in Watir somewhere. From forum-watir-users at openqa.org Fri May 18 11:57:00 2007 From: forum-watir-users at openqa.org (Jorj) Date: Fri, 18 May 2007 10:57:00 CDT Subject: [Wtr-general] How to include asserts from Watir::Simple module? Message-ID: <33821061.39151179503850663.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Guys, can you help me? I can work with asserts from Test::Unit::Assertions. But how, for example, work with following assert: assert_image_with_src("link")? What I shell do? Help me! From bret at pettichord.com Fri May 18 12:31:22 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 18 May 2007 11:31:22 -0500 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: <72799cd70705180826s28044e38q159734d484ba9eb3@mail.gmail.com> References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> <464DA682.3020806@pettichord.com> <72799cd70705180731n53d0cfb5u4cd6d81b60c2db43@mail.gmail.com> <464DBAB4.30908@pettichord.com> <72799cd70705180749q3e9c7fedm35b585597d976d29@mail.gmail.com> <72799cd70705180826s28044e38q159734d484ba9eb3@mail.gmail.com> Message-ID: <464DD4DA.8010304@pettichord.com> Chris McMahon wrote: > I just think > ie = IE.new > > is nicer than > > ie = Watir::IE.new > If we are going to tell everyone to do 'include Watir', then we could make things easier by putting just this line of code in watir.rb and have it execute automatically when the 'require "watir"' happens. Or to put in another way, why put the Watir code in a module when you are just going to tell users to import the module into the toplevel name space? Bret From bret at pettichord.com Fri May 18 13:12:31 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 18 May 2007 12:12:31 -0500 Subject: [Wtr-general] Error message with a dropdown In-Reply-To: <28447195.39091179502870082.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28447195.39091179502870082.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <464DDE7F.2000104@pettichord.com> Ken wrote: > Yea, I realized that about 2 min after i posted it. I fixed the "select" command and what I have suspected all along is what I am seeing in the console. Its unable to locate the object. Since the Dev Tool cannot locate it either, this is not a surprise to me. What bugs me is I have no idea why it wont recognize it. I used another product before I found this one and that one was able to identify the drop down so I know that the problem likes in Watir somewhere Actually, i'm starting to think that the problem is that you are expecting Watir to understand the naming convention used by another tool. Without seeing the HTML, i can't really say, but to me it looks like your select list might be inside a frame, and that your name string is incorrect. Bret From bret at pettichord.com Fri May 18 13:22:59 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 18 May 2007 12:22:59 -0500 Subject: [Wtr-general] exists? method not working inside my assert - can In-Reply-To: <38107975.28781179443314503.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <38107975.28781179443314503.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <464DE0F3.2010308@pettichord.com> Lauren wrote: > Wouldn't -> assert(true) return true? Nope. That's not what assert does. It raises an exception on failure. It does not return a value. From forum-watir-users at openqa.org Fri May 18 13:48:15 2007 From: forum-watir-users at openqa.org (Ken) Date: Fri, 18 May 2007 12:48:15 CDT Subject: [Wtr-general] Error message with a dropdown In-Reply-To: <464DDE7F.2000104@pettichord.com> Message-ID: <24672094.311179510525660.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Here is the HTML for the object:
    You could be right in thinking that it is buried in a frame but I dont think that it is given the lack of problems in the past. From forum-watir-users at openqa.org Fri May 18 14:03:35 2007 From: forum-watir-users at openqa.org (Lauren) Date: Fri, 18 May 2007 13:03:35 CDT Subject: [Wtr-general] exists? method not working inside my assert - can In-Reply-To: <464DE0F3.2010308@pettichord.com> Message-ID: <22544758.371179511445348.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks Bret for writing in. I guess what I meant was when the statement inside the assert statement is true -> assert(true) wouldn't the +value+ then be true...meaning not false...meaning +shouldn't+ fail or throw an exception ? If the object above exists and I wrap an assert around it - doesn't the statement say "assert that this statement is true" -> the statement is true...so it passes without failure. Right? 1 test 1 assertion 0 failures 0 errors Instead, I am getting: 1 test 1 assertion 1 failure 0 errors. I thought I saw this type of testing in the unittests. For example, in "div_test.rb" line#132: assert($ie.span(:id, 'buttons1').button(:index,1).exists? ) From bret at pettichord.com Fri May 18 16:38:34 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 18 May 2007 15:38:34 -0500 Subject: [Wtr-general] Error message with a dropdown In-Reply-To: <24672094.311179510525660.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <24672094.311179510525660.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <464E0ECA.6080401@pettichord.com> Ken wrote: > Here is the HTML for the object: > > > > You could be right in thinking that it is buried in a frame but I dont think that it is given the lack of problems in the past. > Have you tried to access it via id? From bret at pettichord.com Fri May 18 16:43:48 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 18 May 2007 15:43:48 -0500 Subject: [Wtr-general] exists? method not working inside my assert - can In-Reply-To: <22544758.371179511445348.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <22544758.371179511445348.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <464E1004.10200@pettichord.com> Lauren wrote: > Thanks Bret for writing in. > > I guess what I meant was when the statement inside the assert statement is true -> assert(true) wouldn't the +value+ then be true...meaning not false...meaning +shouldn't+ fail or throw an exception ? > > If the object above exists and I wrap an assert around it - doesn't the statement say "assert that this statement is true" -> the statement is true...so it passes without failure. Right? > > 1 test 1 assertion 0 failures 0 errors > > Instead, I am getting: 1 test 1 assertion 1 failure 0 errors. > > I thought I saw this type of testing in the unittests. > For example, in "div_test.rb" line#132: assert($ie.span(:id, 'buttons1').button(:index,1).exists? ) > I think you understand it correctly. I looked at your code again and cannot guess what the problem could be. Is it possible that you actually have more code than you are showing us? Bret From forum-watir-users at openqa.org Fri May 18 17:11:03 2007 From: forum-watir-users at openqa.org (Lauren) Date: Fri, 18 May 2007 16:11:03 CDT Subject: [Wtr-general] exists? method not working inside my assert - can In-Reply-To: <464E1004.10200@pettichord.com> Message-ID: <32837977.1171179522693891.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> > {quote:title=bret wrote:}{quote} >Is it possible that you actually have more code than you are showing us? Nope. That's the whole thing. I did edit out the (http://........) address for the forum's benefit. The actual code goes to the actual test site. Other than that, it's exactly the same. I just double checked. From crasch at gmail.com Fri May 18 17:36:58 2007 From: crasch at gmail.com (Christopher Rasch) Date: Fri, 18 May 2007 14:36:58 -0700 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> Message-ID: <464E1C7A.5000701@gmail.com> ?eljko Filipin wrote: > On 5/18/07, ?eljko Filipin wrote: >> >> Christopher Rasch added anchors for installation instructions for >> platforms and browsers other than Windows/IE. > > > Christopher, > > I have moved your contribution to > http://wiki.openqa.org/display/WTR/Install+instructions and linked to it > from user guide. If you think install instructions should be in user guide, > please let me know. I would like to hear from others too. > > I hope this will not discourage you (and others) in further > contributions. I > have a vague vision how user guide should look, and detailed installation > instructions for various platforms and browsers just did not fit at that > page. I am glad that you have contributed it, but I think it should have > it's own page. > > Zeljko > Hi Zeljko, Thanks! Moving the install instructions to their own page is fine with me. Chris From jeff.fry at gmail.com Fri May 18 18:43:38 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Fri, 18 May 2007 15:43:38 -0700 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: <464DD4DA.8010304@pettichord.com> References: <464DA682.3020806@pettichord.com> <72799cd70705180731n53d0cfb5u4cd6d81b60c2db43@mail.gmail.com> <464DBAB4.30908@pettichord.com> <72799cd70705180749q3e9c7fedm35b585597d976d29@mail.gmail.com> <72799cd70705180826s28044e38q159734d484ba9eb3@mail.gmail.com> <464DD4DA.8010304@pettichord.com> Message-ID: <970956b0705181543o10a42cdbk7f58662c0e11af81@mail.gmail.com> On 5/18/07, Bret Pettichord wrote: > > > If we are going to tell everyone to do 'include Watir', then we could > make things easier by putting just this line of code in watir.rb and > have it execute automatically when the 'require "watir"' happens. Huh, could you do that? Here are my decidely non-expert understandings about what requiring and including do, based on playing around: - require 'watir' => I want to use things from watir (generally methods, possibly also constants, etc.) - include Watir => I don't want to have to type Watir:: in front of any watir methods I use. (Put more precisely, when I call a method without pre-pending it with the name of a file, check both this file and whatever files I've included.) If anyone who understands the above better than I do wants to add to or correct the above, I'd appreciate it. >From my perspective, I always start out by requiring and including watir, because I'd rather paste it into the top of a script once than have to type Watir:: several times below. I was planning to say that I'd love to have watir automatically included whenever I require it...but that might have resulted in unneccessary confusion when I first started requiring (and wishing to include) other ruby modules. So in the end I think my vote is to teach include from the beginning, but not to have require automagically include as well...since that's not true for other ruby modules. Or to put in another way, why put the Watir code in a module when you > are just going to tell users to import the module into the toplevel name > space? > > Bret > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/3dbe7864/attachment.html From forum-watir-users at openqa.org Fri May 18 18:50:28 2007 From: forum-watir-users at openqa.org (Lauren) Date: Fri, 18 May 2007 17:50:28 CDT Subject: [Wtr-general] exists? method not working inside my assert - can In-Reply-To: <32837977.1171179522693891.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <28275010.1781179528658801.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I figured it out: It was the: *$ie.close* Wrapping it in a method solved the problem. (See below for example) ------ require 'watir' require 'test/unit' require 'test/unit/testcase' $ie = Watir::IE.start("http://cashwest.com/TestTheForm/Form/?reset=1&test=1&cf=8143&forcePage=1") $ie.bring_to_front if $ie.span(:class=>"formText", :text=>"title").exists? puts("Found it! Title") else puts("...back to the drawing board...") end titleExist = $ie.span(:class=>"formText", :text=>"title").exists? puts titleExist class TC_personal_information < Test::Unit::TestCase include Watir def test_completely_unique_method_name assert($ie.span(:class=>"formText", :text=>"title").exists?) end end #end class *def close* $ie.close *end* -------------------- ruby debug05152007.rb Found it! Title true Loaded suite debug05152007 Started . Finished in 0.0 seconds. 1 tests, 1 assertions, 0 failures, 0 errors Exit code: 0 From christopher.mcmahon at gmail.com Fri May 18 19:00:24 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 18 May 2007 17:00:24 -0600 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: <970956b0705181543o10a42cdbk7f58662c0e11af81@mail.gmail.com> References: <464DA682.3020806@pettichord.com> <72799cd70705180731n53d0cfb5u4cd6d81b60c2db43@mail.gmail.com> <464DBAB4.30908@pettichord.com> <72799cd70705180749q3e9c7fedm35b585597d976d29@mail.gmail.com> <72799cd70705180826s28044e38q159734d484ba9eb3@mail.gmail.com> <464DD4DA.8010304@pettichord.com> <970956b0705181543o10a42cdbk7f58662c0e11af81@mail.gmail.com> Message-ID: <72799cd70705181600q3a41334aof67dad921d9eb38a@mail.gmail.com> > From my perspective, I always start out by requiring and including watir, > because I'd rather paste it into the top of a script once than have to type > Watir:: several times below. > > I was planning to say that I'd love to have watir automatically included > whenever I require it...but that might have resulted in unneccessary > confusion when I first started requiring (and wishing to include) other ruby > modules. So in the end I think my vote is to teach include from the > beginning, but not to have require automagically include as well...since > that's not true for other ruby modules. +1, well put. From forum-watir-users at openqa.org Fri May 18 19:09:21 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Fri, 18 May 2007 18:09:21 CDT Subject: [Wtr-general] How to select option on Menu button with multiple levels of the option list Message-ID: <41248150.1841179529791364.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello, I need to select an option in the Menu button with multiple levels of the option list. 1. Click on the menu button, a list of option is displayed 2. Move mouse over to the option 3, a list of option is displayed for option 3 3. Select the option 3.2 I tried with ?span(:id, ?xxx?).click?. It works on step 1, but not for step 2 and 3. What method should I use to select an option in step 2 and 3? Please help! Html for the option I want to select in step 2: New Document Html for the option I want to select in step 3: Link an existing document to this claim Thanks. Kui From jim_matt at swbell.net Fri May 18 20:16:25 2007 From: jim_matt at swbell.net (jim_matt) Date: Fri, 18 May 2007 19:16:25 -0500 Subject: [Wtr-general] ie.maximize does not always work Message-ID: <0abd01c799aa$f062b800$6401a8c0@Jimsxp> Interestingly I posted something earlier today and I do not see it in the mail. Anyway, to the topic at hand. I have tried to use ie.maximize and ie.minimize and they do not seem to work. Thinking that I might have a problem with my Watir installation, I went and ran the unit test with Watir and they worked fine. I went back and ran it on my current browser and it did not work. Other things like ie.close did work. I have had a similar problem with attach by title. Sometimes it works but most of the time it does not. I am running IE 6 up to current patches and Watir 1.5.1145. Anyone have ideas on what is going wrong? Jim Matthews -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/0f6bdd73/attachment.html From bret at pettichord.com Fri May 18 23:02:55 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 18 May 2007 22:02:55 -0500 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: <72799cd70705181600q3a41334aof67dad921d9eb38a@mail.gmail.com> References: <464DA682.3020806@pettichord.com> <72799cd70705180731n53d0cfb5u4cd6d81b60c2db43@mail.gmail.com> <464DBAB4.30908@pettichord.com> <72799cd70705180749q3e9c7fedm35b585597d976d29@mail.gmail.com> <72799cd70705180826s28044e38q159734d484ba9eb3@mail.gmail.com> <464DD4DA.8010304@pettichord.com> <970956b0705181543o10a42cdbk7f58662c0e11af81@mail.gmail.com> <72799cd70705181600q3a41334aof67dad921d9eb38a@mail.gmail.com> Message-ID: <464E68DF.6070407@pettichord.com> Chris McMahon wrote: >> From my perspective, I always start out by requiring and including watir, >> because I'd rather paste it into the top of a script once than have to type >> Watir:: several times below. >> >> I was planning to say that I'd love to have watir automatically included >> whenever I require it...but that might have resulted in unneccessary >> confusion when I first started requiring (and wishing to include) other ruby >> modules. So in the end I think my vote is to teach include from the >> beginning, but not to have require automagically include as well...since >> that's not true for other ruby modules. >> > > +1, well put. > I don't understand why we treat the Watir module differently from other Ruby modules. For example, everyone writes require 'test/unit' class MyTest < Test::Unit::TestCase ... end rather than require 'test/unit' include Test::Unit class MyTest < TestCase ... end or @soap = SOAP::WSDLDriverFactory.new(wsdl_url).create_rpc_driver rather than include SOAP @soap = WSDLDriverFactory.new(wsdl_url).create_rpc_driver or xml = REXML::Document.new(File.open("demo.xml")) rather than include REXML xml = Document.new(File.open("demo.xml")) There are consequences to including modules that people should understand before they make casual use of it. You are collapsing the namespace and you need to know that you won't create any unexpected collisions when you do this. For example, i recently added a class called Watir::Process, but there is also a standard Ruby library called Process. You could break a library that uses the Process class (from win32-process) if you mixin the Watir module into the toplevel context. That's why using include is not an everyday Ruby practice, but rather typically used to support mixins, rather than simply saving a few keystrokes. I just don't think we should be teaching bad ruby practices to Watir users. We already have too many users who don't realize that Watir is simply another Ruby library. I'd like us to treat it this way, instead of encouraging our own special (and dangerous) I do realize that there are many examples in the Watir source base that use "include Watir", but i guess it is simply time to remove them. I make use of mixins a lot in my test suites and on several occasions have run into bugs due to collisions from mixed-in modules. These are often very difficult problems to figure out. It is much safer to avoid using them, especially for such trivial reasons as this. Bret From jim_matt at swbell.net Fri May 18 23:39:15 2007 From: jim_matt at swbell.net (jim_matt) Date: Fri, 18 May 2007 22:39:15 -0500 Subject: [Wtr-general] gem error installing 'builder' Message-ID: <0b2e01c799c7$46397220$6401a8c0@Jimsxp> I am resending this because I have not seen it show up in email distribution. I sent it earlier in the day than the one titled "ie.maximize does not always work". I did more research after I sent the following message. Most of the solutions seemed to be for unix based systems. The best one I found for windows appeared to involve completely uninstalling gem 0.9.3 and installing gem 0.9.2. The original message I sent follows below. ------------------------------------------------------------------------------------------------------------------------------- I am getting the following error when I try to install 'builder'. Any suggestions? D:\InstalledFiles\builder_2_1_1>gem install builder -l -y D:\InstalledFiles\builder_2_1_1>"D:\ruby\bin\ruby.exe" "D:\ruby\bin\gem" install builder - l -y ERROR: Error installing gem builder[.gem]: install directory # not absolute Obviously the error about the pathname not being absolute is incorrect. I am running Ruby 1.8.2-15 Watir 1.5-1145 as a gem gem 0.9.3 I am trying to set things up so I can get reports with ci_reporter and running specific versions of Ruby and Watir to avoid certain bugs. Jim Matthews -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070518/ffd1a48b/attachment.html From zeljko.filipin at gmail.com Sat May 19 02:41:33 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Sat, 19 May 2007 08:41:33 +0200 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> Message-ID: On 5/18/07, Chris McMahon wrote: > > include Watir (it's magic anyway, it won't hurt) > ie = IE.new (let people see a blank browser) I have just checked my test suite, and I have only one ie = Watir::IE.new After that i just use ie variable. I guess that others may have different usage pattern for this. Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070519/2dd265b8/attachment.html From zeljko.filipin at gmail.com Sat May 19 02:45:49 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Sat, 19 May 2007 08:45:49 +0200 Subject: [Wtr-general] New Watir User Guide (beta) In-Reply-To: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> Message-ID: On 5/18/07, Chris McMahon wrote: > > ie = IE.new (let people see a blank browser) > ie.goto("http://www.google.com") I have been thinking about this again. Do you ever do something with an empty browser? Every time I open a browser, I immediately go to a web page. I am thinking in changing it back to ie = Watir::IE.start("http://www.google.com") Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070519/cca0431b/attachment.html From jim_matt at swbell.net Sat May 19 10:54:44 2007 From: jim_matt at swbell.net (jim_matt) Date: Sat, 19 May 2007 09:54:44 -0500 Subject: [Wtr-general] New Watir User Guide (beta) References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> Message-ID: <00fd01c79a25$a3b05be0$6401a8c0@Jimsxp> I do the same sort of thing now except that I normally do $br = Water::IE.new in one place. I do this for the time I might want to point $br to FireFox and run the same script with it. Jim Matthews ----- Original Message ----- From: ?eljko Filipin To: wtr-general at rubyforge.org Sent: Saturday, May 19, 2007 1:41 AM Subject: Re: [Wtr-general] New Watir User Guide (beta) On 5/18/07, Chris McMahon wrote: include Watir (it's magic anyway, it won't hurt) ie = IE.new (let people see a blank browser) I have just checked my test suite, and I have only one ie = Watir::IE.new After that i just use ie variable. I guess that others may have different usage pattern for this. Zeljko ------------------------------------------------------------------------------ _______________________________________________ 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/20070519/4203fc04/attachment-0001.html From jim_matt at swbell.net Sat May 19 10:59:42 2007 From: jim_matt at swbell.net (jim_matt) Date: Sat, 19 May 2007 09:59:42 -0500 Subject: [Wtr-general] New Watir User Guide (beta) References: <72799cd70705171702l6cd51902mb6130e222af24fab@mail.gmail.com> Message-ID: <011001c79a26$55602eb0$6401a8c0@Jimsxp> Since I now normally do a separate $br = Watir::IE I do a '.new' and then a 'goto' elsewhere. In this case it brings up 'about:blank' and does not have to wait for a lot of junk to load. If you are not on a LAN that has access to WWW, then you will wait a long time for http://www.google.com. Jim ----- Original Message ----- From: ?eljko Filipin To: wtr-general at rubyforge.org Sent: Saturday, May 19, 2007 1:45 AM Subject: Re: [Wtr-general] New Watir User Guide (beta) On 5/18/07, Chris McMahon wrote: ie = IE.new (let people see a blank browser) ie.goto("http://www.google.com") I have been thinking about this again. Do you ever do something with an empty browser? Every time I open a browser, I immediately go to a web page. I am thinking in changing it back to ie = Watir::IE.start("http://www.google.com") Zeljko ------------------------------------------------------------------------------ _______________________________________________ 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/20070519/0b7d8eec/attachment.html From forum-watir-users at openqa.org Sat May 19 12:30:18 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Sat, 19 May 2007 11:30:18 CDT Subject: [Wtr-general] The test case should be failed, but it is not In-Reply-To: Message-ID: <24331871.2981179592249083.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks Charley! assert_equal(1, autoit.WinExists("test.txt - Notepad")) works as what I need. Kui From marick at testing.com Sat May 19 12:40:59 2007 From: marick at testing.com (Brian Marick) Date: Sat, 19 May 2007 11:40:59 -0500 Subject: [Wtr-general] Controlling IE popups with stock Watir: simplest way? In-Reply-To: References: <91957548-9D3E-43BA-864F-B903FB6333D0@testing.com> <464BCF47.8090107@pettichord.com> <464C9492.20902@pettichord.com> Message-ID: <33DFD8A1-27F6-4238-986B-7CBA0C3235A3@testing.com> I played around with win32-utils code, but I was getting odd results. (It appeared that the fork() was really exec()ing the program in a subprocess, rather than continuing the subprogram from the point of the fork.) So I went back to popen. I ran into a further problem. One button press would generate two confirmation dialogs, one after the other, without control returning to Watir between them. So I needed to invent some new syntax. I'm not wildly fond of it, but it works. It looks like this: $ie.after { button(:name, "action").click }.dismiss_windows( "Choose a digital certificate" => ["{Tab}", "{Space}"], "Signing" => ["{Space}"] ) Code below. I should write tests for it. Realistically, though, I won't have time to be a good submitter for the near future. I have to learn both Rails and Selenium next week for a different client, and I'll be going flat out for at least all of June. This code should probably invoke the watcher scripts using ruby -S. Right now, it assumes the watcher script is in the same directory as the test, which is sloppy. ======================= class IE def after(&block) @block = block self end def grab_window(window_title) @window_title = window_title self end def and_send(*keys) launch_watcher(@window_title, keys) continue_script(@block) end def dismiss_windows(hash) hash.each do | title, keys | launch_watcher(title, keys) end continue_script(@block) end private def launch_watcher(window_title, keys) commandline = ["/ruby/bin/ruby", "watcher-popen.rb", "'" + window_title + "'"] + keys IO.popen(commandline.join(' ')) end def continue_script(block) instance_eval(&block) if block end end ==== watcher.rb ===== require 'watir' # Do this in JMock style, just because DSLs are all the rage. class Watcher private_class_method :new def self.after_seeing(title) new(title) end def initialize(title) @autoit = Watir.autoit @title = title end def send(keys) @keys = keys do_await_window do_send_keys self end private def do_await_window @autoit.WinWait @title, "" end def do_send_keys @keys.each do | key | sleep 1 # Just to watch it happen. @autoit.Send key end end end if $0 == __FILE__ title = ARGV[0] keys = ARGV[1..-1] # $stderr.puts title, keys.inspect; $stderr.flush Watcher.after_seeing(title).send(keys) end ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant www.exampler.com, www.exampler.com/blog From christopher.mcmahon at gmail.com Sat May 19 13:13:51 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Sat, 19 May 2007 11:13:51 -0600 Subject: [Wtr-general] Controlling IE popups with stock Watir: simplest way? In-Reply-To: <33DFD8A1-27F6-4238-986B-7CBA0C3235A3@testing.com> References: <91957548-9D3E-43BA-864F-B903FB6333D0@testing.com> <464BCF47.8090107@pettichord.com> <464C9492.20902@pettichord.com> <33DFD8A1-27F6-4238-986B-7CBA0C3235A3@testing.com> Message-ID: <72799cd70705191013s44cfa01au6e72db037a9811fa@mail.gmail.com> You might be interested in my venerable Perl controller below. It launches a ruby script using system(1,), which returns control to the calling process. A short explanation of how system() does this is here: http://perlmonks.org/?node_id=547218 use warnings; use strict; use Win32::GuiTest qw(FindWindowLike SetForegroundWindow SendKeys ); my $x = 0; system (1, "ruby c:/myscript.rb"); while (1) { #INFINITE LOOP sleep 2; #CHECK FOR NEW WINDOW EVERY 2 SEC my @windows = FindWindowLike(0, "^Logon Right Here"); for (@windows) { SetForegroundWindow($_); #BRING THE RIGHT WINDOW IN FOCUS JUST IN CASE SendKeys("user"); SendKeys("{TAB}"); SendKeys("password"); SendKeys("{ENTER}"); $x = 1; } exit if $x == 1; } From jeff.fry at gmail.com Sun May 20 21:52:13 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Sun, 20 May 2007 18:52:13 -0700 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <970956b0705161448l7de55a0dke43adc9cc888d5aa@mail.gmail.com> References: <46412CAC.1030801@gmail.com> <464166F7.6030000@pettichord.com> <4645231D.9000608@gmail.com> <4649CD89.4040103@pettichord.com> <970956b0705161448l7de55a0dke43adc9cc888d5aa@mail.gmail.com> Message-ID: <4650FB4D.6050005@gmail.com> Jeff Fry wrote: > > On 5/15/07, *Bret Pettichord* > wrote: > > Jeff Fry: > > > > * Think about how best to lay out hows & whats. Please comment. > > > Unless someone volunteers manually keep all the duplication in sync > (Maybe you are volunteering to do this -- it's not clear to me), > then I > plan to consolidate it so that it is at least accurate. Right now, > it is > easy to read (somewhat) but incomplete, which is pretty bad. > > > I think consolidating it is the right choice. If it would be helpful, > I'll try to take a first whack at this by the beginning of next week > as well. I'm sure whatever I make will/would contain inaccuracies ( > e.g. my not knowing that the multiple attribute support only for > non-input elements) but if my creating a first draft would help I will > see what I can put together between tonight and this coming Wednesday. Here's my first stab at a centralized page to describe supported elements, 'how's for interacting with those elements, and a chart of which 'how's apply to which elements: http://wiki.openqa.org/display/WTR/Methods+supported+by+Element For the chart, I tried to follow the rdoc, but I didn't follow it too closely, knowing that the rdoc already has inaccuracies in it. I'm hoping that someone who knows what *actually* does and doesn't work will volunteer to correct the chart (or even just email me corrections to make myself). I added a number of questions at the bottom of the page, but will repeat them here for convenience: * Are there any missing element types, or element types that shouldn't be included? (What about the following methods: tableCell? file_field? ps? pre?) * Any missing (or extraneous) attributes? * Any inaccuracies? (I assume that currently there are many.) * Should this be folded into, or linked to from, the User Guide? * Should this page contain usage examples (simple and complex) or link to them in the User Guide? * Can someone add descriptions for :method and :action, above? * Other suggestions? I have made a number of other edits to the rdoc but am not ready to submit a second patch yet. I hope to post it by Wednesday. Cheers, Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070520/d26a0e78/attachment.html From zeljko.filipin at gmail.com Mon May 21 04:02:01 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 21 May 2007 10:02:01 +0200 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <4650FB4D.6050005@gmail.com> References: <46412CAC.1030801@gmail.com> <464166F7.6030000@pettichord.com> <4645231D.9000608@gmail.com> <4649CD89.4040103@pettichord.com> <970956b0705161448l7de55a0dke43adc9cc888d5aa@mail.gmail.com> <4650FB4D.6050005@gmail.com> Message-ID: Hi Jeff, Comments are inline. On 5/21/07, Jeff Fry wrote: > > * Should this be folded into, or linked to from, the User Guide? > Definitively linked. Maybe included into, depending how user guide evolves. * Should this page contain usage examples (simple and complex) or link to > them in the User Guide? > I suggest that you add usage examples to this page for the moment. We can include it in the user guide later, again depending how user guide evolves. Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070521/0f271075/attachment.html From Koteswara_Annavarapu at symantec.com Mon May 21 05:07:19 2007 From: Koteswara_Annavarapu at symantec.com (Koteswara Annavarapu) Date: Mon, 21 May 2007 14:37:19 +0530 Subject: [Wtr-general] How to send yes to the security certificate In-Reply-To: References: Message-ID: <2B63BBC3F2F85B45A985FAD965DE969E03283CFF@ITPXCHCLN1.enterprise.veritas.com> Hi all, I am working with a secured site , which when invoked asks me for accepting the security certificate. Can some one let me know , how can we handle such things through Watir. Thanks in advance Koteswara Rao From ajitesh.srinetra at gmail.com Mon May 21 09:32:24 2007 From: ajitesh.srinetra at gmail.com (Ajitesh Srinetra) Date: Mon, 21 May 2007 19:02:24 +0530 Subject: [Wtr-general] Assertion on the contents of PDF Message-ID: <4f6da15b0705210632k368bdd71w828f889323a52d90@mail.gmail.com> Hi All In my Application I have one link which puts the data from a table on the web-page to a pdf . Now can i assert on the contents of this PDF file through watir Can the same be done with excel and text files Ajitesh Srinetra -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070521/176eba8b/attachment.html From zeljko.filipin at gmail.com Mon May 21 09:48:48 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 21 May 2007 15:48:48 +0200 Subject: [Wtr-general] Assertion on the contents of PDF In-Reply-To: <4f6da15b0705210632k368bdd71w828f889323a52d90@mail.gmail.com> References: <4f6da15b0705210632k368bdd71w828f889323a52d90@mail.gmail.com> Message-ID: On 5/21/07, Ajitesh Srinetra wrote: > > Now can i assert on the contents of this PDF file through watir > Can the same be done with excel and text files > Hi Ajitesh, Watir is just a Ruby library for driving Internet Exporer. You can not test pdf and Excel files with Watir, but I am sure there are other Ruby libraries that can do it. Search for "ruby pdf". I have not used it, but others on this list say this is good reference for Excel. http://wiki.rubygarden.org/ruby/page/show/ScriptingExcel It is offline a lot, but there is cached version at http://209.85.135.104/search?q=cache:tEaxL9sKYdQJ:wiki.rubygarden.org/ruby/page/show/ScriptingExcel&hl=en&strip=1 Ruby can handle text files. Take a look at this link http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_io.html Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070521/6eafc2d5/attachment.html From forum-watir-users at openqa.org Mon May 21 10:58:23 2007 From: forum-watir-users at openqa.org (Ken) Date: Mon, 21 May 2007 09:58:23 CDT Subject: [Wtr-general] Error message with a dropdown In-Reply-To: <464E0ECA.6080401@pettichord.com> Message-ID: <27505727.2301179759533216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Good suggestion with the ID but I got the same results. Now I remember why I hate coding so much! From I_Webb at acs.org Mon May 21 11:15:44 2007 From: I_Webb at acs.org (Ian Webb) Date: Mon, 21 May 2007 11:15:44 -0400 Subject: [Wtr-general] How to send yes to the security certificate In-Reply-To: <2B63BBC3F2F85B45A985FAD965DE969E03283CFF@ITPXCHCLN1.enterprise.veritas.com> References: <2B63BBC3F2F85B45A985FAD965DE969E03283CFF@ITPXCHCLN1.enterprise.veritas.com> Message-ID: <353BA7F10699794198CD75B3033E62AA027289A0@washnt57.acs.org> Which popup/certificate error message are you getting? I've had a similar, possibly the same, problem. My workaround was to turn off the warning message about a certificate name mismatch in Internet Options > Advanced > uncheck "Warn about certificate address mismatch". (Basically, our testing site has a different hostname but the same certificate as the live site, hence a mismatch error) If this is the other common certificate error, non-trusted root, then you should be able to add the certificate and prevent the popup. Cheers, Ian -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Koteswara Annavarapu Sent: Monday, May 21, 2007 5:07 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] How to send yes to the security certificate Hi all, I am working with a secured site , which when invoked asks me for accepting the security certificate. Can some one let me know , how can we handle such things through Watir. Thanks in advance Koteswara Rao _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From erik.oliver at gmail.com Mon May 21 13:15:39 2007 From: erik.oliver at gmail.com (Erik Oliver) Date: Mon, 21 May 2007 10:15:39 -0700 Subject: [Wtr-general] IE7 security issues and changing action value of a form Message-ID: <7c1d10a70705211015t2ad59aebu3f2b92f7e0a96a86@mail.gmail.com> A web page I'm trying to automate with Watir works as follows: Visible to user is a link to a javascript (JS1), JS1 in turn sets a bunch of hidden form values AND the action URL of the form, JS1 then calls submit on the form. Purpose of using Watir is to automate a repetitive task (download of multiple XML files from the website). **STRATEGY 1*** Use the straightforward ie.link(:text, [text of link]) to cause JS1 to invoke. That causes IE7 to pop up one of those nasty download warnings and the script gets hung up. Any suggestions for bypassing this? **STRATEGY 2** I tried to simulate the JS itself since what I'm trying to do is automate a repetitive form task and batch download files, I generated the following basic code: form = ie.form(:name, 'appsByCustomer') form.hidden(:name,'isSubmitted').value = 'isSubmitted' form.hidden(:name,'paramForXmlDownload').value = 'forMultipleDownloads' form.hidden(:name,'dosnum').value = 'null' ### problem is how do I set form.action, the obvious form.action = 'url string' doesn't work? form.submit Suggestions for how to set the action attribute? Regards, Erik PS: The page basically has about 5 different Javascripts wrapping the same form, the html has
    , each of the javascripts sets the action to a different value. From christopher.mcmahon at gmail.com Mon May 21 14:27:44 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 21 May 2007 12:27:44 -0600 Subject: [Wtr-general] IE7 security issues and changing action value of a form In-Reply-To: <7c1d10a70705211015t2ad59aebu3f2b92f7e0a96a86@mail.gmail.com> References: <7c1d10a70705211015t2ad59aebu3f2b92f7e0a96a86@mail.gmail.com> Message-ID: <72799cd70705211127l718e391dteda3bd25be47cef6@mail.gmail.com> Might be worth trying Mechanize to bypass the nasty UI: http://rubyforge.org/projects/mechanize/ -C On 5/21/07, Erik Oliver wrote: > A web page I'm trying to automate with Watir works as follows: Visible > to user is a link to a javascript (JS1), JS1 in turn sets a bunch of > hidden form values AND the action URL of the form, JS1 then calls > submit on the form. > > Purpose of using Watir is to automate a repetitive task (download of > multiple XML files from the website). > > **STRATEGY 1*** > > Use the straightforward ie.link(:text, [text of link]) to cause JS1 to > invoke. That causes IE7 to pop up one of those nasty download warnings > and the script gets hung up. > > Any suggestions for bypassing this? > > **STRATEGY 2** > > I tried to simulate the JS itself since what I'm trying to do is > automate a repetitive form task and batch download files, I generated > the following basic code: > > form = ie.form(:name, 'appsByCustomer') > form.hidden(:name,'isSubmitted').value = 'isSubmitted' > form.hidden(:name,'paramForXmlDownload').value = 'forMultipleDownloads' > form.hidden(:name,'dosnum').value = 'null' > ### problem is how do I set form.action, the obvious form.action = > 'url string' doesn't work? > form.submit > > Suggestions for how to set the action attribute? > > Regards, > Erik > > PS: The page basically has about 5 different Javascripts wrapping the > same form, the html has , > each of the javascripts sets the action to a different value. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From erik.oliver at gmail.com Mon May 21 15:12:20 2007 From: erik.oliver at gmail.com (Erik Oliver) Date: Mon, 21 May 2007 12:12:20 -0700 Subject: [Wtr-general] IE7 security issues and changing action value of Message-ID: <7c1d10a70705211212y65c7c114q86b1afd10843507a@mail.gmail.com> Chris McMahon wrote at Mon May 21 14:27:44 EDT 2007: > Might be worth trying Mechanize to bypass the nasty UI: > http://rubyforge.org/projects/mechanize/ The UI is so nasty there is a Java Applet security app (Entrust something or other and you need to provide a digital certificate) in front of the nasty Javascript I am wrestling with. I decided that having to manually enter the certificate was tolerable. >From what I read I don't see how the mechanize project could help me with the Java applet... Meanwhile, I figured out how to get rid of the pop up, I put the site in the trusted security zone and then set "Enable" for "Automatic Prompting for file Downloads"... ...so next challenge scripting the save file dialog box. Regards, Erik PS: The whole thing is very short right now ~30 lines and is probably 3 lines of code now away from doing what I want if I can get the save to work. From forum-watir-users at openqa.org Mon May 21 15:38:25 2007 From: forum-watir-users at openqa.org (Ruben) Date: Mon, 21 May 2007 14:38:25 CDT Subject: [Wtr-general] How to clear cache from within watir script? Message-ID: <22107843.691179776335635.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello All, I was wondering if anybody here knows how to clear cache from within a watir script. I searched on this forum prior to posting this and found a similar post but the answer was not really provided. I have looked in the watir API reference and I found "deleteSpecialFolderContents(specFolderName)" this function but I wasn't able to get it to work. G:/Program Files/Watir/examples/SV/SV Tests/SVTime.rb:16: undefined method `deleteSpeci nts' for # (NoMethodError) I would get this error. Does anyone have any idea on how to do this? Thanks From forum-watir-users at openqa.org Mon May 21 17:01:22 2007 From: forum-watir-users at openqa.org (vamsi) Date: Mon, 21 May 2007 16:01:22 CDT Subject: [Wtr-general] how to extract one word from a sentence? Message-ID: <25631546.1091179781312743.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, Can any one please tell me how to extract the last word from one senetence using watir scripting? Example: Sentence: What is your name? My answer is : name so i need to extract the name from the above sentence. can any one please help me to resolve this problem? Thanks in advance. Regards Vamsi From christopher.mcmahon at gmail.com Mon May 21 17:34:33 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 21 May 2007 15:34:33 -0600 Subject: [Wtr-general] how to extract one word from a sentence? In-Reply-To: <25631546.1091179781312743.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <25631546.1091179781312743.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70705211434i74a02daan27decb91b46d2759@mail.gmail.com> On 5/21/07, vamsi wrote: > Hi, > > > Can any one please tell me how to extract the last word from one senetence using watir scripting? > > Example: Sentence: What is your name? > My answer is : name > > so i need to extract the name from the above sentence. can any one please help me to resolve this problem? Read about "regular expressions": ########################### data = 'What is your name' #with split() words = data.split(/\s+/) puts words.last puts words.first #with pure regexp data =~ /\w+$/ puts $& From lyi at manpower.com.au Mon May 21 18:53:19 2007 From: lyi at manpower.com.au (Yi, Lawrence) Date: Tue, 22 May 2007 06:53:19 +0800 Subject: [Wtr-general] how to extract one word from a sentence? In-Reply-To: <25631546.1091179781312743.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <7C7F202323219D4698E0861AD71588B870E49C@gsd3w050c.CORP.ROOT.GLOBAL> Hi Vamsi, One way of doing it: ----------------------------------- # Convert to array sentence = "What is your name?".split # Get the last item in the array lastword = sentence[sentence.length - 1] # Replace any unwanted characters such as '?' lastword.gsub!(/[?!-.]/, '') puts "My answer is : #{lastword}" ----------------------------------- Regards, Lawrence -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of vamsi Sent: Tuesday, 22 May 2007 7:01 To: wtr-general at rubyforge.org Subject: [Wtr-general] how to extract one word from a sentence? Hi, Can any one please tell me how to extract the last word from one senetence using watir scripting? Example: Sentence: What is your name? My answer is : name so i need to extract the name from the above sentence. can any one please help me to resolve this problem? Thanks in advance. Regards Vamsi _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Koteswara_Annavarapu at symantec.com Tue May 22 02:28:02 2007 From: Koteswara_Annavarapu at symantec.com (Koteswara Annavarapu) Date: Tue, 22 May 2007 11:58:02 +0530 Subject: [Wtr-general] How to send yes to the security certificate Message-ID: <2B63BBC3F2F85B45A985FAD965DE969E03283E61@ITPXCHCLN1.enterprise.veritas.com> Hi Ian , This is the common certificate error , when you open a secured site whose certificate is issued by a non trusted certifying authority. When I open any https site like this ie.goto('https://www.securedsite.net/') the OS will popup a modal dialog asking for accepting the certificate and until I accept this certificate the script won't move further . I have tried Winclicker also , but the ie.goto is not stepping further until you clear the certificate. Thanks, Koteswara >>>>>>>>>>>>>>>>>>>>>>>>> From: "Ian Webb" Subject: Re: [Wtr-general] How to send yes to the security certificate To: Message-ID: <353BA7F10699794198CD75B3033E62AA027289A0 at washnt57.acs.org> Content-Type: text/plain; charset="us-ascii" Which popup/certificate error message are you getting? I've had a similar, possibly the same, problem. My workaround was to turn off the warning message about a certificate name mismatch in Internet Options > Advanced > uncheck "Warn about certificate address mismatch". (Basically, our testing site has a different hostname but the same certificate as the live site, hence a mismatch error) If this is the other common certificate error, non-trusted root, then you should be able to add the certificate and prevent the popup. Cheers, Ian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070522/7946148f/attachment.html From zeljko.filipin at gmail.com Tue May 22 03:47:24 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 22 May 2007 09:47:24 +0200 Subject: [Wtr-general] How to select option on Menu button with multiple levels of the option list In-Reply-To: <41248150.1841179529791364.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <41248150.1841179529791364.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Kui, This does not work? ie.span(:id, "Claim:ClaimMenuActions:ClaimMenuActions_NewDocument").click Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070522/d3463e63/attachment.html From aidy.lewis at googlemail.com Tue May 22 04:16:25 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Tue, 22 May 2007 09:16:25 +0100 Subject: [Wtr-general] How to send yes to the security certificate In-Reply-To: <2B63BBC3F2F85B45A985FAD965DE969E03283E61@ITPXCHCLN1.enterprise.veritas.com> References: <2B63BBC3F2F85B45A985FAD965DE969E03283E61@ITPXCHCLN1.enterprise.veritas.com> Message-ID: <7ac2300c0705220116y6aa630e2m511ddb852f289f33@mail.gmail.com> On 22/05/07, Koteswara Annavarapu wrote: > but the ie.goto is not stepping further until you clear the certificate. You need to use threads. I will put it on the faqs. class Browser def initialize $ie = Watir::IE.new end def goto(url) @url = url t = Thread.new(){ puts "winclicker thread started" wc = WinClicker.new wc.clearSecurityAlertBox } m = Thread.new($ie) { $ie.goto(@url) } m.join t.join $ie.bring_to_front $ie.maximize end def close $ie.close end end From anandsri01 at gmail.com Tue May 22 04:26:36 2007 From: anandsri01 at gmail.com (atul srivastava) Date: Tue, 22 May 2007 13:56:36 +0530 Subject: [Wtr-general] how click on save button and save to a paticular folder Message-ID: how click on save button and after select paticualr drive and folder to sva e the file. i m using some coad but not working...... require 'win32ole' autoit = WIN32OLE.new("AutoItX3.Control") autoit.WinWait("File Download", "Do you want to open or save", 3) autoit.ControlClick("File Download", "Do you want to open or save", "&Save") autoit.WinWait("Save As", "Save &in", 3) autoit.ControlSetText("Save As", "Save &in", "Edit1", "path\filename.ext") autoit.ControlClick("Save As", "Save &in", "&Save") #$ie.button(:caption, "Save").click_no_wait #sleep 3 #assert dialog.exists? # sleep 0.4 #$ie.button('Save').click #content_frame(@ie).fileField(:id, 'file_name').set("D:/files/filename.txt") #$ie.back please help ....!!!!!!!!!!! -- With Thanks and Regards, Anand Vardhan Srivastava -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070522/7e6decf6/attachment.html From shalinigupta2006 at gmail.com Tue May 22 08:04:03 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Tue, 22 May 2007 17:34:03 +0530 Subject: [Wtr-general] How to click variable link Message-ID: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> Hi all, In my project i have some links that is user dependent.i.e. depend on user input.(text is not fixed).How can i click this. I dont want to click this with text as text is not fixed.what are the other properties that should be fixed for this type of links. I tried to this with "href" but its not working. Please hepl its very urgent Thanks in advance regards Shalini Gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070522/62fe273b/attachment.html From zeljko.filipin at gmail.com Tue May 22 08:17:52 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 22 May 2007 14:17:52 +0200 Subject: [Wtr-general] How to click variable link In-Reply-To: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> Message-ID: On 5/22/07, SHALINI GUPTA wrote: > > I tried to this with "href" but its not working. Hi Shalini, What error message do you get when you use href? Can you post your Watir and Ruby code? There is lot of ways you can click a link. I recommend id. Jeff has made page at Watir wiki about it. See http://wiki.openqa.org/display/WTR/Methods+supported+by+Element Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070522/83778930/attachment.html From forum-watir-users at openqa.org Tue May 22 08:48:16 2007 From: forum-watir-users at openqa.org (anand) Date: Tue, 22 May 2007 07:48:16 CDT Subject: [Wtr-general] How click on save button in file download Message-ID: <34533119.4581179838126987.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> hi, i want to download a file in a particular folder. i m trying coad but not working require 'win32ole' autoit = WIN32OLE.new("AutoItX3.Control") autoit.WinWait("File Download", "Do you want to open or save", 3) autoit.ControlClick("File Download", "Do you want to open or save", "&Save") autoit.WinWait("Save As", "Save &in", 3) autoit.ControlSetText("Save As", "Save &in", "Edit1", "path\filename.ext") autoit.ControlClick("Save As", "Save &in", "&Save") #$ie.button(:caption, "Save").click_no_wait #sleep 3 #assert dialog.exists? # sleep 0.4 #$ie.button('Save').click #content_frame(@ie).fileField(:id, 'file_name').set("D:/files/filename.txt") #$ie.back so please help it's urgent thanks & regards anand From forum-watir-users at openqa.org Tue May 22 09:03:17 2007 From: forum-watir-users at openqa.org (zaheer) Date: Tue, 22 May 2007 08:03:17 CDT Subject: [Wtr-general] Identification of null value from a particular object Message-ID: <29718250.4691179839027807.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have a text box. I want to verify that a particulat text field has null value.If so how to identify the null value? From zeljko.filipin at gmail.com Tue May 22 09:22:29 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 22 May 2007 15:22:29 +0200 Subject: [Wtr-general] Identification of null value from a particular object In-Reply-To: <29718250.4691179839027807.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <29718250.4691179839027807.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 5/22/07, zaheer wrote: > > I have a text box. I want to verify that a particulat text field has null > value.If so how to identify the null value? > Hi Zaheer, what do you mean by null value? That text field is empty, or has text "null"? Try this: ie.text_field(:index, 1).text Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070522/a3c7e984/attachment-0001.html From forum-watir-users at openqa.org Tue May 22 09:45:01 2007 From: forum-watir-users at openqa.org (zaheer) Date: Tue, 22 May 2007 08:45:01 CDT Subject: [Wtr-general] Identification of null value from a particular object In-Reply-To: <29718250.4691179839027807.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <25410232.4801179841531577.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I meant to say that the text field does not have any value. From zeljko.filipin at gmail.com Tue May 22 09:50:02 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 22 May 2007 15:50:02 +0200 Subject: [Wtr-general] Identification of null value from a particular object In-Reply-To: <25410232.4801179841531577.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <29718250.4691179839027807.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <25410232.4801179841531577.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 5/22/07, zaheer wrote: > > I meant to say that the text field does not have any value. And this does not help you? ie.text_field(:index, 1).text -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070522/145ef191/attachment.html From forum-watir-users at openqa.org Tue May 22 10:02:57 2007 From: forum-watir-users at openqa.org (zaheer) Date: Tue, 22 May 2007 09:02:57 CDT Subject: [Wtr-general] Identification of null value from a particular object In-Reply-To: <29718250.4691179839027807.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <32720026.4911179842607556.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> No. The condition here is : If the text field has any value, i will continue with the next page. If it has null value i need to enter the data there. From jeff.fry at gmail.com Tue May 22 10:14:25 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Tue, 22 May 2007 07:14:25 -0700 Subject: [Wtr-general] Identification of null value from a particular object In-Reply-To: <32720026.4911179842607556.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32720026.4911179842607556.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4652FAC1.6060305@gmail.com> zaheer wrote: > No. The condition here is : > > If the text field has any value, i will continue with the next page. If it has null value i need to enter the data there. Hi Zaheer, what does your script look like so far? What Zeljko gave you should generally work to identify a field that doesn't have any text in it. It sounds like you might be looking for help with the if logic as well, something like if ie.text_field(:index, 1).text do ie.text_field(:index, 1).text("my new text here") end Note also that Zeljko's illustration assumes you are finding the text_field by index. He did that for illustration since you didn't mention how you are finding the text field, but do be sure to substitute whatever way you prefer for identifying the text_field. If I missunderstood you or if the above doesn't work, please write back with a snippet of your broken code plus the html source of the text_field you want to check. Jeff From jeff.fry at gmail.com Tue May 22 11:25:33 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Tue, 22 May 2007 08:25:33 -0700 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <4649CD89.4040103@pettichord.com> References: <46412CAC.1030801@gmail.com> <464166F7.6030000@pettichord.com> <4645231D.9000608@gmail.com> <4649CD89.4040103@pettichord.com> Message-ID: <46530B6D.4030304@gmail.com> Bret Pettichord wrote: >> *Questions: >> *changes.rb and license.rb >> >> * What do I need to do so that these will be listed in the rdoc >> (as they are for rspec and rails)? When I rolled my own rdoc, I >> don't see these under Files. >> > This is controlled by the rdoc task definition in the rakefile.rb. Note > that some of this is defined indirectly, ensuring that the gem creates > rdoc that looks the same as that created by the rakefile. > Cool. I've updated the rakefile.rb to include changes.rb and license.rb. One question: I tried commenting out the empty class in changes.rb as an experiment. I still see changes.rb in Files (as I'd hoped) and no longer see it under Classes (as I'd also hoped). Is there something I'm missing here, or is it alright for me to remove the empty class from changes.rb, license.rb and readme.rb so that they list only under Files, not under Classes? Thanks, Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070522/a1a6ab64/attachment.html From forum-watir-users at openqa.org Tue May 22 13:04:55 2007 From: forum-watir-users at openqa.org (Tiffany Fodor) Date: Tue, 22 May 2007 12:04:55 CDT Subject: [Wtr-general] Long, strange field name issue Message-ID: <37864049.5551179853525669.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi all! I'm using the new Excel interface class to retrieve data from a spreadsheet for testing our web app. One field on our website is giving me fits. I've verified with IE Developer that the field is Business Income/Extra Expense/Rental Value_0 The line in my script (#126) that writes data to this field looks like this: ie.text_field(:name, "Business Income/Extra Expense/Rental Value_0").set(account["bldgBI"]) When my script gets to this point, I get the following error: c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:4054:in `doKeyPress': undefined method `length' for nil:NilClass (NoMethodError) from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:4026:in `set' from C:/WatirScripts/CreateQuotes.rb:126 from C:/WatirScripts/CreateQuotes.rb:76:in `each' from C:/WatirScripts/CreateQuotes.rb:76 Does anyone know if my problem is the length of the field name or if it's because it includes /'s? Is there any way around the problem? Thanks in advance for any help you can provide! -Tiffany From tester.paul at gmail.com Tue May 22 13:08:40 2007 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 22 May 2007 13:08:40 -0400 Subject: [Wtr-general] Long, strange field name issue In-Reply-To: <37864049.5551179853525669.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <37864049.5551179853525669.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <37c405480705221008g4512096ds27a98b9b3c90e7ac@mail.gmail.com> Did you try it with single-quotes instead of double-quotes? On 22/05/07, Tiffany Fodor wrote: > > The line in my script (#126) that writes data to this field looks like > this: > > ie.text_field(:name, "Business Income/Extra Expense/Rental > Value_0").set(account["bldgBI"]) > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070522/de40ad32/attachment.html From forum-watir-users at openqa.org Tue May 22 13:23:11 2007 From: forum-watir-users at openqa.org (Tiffany Fodor) Date: Tue, 22 May 2007 12:23:11 CDT Subject: [Wtr-general] Long, strange field name issue In-Reply-To: <37c405480705221008g4512096ds27a98b9b3c90e7ac@mail.gmail.com> Message-ID: <28245610.5661179854621177.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks so much for the suggestion and quick resonse, but I tried single quotes and got the same error. I've also tried finding the object using :class (not great since I may have multiple fields with the same class) and :title. When I used :class, I got the same error as before. When I used :title I got an error saying it was unable to locate the object. -Tiffany From paul.rogers at shaw.ca Tue May 22 13:26:21 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 22 May 2007 11:26:21 -0600 Subject: [Wtr-general] Long, strange field name issue In-Reply-To: <37864049.5551179853525669.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <37864049.5551179853525669.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: the exception is caused by the value you are trying to set account["bldgBI"] being nil you can test is by doing this first puts "oh no - its nil " if account["bldgBI"].nil? ----- Original Message ----- From: Tiffany Fodor Date: Tuesday, May 22, 2007 11:04 am Subject: [Wtr-general] Long, strange field name issue > Hi all! > > I'm using the new Excel interface class to retrieve data from a > spreadsheet for testing our web app. One field on our website is > giving me fits. > > I've verified with IE Developer that the field is Business > Income/Extra Expense/Rental Value_0 > > The line in my script (#126) that writes data to this field looks > like this: > > ie.text_field(:name, "Business Income/Extra Expense/Rental > Value_0").set(account["bldgBI"]) > When my script gets to this point, I get the following error: > > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:4054:in > `doKeyPress': undefined method `length' for nil:NilClass > (NoMethodError)from c:/ruby/lib/ruby/gems/1.8/gems/watir- > 1.5.1.1166/./watir.rb:4026:in `set' > from C:/WatirScripts/CreateQuotes.rb:126 > from C:/WatirScripts/CreateQuotes.rb:76:in `each' > from C:/WatirScripts/CreateQuotes.rb:76 > > Does anyone know if my problem is the length of the field name or > if it's because it includes /'s? Is there any way around the problem? > > Thanks in advance for any help you can provide! > > -Tiffany > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Tue May 22 13:43:48 2007 From: forum-watir-users at openqa.org (Tiffany Fodor) Date: Tue, 22 May 2007 12:43:48 CDT Subject: [Wtr-general] Long, strange field name issue In-Reply-To: Message-ID: <27513475.6061179855858436.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> D'Oh! I was so focused on that field name that I didn't notice I forgot to update my script with the new name of that row in my spreadsheet. I was trying to enter a value that didn't exist in my hash. It works fine now. Thanks so much for your help and quick responses! -Tiffany From bret at pettichord.com Tue May 22 15:29:59 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 22 May 2007 14:29:59 -0500 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <46530B6D.4030304@gmail.com> References: <46412CAC.1030801@gmail.com> <464166F7.6030000@pettichord.com> <4645231D.9000608@gmail.com> <4649CD89.4040103@pettichord.com> <46530B6D.4030304@gmail.com> Message-ID: <465344B7.2070204@pettichord.com> Jeff Fry wrote: > I tried commenting out the empty class in changes.rb as an experiment. > I still see changes.rb in Files (as I'd hoped) and no longer see it > under Classes (as I'd also hoped). Is there something I'm missing > here, or is it alright for me to remove the empty class from > changes.rb, license.rb and readme.rb so that they list only under > Files, not under Classes? Your plan sounds fine. Bret From forum-watir-users at openqa.org Tue May 22 15:39:39 2007 From: forum-watir-users at openqa.org (Ruben) Date: Tue, 22 May 2007 14:39:39 CDT Subject: [Wtr-general] How to clear cache from within watir script? In-Reply-To: <22107843.691179776335635.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <25472701.6331179862809343.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Since no one is replying I'll update my status on the current issue. So for some reason the cookie/cache watir functions were not working properly for me but when I tried the same thing on my other computer with Watir 1.5.1.1166 they started to work, somewhat. For cookies, it works 100% require 'watir' require 'thread' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'watir/testUnitAddons' require 'watir/cookiemanager' include Watir print Watir::CookieManager::WatirHelper.getSpecialFolderLocation(Watir::CookieManager::WatirHelper::COOKIES) Gives me the location of the cookie folder Watir::CookieManager::WatirHelper.deleteSpecialFolderContents(Watir::CookieManager::WatirHelper::COOKIES) Clears that folder For Cache print Watir::CookieManager::WatirHelper.getSpecialFolderLocation(Watir::CookieManager::WatirHelper::INTERNET_CACHE) Gives me the location of the cookie folder Watir::CookieManager::WatirHelper.deleteSpecialFolderContents(Watir::CookieManager::WatirHelper::INTERNET_CACHE) This does not actually clear the cache folder! Does anyone have any idea why?? Thanks. From forum-watir-users at openqa.org Tue May 22 17:42:15 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Tue, 22 May 2007 16:42:15 CDT Subject: [Wtr-general] How to select option on Menu button with multiple levels of the option list In-Reply-To: Message-ID: <33521577.7011179870165228.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Zeljko, Yes. it works. I did not specify the correct frame that caused me a trouble. Works fine now. Thanks! Kui From bret at pettichord.com Tue May 22 18:45:10 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 22 May 2007 17:45:10 -0500 Subject: [Wtr-general] How to clear cache from within watir script? In-Reply-To: <25472701.6331179862809343.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <25472701.6331179862809343.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <46537276.1060609@pettichord.com> Ruben wrote: > Since no one is replying I'll update my status on the current issue. So for some reason the cookie/cache watir functions were not working properly for me but when I tried the same thing on my other computer with Watir 1.5.1.1166 they started to work, somewhat. > > For cookies, it works 100% > require 'watir' > require 'thread' > require 'test/unit' > require 'test/unit/ui/console/testrunner' > require 'watir/testUnitAddons' > require 'watir/cookiemanager' > include Watir > > print Watir::CookieManager::WatirHelper.getSpecialFolderLocation(Watir::CookieManager::WatirHelper::COOKIES) > Gives me the location of the cookie folder > Watir::CookieManager::WatirHelper.deleteSpecialFolderContents(Watir::CookieManager::WatirHelper::COOKIES) > Clears that folder > > For Cache > print Watir::CookieManager::WatirHelper.getSpecialFolderLocation(Watir::CookieManager::WatirHelper::INTERNET_CACHE) > Gives me the location of the cookie folder > Watir::CookieManager::WatirHelper.deleteSpecialFolderContents(Watir::CookieManager::WatirHelper::INTERNET_CACHE) > This does not actually clear the cache folder! Does anyone have any idea why?? > > Thanks. Ruben, Thanks for your report on the cookie manager. I don't believe any of us are supporting the cookiemanager any more and it will probably be removed from Watir at some future date, so that users don't get so frustrated. Bret From forum-watir-users at openqa.org Tue May 22 22:49:54 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Tue, 22 May 2007 21:49:54 CDT Subject: [Wtr-general] Why it is always failed? Message-ID: <38362190.7421179888624517.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello, I need to assert the text is displayed in the frame. Using the following assert statement, I always get failed result. When I use selectFrame("inet-menu-tree-frame") in selenium, it works. Not sure why it is not working in Watir? Attached html code. Please help. assert(ie.frame(:name, "top_frame").frame(:name, "inet-menu-tree-frame").contains_text("Welcome manager!"))
    Employee:
    New
    Find
    title
    first name last name
    title
    first name last name
    > >
    Welcome manager!
    ************************************************************************************* assert(ie.frame(:name, "top_frame").frame(:name, "inet-menu-tree-frame").contains_text("Report Repository"))
     Report Repository
    Thanks! Kui From shalinigupta2006 at gmail.com Wed May 23 02:42:45 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Wed, 23 May 2007 12:12:45 +0530 Subject: [Wtr-general] How to click variable link In-Reply-To: References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> Message-ID: <7523f5800705222342w41f0da30pcafd95a84b299724@mail.gmail.com> hi, Thanks!! im getting this problem with HREF 1) Error: test_ADGDashboard_Homepage(TC_CAST_ADGDashboard_Homepage): Watir::Exception::UnknownObjectException: Unable to locate object, using HREF and http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3 i also tried with href(lower case). but the error was same. im sending the HTML.. HTML :- sys_asp   'sys_asp' is variable link...it is user defined.. please help its very urgent Regards Shalini Gupta On 5/22/07, ?eljko Filipin wrote: > > On 5/22/07, SHALINI GUPTA wrote: > > > > I tried to this with "href" but its not working. > > > Hi Shalini, > > What error message do you get when you use href? Can you post your Watir > and Ruby code? > > There is lot of ways you can click a link. I recommend id. > > Jeff has made page at Watir wiki about it. See > http://wiki.openqa.org/display/WTR/Methods+supported+by+Element > > Zeljko > -- > ZeljkoFilipin.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/20070523/220b0535/attachment.html From prema.arya at gmail.com Wed May 23 02:45:35 2007 From: prema.arya at gmail.com (Prema Arya) Date: Wed, 23 May 2007 12:15:35 +0530 Subject: [Wtr-general] FireWatir doesn't ignore if it doesn't exists but In-Reply-To: <46449C1C.2040306@pettichord.com> References: <35273878.1881178883150498.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <46449C1C.2040306@pettichord.com> Message-ID: <27915010705222345r7570c5fy343a98100a7e4324@mail.gmail.com> Hi Eoin, Are you still facing the problem? try using the latest code from svn. if it's still there ,II will look into it. Regards, Prema On 5/11/07, Bret Pettichord wrote: > > I was confused about your problem. It now looks like this is a FireWatir > bug. > > Bret > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- Prema Arya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/0f34555f/attachment.html From prema.arya at gmail.com Wed May 23 02:48:27 2007 From: prema.arya at gmail.com (Prema Arya) Date: Wed, 23 May 2007 12:18:27 +0530 Subject: [Wtr-general] How to click variable link In-Reply-To: <7523f5800705222342w41f0da30pcafd95a84b299724@mail.gmail.com> References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <7523f5800705222342w41f0da30pcafd95a84b299724@mail.gmail.com> Message-ID: <27915010705222348w61a1cbc4jdb559ba712680a2f@mail.gmail.com> can you send the code snippet? On 5/23/07, SHALINI GUPTA wrote: > > hi, > Thanks!! > > im getting this problem with HREF > > 1) Error: > test_ADGDashboard_Homepage(TC_CAST_ADGDashboard_Homepage): > Watir::Exception::UnknownObjectException: Unable to locate object, using > HREF and > http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3 > > i also tried with href(lower case). > but the error was same. > > im sending the HTML.. > HTML :- > > ONCLICK="javascript:toggleRows('m523');toggleImageSource('img2','themes/default/images/open- > menu.gif','themes/default/images/closed-menu.gif')"> SRC='themes/default/images/closed-menu.gif' ALT="" > ALIGN="absmiddle"/> onmouseout="javascript:HideTooltip();" > > sys_asp > >   > > > > 'sys_asp' is variable link...it is user defined.. > > please help its very urgent > Regards > Shalini Gupta > On 5/22/07, ?eljko Filipin wrote: > > > On 5/22/07, SHALINI GUPTA wrote: > > > > > > I tried to this with "href" but its not working. > > > > > > Hi Shalini, > > > > What error message do you get when you use href? Can you post your Watir > > and Ruby code? > > > > There is lot of ways you can click a link. I recommend id. > > > > Jeff has made page at Watir wiki about it. See http://wiki.openqa.org/display/WTR/Methods+supported+by+Element > > > > > > Zeljko > > -- > > ZeljkoFilipin.com > > _______________________________________________ > > 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 > -- Prema Arya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/98446406/attachment-0001.html From shalinigupta2006 at gmail.com Wed May 23 02:57:30 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Wed, 23 May 2007 12:27:30 +0530 Subject: [Wtr-general] How to click variable link In-Reply-To: <27915010705222348w61a1cbc4jdb559ba712680a2f@mail.gmail.com> References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <7523f5800705222342w41f0da30pcafd95a84b299724@mail.gmail.com> <27915010705222348w61a1cbc4jdb559ba712680a2f@mail.gmail.com> Message-ID: <7523f5800705222357s3102cc43k4632c8bbeeef250c@mail.gmail.com> hi, this is my code snipset def system_link $logger.log("## CAST_HOMEPAGE_05") $logger.log("") $logger.log "## System link #####################################################################\n" $logger.log("Description-In Health Factor with lowest grade / System subsection, click System link ") #logs only to corelogger file $logger.log("Expected Output-Outline page displaying Focus on System systemX - part of CORPORATE - for snapshotX snapshot should be displayed ") $logger.log("") $ie.link(:id,"m522").click #$ie.image(:HREF," http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3 ").click end regards shalini On 5/23/07, Prema Arya wrote: > > can you send the code snippet? > > On 5/23/07, SHALINI GUPTA wrote: > > > > hi, > > Thanks!! > > > > im getting this problem with HREF > > > > 1) Error: > > test_ADGDashboard_Homepage(TC_CAST_ADGDashboard_Homepage): > > Watir::Exception::UnknownObjectException: Unable to locate object, using > > HREF and > > http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3 > > > > i also tried with href(lower case). > > but the error was same. > > > > im sending the HTML.. > > HTML :- > > > > > ONCLICK="javascript:toggleRows('m523');toggleImageSource('img2','themes/default/images/open- > > menu.gif','themes/default/images/closed-menu.gif')"> > SRC='themes/default/images/closed-menu.gif' ALT="" > > ALIGN="absmiddle"/> > onmouseout="javascript:HideTooltip();" > > > sys_asp > > > >   > > > > > > > > 'sys_asp' is variable link...it is user defined.. > > > > please help its very urgent > > Regards > > Shalini Gupta > > On 5/22/07, ?eljko Filipin < zeljko.filipin at gmail.com> wrote: > > > > > On 5/22/07, SHALINI GUPTA < shalinigupta2006 at gmail.com > wrote: > > > > > > > > I tried to this with "href" but its not working. > > > > > > > > > Hi Shalini, > > > > > > What error message do you get when you use href? Can you post your > > > Watir and Ruby code? > > > > > > There is lot of ways you can click a link. I recommend id. > > > > > > Jeff has made page at Watir wiki about it. See http://wiki.openqa.org/display/WTR/Methods+supported+by+Element > > > > > > > > > Zeljko > > > -- > > > ZeljkoFilipin.com > > > _______________________________________________ > > > 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 > > > > > > -- > Prema Arya > _______________________________________________ > 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/20070523/4cb931f5/attachment.html From prema.arya at gmail.com Wed May 23 03:16:07 2007 From: prema.arya at gmail.com (Prema Arya) Date: Wed, 23 May 2007 12:46:07 +0530 Subject: [Wtr-general] How to click variable link In-Reply-To: <7523f5800705222357s3102cc43k4632c8bbeeef250c@mail.gmail.com> References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <7523f5800705222342w41f0da30pcafd95a84b299724@mail.gmail.com> <27915010705222348w61a1cbc4jdb559ba712680a2f@mail.gmail.com> <7523f5800705222357s3102cc43k4632c8bbeeef250c@mail.gmail.com> Message-ID: <27915010705230016n1b1f3b8dr14a132beface99a3@mail.gmail.com> Hi Shalini, > $ie.link(:id,"m522").click I cannot fine the link with id 'm522'. but the line you have commented as below #$ie.image(:HREF," http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3").click I changed the image to link as its the href for the link. and put lower case for href it works. The error was there was a space before the url " http://" removed that also. $ie.link(:href,' http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3').click Try this.. hope it works. Regards, Prema On 5/23/07, SHALINI GUPTA wrote: > > hi, > this is my code snipset > def system_link > $logger.log("## CAST_HOMEPAGE_05") > $logger.log("") > $logger.log "## System link > #####################################################################\n" > $logger.log("Description-In Health Factor with lowest grade / System > subsection, click System link ") #logs only to corelogger file > $logger.log("Expected Output-Outline page displaying Focus on System > systemX - part of CORPORATE - for snapshotX snapshot should be displayed ") > $logger.log("") > $ie.link(:id,"m522").click > #$ie.image(:HREF,"http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3 > ").click > > end > regards > shalini > > On 5/23/07, Prema Arya wrote: > > > > can you send the code snippet? > > > > On 5/23/07, SHALINI GUPTA wrote: > > > > > > hi, > > > Thanks!! > > > > > > im getting this problem with HREF > > > > > > 1) Error: > > > test_ADGDashboard_Homepage(TC_CAST_ADGDashboard_Homepage): > > > Watir::Exception::UnknownObjectException: Unable to locate object, > > > using HREF and > > > http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3 > > > > > > i also tried with href(lower case). > > > but the error was same. > > > > > > im sending the HTML.. > > > HTML :- > > > > > > > > ONCLICK="javascript:toggleRows('m523');toggleImageSource('img2','themes/default/images/open- > > > menu.gif','themes/default/images/closed-menu.gif')"> > > SRC='themes/default/images/closed-menu.gif' ALT="" > > > ALIGN="absmiddle"/> > > onmouseout="javascript:HideTooltip();" > > > > sys_asp > > > > > >   > > > > > > > > > > > > 'sys_asp' is variable link...it is user defined.. > > > > > > please help its very urgent > > > Regards > > > Shalini Gupta > > > On 5/22/07, ?eljko Filipin < zeljko.filipin at gmail.com> wrote: > > > > > > > On 5/22/07, SHALINI GUPTA < shalinigupta2006 at gmail.com > wrote: > > > > > > > > > > I tried to this with "href" but its not working. > > > > > > > > > > > > Hi Shalini, > > > > > > > > What error message do you get when you use href? Can you post your > > > > Watir and Ruby code? > > > > > > > > There is lot of ways you can click a link. I recommend id. > > > > > > > > Jeff has made page at Watir wiki about it. See http://wiki.openqa.org/display/WTR/Methods+supported+by+Element > > > > > > > > > > > > Zeljko > > > > -- > > > > ZeljkoFilipin.com > > > > _______________________________________________ > > > > 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 > > > > > > > > > > > -- > > Prema Arya > > _______________________________________________ > > 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 > -- Prema Arya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/972e1842/attachment.html From shalinigupta2006 at gmail.com Wed May 23 03:21:12 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Wed, 23 May 2007 12:51:12 +0530 Subject: [Wtr-general] How to click variable link In-Reply-To: <27915010705230016n1b1f3b8dr14a132beface99a3@mail.gmail.com> References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <7523f5800705222342w41f0da30pcafd95a84b299724@mail.gmail.com> <27915010705222348w61a1cbc4jdb559ba712680a2f@mail.gmail.com> <7523f5800705222357s3102cc43k4632c8bbeeef250c@mail.gmail.com> <27915010705230016n1b1f3b8dr14a132beface99a3@mail.gmail.com> Message-ID: <7523f5800705230021ga9f1fe2u9326c97a39e25c92@mail.gmail.com> hi, now im getting this error 1) Error: test_ADGDashboard_Homepage(TC_CAST_ADGDashboard_Homepage): Watir::Exception::MissingWayOfFindingObjectException: :href is an unknown way of finding a link ( http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3) Thanks for ur response!! Regards Shalini On 5/23/07, Prema Arya wrote: > > Hi Shalini, > > > $ie.link(:id,"m522").click > I cannot fine the link with id 'm522'. > but the line you have commented as below > #$ie.image(:HREF," > http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3").click > > I changed the image to link as its the href for the link. and put lower > case for href it works. > The error was there was a space before the url " http://" removed that > also. > $ie.link(:href,'http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3').click > > > > Try this.. hope it works. > > Regards, > Prema > > > > On 5/23/07, SHALINI GUPTA wrote: > > > > hi, > > this is my code snipset > > def system_link > > $logger.log("## CAST_HOMEPAGE_05") > > $logger.log("") > > $logger.log "## System link > > #####################################################################\n" > > $logger.log("Description-In Health Factor with lowest grade / > > System subsection, click System link ") #logs only to corelogger file > > $logger.log("Expected Output-Outline page displaying Focus on > > System systemX - part of CORPORATE - for snapshotX snapshot should be > > displayed ") > > $logger.log("") > > $ie.link(:id,"m522").click > > #$ie.image(:HREF,"http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3 > > ").click > > > > end > > regards > > shalini > > > > On 5/23/07, Prema Arya wrote: > > > > > > can you send the code snippet? > > > > > > On 5/23/07, SHALINI GUPTA wrote: > > > > > > > > hi, > > > > Thanks!! > > > > > > > > im getting this problem with HREF > > > > > > > > 1) Error: > > > > test_ADGDashboard_Homepage(TC_CAST_ADGDashboard_Homepage): > > > > Watir::Exception::UnknownObjectException: Unable to locate object, > > > > using HREF and > > > > http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3 > > > > > > > > i also tried with href(lower case). > > > > but the error was same. > > > > > > > > im sending the HTML.. > > > > HTML :- > > > > > > > > > > > ONCLICK="javascript:toggleRows('m523');toggleImageSource('img2','themes/default/images/open- > > > > menu.gif','themes/default/images/closed-menu.gif')"> > > > SRC='themes/default/images/closed-menu.gif' ALT="" > > > > ALIGN="absmiddle"/> > > > onmouseout="javascript:HideTooltip();" > > > > > sys_asp > > > > > > > >   > > > > > > > > > > > > > > > > 'sys_asp' is variable link...it is user defined.. > > > > > > > > please help its very urgent > > > > Regards > > > > Shalini Gupta > > > > On 5/22/07, ?eljko Filipin < zeljko.filipin at gmail.com > wrote: > > > > > > > > > On 5/22/07, SHALINI GUPTA < shalinigupta2006 at gmail.com > wrote: > > > > > > > > > > > > I tried to this with "href" but its not working. > > > > > > > > > > > > > > > Hi Shalini, > > > > > > > > > > What error message do you get when you use href? Can you post your > > > > > Watir and Ruby code? > > > > > > > > > > There is lot of ways you can click a link. I recommend id. > > > > > > > > > > Jeff has made page at Watir wiki about it. See http://wiki.openqa.org/display/WTR/Methods+supported+by+Element > > > > > > > > > > > > > > > Zeljko > > > > > -- > > > > > ZeljkoFilipin.com > > > > > _______________________________________________ > > > > > 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 > > > > > > > > > > > > > > > > -- > > > Prema Arya > > > _______________________________________________ > > > 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 > > > > > > -- > Prema Arya > > _______________________________________________ > 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/20070523/d0a2cf3c/attachment-0001.html From forum-watir-users at openqa.org Wed May 23 03:31:12 2007 From: forum-watir-users at openqa.org (Grzesiek) Date: Wed, 23 May 2007 02:31:12 CDT Subject: [Wtr-general] How click on save button in file download In-Reply-To: <34533119.4581179838126987.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <25893062.7851179905502374.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I had also problems with it. I had to download autoitX3 tool. Because there is a tool which identifies the instances of buttons and without that actions did not work for me. autoit.WinWaitActive("Save As") (catching the popup) autoit.ControlClick("Save As", "", "[CLASS:Button;TEXT:&Save;INSTANCE:2]") (pressing Save button) autoit = WIN32OLE.new('AutoItX3.Control') autoit.WinWaitActive("File") #window name File Download autoit.ControlClick("File","","[CLASS:Button;TEXT:&Save;INSTANCE:2]") # first popup is shown autoit.WinWaitActive("Save As") autoit.Send("file_name") autoit.ControlClick("Save As", "", "[CLASS:Button;TEXT:&Save;INSTANCE:2]") autoit.WinWaitActive("Download") autoit.ControlClick("Download", "", "[CLASS:Button;TEXT:&Open;INSTANCE:2]") Hope this will helps Br, Sfistak From forum-watir-users at openqa.org Wed May 23 03:41:27 2007 From: forum-watir-users at openqa.org (Grzesiek) Date: Wed, 23 May 2007 02:41:27 CDT Subject: [Wtr-general] Cannot click Cancel button in download file window In-Reply-To: <30366079.25831178837215993.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <30819738.8001179906117662.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Kui, I had also problems with that. I have installed the script AutoIT because it identifies instances of buttons. After that my script is working with popups. This is how it looks like autoit = WIN32OLE.new('AutoItX3.Control') autoit.WinWaitActive("File") #File Download window autoit.ControlClick("File","","[CLASS:Button;TEXT:&Cancel;INSTANCE:3]") I found that when there is popup with title File Download then OK button is with instance = 1 Save button is with instace =2 Cancel button is with instance =3 Hope it will work for you Br, Sfistak From forum-watir-users at openqa.org Wed May 23 03:46:43 2007 From: forum-watir-users at openqa.org (Grzesiek) Date: Wed, 23 May 2007 02:46:43 CDT Subject: [Wtr-general] Watir + Autoit + Save As In-Reply-To: <28184734.231178264404836.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <29186803.8071179906433931.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I had to use the AutoIT tool for identifing the INSTANCE of buttons. Then it worked for me: autoit = WIN32OLE.new('AutoItX3.Control') autoit.WinWaitActive("File") #File Download popup autoit.ControlClick("File","","[CLASS:Button;TEXT:&Save;INSTANCE:2]") #clicking Save button autoit.WinWaitActive("Save As") #catching the Save As popup autoit.Send("file_name") #sending file name into window autoit.ControlClick("Save As", "", "[CLASS:Button;TEXT:&Save;INSTANCE:2]") #clicking Save button autoit.WinWaitActive("Download") #catching Download popup autoit.ControlClick("Download", "", "[CLASS:Button;TEXT:&Open;INSTANCE:2]") #opening the downloaded file Hope this will help Br, Sfistak From zeljko.filipin at gmail.com Wed May 23 03:47:33 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 23 May 2007 09:47:33 +0200 Subject: [Wtr-general] How to click variable link In-Reply-To: <7523f5800705230021ga9f1fe2u9326c97a39e25c92@mail.gmail.com> References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <7523f5800705222342w41f0da30pcafd95a84b299724@mail.gmail.com> <27915010705222348w61a1cbc4jdb559ba712680a2f@mail.gmail.com> <7523f5800705222357s3102cc43k4632c8bbeeef250c@mail.gmail.com> <27915010705230016n1b1f3b8dr14a132beface99a3@mail.gmail.com> <7523f5800705230021ga9f1fe2u9326c97a39e25c92@mail.gmail.com> Message-ID: On 5/23/07, SHALINI GUPTA wrote: > > Watir::Exception::MissingWayOfFindingObjectException: :href is an unknown > way of finding a link Which Watir version are you using? It should work with 1.5.1.1166. You can get it here. http://wiki.openqa.org/display/WTR/Development+Builds Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/235bb534/attachment.html From shalinigupta2006 at gmail.com Wed May 23 03:54:20 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Wed, 23 May 2007 13:24:20 +0530 Subject: [Wtr-general] How to click variable link In-Reply-To: References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <7523f5800705222342w41f0da30pcafd95a84b299724@mail.gmail.com> <27915010705222348w61a1cbc4jdb559ba712680a2f@mail.gmail.com> <7523f5800705222357s3102cc43k4632c8bbeeef250c@mail.gmail.com> <27915010705230016n1b1f3b8dr14a132beface99a3@mail.gmail.com> <7523f5800705230021ga9f1fe2u9326c97a39e25c92@mail.gmail.com> Message-ID: <7523f5800705230054o75f6440aj9b5caa1a769023bd@mail.gmail.com> im using watir 1.4.1 but also installed this watir-1.5.1.1127.gem On 5/23/07, ?eljko Filipin wrote: > > On 5/23/07, SHALINI GUPTA wrote: > > > > Watir::Exception::MissingWayOfFindingObjectException: :href is an > > unknown way of finding a link > > > Which Watir version are you using? It should work with 1.5.1.1166. You can > get it here. > http://wiki.openqa.org/display/WTR/Development+Builds > > Zeljko > > _______________________________________________ > 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/20070523/78ab80eb/attachment.html From zeljko.filipin at gmail.com Wed May 23 03:57:01 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 23 May 2007 09:57:01 +0200 Subject: [Wtr-general] Why it is always failed? In-Reply-To: <38362190.7421179888624517.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <38362190.7421179888624517.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 5/23/07, Kui Zhang wrote: > > Using the following assert statement, I always get failed result. This works for me (no exception raised). irb(main):007:0> assert(ie.contains_text("Welcome manager!")) => nil Maybe you are not identifying frame correctly. It would help if you posted your error message. Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/8ec41ed5/attachment.html From zeljko.filipin at gmail.com Wed May 23 04:00:37 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 23 May 2007 10:00:37 +0200 Subject: [Wtr-general] How to click variable link In-Reply-To: <7523f5800705230054o75f6440aj9b5caa1a769023bd@mail.gmail.com> References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <7523f5800705222342w41f0da30pcafd95a84b299724@mail.gmail.com> <27915010705222348w61a1cbc4jdb559ba712680a2f@mail.gmail.com> <7523f5800705222357s3102cc43k4632c8bbeeef250c@mail.gmail.com> <27915010705230016n1b1f3b8dr14a132beface99a3@mail.gmail.com> <7523f5800705230021ga9f1fe2u9326c97a39e25c92@mail.gmail.com> <7523f5800705230054o75f6440aj9b5caa1a769023bd@mail.gmail.com> Message-ID: On 5/23/07, SHALINI GUPTA wrote: > > im using watir 1.4.1 > but also installed this watir-1.5.1.1127.gem Paste this into command prompt. ruby -e 'require "watir"; puts Watir::IE::VERSION' What do you get? In any case, you should uninstall both versions of watir and install 1.5.1.1166. :) Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/0ef9ce76/attachment.html From shalinigupta2006 at gmail.com Wed May 23 04:18:07 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Wed, 23 May 2007 13:48:07 +0530 Subject: [Wtr-general] How to click variable link In-Reply-To: References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <7523f5800705222342w41f0da30pcafd95a84b299724@mail.gmail.com> <27915010705222348w61a1cbc4jdb559ba712680a2f@mail.gmail.com> <7523f5800705222357s3102cc43k4632c8bbeeef250c@mail.gmail.com> <27915010705230016n1b1f3b8dr14a132beface99a3@mail.gmail.com> <7523f5800705230021ga9f1fe2u9326c97a39e25c92@mail.gmail.com> <7523f5800705230054o75f6440aj9b5caa1a769023bd@mail.gmail.com> Message-ID: <7523f5800705230118m2c1ca97dwe3a372ebc618e969@mail.gmail.com> i Have installed 1.5.1166 and problem is solved.. but when i change that link name...its not working.. is href also variable?? On 5/23/07, ?eljko Filipin wrote: > > On 5/23/07, SHALINI GUPTA wrote: > > > > im using watir 1.4.1 > > but also installed this watir-1.5.1.1127.gem > > > Paste this into command prompt. > > ruby -e 'require "watir"; puts Watir::IE::VERSION' > > What do you get? In any case, you should uninstall both versions of watir > and install 1.5.1.1166. :) > > Zeljko > > > _______________________________________________ > 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/20070523/9107815f/attachment.html From erik.oliver at gmail.com Wed May 23 04:24:53 2007 From: erik.oliver at gmail.com (Erik Oliver) Date: Wed, 23 May 2007 01:24:53 -0700 Subject: [Wtr-general] AutoIt -- Unable to actually click IE7 buttons Message-ID: <7c1d10a70705230124g746b196jc2d9b18371d7f260@mail.gmail.com> So, I'm running into a weird problem with AutoIt and IE7 file download buttons.... I want to click "Save", but am having no love. I've tried a number of different approaches (see below) with no luck. The uncommented version is what has come closest to working in that it actually manages to switch the focus to the 'Save' item. (send("!s") manages to underline the 'S', etc., but not 'hit' the save.) Any thoughts as to what is happening? It is as if there is some black hole of an event sink swallowing my clicks/sent keys? Regards, Erik autoit.WinActivate ("File Download") autoit.WinWaitActive ("File Download") autoit.ControlFocus("File Download","", 4427) autoit.ControlClick("File Download", "", 4427) #autoit.Send("!s") #autoit.ControlFocus("File Download","","&Save") #autoit.ControlClick("File Download", "Do you want to open or save this file?", "&Save") #autoit.ControlFocus("File Download", "", "[CLASS:Button;TEXT:&Send;INSTANCE:2]") #autoit.ControlClick("File Download", "", "[CLASS:Button;TEXT:&Send;INSTANCE:2]") From shalinigupta2006 at gmail.com Wed May 23 04:27:05 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Wed, 23 May 2007 13:57:05 +0530 Subject: [Wtr-general] CAN BE CLICK LINK ASSOCIATED WITH AN IMAGE Message-ID: <7523f5800705230127w1291032bi317945890631cc3b@mail.gmail.com> Hi, In my project i want to click a link that is variable.i.e user dependent.Butalways it comes after an image... so is there any way to click a link just next to an image. please help.Its very urgent Regards Shalini Gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/a5c406b4/attachment-0001.html From zeljko.filipin at gmail.com Wed May 23 04:28:12 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 23 May 2007 10:28:12 +0200 Subject: [Wtr-general] How to click variable link In-Reply-To: <7523f5800705230118m2c1ca97dwe3a372ebc618e969@mail.gmail.com> References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <7523f5800705222342w41f0da30pcafd95a84b299724@mail.gmail.com> <27915010705222348w61a1cbc4jdb559ba712680a2f@mail.gmail.com> <7523f5800705222357s3102cc43k4632c8bbeeef250c@mail.gmail.com> <27915010705230016n1b1f3b8dr14a132beface99a3@mail.gmail.com> <7523f5800705230021ga9f1fe2u9326c97a39e25c92@mail.gmail.com> <7523f5800705230054o75f6440aj9b5caa1a769023bd@mail.gmail.com> <7523f5800705230118m2c1ca97dwe3a372ebc618e969@mail.gmail.com> Message-ID: On 5/23/07, SHALINI GUPTA wrote: > > but when i change that link name...its not working.. > is href also variable? I would like to help, but I have no idea what are you talking about. :) Please be explicit? Like this: I have this html (snippet). I want to do this. I have tried this (watir code snippet). This happened (copy/paste error message, if any). Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/f875cfd8/attachment.html From zeljko.filipin at gmail.com Wed May 23 04:34:02 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 23 May 2007 10:34:02 +0200 Subject: [Wtr-general] AutoIt -- Unable to actually click IE7 buttons In-Reply-To: <7c1d10a70705230124g746b196jc2d9b18371d7f260@mail.gmail.com> References: <7c1d10a70705230124g746b196jc2d9b18371d7f260@mail.gmail.com> Message-ID: I do not mean to be rude, but don't you think you will get a faster and better reply if you posted you question at AutoIt forum? I would like to help, but I have never used AutoIt (I know Watir uses it somewhere, but it is hidden from me). Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/46a9b375/attachment.html From shalinigupta2006 at gmail.com Wed May 23 04:35:36 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Wed, 23 May 2007 14:05:36 +0530 Subject: [Wtr-general] How to click variable link In-Reply-To: References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <27915010705222348w61a1cbc4jdb559ba712680a2f@mail.gmail.com> <7523f5800705222357s3102cc43k4632c8bbeeef250c@mail.gmail.com> <27915010705230016n1b1f3b8dr14a132beface99a3@mail.gmail.com> <7523f5800705230021ga9f1fe2u9326c97a39e25c92@mail.gmail.com> <7523f5800705230054o75f6440aj9b5caa1a769023bd@mail.gmail.com> <7523f5800705230118m2c1ca97dwe3a372ebc618e969@mail.gmail.com> Message-ID: <7523f5800705230135s260ddc92kbdcbd7e08b8cc36b@mail.gmail.com> hi, my watir code is this.. def system_link $logger.log("## CAST_HOMEPAGE_05") $logger.log("") $logger.log "## System link #####################################################################\n" $logger.log("Description-In Health Factor with lowest grade / System subsection, click System link ") #logs only to corelogger file $logger.log("Expected Output-Outline page displaying Focus on System systemX - part of CORPORATE - for snapshotX snapshot should be displayed ") $logger.log("") $ie.link(:href,' http://172.16.59.105/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3').click end and my html code is this. CAST AD Governance Dashboard - Welcome Page
    AD Governance Dashboard
     
     

    Systems/Application Overview
    CAST Maintainability (and variation)
    Object CAST Maintainability CAST Maintainability Variation Variation  
    sys_asp   2.77   High Risk 0    
    sys_dotnet   2.85   High Risk 0    
    R-12   3.5   Moderate Risk 0    
    Health Factor with lowest grade / System
    Health Factor with lowest grade / Application
    Application with lowest grade / Health Factor
    Module with lowest grade / Health Factor
    Business Value x CAST Maintainability x Functional Weight mapping - System level
    Business Value not set, default value '1' used instead

    The chart maps all Systems using the highest business value of enclosed Modules, the lowest CAST Maintainability value of enclosed Modules and the compounded number of Backfired IFPUG Function Points. It helps identify the 'weakest link in the chain'.
    Business Value x CAST Maintainability x Functional Weight mapping - Application level
    Application Focus and Monitoring Over Time
    Application Focus
    Source code quality assessment for the application with the lowest CAST Maintainability rating.
    sys_asp / job_asp - Rule-12
    Click on system or application name in the title bar to drilldown for more details.
    Transferability   2.96  
    Changeability   2.62  
    Robustness   3.17  
    Performance   2.65  
    Security   2.36  

    Application Monitoring Over Time
    Trend analysis for the application with most downward CAST Maintainability variation.
    sys_asp / job_asp - Up to Rule-12
    Click on system or application name in the title bar to drill down for more details.
    In this "sys_asp" is variable link. we can change this with any name..its user dependent i want that whatever be the name of the link it should click.It should not depend on stop. but when i changed this. Its not working. Regards shalini On 5/23/07, ?eljko Filipin wrote: > > On 5/23/07, SHALINI GUPTA wrote: > > > > but when i change that link name...its not working.. > > is href also variable? > > > I would like to help, but I have no idea what are you talking about. :) > Please be explicit? Like this: > I have this html (snippet). I want to do this. I have tried this (watir > code snippet). This happened (copy/paste error message, if any). > > Zeljko > > > > _______________________________________________ > 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/20070523/cba4275a/attachment-0001.html From shalinigupta2006 at gmail.com Wed May 23 05:07:04 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Wed, 23 May 2007 14:37:04 +0530 Subject: [Wtr-general] How to click variable link In-Reply-To: <7523f5800705230135s260ddc92kbdcbd7e08b8cc36b@mail.gmail.com> References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <7523f5800705222357s3102cc43k4632c8bbeeef250c@mail.gmail.com> <27915010705230016n1b1f3b8dr14a132beface99a3@mail.gmail.com> <7523f5800705230021ga9f1fe2u9326c97a39e25c92@mail.gmail.com> <7523f5800705230054o75f6440aj9b5caa1a769023bd@mail.gmail.com> <7523f5800705230118m2c1ca97dwe3a372ebc618e969@mail.gmail.com> <7523f5800705230135s260ddc92kbdcbd7e08b8cc36b@mail.gmail.com> Message-ID: <7523f5800705230207q5305c6bcw9c0f33e460b52877@mail.gmail.com> my watir code is... def system_link $logger.log("## CAST_HOMEPAGE_05") $logger.log("") $logger.log "## System link #####################################################################\n" $logger.log("Description-In Health Factor with lowest grade / System subsection, click System link ") #logs only to corelogger file $logger.log("Expected Output-Outline page displaying Focus on System systemX - part of CORPORATE - for snapshotX snapshot should be displayed ") $logger.log("") $ie.link(:href,'http://172.16.59.105/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3').click end HTML CODE IS:- sys_asp   2.77   High Risk 0     in this code "sys_asp" is variable link.i.e user dependent. i want to click this without depending on this name.. Regards shalini -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/4f6e9954/attachment.html From zeljko.filipin at gmail.com Wed May 23 05:13:03 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 23 May 2007 11:13:03 +0200 Subject: [Wtr-general] How to click variable link In-Reply-To: <7523f5800705230207q5305c6bcw9c0f33e460b52877@mail.gmail.com> References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <27915010705230016n1b1f3b8dr14a132beface99a3@mail.gmail.com> <7523f5800705230021ga9f1fe2u9326c97a39e25c92@mail.gmail.com> <7523f5800705230054o75f6440aj9b5caa1a769023bd@mail.gmail.com> <7523f5800705230118m2c1ca97dwe3a372ebc618e969@mail.gmail.com> <7523f5800705230135s260ddc92kbdcbd7e08b8cc36b@mail.gmail.com> <7523f5800705230207q5305c6bcw9c0f33e460b52877@mail.gmail.com> Message-ID: This does not work? ie.link(:href, " http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3 ").click What happens? Do you get any error message? Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/eb4abf6c/attachment.html From prema.arya at gmail.com Wed May 23 05:12:20 2007 From: prema.arya at gmail.com (Prema Arya) Date: Wed, 23 May 2007 14:42:20 +0530 Subject: [Wtr-general] How to click variable link In-Reply-To: <7523f5800705230135s260ddc92kbdcbd7e08b8cc36b@mail.gmail.com> References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <7523f5800705222357s3102cc43k4632c8bbeeef250c@mail.gmail.com> <27915010705230016n1b1f3b8dr14a132beface99a3@mail.gmail.com> <7523f5800705230021ga9f1fe2u9326c97a39e25c92@mail.gmail.com> <7523f5800705230054o75f6440aj9b5caa1a769023bd@mail.gmail.com> <7523f5800705230118m2c1ca97dwe3a372ebc618e969@mail.gmail.com> <7523f5800705230135s260ddc92kbdcbd7e08b8cc36b@mail.gmail.com> Message-ID: <27915010705230212y5bea5e72nce5c5e78abbc8816@mail.gmail.com> in the html code you have given no link is having "http://172.16.59.105" in the href .... every link's href start with localhost:8080 are you sure you are using the same HTML? On 5/23/07, SHALINI GUPTA wrote: > > hi, > my watir code is this.. > > def system_link > $logger.log("## CAST_HOMEPAGE_05") > $logger.log("") > $logger.log "## System link > #####################################################################\n" > $logger.log("Description-In Health Factor with lowest grade / System > subsection, click System link ") #logs only to corelogger file > $logger.log("Expected Output-Outline page displaying Focus on System > systemX - part of CORPORATE - for snapshotX snapshot should be displayed ") > $logger.log("") > $ie.link(:href,'http://172.16.59.105/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3').click > > end > > and my html code is this. > > http://www.w3.org/TR/html4/loose.dtd "> > > > > > > CAST AD Governance Dashboard - Welcome Page > TYPE="text/css" media="screen"> > media="print"> > > > > > > >
    > AD Governance Dashboard >
    > >
    >   >
    >
    >   >
    > >
    > > > > >
    > ONCLICK="javascript:toggleRows('m1392');toggleImageSource('img0','themes/default/images/open- > menu.gif','themes/default/images/closed- menu.gif')"> SRC='themes/default/images/open-menu.gif' ALT="" > ALIGN="absmiddle"/> > Systems/Application Overview > >
    >
    > > > > > >
    > > > > > > > > > > > > > > > > >
    > > > > >
    > ONCLICK="javascript:toggleRows('m1393');toggleImageSource('img1','themes/default/images/open- > menu.gif','themes/default/images/closed-menu.gif')"> SRC='themes/default/images/open-menu.gif' ALT="" > ALIGN="absmiddle"/> > CAST Maintainability (and variation) > >
    >
    >
    > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
    > Object > > CAST Maintainability > > CAST Maintainability > > Variation > > Variation > >   >
    > ONCLICK="javascript:toggleRows('m1397');toggleImageSource('img2','themes/default/images/open- > menu.gif','themes/default/images/closed- menu.gif')"> SRC='themes/default/images/closed-menu.gif' ALT="" > ALIGN="absmiddle"/> onmouseover="javascript:ShowTooltip('Access detailed quality and quantity > assessment page for the selected component.');" > onmouseout="javascript:HideTooltip();" > > sys_asp > >   > > 2.77 >   > > High Risk > > 0 > > > ALT="" /> > >   > > > > >   >
    > ONCLICK="javascript:toggleRows('m1399');toggleImageSource('img3','themes/default/images/open- > menu.gif','themes/default/images/closed-menu.gif')"> SRC='themes/default/images/closed-menu.gif' ALT="" > ALIGN="absmiddle"/> onmouseout="javascript:HideTooltip();" > > sys_dotnet > >   > > 2.85 >   > > High Risk > > 0 > > > ALT="" /> > >   > > > > >   >
    > ONCLICK="javascript:toggleRows('m1401');toggleImageSource('img4','themes/default/images/open- > menu.gif','themes/default/images/closed-menu.gif')"> SRC='themes/default/images/closed-menu.gif' ALT="" > ALIGN="absmiddle"/> onmouseout="javascript:HideTooltip();" > > R-12 > >   > > 3.5 >   > > Moderate Risk > > 0 > > > ALT="" /> > >   > > > > >   >
    >
    >
    >
    > > > > >
    > ALIGN="absmiddle"/> > Health Factor with lowest grade / System > >
    > >
    > > > > >
    > ALIGN="absmiddle"/> > Health Factor with lowest grade / Application > >
    > >
    > > > > >
    > ALIGN="absmiddle"/> > Application with lowest grade / Health Factor > >
    > >
    > > > > >
    > ALIGN="absmiddle"/> > Module with lowest grade / Health Factor > >
    > >
    >
    > > > > > > > >
    > > > > >
    > ONCLICK="javascript:toggleRows('m1406');toggleImageSource('img9','themes/default/images/open- > menu.gif','themes/default/images/closed- menu.gif')"> SRC='themes/default/images/open-menu.gif' ALT="" > ALIGN="absmiddle"/> > Business Value x CAST Maintainability x Functional Weight > mapping - System level > >
    >
    > > Business Value not set, default value '1' used instead > >
    >
    > > > > title=" 2.00" > > > title="3.00" > > > title=" 4.00" > > > coords="296,93,295,96,295,99,294,102,293,105,292,109,290,112,289,114,287,117,284,119,282,122,279,124,277,125,274,127,270,128,267,129,264,130,261,130,258,131,254,130,251,130,248,129,245,128,241,127,239,125,236,124,233,122,231,119,228,117,226,114,225,112,223,109,222,105,221,102,220,99,220,96,220,93,220,89,220,86,221,83,222,80,223,76,225,74,226,71,228,68,231,66,233,63,236,61,238,60,241,58,245,57,248,56,251,55,254,55,258,54,261,55,264,55,267,56,270,57,274,58,277,60,279,61,282,63,284,66,287,68,289,71,290,73,292,76,293,80,294,83,295,86,295,89" > title="sys_asp(x : 2.77 - y : 1.00 - z : 38.00000000000001)" > > > coords="294,104,294,105,294,106,294,108,293,109,293,110,292,112,291,113,291,114,290,115,289,116,288,116,287,117,285,118,284,118,283,119,281,119,280,119,279,119,277,119,276,119,275,119,273,118,272,118,271,117,270,116,269,116,268,115,267,114,266,113,265,112,265,110,264,109,264,108,263,106,263,105,263,104,263,102,263,101,264,100,264,98,265,97,265,96,266,95,267,94,268,93,269,92,270,91,271,90,272,90,273,89,275,89,276,88,277,88,279,88,280,88,281,88,283,89,284,89,285,90,287,90,288,91,289,92,290,93,291,94,291,95,292,96,293,97,293,98,294,100,294,101,294,102" > title="sys_dotnet(x : 2.85 - y : 1.00 - z : 15.490445859872613)" > > > coords="373,107,372,107,372,108,372,109,372,110,372,111,371,112,371,112,370,113,370,114,369,114,368,115,368,115,367,116,366,116,365,116,364,116,363,116,363,117,362,116,361,116,360,116,359,116,358,116,358,115,357,115,356,114,355,114,355,113,354,112,354,112,353,111,353,110,353,109,353,108,353,107,353,107,353,106,353,105,353,104,353,103,353,102,354,102,354,101,355,100,355,99,356,99,357,98,358,98,358,97,359,97,360,97,361,97,362,97,363,97,363,97,364,97,365,97,366,97,367,97,368,98,368,98,369,99,370,99,370,100,371,101,371,102,372,102,372,103,372,104,372,105,372,106" > title="R-12(x : 3.50 - y : 1.00 - z : 10.0)" > > > > > ALT="" USEMAP="#m1407" /> > >
    >
    > > The chart maps all Systems using the highest business value of > enclosed Modules, the lowest CAST Maintainability value of enclosed Modules > and the compounded number of Backfired IFPUG Function Points. It helps > identify the 'weakest link in the chain'. > >
    >
    >
    > > > > >
    > ALIGN="absmiddle"/> > Business Value x CAST Maintainability x Functional Weight > mapping - Application level > >
    > >
    >
    >
    > > > > >
    > ONCLICK="javascript:toggleRows('m1410');toggleImageSource('img11','themes/default/images/open- > menu.gif','themes/default/images/closed-menu.gif')"> SRC='themes/default/images/open-menu.gif' ALT="" > ALIGN="absmiddle"/> > Application Focus and Monitoring Over Time > >
    >
    > > > > > >
    > > > > >
    > ONCLICK="javascript:toggleRows('m1411');toggleImageSource('img12','themes/default/images/open- > menu.gif','themes/default/images/closed- menu.gif')"> SRC='themes/default/images/open-menu.gif' ALT="" > ALIGN="absmiddle"/> > Application Focus > >
    >
    > > Source code quality assessment for the application with the lowest > CAST Maintainability rating. > > > > > >
    > ONCLICK="javascript:toggleRows('m1412');toggleImageSource('img13','themes/default/images/open- > menu.gif','themes/default/images/closed-menu.gif')"> SRC='themes/default/images/open-menu.gif' ALT="" > ALIGN="absmiddle"/> > > sys_asp > > / > > job_asp > > - Rule-12 > >
    >
    > > Click on system or application name in the title bar to drilldown > for more details. > > > > > > >
    > >
    >
    >
    > > title="Transferability: 2.96" > > > title="Changeability:2.62" > > > title="Robustness: 3.17" > > > title="Performance:2.65" > > > title="Security: 2.36" > > > > > > >
    >
    > >
    >
    >
    > > > > >
    > ONCLICK="javascript:toggleRows('m1423');toggleImageSource('img14','themes/default/images/open- > menu.gif','themes/default/images/closed-menu.gif')"> SRC='themes/default/images/open-menu.gif' ALT="" > ALIGN="absmiddle"/> > Application Monitoring Over Time > >
    >
    > > Trend analysis for the application with most downward CAST > Maintainability variation. > > > > > >
    > ONCLICK="javascript:toggleRows('m1424');toggleImageSource('img15','themes/default/images/open- > menu.gif','themes/default/images/closed-menu.gif')"> SRC='themes/default/images/open-menu.gif' ALT="" > ALIGN="absmiddle"/> > > sys_asp > > / > > job_asp > > - Up to Rule-12 > >
    >
    > > Click on system or application name in the title bar to drill down > for more details. > >
    > > title="test_snapshot" > > > title="test_snapshot_dotnet" > > > title="Rule-12" > > > title="Transferability:2.96" > > > title="Transferability: 2.96" > > > title="Transferability:2.96" > > > title="Transferability: 2.96" > > > title="Changeability:2.62" > > > title="Changeability: 2.62" > > > title="Changeability:2.62" > > > title="Changeability: 2.62" > > > title="Robustness:3.17" > > > title="Robustness: 3.17" > > > title="Robustness:3.17" > > > title="Robustness: 3.17" > > > title="Performance:2.65" > > > title="Performance: 2.65" > > > title="Performance:2.65" > > > title="Performance: 2.65" > > > title="SEI Maintainability:3.19" > > > title="SEI Maintainability: 3.19" > > > title="SEI Maintainability:3.19" > > > title="SEI Maintainability: 3.19" > > > title="Security:2.36" > > > title="Security: 2.36" > > > title="Security:2.36" > > > title="Security: 2.36" > > > title="CAST Maintainability:2.77" > > > title="CAST Maintainability: 2.77" > > > title="CAST Maintainability:2.77" > > > title="CAST Maintainability: 2.77" > > > > > ALT="" USEMAP="#m1425" /> > >
    >
    >
    >
    >
    > > > > In this "sys_asp" is variable link. > we can change this with any name..its user dependent > i want that whatever be the name of the link it should click.It should not > depend on stop. > but when i changed this. Its not working. > > Regards > shalini > > On 5/23/07, ?eljko Filipin wrote: > > > > On 5/23/07, SHALINI GUPTA wrote: > > > > > > but when i change that link name...its not working.. > > > is href also variable? > > > > > > I would like to help, but I have no idea what are you talking about. :) > > Please be explicit? Like this: > > I have this html (snippet). I want to do this. I have tried this (watir > > code snippet). This happened (copy/paste error message, if any). > > > > Zeljko > > > > > > > > > > > > _______________________________________________ > > 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 > -- Prema Arya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/8e2c13e6/attachment-0001.html From prema.arya at gmail.com Wed May 23 05:16:25 2007 From: prema.arya at gmail.com (Prema Arya) Date: Wed, 23 May 2007 14:46:25 +0530 Subject: [Wtr-general] How to click variable link In-Reply-To: References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <7523f5800705230021ga9f1fe2u9326c97a39e25c92@mail.gmail.com> <7523f5800705230054o75f6440aj9b5caa1a769023bd@mail.gmail.com> <7523f5800705230118m2c1ca97dwe3a372ebc618e969@mail.gmail.com> <7523f5800705230135s260ddc92kbdcbd7e08b8cc36b@mail.gmail.com> <7523f5800705230207q5305c6bcw9c0f33e460b52877@mail.gmail.com> Message-ID: <27915010705230216w7c57d4a1gb4eaef908c1f0d48@mail.gmail.com> in the html code you have given no link is having "http://172.16.59.105" in the href .... every link's href start with localhost:8080 are you sure you are using the same HTML? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/62253987/attachment.html From shalinigupta2006 at gmail.com Wed May 23 07:11:57 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Wed, 23 May 2007 16:41:57 +0530 Subject: [Wtr-general] How to click variable link In-Reply-To: <27915010705230216w7c57d4a1gb4eaef908c1f0d48@mail.gmail.com> References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <7523f5800705230054o75f6440aj9b5caa1a769023bd@mail.gmail.com> <7523f5800705230118m2c1ca97dwe3a372ebc618e969@mail.gmail.com> <7523f5800705230135s260ddc92kbdcbd7e08b8cc36b@mail.gmail.com> <7523f5800705230207q5305c6bcw9c0f33e460b52877@mail.gmail.com> <27915010705230216w7c57d4a1gb4eaef908c1f0d48@mail.gmail.com> Message-ID: <7523f5800705230411i74d60379ue44de30e347ad07c@mail.gmail.com> hi, after using regular expression im getting this error 1) Error: test_ADGDashboard_Homepage(TC_CAST_ADGDashboard_Homepage): Watir::Exception::UnknownObjectException: Unable to locate object, using href and (?-mix:treeobject=46&object=46&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS) On 5/23/07, Prema Arya wrote: > > in the html code you have given no link is having " http://172.16.59.105" > in the href .... every link's href start with localhost:8080 > > are you sure you are using the same HTML? > > _______________________________________________ > 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/20070523/25f08529/attachment.html From shalinigupta2006 at gmail.com Wed May 23 07:23:10 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Wed, 23 May 2007 16:53:10 +0530 Subject: [Wtr-general] How to click variable link In-Reply-To: <7523f5800705230411i74d60379ue44de30e347ad07c@mail.gmail.com> References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <7523f5800705230054o75f6440aj9b5caa1a769023bd@mail.gmail.com> <7523f5800705230118m2c1ca97dwe3a372ebc618e969@mail.gmail.com> <7523f5800705230135s260ddc92kbdcbd7e08b8cc36b@mail.gmail.com> <7523f5800705230207q5305c6bcw9c0f33e460b52877@mail.gmail.com> <27915010705230216w7c57d4a1gb4eaef908c1f0d48@mail.gmail.com> <7523f5800705230411i74d60379ue44de30e347ad07c@mail.gmail.com> Message-ID: <7523f5800705230423l3a48f6d0j78d82176f5fa48fd@mail.gmail.com> my watir code is:- def system_link $logger.log("## CAST_HOMEPAGE_05") $logger.log("") $logger.log "## System link #####################################################################\n" $logger.log("Description-In Health Factor with lowest grade / System subsection, click System link ") #logs only to corelogger file $logger.log("Expected Output-Outline page displaying Focus on System systemX - part of CORPORATE - for snapshotX snapshot should be displayed ") $logger.log("") #$ie.link(:href,' http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3').click $ie.link(:href,/treeobject=46&object=46&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS/).click end error is 1) Error: test_ADGDashboard_Homepage(TC_CAST_ADGDashboard_Homepage): Watir::Exception::UnknownObject > > Exception: Unable to locate object, using href and > (?-mix:treeobject=46&object=46&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS) regards shalini gupta On 5/23/07, SHALINI GUPTA wrote: > > hi, > > after using regular expression im getting this error > 1) Error: > test_ADGDashboard_Homepage(TC_CAST_ADGDashboard_Homepage): > Watir::Exception::UnknownObjectException: Unable to locate object, using > href and > (?-mix:treeobject=46&object=46&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS) > > > On 5/23/07, Prema Arya wrote: > > > > in the html code you have given no link is having " http://172.16.59.105" > > in the href .... every link's href start with localhost:8080 > > > > are you sure you are using the same HTML? > > > > _______________________________________________ > > 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/20070523/cbba743d/attachment.html From prema.arya at gmail.com Wed May 23 07:35:16 2007 From: prema.arya at gmail.com (Prema Arya) Date: Wed, 23 May 2007 17:05:16 +0530 Subject: [Wtr-general] How to click variable link In-Reply-To: <7523f5800705230423l3a48f6d0j78d82176f5fa48fd@mail.gmail.com> References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <7523f5800705230118m2c1ca97dwe3a372ebc618e969@mail.gmail.com> <7523f5800705230135s260ddc92kbdcbd7e08b8cc36b@mail.gmail.com> <7523f5800705230207q5305c6bcw9c0f33e460b52877@mail.gmail.com> <27915010705230216w7c57d4a1gb4eaef908c1f0d48@mail.gmail.com> <7523f5800705230411i74d60379ue44de30e347ad07c@mail.gmail.com> <7523f5800705230423l3a48f6d0j78d82176f5fa48fd@mail.gmail.com> Message-ID: <27915010705230435w4a4124k869d21165454b9bc@mail.gmail.com> Shalini, The code your have written works fine here at my end using the html you have sent .. provided the link having text ",/treeobject=46&object=46&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS" is there in the page. However, when I change the text so someting that is not there in the page it is throwing same error as you are getting. It seems to me, you are looking for a link on a screen where its not present or there is some spelling mistake in the text you are searching. Regards, Prema. On 5/23/07, SHALINI GUPTA wrote: > > my watir code is:- > > def system_link > $logger.log("## CAST_HOMEPAGE_05") > $logger.log("") > $logger.log "## System link > #####################################################################\n" > $logger.log("Description-In Health Factor with lowest grade / System > subsection, click System link ") #logs only to corelogger file > $logger.log("Expected Output-Outline page displaying Focus on System > systemX - part of CORPORATE - for snapshotX snapshot should be displayed ") > $logger.log("") > #$ie.link(:href,'http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3').click > > > $ie.link(:href,/treeobject=46&object=46&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS/).click > end > error is > 1) Error: > test_ADGDashboard_Homepage(TC_CAST_ADGDashboard_Homepage): > Watir::Exception::UnknownObject > > > > Exception: Unable to locate object, using href and > > (?-mix:treeobject=46&object=46&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS) > > > regards > shalini gupta > > > > On 5/23/07, SHALINI GUPTA wrote: > > > > hi, > > > > after using regular expression im getting this error > > 1) Error: > > test_ADGDashboard_Homepage(TC_CAST_ADGDashboard_Homepage): > > Watir::Exception::UnknownObjectException: Unable to locate object, using > > href and > > (?-mix:treeobject=46&object=46&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS) > > > > > > On 5/23/07, Prema Arya < prema.arya at gmail.com> wrote: > > > > > > in the html code you have given no link is having "http://172.16.59.105" > > > in the href .... every link's href start with localhost:8080 > > > > > > are you sure you are using the same HTML? > > > > > > _______________________________________________ > > > 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 > -- Prema Arya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/14f9bfa6/attachment.html From prema.arya at gmail.com Wed May 23 08:16:48 2007 From: prema.arya at gmail.com (Prema Arya) Date: Wed, 23 May 2007 17:46:48 +0530 Subject: [Wtr-general] How to click variable link In-Reply-To: <27915010705230435w4a4124k869d21165454b9bc@mail.gmail.com> References: <7523f5800705220504q47644b09jd358fdcfd82bb6d5@mail.gmail.com> <7523f5800705230118m2c1ca97dwe3a372ebc618e969@mail.gmail.com> <7523f5800705230135s260ddc92kbdcbd7e08b8cc36b@mail.gmail.com> <7523f5800705230207q5305c6bcw9c0f33e460b52877@mail.gmail.com> <27915010705230216w7c57d4a1gb4eaef908c1f0d48@mail.gmail.com> <7523f5800705230411i74d60379ue44de30e347ad07c@mail.gmail.com> <7523f5800705230423l3a48f6d0j78d82176f5fa48fd@mail.gmail.com> <27915010705230435w4a4124k869d21165454b9bc@mail.gmail.com> Message-ID: <27915010705230516o555842dfm80ab416cb0b4ac41@mail.gmail.com> One more thing '&' has different meaning in regular expression, so try escaping it out like $ie.link(:href,/treeobject=3305\&object=3305\&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS/).click This could be the mistake... Regards, Prema On 5/23/07, Prema Arya wrote: > > Shalini, > > The code your have written works fine here at my end using the html you > have sent .. provided the link having text > ",/treeobject=46&object=46&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS" is there in > the page. However, when I change the text so someting that is not there in > the page it is throwing same error as you are getting. > > It seems to me, you are looking for a link on a screen where its not > present or there is some spelling mistake in the text you are searching. > > Regards, > Prema. > > > On 5/23/07, SHALINI GUPTA wrote: > > > > my watir code is:- > > > > def system_link > > $logger.log("## CAST_HOMEPAGE_05") > > $logger.log("") > > $logger.log "## System link > > #####################################################################\n" > > $logger.log("Description-In Health Factor with lowest grade / > > System subsection, click System link ") #logs only to corelogger file > > $logger.log("Expected Output-Outline page displaying Focus on > > System systemX - part of CORPORATE - for snapshotX snapshot should be > > displayed ") > > $logger.log("") > > #$ie.link(:href,' http://localhost:8080/CASTAD/?treeobject=2&object=2&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS&snapshot=3').click > > > > > > $ie.link(:href,/treeobject=46&object=46&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS/).click > > end > > error is > > 1) Error: > > test_ADGDashboard_Homepage(TC_CAST_ADGDashboard_Homepage): > > Watir::Exception::UnknownObject > > > > > > Exception: Unable to locate object, using href and > > > (?-mix:treeobject=46&object=46&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS) > > > > > > regards > > shalini gupta > > > > > > > > On 5/23/07, SHALINI GUPTA < shalinigupta2006 at gmail.com > wrote: > > > > > > hi, > > > > > > after using regular expression im getting this error > > > 1) Error: > > > test_ADGDashboard_Homepage(TC_CAST_ADGDashboard_Homepage): > > > Watir::Exception::UnknownObjectException: Unable to locate object, > > > using href and > > > (?-mix:treeobject=46&object=46&frame=FRAME_PORTAL_TOP_LEVEL_DETAILS) > > > > > > > > > On 5/23/07, Prema Arya < prema.arya at gmail.com > wrote: > > > > > > > > in the html code you have given no link is having "http://172.16.59.105" > > > > in the href .... every link's href start with localhost:8080 > > > > > > > > are you sure you are using the same HTML? > > > > > > > > _______________________________________________ > > > > 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 > > > > > > -- > Prema Arya -- Prema Arya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/42f2b499/attachment-0001.html From forum-watir-users at openqa.org Wed May 23 10:04:07 2007 From: forum-watir-users at openqa.org (Ameya) Date: Wed, 23 May 2007 09:04:07 CDT Subject: [Wtr-general] How to identify Textboxes in Frames using xpath in Watir. Message-ID: <30457874.13521179929077449.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I want to select a text box , which is inside a frame. Apparently there are three frames, and the text box which i am interested in is in a sub frame. I tried using " $browser.frame("framename").text_field(:xpath,"Expression").set("the value") I also read a document online that says that xpath doesnt support frame, but i am not sure of this is entirely correct. but this doesnt seem to work. Can any one help me here.??? -Ameya. From caesarkim at hotmail.com Wed May 23 10:24:13 2007 From: caesarkim at hotmail.com (Jungwhan Kim) Date: Wed, 23 May 2007 10:24:13 -0400 Subject: [Wtr-general] handling multiple IE Message-ID: I want to test my project on multiple IE versions (IE 5,6,7). does anybody know how to configure the watir or any resource that I can look up? I'd appreciated it. _________________________________________________________________ Create the ultimate e-mail address book. Import your contacts to Windows Live Hotmail. www.windowslive-hotmail.com/learnmore/managemail2.html?locale=en-us&ocid=TXT_TAGLM_HMWL_reten_impcont_0507 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/83f6af41/attachment.html From zeljko.filipin at gmail.com Wed May 23 10:49:07 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 23 May 2007 16:49:07 +0200 Subject: [Wtr-general] handling multiple IE In-Reply-To: References: Message-ID: On 5/23/07, Jungwhan Kim wrote: > > any resource that I can look up? > IE6 and IE7 Running on a Single Machine http://blogs.msdn.com/ie/archive/2006/11/30/ie6-and-ie7-running-on-a-single-machine.aspx Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/c99c3f9f/attachment.html From caesarkim at hotmail.com Wed May 23 11:09:20 2007 From: caesarkim at hotmail.com (Jungwhan Kim) Date: Wed, 23 May 2007 11:09:20 -0400 Subject: [Wtr-general] handling multiple IE Message-ID: Thanks for the info. Can I automate the testing with watir? I want to automate the testing process on IE 6 and IE7 sequencially. Is there any configuration file or watir script support this feature? Date: Wed, 23 May 2007 16:49:07 +0200From: zeljko.filipin at gmail.comTo: wtr-general at rubyforge.orgSubject: Re: [Wtr-general] handling multiple IEOn 5/23/07, Jungwhan Kim wrote: any resource that I can look up? IE6 and IE7 Running on a Single Machinehttp://blogs.msdn.com/ie/archive/2006/11/30/ie6-and-ie7-running-on-a-single-machine.aspx Zeljko _________________________________________________________________ Create the ultimate e-mail address book. Import your contacts to Windows Live Hotmail. www.windowslive-hotmail.com/learnmore/managemail2.html?locale=en-us&ocid=TXT_TAGLM_HMWL_reten_impcont_0507 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/44c6cddc/attachment.html From forum-watir-users at openqa.org Wed May 23 12:09:37 2007 From: forum-watir-users at openqa.org (Ruben) Date: Wed, 23 May 2007 11:09:37 CDT Subject: [Wtr-general] handling multiple IE In-Reply-To: Message-ID: <27321506.13891179936608073.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Multiple IE http://tredosoft.com/Multiple_IE http://tredosoft.com/files/multi-ie/multiple-ie-setup.exe From caesarkim at hotmail.com Wed May 23 12:28:03 2007 From: caesarkim at hotmail.com (Jungwhan Kim) Date: Wed, 23 May 2007 12:28:03 -0400 Subject: [Wtr-general] handling multiple IE Message-ID: Thanks for the info. But let's say that the default is IE 7. But how should I start the instance of IE6 in Watir? Watir starts an IE instance like this, ie = IE.new Is there any way to tell Watir to open a specific version of IE after multiple versions of IE is installed in a single machine? Thanks again. > Date: Wed, 23 May 2007 11:09:37 -0500> From: forum-watir-users at openqa.org> To: wtr-general at rubyforge.org> Subject: Re: [Wtr-general] handling multiple IE> > Multiple IE> http://tredosoft.com/Multiple_IE> http://tredosoft.com/files/multi-ie/multiple-ie-setup.exe> _______________________________________________> Wtr-general mailing list> Wtr-general at rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general _________________________________________________________________ Change is good. See what?s different about Windows Live Hotmail. www.windowslive-hotmail.com/learnmore/default.html?locale=en-us&ocid=TXT_TAGLM_HMWL_reten_changegood_0507 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/de6cacc6/attachment.html From forum-watir-users at openqa.org Wed May 23 13:28:26 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Wed, 23 May 2007 12:28:26 CDT Subject: [Wtr-general] Why it is always failed? In-Reply-To: Message-ID: <41152031.14321179941336406.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Zeljko, Thank you the reply! I found one of your reply for the assertion in another email and that helped with my problem. Here is the code I had before and it always failed. begin assert(ie.frame(:name, "top_frame").contains_text("ClaimCenter")) puts ("Test Passed. Found folder 'ClaimCenter'") rescue => e puts("TEST FAILED. Cannot find folder 'ClaimCenter'") end I removed the rescure... and it works now: begin assert(ie.frame(:name, "top_frame").contains_text("ClaimCenter")) puts ("Test Passed. Found folder 'ClaimCenter'") end Have one question for you. When using assert in irb, it gives me NoMethodError. I did require 'Watir', should I be able to use assert in this case? irb(main):006:0> assert(ie.contains_text('iGoogle')) NoMethodError: undefined method `assert' for # Really appreciate your help! Kui From paul.rogers at shaw.ca Wed May 23 13:36:29 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 23 May 2007 11:36:29 -0600 Subject: [Wtr-general] Why it is always failed? In-Reply-To: <41152031.14321179941336406.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <41152031.14321179941336406.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: you need to 'load up' the assertions libraries the following shows you how C:\cygwin>irb irb(main):001:0> require 'test/unit/assertions' => true irb(main):002:0> include Test::Unit::Assertions => Object irb(main):003:0> assert( true ) => nil irb(main):004:0> assert(false) Test::Unit::AssertionFailedError: is not true. from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:30:in `assert_block' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:359:in `_wrap_assertion' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:28:in `assert_block' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:40:in `assert' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:354:in `_wrap_assertion' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:38:in `assert' from (irb):4 irb(main):005:0> ----- Original Message ----- From: Kui Zhang Date: Wednesday, May 23, 2007 11:28 am Subject: Re: [Wtr-general] Why it is always failed? > Hi Zeljko, > > Thank you the reply! > > I found one of your reply for the assertion in another email and > that helped with my problem. Here is the code I had before and it > always failed. > begin > assert(ie.frame(:name, "top_frame").contains_text("ClaimCenter")) > puts ("Test Passed. Found folder 'ClaimCenter'") > > rescue => e > puts("TEST FAILED. Cannot find folder 'ClaimCenter'") > end > > I removed the rescure... and it works now: > > begin > assert(ie.frame(:name, "top_frame").contains_text("ClaimCenter")) > puts ("Test Passed. Found folder 'ClaimCenter'") > end > > > Have one question for you. When using assert in irb, it gives me > NoMethodError. I did require 'Watir', should I be able to use > assert in this case? > > irb(main):006:0> assert(ie.contains_text('iGoogle')) > NoMethodError: undefined method `assert' for # > > Really appreciate your help! > > Kui > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Wed May 23 13:53:20 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Wed, 23 May 2007 12:53:20 CDT Subject: [Wtr-general] Why it is always failed? In-Reply-To: Message-ID: <39776684.14881179942830737.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Got it. Thanks Zeljko! Kui From anandsri01 at gmail.com Wed May 23 14:01:48 2007 From: anandsri01 at gmail.com (atul srivastava) Date: Wed, 23 May 2007 11:01:48 -0700 Subject: [Wtr-general] How click on save button in file download In-Reply-To: <25893062.7851179905502374.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <34533119.4581179838126987.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <25893062.7851179905502374.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi, is there somthing specail to do for executed this coad..........? i have install ruby & watir 1.4 on my system...? but this coad does not execut. plzzzz help.........!!!!!!!!!!!!! On 23/05/07, Grzesiek wrote: > > Hi, > > I had also problems with it. I had to download autoitX3 tool. > Because there is a tool which identifies the instances of buttons and > without that actions did not work for me. > > autoit.WinWaitActive("Save > As") (catching > the popup) > autoit.ControlClick("Save As", "", > "[CLASS:Button;TEXT:&Save;INSTANCE:2]") (pressing Save button) > > > autoit = WIN32OLE.new('AutoItX3.Control') > autoit.WinWaitActive("File") #window name File Download > autoit.ControlClick("File","","[CLASS:Button;TEXT:&Save;INSTANCE:2]") # > first popup is shown > autoit.WinWaitActive("Save As") > autoit.Send("file_name") > autoit.ControlClick("Save As", "", "[CLASS:Button;TEXT:&Save;INSTANCE:2]") > autoit.WinWaitActive("Download") > autoit.ControlClick("Download", "", > "[CLASS:Button;TEXT:&Open;INSTANCE:2]") > > > Hope this will helps > > Br, > Sfistak > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- With Thanks and Regards, Anand Vardhan Srivastava | GlobalLogic India The Leader in Global Product Development B34/1, Sector-59,Noida ,201301 Phone: +91. 4342000 x 4285 Cell Number : +919811228992 Disclaimer: http://www.globallogic.com/email_disclaimer.txt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/210f767d/attachment-0001.html From forum-watir-users at openqa.org Wed May 23 14:02:46 2007 From: forum-watir-users at openqa.org (Kui Zhang) Date: Wed, 23 May 2007 13:02:46 CDT Subject: [Wtr-general] Cannot click Cancel button in download file window In-Reply-To: <30819738.8001179906117662.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <35545751.14941179943396123.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Sfistak, I installed AutoIT. But I could not find the Instance for buttons. What did you use to get the instance of the button? Do you use Window Info tool? Thanks! Kui From rdewolfe at Credant.com Wed May 23 15:03:13 2007 From: rdewolfe at Credant.com (Russ DeWolfe) Date: Wed, 23 May 2007 14:03:13 -0500 Subject: [Wtr-general] global variable is not seen in test_ method Message-ID: When I attempt to use the $ie global variable in a test _ method: class TC_Policies < Test::Unit::TestCase require 'rubygems' gem 'watir' require 'watir' require 'utilities' require 'test/unit/testcase' require 'win32ole' require 'unittests/setup' #setup to run suite $ie = openCMGServer($cmgServerName) openPolicyExcelFile() login($ie, "username","password") def test_Windows_Tool_Tip_Values assert_equal(true, policyDropDownPossibleValues($ie, 'windows')) end end I get the following error: 1) Error: test_Windows_Tool_Tip_Values(TC_Policies): WIN32OLERuntimeError: unknown property or method `document' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1775:in `method_missing' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1775:in `document' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1157:in `each_element' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1166:in `locate' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1123:in `locate_tagged_element' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:3201:in `locate' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:2412:in `assert_exists' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:3260:in `[]' ./utilities.rb:100:in `clickMenuItem' ./PolicyDropDownPossibleValues.rb:16:in `policyDropDownPossibleValues' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./CMG_tests/policy_test_ suite.rb:32:in `test_Windows_Tool_Tip_Values' However, if I use a local variable in my class, it runs fine: class TC_Policies < Test::Unit::TestCase require 'rubygems' gem 'watir' require 'watir' require 'utilities' require 'test/unit/testcase' require 'win32ole' require 'unittests/setup' #setup to run suite @@ie = openCMGServer($cmgServerName) openPolicyExcelFile() login(@@ie, "username","password") def test_Windows_Tool_Tip_Values assert_equal(true, policyDropDownPossibleValues(@@ie, 'windows')) end end Any idea what is going on here? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/0f95f9dc/attachment.html From forum-watir-users at openqa.org Wed May 23 16:55:50 2007 From: forum-watir-users at openqa.org (Ruben) Date: Wed, 23 May 2007 15:55:50 CDT Subject: [Wtr-general] How to clear cache from within watir script? In-Reply-To: <22107843.691179776335635.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <28200663.15721179953780090.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks Bret for letting me know. I pretty much gave up on figuring this out plus I do not think it is necessary any longer for us. From msofaer at modeln.com Wed May 23 16:57:28 2007 From: msofaer at modeln.com (Michael Sofaer) Date: Wed, 23 May 2007 13:57:28 -0700 Subject: [Wtr-general] Seg-faults with >4 ie windows (hello) Message-ID: <6F8CBA5E01C02842B0E19554310C1CF1063199EB@hdqmail1.modeln.com> Hello, all. I recently started using WATIR to automate load testing for my company's application, and I'm running into some trouble when I try to run more than four client windows at the same time. Each window needs its own ie process, since it needs its own session variables, so I got the development gem and am using ie.new_process, which works well most of the time. But when I try to run with more than about four windows, I eventually get this error: c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir/contrib/ie-new-p rocess.rb:44: [BUG] Segmentation fault ruby 1.8.6 (2007-03-13) [i386-mswin32] Can anyone help me with this? I tried running multiple small sessions in multiple command windows but it didn't seem to help. This is also my first foray into the world of open-source mailing lists, so if I've made an etiquette violation, please forgive me. Thanks, Michael Sofaer -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070523/7a30b2c8/attachment.html From christopher.mcmahon at gmail.com Wed May 23 17:24:17 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 23 May 2007 15:24:17 -0600 Subject: [Wtr-general] Seg-faults with >4 ie windows (hello) In-Reply-To: <6F8CBA5E01C02842B0E19554310C1CF1063199EB@hdqmail1.modeln.com> References: <6F8CBA5E01C02842B0E19554310C1CF1063199EB@hdqmail1.modeln.com> Message-ID: <72799cd70705231424v2ea3cbcdhb278f86a1dc53471@mail.gmail.com> Maybe you're running out of memory? Take a look at taskmanager, or see if you can run more browsers on a beefier machine. I know I've personally run about 80-90 browsers simultaneously on a single desktop some time ago, but they weren't holding any large amounts of test data. Just BTW, you'll never achieve reasonable loads with browser-based test tools. You should consider something like Grinder for generating load. On 5/23/07, Michael Sofaer wrote: > > > > > Hello, all. > > > > I recently started using WATIR to automate load testing for my company's > application, and I'm running into some trouble when I try to run more than > four client windows at the same time. > > > > Each window needs its own ie process, since it needs its own session > variables, so I got the development gem and am using ie.new_process, which > works well most of the time. But when I try to run with more than about four > windows, I eventually get this error: > > > > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir/contrib/ie-new-process.rb:44: > [BUG] Segmentation fault > > ruby 1.8.6 (2007-03-13) [i386-mswin32] > > > > Can anyone help me with this? I tried running multiple small sessions in > multiple command windows but it didn't seem to help. > > > > This is also my first foray into the world of open-source mailing lists, so > if I've made an etiquette violation, please forgive me. > > > > Thanks, > > Michael Sofaer > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Wed May 23 17:27:51 2007 From: forum-watir-users at openqa.org (Kevin Scott) Date: Wed, 23 May 2007 16:27:51 CDT Subject: [Wtr-general] Accessing a web page when a server request for username/password appears? In-Reply-To: <24381808.4831175724787427.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <21752420.51179955701787.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I was not able to get this to work via Watir. I created a very small Autoit file which ran before the script. I used a batch file to execute both files. The Auotit code is below (just in case, someone else runs into the issue): Run("C:\Program Files\Internet Explorer\iexplore.exe") WinWaitActive("Blank Page - Windows Internet Explorer") Send("http://mytest_site") Send("{ENTER}") WinWaitActive("Title of mytest_site") Send("{ENTER}") From forum-watir-users at openqa.org Wed May 23 17:37:26 2007 From: forum-watir-users at openqa.org (Kevin Scott) Date: Wed, 23 May 2007 16:37:26 CDT Subject: [Wtr-general] Unable to a get a handle of secondary popup window Message-ID: <22772387.111179956276322.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> This is the scenario I am trying to use Watir for: 1. Click link within IE window 2. Standard Microsoft window opens - File Download (Window Title) - Click Save 3. Standard Microsoft window opens - Save As (Window Title) - Click Save 4. Standard Microsoft window opens - Download Complete (Window Title) - Click Close 5. Continue with script I am to get through Steps 1 & 2 via the following code (this was available within the forum): ie.link(:id, "export_results_to_excel").click_no_wait() hwnd = ie.enabled_popup(15) if (hwnd) popup = WinClicker.new popup.makeWindowActive(hwnd_1) popup.clickWindowsButton("File Download", "Save", maxWaittime = 30) end It's moving through steps 3 & 4 where I'm struggling. On a side note, this product rocks! From christopher.mcmahon at gmail.com Wed May 23 17:48:49 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 23 May 2007 15:48:49 -0600 Subject: [Wtr-general] Accessing a web page when a server request for username/password appears? In-Reply-To: <21752420.51179955701787.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <24381808.4831175724787427.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <21752420.51179955701787.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70705231448g136c40e9m808f5d41bdbdb236@mail.gmail.com> We don't have a more elegant way of dealing with Basic Authentication yet. Someday Watir might borrow some of the code from Net::HTTP to do this, but it won't be happening any time soon. If you search the archives, you'll find some discussion of me trying to hack Basic Auth into Watir's goto() method. I could get to the main page OK with automated Basic Auth credentials, but I couldn't fool IE into giving me access to links, frames, etc. On 5/23/07, Kevin Scott wrote: > I was not able to get this to work via Watir. I created a very small Autoit file which ran before the script. I used a batch file to execute both files. The Auotit code is below (just in case, someone else runs into the issue): > > Run("C:\Program Files\Internet Explorer\iexplore.exe") > WinWaitActive("Blank Page - Windows Internet Explorer") > Send("http://mytest_site") > Send("{ENTER}") > WinWaitActive("Title of mytest_site") > Send("{ENTER}") > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Wed May 23 18:04:02 2007 From: forum-watir-users at openqa.org (Bill Agee) Date: Wed, 23 May 2007 17:04:02 CDT Subject: [Wtr-general] How to clear cache from within watir script? In-Reply-To: <28200663.15721179953780090.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <22724669.381179957872171.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Give the script from this page a try: http://rubyforge.org/snippet/detail.php?type=snippet&id=26 For a quick demo just copy/paste the whole thing into a file, name it "del_cache.rb", and run it. It always worked fine for me on XP SP2. From msofaer at modeln.com Wed May 23 18:10:05 2007 From: msofaer at modeln.com (Michael Sofaer) Date: Wed, 23 May 2007 15:10:05 -0700 Subject: [Wtr-general] Seg-faults with >4 ie windows (hello) In-Reply-To: <72799cd70705231424v2ea3cbcdhb278f86a1dc53471@mail.gmail.com> Message-ID: <6F8CBA5E01C02842B0E19554310C1CF106319B12@hdqmail1.modeln.com> Thanks, Chris I don't think that it's the machine running out of memory, 8 windows is taking about 150 MB of the 270 MB I have available before I get the seg fault. Closing additional expensive processes doesn't improve the number of windows I can run. Could I be running into a memory limit inside Ruby or Watir? Thanks for the recommendation for Grinder, I will look into that, although the app is pretty back-end intensive per user, so I hope to be OK for a bit with Watir. -----Original Message----- From: Chris McMahon [mailto:christopher.mcmahon at gmail.com] Sent: Wednesday, May 23, 2007 2:24 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Seg-faults with >4 ie windows (hello) Maybe you're running out of memory? Take a look at taskmanager, or see if you can run more browsers on a beefier machine. I know I've personally run about 80-90 browsers simultaneously on a single desktop some time ago, but they weren't holding any large amounts of test data. Just BTW, you'll never achieve reasonable loads with browser-based test tools. You should consider something like Grinder for generating load. On 5/23/07, Michael Sofaer wrote: > > > > > Hello, all. > > > > I recently started using WATIR to automate load testing for my company's > application, and I'm running into some trouble when I try to run more than > four client windows at the same time. > > > > Each window needs its own ie process, since it needs its own session > variables, so I got the development gem and am using ie.new_process, which > works well most of the time. But when I try to run with more than about four > windows, I eventually get this error: > > > > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir/contrib/ie-new-p rocess.rb:44: > [BUG] Segmentation fault > > ruby 1.8.6 (2007-03-13) [i386-mswin32] > > > > Can anyone help me with this? I tried running multiple small sessions in > multiple command windows but it didn't seem to help. > > > > This is also my first foray into the world of open-source mailing lists, so > if I've made an etiquette violation, please forgive me. > > > > Thanks, > > Michael Sofaer > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From christopher.mcmahon at gmail.com Wed May 23 18:17:16 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 23 May 2007 16:17:16 -0600 Subject: [Wtr-general] Seg-faults with >4 ie windows (hello) In-Reply-To: <6F8CBA5E01C02842B0E19554310C1CF106319B12@hdqmail1.modeln.com> References: <72799cd70705231424v2ea3cbcdhb278f86a1dc53471@mail.gmail.com> <6F8CBA5E01C02842B0E19554310C1CF106319B12@hdqmail1.modeln.com> Message-ID: <72799cd70705231517y109b8149s727c5a2a2beecf57@mail.gmail.com> Maybe try using threads instead of ie-new-process? From charley.baker at gmail.com Wed May 23 18:34:22 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 23 May 2007 16:34:22 -0600 Subject: [Wtr-general] Unable to a get a handle of secondary popup window In-Reply-To: <22772387.111179956276322.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <22772387.111179956276322.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: There have been a lot of posts in the past day on the File Download dialog using AutoIt, take a look at the archives: http://www.mail-archive.com/wtr-general%40rubyforge.org/ As far as step 4, I'd suggest turning it off in IE. Internet Options > Advanced > Notify when downloads complete. I haven't had the need to do file downloads, so I haven't mucked around with it. -Charley On 5/23/07, Kevin Scott wrote: > > This is the scenario I am trying to use Watir for: > > 1. Click link within IE window > 2. Standard Microsoft window opens - File Download (Window Title) - Click > Save > 3. Standard Microsoft window opens - Save As (Window Title) - Click Save > 4. Standard Microsoft window opens - Download Complete (Window Title) - > Click Close > 5. Continue with script > > I am to get through Steps 1 & 2 via the following code (this was available > within the forum): > > ie.link(:id, "export_results_to_excel").click_no_wait() > > hwnd = ie.enabled_popup(15) > if (hwnd) > popup = WinClicker.new > popup.makeWindowActive(hwnd_1) > popup.clickWindowsButton("File Download", "Save", maxWaittime = 30) > end > > It's moving through steps 3 & 4 where I'm struggling. On a side note, this > product rocks! > _______________________________________________ > 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/20070523/a2d870cb/attachment.html From forum-watir-users at openqa.org Wed May 23 21:58:22 2007 From: forum-watir-users at openqa.org (Norm) Date: Wed, 23 May 2007 20:58:22 CDT Subject: [Wtr-general] ie-new-process and rubyw.exe? bug? Message-ID: <30170947.961179971932383.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Using ruby 1.8.5 and watir 1.5.1.1164. When I use the following code the script stops after opening the browser and doesn't set the text field and move on with the script, can't figure out why!: =============================================== require 'watir' require 'watir/contrib/ie-new-process' $ie = Watir::IE.new_process $ie.logger.level = Logger::ERROR $ie.goto('www.google.com') $ie.text_field(:name, "q").set("test") =============================================== If I use ruby.exe instead of rubyw.exe it works fine! A) Do I need a different version of Ruby? B) Does ie-new-process simply not support rubyw.exe (BUG)? If anyone can help it would be appreciated! Thanks in advance! From bret at pettichord.com Wed May 23 23:21:13 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 23 May 2007 22:21:13 -0500 Subject: [Wtr-general] Seg-faults with >4 ie windows (hello) In-Reply-To: <6F8CBA5E01C02842B0E19554310C1CF106319B12@hdqmail1.modeln.com> References: <6F8CBA5E01C02842B0E19554310C1CF106319B12@hdqmail1.modeln.com> Message-ID: <465504A9.5030402@pettichord.com> Michael Sofaer wrote: > Thanks, Chris > > I don't think that it's the machine running out of memory, 8 windows is > taking about 150 MB of the 270 MB I have available before I get the seg > fault. Closing additional expensive processes doesn't improve the number > of windows I can run. Could I be running into a memory limit inside Ruby > or Watir? > > Thanks for the recommendation for Grinder, I will look into that, > although the app is pretty back-end intensive per user, so I hope to be > OK for a bit with Watir. > > Michael, Thank you for your report. I'm am sorry to hear of the problems you reported. The following script repeatedly failed for me after 30 windows were opened, although i was not able to reproduce the SIGSEGV that you reported. In my case, I got errors telling me that Internet Explorer itself had failed. Bret require 'watir' @ie = [] 50.times do | n | puts n; $stdout.flush @ie << Watir::IE.new_process end @ie.each {|ie| ie.close} From bret at pettichord.com Wed May 23 23:25:01 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 23 May 2007 22:25:01 -0500 Subject: [Wtr-general] Seg-faults with >4 ie windows (hello) In-Reply-To: <72799cd70705231517y109b8149s727c5a2a2beecf57@mail.gmail.com> References: <72799cd70705231424v2ea3cbcdhb278f86a1dc53471@mail.gmail.com> <6F8CBA5E01C02842B0E19554310C1CF106319B12@hdqmail1.modeln.com> <72799cd70705231517y109b8149s727c5a2a2beecf57@mail.gmail.com> Message-ID: <4655058D.1050905@pettichord.com> Chris McMahon wrote: > Maybe try using threads instead of ie-new-process? > Not really a good idea. If you want separate sessions you must use IE.new_process. Indeed, in trunk, i have changed the default IE.new method to actually use the IE.new_process implementation because it behaves more reliably and better matches tester/user expectations. Chris might be thinking of Perl threads, which are native, and can accomplish things that Ruby threads (which are "green") cannot. Bret From bret at pettichord.com Wed May 23 23:29:10 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 23 May 2007 22:29:10 -0500 Subject: [Wtr-general] handling multiple IE In-Reply-To: References: Message-ID: <46550686.40107@pettichord.com> Jungwhan Kim wrote: > Thanks for the info. But let's say that the default is IE 7. But how > should I start the instance of IE6 in Watir? > > Watir starts an IE instance like this, > ie = IE.new > > Is there any way to tell Watir to open a specific version of IE after > multiple versions of IE is installed in a single machine? > Look at IE.new_process in watir/contrib/ie-new-process.rb. Bret From bret at pettichord.com Wed May 23 23:34:03 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 23 May 2007 22:34:03 -0500 Subject: [Wtr-general] ie-new-process and rubyw.exe? bug? In-Reply-To: <30170947.961179971932383.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30170947.961179971932383.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <465507AB.1050103@pettichord.com> Norm wrote: > Using ruby 1.8.5 and watir 1.5.1.1164. When I use the following code the script stops after opening the browser and doesn't set the text field and move on with the script, can't figure out why!: > > =============================================== > require 'watir' > require 'watir/contrib/ie-new-process' > > $ie = Watir::IE.new_process > $ie.logger.level = Logger::ERROR > $ie.goto('www.google.com') > $ie.text_field(:name, "q").set("test") > =============================================== > > If I use ruby.exe instead of rubyw.exe it works fine! > > This works fine for me using rubyw.exe, ruby 1.8.5 and the trunk version of watir. Would it be possible for you to narrow down the problem a bit more? From bret at pettichord.com Wed May 23 23:34:58 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 23 May 2007 22:34:58 -0500 Subject: [Wtr-general] How to clear cache from within watir script? In-Reply-To: <22724669.381179957872171.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <22724669.381179957872171.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <465507E2.4090305@pettichord.com> Bill Agee wrote: > Give the script from this page a try: > > http://rubyforge.org/snippet/detail.php?type=snippet&id=26 > > For a quick demo just copy/paste the whole thing into a file, name it "del_cache.rb", and run it. It always worked fine for me on XP SP2. > Thanks for the tip! From bret at pettichord.com Wed May 23 23:38:42 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 23 May 2007 22:38:42 -0500 Subject: [Wtr-general] CAN BE CLICK LINK ASSOCIATED WITH AN IMAGE In-Reply-To: <7523f5800705230127w1291032bi317945890631cc3b@mail.gmail.com> References: <7523f5800705230127w1291032bi317945890631cc3b@mail.gmail.com> Message-ID: <465508C2.80309@pettichord.com> SHALINI GUPTA wrote: > In my project i want to click a link that is variable.i.e user > dependent.But always it comes after an image... > so is there any way to click a link just next to an image. > please help.Its very urgent There is an little known feature in 1.5 that supports this: ie.link(:after, ie.image(:id, 'foo')).click Bret From forum-watir-users at openqa.org Wed May 23 23:52:28 2007 From: forum-watir-users at openqa.org (Norm) Date: Wed, 23 May 2007 22:52:28 CDT Subject: [Wtr-general] ie-new-process and rubyw.exe? bug? In-Reply-To: <465507AB.1050103@pettichord.com> Message-ID: <31403732.1221179978778389.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> What is the "trunk" version of watir? I am using a development build, 1.5.1.1164. What happens is that it opens the google site, but doesn't enter the text, and will execute nothing after that line either (like if I have it click the search button, issue a "system" command, etc). This happens if I change the default interpreter for .rb files to rubyw.exe instead of ruby.exe. E.g. "c:\ruby\bin\rubyw.exe" "%1" %* I'm not sure what else I can provide in terms of information, if it is working for you without issue then I am dumbfounded... From forum-watir-users at openqa.org Thu May 24 02:14:51 2007 From: forum-watir-users at openqa.org (Ameya) Date: Thu, 24 May 2007 01:14:51 CDT Subject: [Wtr-general] How to check for the presence of a frame in a page? In-Reply-To: <21832300.831175585287077.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <34759232.1461179987321083.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> you can try and use ie.showframes this will display the names of all frames on the page. If this doesnt work , then add the site url that has frames to the trusted sites in the IE internet options -> Security and then try ie.showframes again. all da best :) From zeljko.filipin at gmail.com Thu May 24 02:56:51 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 24 May 2007 08:56:51 +0200 Subject: [Wtr-general] Why it is always failed? In-Reply-To: <39776684.14881179942830737.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <39776684.14881179942830737.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 5/23/07, Kui Zhang wrote: > > Got it. Thanks Zeljko! You are welcome. But, actually Paul answered your question. :) Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070524/0f3d6b60/attachment.html From zeljko.filipin at gmail.com Thu May 24 03:13:52 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 24 May 2007 09:13:52 +0200 Subject: [Wtr-general] handling multiple IE In-Reply-To: References: Message-ID: On 5/23/07, Jungwhan Kim wrote: > > Is there any way to tell Watir to open a specific version of IE after > multiple versions of IE is installed in a single machine? > Jungwhan, As far as I know, the only way you can have multiple versions of IE installed on one machine is to have several virtual machines installed, and each of them has different IE version. Are you familiar with virtual machines? This is quote from IE blog ( http://blogs.msdn.com/ie/archive/2006/11/30/ie6-and-ie7-running-on-a-single-machine.aspx ) "There are workarounds, but they are unsupported and don't necessarily work the same way as IE6 or IE7 would work when installed properly. [...] the best way to use multiple versions of IE on one machine is via virtualization." Also, as far as I know, Watir can not open virtual machine and then drive it. But, you can install Watir on every virtual machine and perform tests using different IE versions. Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070524/3cca7771/attachment.html From zeljko.filipin at gmail.com Thu May 24 03:39:26 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 24 May 2007 09:39:26 +0200 Subject: [Wtr-general] ie-new-process and rubyw.exe? bug? In-Reply-To: <31403732.1221179978778389.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <465507AB.1050103@pettichord.com> <31403732.1221179978778389.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 5/24/07, Norm wrote: > > What is the "trunk" version of watir? Hi Norm, Take a look at this. http://openqa.org/watir/cvs.action Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070524/2523cca7/attachment.html From forum-watir-users at openqa.org Thu May 24 04:33:41 2007 From: forum-watir-users at openqa.org (Norm) Date: Thu, 24 May 2007 03:33:41 CDT Subject: [Wtr-general] ie-new-process and rubyw.exe? bug? In-Reply-To: Message-ID: <24197304.2051179995651258.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Arg, same thing on my other computer. Must be a bug in the version of watir I am using. Looking at CVS it looks like the ie-new-process has had a lot of changes... I guess I'll wait for the next gem to be released and try a new build, until then I'll have to live with the stray console windows I suppose... Does anyone know of a way to install watir (gem) to the same directory everytime? For example instead of "C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.1.1164" just use "C:\ruby\lib\ruby\gems\1.8\gems\watir"? That would be HUGE for me. Thanks for your help! From shalinigupta2006 at gmail.com Thu May 24 05:50:56 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 24 May 2007 15:20:56 +0530 Subject: [Wtr-general] want to enter URL manualy Message-ID: <7523f5800705240250u2bf98d95g1b40a93b5f8d6bf5@mail.gmail.com> Hi all, I want to enter URL in address bar of my project manually.so i have tried this $ie=IE.new() $ie.wait() But previously it was working but now its not working. i have changed my watir version from 1.5.1127 to 1.5.1166 is it the problem?? Please help Thanks In advance!! Regards Shalini Gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070524/ce59374b/attachment.html From zeljko.filipin at gmail.com Thu May 24 05:51:30 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 24 May 2007 11:51:30 +0200 Subject: [Wtr-general] CAN BE CLICK LINK ASSOCIATED WITH AN IMAGE In-Reply-To: <465508C2.80309@pettichord.com> References: <7523f5800705230127w1291032bi317945890631cc3b@mail.gmail.com> <465508C2.80309@pettichord.com> Message-ID: On 5/24/07, Bret Pettichord wrote: > > ie.link(:after, ie.image(:id, 'foo')).click Bret, this does not work for me. Am I doing something wrong? Environment: cmd>ruby -v ruby 1.8.2 (2004-12-25) [i386-mswin32] irb> Watir::IE::VERSION => "1.5.1.1166" HTML: text IRB: irb(main):011:0> ie.link(:after, ie.image(:id, 'foo')).click Watir::Exception::MissingWayOfFindingObjectException: after is an unknown way of finding a element (type: id: foo name: value: disabled: false src: file:///C:/Documents%20and%20Settings/limited/Desktop/au1.png file date: 05/24/2007 file size: 38804 width: 419 height: 463 alt: ) from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1190:in `match?' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1171:in `locate' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1169:in `each' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1169:in `locate' from c:/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.1166/./watir.rb:1168:in `catch' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1168:in `locate' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1166:in `each_element' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1157:in `each' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1157:in `each_element' from c:/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.1166/./watir.rb:1166:in `locate' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1123:in `locate_tagged_element' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:3668:in `locate' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2411:in `assert_exists' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2642:in `enabled?' from c:/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.1166/./watir.rb:2417:in `assert_enabled' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2587:in `click!' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2573:in `click' -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070524/eb49e00e/attachment.html From bret at pettichord.com Thu May 24 10:18:52 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 24 May 2007 09:18:52 -0500 Subject: [Wtr-general] ie-new-process and rubyw.exe? bug? In-Reply-To: <24197304.2051179995651258.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <24197304.2051179995651258.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <46559ECC.3070006@pettichord.com> Norm wrote: > Arg, same thing on my other computer. Must be a bug in the version of watir I am using. Looking at CVS it looks like the ie-new-process has had a lot of changes... I guess I'll wait for the next gem to be released and try a new build, until then I'll have to live with the stray console windows I suppose... > None of the changes should make a difference for the issues you are having. Have you reproduced the problem running ruby from the command line? Or have you only tried launching ruby from another tool (e.g. an editor or ide)? > Does anyone know of a way to install watir (gem) to the same directory everytime? For example instead of "C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.1.1164" just use "C:\ruby\lib\ruby\gems\1.8\gems\watir"? That would be HUGE for me. > The answer is that you would have to manually install watir instead of using the gem system. But you shouldn't be doing this unless you already know what you are doing -- in which case you wouldn't be asking us the question. Why do you care where Watir is installed? From charley.baker at gmail.com Thu May 24 10:38:23 2007 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 24 May 2007 08:38:23 -0600 Subject: [Wtr-general] want to enter URL manualy In-Reply-To: <7523f5800705240250u2bf98d95g1b40a93b5f8d6bf5@mail.gmail.com> References: <7523f5800705240250u2bf98d95g1b40a93b5f8d6bf5@mail.gmail.com> Message-ID: Hi Shalini, There shouldn't be a need to use $ie.wait $ie = IE.new # creates a new browser window Now you can enter your url manually if you want. How is this not working? -Charley On 5/24/07, SHALINI GUPTA wrote: > > Hi all, > > I want to enter URL in address bar of my project manually.so i have tried > this > $ie=IE.new() > $ie.wait() > > But previously it was working but now its not working. > i have changed my watir version from 1.5.1127 to 1.5.1166 > > is it the problem?? > > Please help > Thanks In advance!! > > Regards > Shalini Gupta > > _______________________________________________ > 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/20070524/26de4ac6/attachment-0001.html From alan.baird at riskmetrics.com Thu May 24 10:32:28 2007 From: alan.baird at riskmetrics.com (Alan Baird) Date: Thu, 24 May 2007 10:32:28 -0400 Subject: [Wtr-general] Does anyone know how to capture an entire screenand compare with image? In-Reply-To: <4D7FC2322B85B848A0A766D1D364D43607EFEE@bugatti.ems.securicor.com> References: <007901c794c2$c4db5be8$0901a8c0@ems.securicor.com> <4D7FC2322B85B848A0A766D1D364D43607EFEE@bugatti.ems.securicor.com> Message-ID: <296DCA57118A7143824911216017E83B063088DC@MAIL-NY01.rmg-ny.com> Adam- We are using a tool called imagemagick (www.imagemagick.com) to do our image comparison, very similar to the approach used in the presentation below (and it's free). We use imagemagick to compare a PDF report to a previously run version. This is extremely helpful for comparing reports in a language you can't read. I wrote our version in Perl but there is a Ruby interface to the image libraries. We solved the image comparison problem using a 3rd party program to convert PDF's to images. Another program that may help you is Snagit which has a scrolling screen capture. That may be difficult to automate with Watir tho. Alan -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Saturday, May 12, 2007 2:07 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Does anyone know how to capture an entire screenand compare with image? Ok here is the information that I was talking about. I don't actually have working samples but in the pdf he talks about the comparisons that he did and what he used to compare them. I don't know how you would automate it but here is the information. http://model.based.testing.googlepages.com/exploratory-automation.pdf Hope this helps! -----Original Message----- From: wtr-general-bounces at rubyforge.org on behalf of Sergio Pinon Sent: Sat 5/12/2007 11:21 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Does anyone know how to capture an entire screenand compare with image? Back in February I attended the dt/td summit. There someone presented on how they captured screens and diffed them using a software called Eggplant. I can see if I can find the information. Chris McMahon might also have it. -----Original Message----- From: "qadude123" To: "wtr-general at rubyforge.org" Sent: 5/12/2007 12:07 AM Subject: [Wtr-general] Does anyone know how to capture an entire screen and compare with image? Hi, I'm a newbie with Watir and Ruby. I would like to capture the entire page and compare it to another image. I've seen that there is a ruby file called screen_capture.rb. How do I get this file? Does anyone have any working code to capture the entire screen ....including the part that's scrolled off the screen? Thanks for any suggestions _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Thu May 24 11:05:17 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 24 May 2007 10:05:17 -0500 Subject: [Wtr-general] CAN BE CLICK LINK ASSOCIATED WITH AN IMAGE In-Reply-To: References: <7523f5800705230127w1291032bi317945890631cc3b@mail.gmail.com> <465508C2.80309@pettichord.com> Message-ID: <4655A9AD.7000104@pettichord.com> ?eljko Filipin wrote: > On 5/24/07, *Bret Pettichord* > wrote: > > ie.link(:after, ie.image(:id, 'foo')).click > > > Bret, this does not work for me. Am I doing something wrong? My mistake. Try this instead. ie.link(:after?, ie.image(:id, 'foo')).click From forum-watir-users at openqa.org Thu May 24 11:15:13 2007 From: forum-watir-users at openqa.org (Bach Le) Date: Thu, 24 May 2007 10:15:13 CDT Subject: [Wtr-general] Question about IE.new_process and Vista Message-ID: <38461662.5451180019743101.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I've installed watir 1165 and tried using IE.new_process on Windows Vista and in both tests and irb, IE.new_process fails. It fails after creating the window when it tries to get the process id from hwnd. I have a coworker who installed this on his Vista machine and it works fine. The problem is that Shell.Application.windows does not get all of the windows but just the ones that are browsing the file system so the IE windows do not show up in this list. It ends up doing in an infinite loop and never breaks out of it. Does anyone have any idea how to fix this? From bret at pettichord.com Thu May 24 11:37:08 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 24 May 2007 10:37:08 -0500 Subject: [Wtr-general] Question about IE.new_process and Vista In-Reply-To: <38461662.5451180019743101.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <38461662.5451180019743101.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4655B124.4000206@pettichord.com> Bach Le wrote: > I've installed watir 1165 and tried using IE.new_process on Windows Vista and in both tests and irb, IE.new_process fails. It fails after creating the window when it tries to get the process id from hwnd. > > I have a coworker who installed this on his Vista machine and it works fine. > > > The problem is that Shell.Application.windows does not get all of the windows but just the ones that are browsing the file system so the IE windows do not show up in this list. It ends up doing in an infinite loop and never breaks out of it. > > > Does anyone have any idea how to fix this? > Thanks for the report. I've logged this as http://jira.openqa.org/browse/WTR-156 I am in the process of migrating this functionality into core watir and would like to get problems like this fixed. I guess the next step is to figure out why the Shell.Application windows are not including any of the IE windows. That is definitely a problem, and, as stated, would be a core MS bug. The other possibility might be that it actually is showing up in this list, but there could be a flaw in the logic we are using to decide whether it is an IE window or not (there have been other flaws in the past). Bret From forum-watir-users at openqa.org Thu May 24 11:46:31 2007 From: forum-watir-users at openqa.org (Bach Le) Date: Thu, 24 May 2007 10:46:31 CDT Subject: [Wtr-general] Question about IE.new_process and Vista In-Reply-To: <4655B124.4000206@pettichord.com> Message-ID: <28080208.6041180021622023.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Bret, the problem actually exists for IE.new as well. I create a new IE window with IE.new and it creates the window but when I call the goto method to navigate to any page, a new IE window shows up and the navigation is done in that window. I've updated the ticket to include this information. From forum-watir-users at openqa.org Thu May 24 12:00:38 2007 From: forum-watir-users at openqa.org (vijay) Date: Thu, 24 May 2007 11:00:38 CDT Subject: [Wtr-general] I do not know how to handle the 'File Download' dialog box with Watir Message-ID: <30569350.6111180022468841.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello people, In our application, there is a button named 'Export', which when clicked would give a 'File Download' dialog box with three options, Open, Save and Cancel. I am able to click these buttons with the 'clickWindowsButton' command (for ex. 'clickWindowsButton ('File Download','Save')). But I do not know how to enter the file path in the subsequent 'Save As' dialog box and then click the 'Save' button in the same. I tried, clicker = WinClicker.new hwnd = clicker.getWindowHandle('Save As') I am not able to get the 'handle' of the 'Save As' dialog box. Watir returns only '-1' for the 'handle'. If I could get the 'handle' of the 'Save As' dialog box, I can make Watir type the file path in the same through the command, 'setComboBoxText(handle,'the file path')'. I can then click the 'Save' button. Is my thinking correct? If not, what will be the ideal method to type the file path in the 'Save As' dialog box. Also, how can I get the handle of the 'Save As' dialog box. Thanks for your time, Vijay. From christopher.mcmahon at gmail.com Thu May 24 12:21:07 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 24 May 2007 10:21:07 -0600 Subject: [Wtr-general] watir, rspec, screen shots Message-ID: <72799cd70705240921w6a67619fl77f85f5e3a08d48c@mail.gmail.com> Aslak Hellesoy's been working with Watir: http://blog.aslakhellesoy.com/2006/12/2/getting-screenshots-from-watir From bret at pettichord.com Thu May 24 12:28:37 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 24 May 2007 11:28:37 -0500 Subject: [Wtr-general] Question about IE.new_process and Vista In-Reply-To: <28080208.6041180021622023.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28080208.6041180021622023.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4655BD35.1020606@pettichord.com> Bach Le wrote: > Bret, the problem actually exists for IE.new as well. I create a new IE window with IE.new and it creates the window but when I call the goto method to navigate to any page, a new IE window shows up and the navigation is done in that window. > Can you show me your code? From forum-watir-users at openqa.org Thu May 24 13:30:20 2007 From: forum-watir-users at openqa.org (Norm) Date: Thu, 24 May 2007 12:30:20 CDT Subject: [Wtr-general] ie-new-process and rubyw.exe? bug? In-Reply-To: <46559ECC.3070006@pettichord.com> Message-ID: <37273033.6661180027850551.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Bret, I was simply thinking of upgrading because changes were made, and you said it was working for you on the CVS "trunk" build, I didn't go line by line or anything and try to see if there was a change that I thought would fix the issue. I have tried running ruby from the command line, same problem: rubyw.exe script.rb I have manually installed watir before, but had problems, everyone said to use the "gem" method, I did, and it worked. So I haven't tried installing manually since. -------------------------------------------------------------------------------------------------------------------------------------- The reason I want the directory to stay the same is that I run all of my scripts from that directory currently, and I have a complex environment in place, so that when the directory path changes, and I re-install my scripts (various scripts, not just ruby), I have to update about 30 different locations of that directory path. I mean, it only takes like 10 minutes, but it would be nice to not have to do it (I have lots of shortcuts, etc). If I could figure out a way to get a script to run outside of the watir directory (like off of C:\Scripts) without failing due to " `require': no such file to load -- watir (LoadError)", then I could store my scripts outside of the watir directory and it wouldn't matter. I have been trying things all morning, still no luck. I tried using RUBYOPT=rubygems env variable, RUBYOPT=-rubygems (found it both ways online). I got it to kind of work when I used the following: require 'rubygems' require_gem 'watir' However, I also use: require 'watir/contrib/ie-new-process' require 'win32ole' and they still bomb out. I can get around it by specifying the full path, but that is the point, not relying on that directory path... I've been searching the forums for a solution, so if anyone has an idea that would be awesome. I just want to be able to house/run my ruby scripts from a different location than the watir gem install folder... From forum-watir-users at openqa.org Thu May 24 13:50:10 2007 From: forum-watir-users at openqa.org (Norm) Date: Thu, 24 May 2007 12:50:10 CDT Subject: [Wtr-general] ie-new-process and rubyw.exe? bug? In-Reply-To: <37273033.6661180027850551.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <26825461.6731180029040663.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Weird, this is working now: require 'rubygems' require_gem 'watir' require 'win32ole' require 'watir/contrib/ie-new-process' So I guess that's 1 problem solved. Now I can try installing a different version of watir to see if my problem with ie-new-process and rubyw goes away... From bret at pettichord.com Thu May 24 14:50:54 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 24 May 2007 13:50:54 -0500 Subject: [Wtr-general] Question about IE.new_process and Vista In-Reply-To: <28080208.6041180021622023.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28080208.6041180021622023.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4655DE8E.1010909@pettichord.com> Bach Le wrote: > Bret, the problem actually exists for IE.new as well. I create a new IE window with IE.new and it creates the window but when I call the goto method to navigate to any page, a new IE window shows up and the navigation is done in that window. > > > I've updated the ticket to include this information. Why do you think the two problems are related? From msofaer at modeln.com Thu May 24 14:45:15 2007 From: msofaer at modeln.com (Michael Sofaer) Date: Thu, 24 May 2007 11:45:15 -0700 Subject: [Wtr-general] Seg-faults with >4 ie windows (hello) In-Reply-To: <465504A9.5030402@pettichord.com> Message-ID: <6F8CBA5E01C02842B0E19554310C1CF10639D94B@hdqmail1.modeln.com> Thanks for looking at this, Bret. I tried running the script you included on my machine, it hangs at around 33 windows, but doesn't crash. Here is the stack trace from the interrupt, for what it's worth: c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir/contrib/ie-new-p rocess.rb:44:in `window': Interrupt from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir/contrib/ie-new-p rocess.rb:43:in `each' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir/contrib/ie-new-p rocess.rb:43:in `window' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir/contrib/ie-new-p rocess.rb:67:in `new_process' from C:/test/Watir/modeln/bret.rb:8 from C:/test/Watir/modeln/bret.rb:6:in `times' from C:/test/Watir/modeln/bret.rb:6 I also need to explicitly include require 'watir/contrib/ie-new-process' in order to get the script to run, but I expect that will change in the next gem release. As far as threading, here is what I've been doing: stack = [] threads = [] num_threads.times do |i| stack.push Thread.new {threads[i] = test.repeat(num_runs) } sleep 4 end stack.each {|thread| thread.join} -Michael -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Wednesday, May 23, 2007 8:21 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Seg-faults with >4 ie windows (hello) Michael Sofaer wrote: > Thanks, Chris > > I don't think that it's the machine running out of memory, 8 windows is > taking about 150 MB of the 270 MB I have available before I get the seg > fault. Closing additional expensive processes doesn't improve the number > of windows I can run. Could I be running into a memory limit inside Ruby > or Watir? > > Thanks for the recommendation for Grinder, I will look into that, > although the app is pretty back-end intensive per user, so I hope to be > OK for a bit with Watir. > > Michael, Thank you for your report. I'm am sorry to hear of the problems you reported. The following script repeatedly failed for me after 30 windows were opened, although i was not able to reproduce the SIGSEGV that you reported. In my case, I got errors telling me that Internet Explorer itself had failed. Bret require 'watir' @ie = [] 50.times do | n | puts n; $stdout.flush @ie << Watir::IE.new_process end @ie.each {|ie| ie.close} _______________________________________________ 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 24 14:59:37 2007 From: forum-watir-users at openqa.org (Norm) Date: Thu, 24 May 2007 13:59:37 CDT Subject: [Wtr-general] ie-new-process and rubyw.exe? bug? In-Reply-To: <26825461.6731180029040663.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <28055054.7611180033207818.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Nope. I upgraded to 1.5.1.1166 and when I change the .rb file extension to use rubyw.exe instead of ruby.exe it still fails: "c:\ruby\bin\ruby.exe" "%1" %* to "c:\ruby\bin\rubyw.exe" "%1" %* ============================================ What happens is that after it opens the browser (using ie-new-process) nothing is executed in the script after that point, it just stops. I put in a "system 'echo test > file.txt'" command, to see if it is even moving past the part where it opens the browser, and it doesn't execute it. It just terminates. I am guessing that since stderr, stdin, stdout are all disabled for rubyw.exe, that is why I get nothing, just terminates... Does it have something to do with the fact that ie-new-process puts the process id to stdout? Maybe that is what is crashing it when running under rubyw.exe? If I put it back to use ruby.exe, instead of rubyw.exe, the code works perfectly... (But I have that ruby console window sitting there, which is a little bit of an annoyance, especially if you have several scripts running...) From bret at pettichord.com Thu May 24 15:31:32 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 24 May 2007 14:31:32 -0500 Subject: [Wtr-general] ie-new-process and rubyw.exe? bug? In-Reply-To: <28055054.7611180033207818.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28055054.7611180033207818.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4655E814.1070808@pettichord.com> Norm wrote: > Does it have something to do with the fact that ie-new-process puts the process id to stdout? Maybe that is what is crashing it when running under rubyw.exe? > I recently changed the code in trunk to stop printing the process id, so that might explain something... I'm having a little bit of trouble following the thread and understanding exactly what is and isn't working for you. If you could summarize, that would help me. Bret From forum-watir-users at openqa.org Thu May 24 16:01:59 2007 From: forum-watir-users at openqa.org (Norm) Date: Thu, 24 May 2007 15:01:59 CDT Subject: [Wtr-general] ie-new-process and rubyw.exe? bug? In-Reply-To: <4655E814.1070808@pettichord.com> Message-ID: <27549464.7901180036949291.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> np Bret, the thread turned into (2) different issues, so it got a little hairy. The 2nd problem that I was talking about, in respect to running scripts outside of the watir directory, is fixed. Problem solved. The 1st problem, and the problem I started this thread for, is still on-going. Here is the full source code that I am executing: ============================== require 'rubygems' require_gem 'watir' require 'watir/contrib/ie-new-process' $ie = Watir::IE.new_process $ie.logger.level = Logger::ERROR $ie.goto("http://www.google.com") $ie.text_field(:name, "q").set("TEXT") ============================== When I have the default action for a .rb file (Tools-->Folder Options-->File Types) set to: "c:\ruby\bin\rubyw.exe" "%1" %* OR, if I run the script from the cmd prompt using rubyw (rubyw.exe script.rb), as soon as the browser is opened the script terminates. It won't even execute the "goto" function and navigate to the proper url, or set the text_field. This happens whether or not I have the "logger" line of code as well, so it isn't that. This same code works 100% fine when I use ruby.exe instead of rubyw.exe. I am using ruby 1.8.5, with watir watir-1[1].5.1.1166.gem. From bret at pettichord.com Thu May 24 17:42:25 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 24 May 2007 16:42:25 -0500 Subject: [Wtr-general] Watir Development Gem 1.5.1.1192 Released Message-ID: <465606C1.5010408@pettichord.com> A new gem is ready for download. This is the latest pull from Subversion trunk, tagged at 1.5.1.1192. This gem has a new install process, due to a new dependency on other gems. http://wiki.openqa.org/display/WTR/Development+Builds After downloading the gem, execute the following commands in the same directory as the gem: > gem install win32-process --include-dependencies > gem install watir Changes in this release include: * Migrated IE.new_process from watir/contrib and improved its reliability. We now recommend IE.new_process over IE.new as a way to avoid numerous errors detailed in http://jira.openqa.org/browse/WTR-150. * Added IE.start_process. This works like IE.start, but uses the new_process mechanism to start IE. * Added IE.new_window and IE.start_window. This are synonyms for IE.new and IE.start. * Added dependency on the win32-process gem. * Rdoc updates from Jeff Fry * Added IE.each, which iterates through the various IE windows currently open. * Updated WindowHelper and watir/dialog to work with IE7 From shalinigupta2006 at gmail.com Thu May 24 23:55:37 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Fri, 25 May 2007 09:25:37 +0530 Subject: [Wtr-general] want to enter URL manualy In-Reply-To: References: <7523f5800705240250u2bf98d95g1b40a93b5f8d6bf5@mail.gmail.com> Message-ID: <7523f5800705242055x123dbb22sdfa7da88235c1251@mail.gmail.com> hi, it just start ruby.exe and with in a second it ends..... and gives this error 1) Error: test_ADGDashboard_Homepage(TC_CAST_ADGDashboard_Homepage): Watir::Exception::UnknownObjectException: Unable to locate object, using name and Login c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2413:in `assert_exists' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2642:in `enabled?' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2417:in `assert_enabled' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:4016:in `set' homepage.rb:90:in `adg_Homepage_launch' homepage.rb:51:in `start_ADGDashboard' homepage.rb:60:in `test_ADGDashboard_Homepage' Regards shalini Gupta On 5/24/07, Charley Baker wrote: > > Hi Shalini, > > There shouldn't be a need to use $ie.wait > > $ie = IE.new # creates a new browser window > > Now you can enter your url manually if you want. How is this not working? > > -Charley > > On 5/24/07, SHALINI GUPTA wrote: > > > Hi all, > > > > I want to enter URL in address bar of my project manually.so i have > > tried this > > $ie=IE.new() > > $ie.wait() > > > > But previously it was working but now its not working. > > i have changed my watir version from 1.5.1127 to 1.5.1166 > > > > is it the problem?? > > > > Please help > > Thanks In advance!! > > > > Regards > > Shalini Gupta > > > > _______________________________________________ > > 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/20070525/84c497e8/attachment.html From jeff.fry at gmail.com Thu May 24 23:57:16 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Thu, 24 May 2007 20:57:16 -0700 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <4650FB4D.6050005@gmail.com> References: <46412CAC.1030801@gmail.com> <464166F7.6030000@pettichord.com> <4645231D.9000608@gmail.com> <4649CD89.4040103@pettichord.com> <970956b0705161448l7de55a0dke43adc9cc888d5aa@mail.gmail.com> <4650FB4D.6050005@gmail.com> Message-ID: <46565E9C.6020909@gmail.com> Hey y'all, I'm resending these in the hopes of getting info from folks who know what watir actually does better than I do. If you are up for updating the wiki chart, great...but if you just want to email me some corrections, that'd be totally fine too. I'll happily update the chart. Jeff Fry wrote: > Here's my first stab at a centralized page to describe supported > elements, 'how's for interacting with those elements, and a chart of > which 'how's apply to which elements: > http://wiki.openqa.org/display/WTR/Methods+supported+by+Element > > For the chart, I tried to follow the rdoc, but I didn't follow it too > closely, knowing that the rdoc already has inaccuracies in it. I'm > hoping that someone who knows what *actually* does and doesn't work > will volunteer to correct the chart (or even just email me corrections > to make myself). > > I added a number of questions at the bottom of the page, but will > repeat them here for convenience: > * Are there any missing element types, or element types that shouldn't > be included? (What about the following methods: tableCell? file_field? > ps? pre?) > * Any missing (or extraneous) attributes? > * Any inaccuracies? (I assume that currently there are many. [snip] cut two questions that Zeljko already answered for me [/snip] > * Can someone add descriptions for :method and :action, above? > * Other suggestions? > > I have made a number of other edits to the rdoc but am not ready to > submit a second patch yet. I hope to post it by Wednesday. Now I'll have them done by the end of the long weekend. > > Cheers, > Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070524/290a6a06/attachment.html From shalinigupta2006 at gmail.com Thu May 24 23:57:37 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Fri, 25 May 2007 09:27:37 +0530 Subject: [Wtr-general] CAN BE CLICK LINK ASSOCIATED WITH AN IMAGE In-Reply-To: <4655A9AD.7000104@pettichord.com> References: <7523f5800705230127w1291032bi317945890631cc3b@mail.gmail.com> <465508C2.80309@pettichord.com> <4655A9AD.7000104@pettichord.com> Message-ID: <7523f5800705242057i46eda1d3x6b3d7148504631cb@mail.gmail.com> Thanks !! it works On 5/24/07, Bret Pettichord wrote: > > ?eljko Filipin wrote: > > On 5/24/07, *Bret Pettichord* > > wrote: > > > > ie.link(:after, ie.image(:id, 'foo')).click > > > > > > Bret, this does not work for me. Am I doing something wrong? > My mistake. Try this instead. > > ie.link(:after?, ie.image(:id, 'foo')).click > > > > _______________________________________________ > 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/20070525/a199a74c/attachment.html From forum-watir-users at openqa.org Fri May 25 02:43:02 2007 From: forum-watir-users at openqa.org (Norm) Date: Fri, 25 May 2007 01:43:02 CDT Subject: [Wtr-general] Watir Development Gem 1.5.1.1192 Released In-Reply-To: <465606C1.5010408@pettichord.com> Message-ID: <26677633.781180075413526.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Awesome, I will try this tomorrow to see if it resolves my problem with ie-new-process and rubyw.exe I outlined in the following post: http://forums.openqa.org/thread.jspa?threadID=8174&tstart=0 From zeljko.filipin at gmail.com Fri May 25 04:09:02 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 25 May 2007 10:09:02 +0200 Subject: [Wtr-general] Watir wiki In-Reply-To: <464DA71C.2@pettichord.com> References: <464DA71C.2@pettichord.com> Message-ID: On 5/18/07, Bret Pettichord wrote: > > You can report this to Patrick if you like. This used to work. Patrick has fixed http://wiki.openqa.org/display/WTR/Watir+Committers Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070525/99b71d2c/attachment-0001.html From peter.krantz at gmail.com Fri May 25 06:12:39 2007 From: peter.krantz at gmail.com (Peter Krantz) Date: Fri, 25 May 2007 12:12:39 +0200 Subject: [Wtr-general] Basic accessibility testing with Watir and RAAKT... Message-ID: <7b9ad66d0705250312m4e854eebtea12e7a6de69068c@mail.gmail.com> Hi! I have been tinkering with an open source accessibility testing tool that easily hooks into Watir. The idea is to check for basic accessibility issues while you are running your Watir functional tests (because you have access to the complete html output from your application). The idea is to capture as many accessibility errors as possible before your app is tested by the QA people. This will hopefully save both time and money see [0] for more on why. The tool is called Raakt (Ruby Accessibility Analysis Kit) and the project wiki can be found here: http://www.peterkrantz.com/raakt/wiki/ Instructions on how to use it in Watir are here: http://www.peterkrantz.com/raakt/wiki/frameworks/watir I would be grateful for feedback on how well this integrates with Watir and if you had any specific issues with it. Kind regards, Peter Krantz http://www.standards-schmandards.com [0]: http://www.standards-schmandards.com/2007/rapid-accessibility-feedback/ From zeljko.filipin at gmail.com Fri May 25 08:16:31 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 25 May 2007 14:16:31 +0200 Subject: [Wtr-general] CAN BE CLICK LINK ASSOCIATED WITH AN IMAGE In-Reply-To: <4655A9AD.7000104@pettichord.com> References: <7523f5800705230127w1291032bi317945890631cc3b@mail.gmail.com> <465508C2.80309@pettichord.com> <4655A9AD.7000104@pettichord.com> Message-ID: On 5/24/07, Bret Pettichord wrote: > > My mistake. Try this instead. > ie.link(:after?, ie.image(:id, 'foo')).click It works now. This is so cool. Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070525/1f8b6666/attachment.html From solly_ at msn.com Fri May 25 08:28:59 2007 From: solly_ at msn.com (Sol Jubrail) Date: Fri, 25 May 2007 13:28:59 +0100 Subject: [Wtr-general] stripping... Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070525/cc844bfd/attachment.html From zeljko.filipin at gmail.com Fri May 25 08:43:35 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 25 May 2007 14:43:35 +0200 Subject: [Wtr-general] stripping... In-Reply-To: References: Message-ID: ie.url returns url. What do want to do with it? irb> ie.url => "http://www.google.com/" Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070525/020bf2ef/attachment.html From solly_ at msn.com Fri May 25 08:47:40 2007 From: solly_ at msn.com (Sol Jubrail) Date: Fri, 25 May 2007 13:47:40 +0100 Subject: [Wtr-general] stripping... In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070525/7e4be946/attachment.html From forum-watir-users at openqa.org Fri May 25 09:05:31 2007 From: forum-watir-users at openqa.org (Ravi) Date: Fri, 25 May 2007 08:05:31 CDT Subject: [Wtr-general] stripping... In-Reply-To: Message-ID: <28629705.6171180098361423.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Try this: new_url=base_url + '/' + ie.url.split('/').last.gsub('.aspx','') From solly_ at msn.com Fri May 25 10:01:38 2007 From: solly_ at msn.com (Sol Jubrail) Date: Fri, 25 May 2007 15:01:38 +0100 Subject: [Wtr-general] stripping... In-Reply-To: <28629705.6171180098361423.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070525/3914cab2/attachment.html From bret at pettichord.com Fri May 25 10:31:32 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 25 May 2007 09:31:32 -0500 Subject: [Wtr-general] want to enter URL manualy In-Reply-To: <7523f5800705242055x123dbb22sdfa7da88235c1251@mail.gmail.com> References: <7523f5800705240250u2bf98d95g1b40a93b5f8d6bf5@mail.gmail.com> <7523f5800705242055x123dbb22sdfa7da88235c1251@mail.gmail.com> Message-ID: <4656F344.8030100@pettichord.com> Shalini, Could you please try to include more information in your posts to this list. It can try the patience of the few people we have who are answering questions here when incomplete information is posted. In your case, you need to take another look at the stack trace you posted and then you tell us what it means to you. If you don't understand it at all, then that is the first problem. Bret SHALINI GUPTA wrote: > hi, > > it just start ruby.exe and with in a second it ends..... > and gives this error > 1) Error: > test_ADGDashboard_Homepage(TC_CAST_ADGDashboard_Homepage): > Watir::Exception::UnknownObjectException: Unable to locate object, > using name and Login > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2413:in > `assert_exists' > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2642:in > `enabled?' > c:/ruby/lib/ruby/gems/1.8/gems/watir- > 1.5.1.1166/./watir.rb:2417:in `assert_enabled' > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:4016:in > `set' > homepage.rb:90:in `adg_Homepage_launch' > homepage.rb:51:in `start_ADGDashboard' > homepage.rb:60:in `test_ADGDashboard_Homepage' > Regards > shalini Gupta > > On 5/24/07, *Charley Baker* < charley.baker at gmail.com > > wrote: > > Hi Shalini, > > There shouldn't be a need to use $ie.wait > > $ie = IE.new # creates a new browser window > > Now you can enter your url manually if you want. How is this not > working? > > -Charley > > On 5/24/07, *SHALINI GUPTA* < shalinigupta2006 at gmail.com > > wrote: > > Hi all, > > I want to enter URL in address bar of my project manually.so i > have tried this > $ie=IE.new() > $ie.wait() > > But previously it was working but now its not working. > i have changed my watir version from 1.5.1127 to 1.5.1166 > > is it the problem?? > > Please help > Thanks In advance!! > > Regards > Shalini Gupta > > _______________________________________________ > 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 forum-watir-users at openqa.org Fri May 25 11:00:09 2007 From: forum-watir-users at openqa.org (Bach Le) Date: Fri, 25 May 2007 10:00:09 CDT Subject: [Wtr-general] Question about IE.new_process and Vista In-Reply-To: <4655DE8E.1010909@pettichord.com> Message-ID: <31562337.7081180105239708.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I thought the two problems are related because in neither instance was watir able to find the window after it was created (I didn't look into the specifics). I did look into it some more after this post and I found out that it was Vista's security settings that caused watir to break. Turning off these security settings fixed it. I don't remember the details right now but as soon as I get my vista box up and running again, I will update the JIRA ticket and this thread with the details. I'm back on my old machine now which is running XP. I'll switch back a little later in the day so I'll update in a few hours. From christopher.mcmahon at gmail.com Fri May 25 11:13:47 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 25 May 2007 09:13:47 -0600 Subject: [Wtr-general] Basic accessibility testing with Watir and RAAKT... In-Reply-To: <7b9ad66d0705250312m4e854eebtea12e7a6de69068c@mail.gmail.com> References: <7b9ad66d0705250312m4e854eebtea12e7a6de69068c@mail.gmail.com> Message-ID: <72799cd70705250813j4983466cic4b39a07a1c1910a@mail.gmail.com> > The tool is called Raakt (Ruby Accessibility Analysis Kit) and the > project wiki can be found here: > http://www.peterkrantz.com/raakt/wiki/ This is very cool and I'm going to try it out. But your site looks awful in Firefox on OS X. :) From forum-watir-users at openqa.org Fri May 25 11:36:20 2007 From: forum-watir-users at openqa.org (Ravi) Date: Fri, 25 May 2007 10:36:20 CDT Subject: [Wtr-general] stripping... In-Reply-To: Message-ID: <32587179.8361180107410748.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I guess you do not need the 'gsub' part. FYI, gsub('old_string','new_string') replaces old_string with new_string. Hope this helps From solly_ at msn.com Fri May 25 11:40:20 2007 From: solly_ at msn.com (Sol Jubrail) Date: Fri, 25 May 2007 16:40:20 +0100 Subject: [Wtr-general] stripping... In-Reply-To: <32587179.8361180107410748.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070525/4ca7638b/attachment-0001.html From charley.baker at gmail.com Fri May 25 11:41:12 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 25 May 2007 09:41:12 -0600 Subject: [Wtr-general] Basic accessibility testing with Watir and RAAKT... In-Reply-To: <72799cd70705250813j4983466cic4b39a07a1c1910a@mail.gmail.com> References: <7b9ad66d0705250312m4e854eebtea12e7a6de69068c@mail.gmail.com> <72799cd70705250813j4983466cic4b39a07a1c1910a@mail.gmail.com> Message-ID: It does look really cool. Unfortunately hpricot (a required dependency) dumps out with a Segmentation fault with Ruby 1.8.2. Looks like it only works with Ruby 1.8.5 and above. Bummer. On 5/25/07, Chris McMahon wrote: > > > The tool is called Raakt (Ruby Accessibility Analysis Kit) and the > > project wiki can be found here: > > http://www.peterkrantz.com/raakt/wiki/ > > This is very cool and I'm going to try it out. > But your site looks awful in Firefox on OS X. :) > _______________________________________________ > 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/20070525/7df920ec/attachment.html From paul.rogers at shaw.ca Fri May 25 11:56:50 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 25 May 2007 09:56:50 -0600 Subject: [Wtr-general] Basic accessibility testing with Watir and RAAKT... References: <7b9ad66d0705250312m4e854eebtea12e7a6de69068c@mail.gmail.com> Message-ID: <045e01c79ee5$4ec8f280$6400a8c0@laptop> this looks really useful - it would work really well with an error checker: AccessChecker = Proc.new{|ie| raakttest = Raakt::Test.new(ie.html) result = raakttest.all if result.length > 0 puts "Accessibility problems detected on #{ie.title}, #{ie.url}:" puts result else puts "No measurable accessibility problems were detected." end } ie = Watir::IE.start('...') ie.add_checker( AccessChecker) this now means that every time a page is loaded, the accessability checks get run Paul ----- Original Message ----- From: "Peter Krantz" To: Sent: Friday, May 25, 2007 4:12 AM Subject: [Wtr-general] Basic accessibility testing with Watir and RAAKT... > Hi! > > I have been tinkering with an open source accessibility testing tool > that easily hooks into Watir. The idea is to check for basic > accessibility issues while you are running your Watir functional tests > (because you have access to the complete html output from your > application). > > The idea is to capture as many accessibility errors as possible before > your app is tested by the QA people. This will hopefully save both > time and money see [0] for more on why. > > The tool is called Raakt (Ruby Accessibility Analysis Kit) and the > project wiki can be found here: > http://www.peterkrantz.com/raakt/wiki/ > > Instructions on how to use it in Watir are here: > http://www.peterkrantz.com/raakt/wiki/frameworks/watir > > I would be grateful for feedback on how well this integrates with > Watir and if you had any specific issues with it. > > Kind regards, > > Peter Krantz > http://www.standards-schmandards.com > > [0]: > http://www.standards-schmandards.com/2007/rapid-accessibility-feedback/ > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Fri May 25 13:46:30 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 25 May 2007 12:46:30 -0500 Subject: [Wtr-general] Question about IE.new_process and Vista In-Reply-To: <31562337.7081180105239708.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <31562337.7081180105239708.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <465720F6.1030404@pettichord.com> Bach Le wrote: > I thought the two problems are related because in neither instance was watir able to find the window after it was created (I didn't look into the specifics). I did look into it some more after this post and I found out that it was Vista's security settings that caused watir to break. Turning off these security settings fixed it. I don't remember the details right now but as soon as I get my vista box up and running again, I will update the JIRA ticket and this thread with the details. I'm back on my old machine now which is running XP. I'll switch back a little later in the day so I'll update in a few hours. It would be great if you could get us that information. We've had a lot of vista-related complaints lately and this will surely help. Bret From bret at pettichord.com Fri May 25 13:53:43 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 25 May 2007 12:53:43 -0500 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <46565E9C.6020909@gmail.com> References: <46412CAC.1030801@gmail.com> <464166F7.6030000@pettichord.com> <4645231D.9000608@gmail.com> <4649CD89.4040103@pettichord.com> <970956b0705161448l7de55a0dke43adc9cc888d5aa@mail.gmail.com> <4650FB4D.6050005@gmail.com> <46565E9C.6020909@gmail.com> Message-ID: <465722A7.6010608@pettichord.com> Jeff Fry wrote: > Hey y'all, I'm resending these in the hopes of getting info from folks > who know what watir actually does better than I do. If you are up for > updating the wiki chart, great...but if you just want to email me some > corrections, that'd be totally fine too. I'll happily update the chart. If you want further review, i think someone will need to read through the unit tests and compare what is in them with what is in your chart. Thanks for putting this together. I think people will find it very useful. Bret From christopher.mcmahon at gmail.com Fri May 25 13:59:38 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 25 May 2007 11:59:38 -0600 Subject: [Wtr-general] Basic accessibility testing with Watir and RAAKT... In-Reply-To: <7b9ad66d0705250312m4e854eebtea12e7a6de69068c@mail.gmail.com> References: <7b9ad66d0705250312m4e854eebtea12e7a6de69068c@mail.gmail.com> Message-ID: <72799cd70705251059i4037aca7g35452b19c0434d51@mail.gmail.com> Hmm, error on both Windows and Mac from the demo script: raakt.rb:14: uninitialized constant Raakt (NameError) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from raakt.rb:3 On 5/25/07, Peter Krantz wrote: > Hi! > > I have been tinkering with an open source accessibility testing tool > that easily hooks into Watir. The idea is to check for basic > accessibility issues while you are running your Watir functional tests > (because you have access to the complete html output from your > application). > > The idea is to capture as many accessibility errors as possible before > your app is tested by the QA people. This will hopefully save both > time and money see [0] for more on why. > > The tool is called Raakt (Ruby Accessibility Analysis Kit) and the > project wiki can be found here: > http://www.peterkrantz.com/raakt/wiki/ > > Instructions on how to use it in Watir are here: > http://www.peterkrantz.com/raakt/wiki/frameworks/watir > > I would be grateful for feedback on how well this integrates with > Watir and if you had any specific issues with it. > > Kind regards, > > Peter Krantz > http://www.standards-schmandards.com > > [0]: http://www.standards-schmandards.com/2007/rapid-accessibility-feedback/ > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From christopher.mcmahon at gmail.com Fri May 25 14:08:15 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 25 May 2007 12:08:15 -0600 Subject: [Wtr-general] Basic accessibility testing with Watir and RAAKT... In-Reply-To: <72799cd70705251059i4037aca7g35452b19c0434d51@mail.gmail.com> References: <7b9ad66d0705250312m4e854eebtea12e7a6de69068c@mail.gmail.com> <72799cd70705251059i4037aca7g35452b19c0434d51@mail.gmail.com> Message-ID: <72799cd70705251108x5c19b3cfvcf80ff3838b1e0ad@mail.gmail.com> Error from the standalone script also Windows and Mac: mechanize.rb:334:in `to_absolute_uri': no history. please specify an absolute URL (RuntimeError) from /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.8/lib/mechanize.rb:170:in `get' from ./raakt.rb:12 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from raakt2.rb:4 The error below is from the command-line script. On 5/25/07, Chris McMahon wrote: > Hmm, error on both Windows and Mac from the demo script: > > raakt.rb:14: uninitialized constant Raakt (NameError) > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require' > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require' > from raakt.rb:3 From christopher.mcmahon at gmail.com Fri May 25 14:18:46 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 25 May 2007 12:18:46 -0600 Subject: [Wtr-general] My mistake! Re: Basic accessibility testing with Watir and RAAKT... Message-ID: <72799cd70705251118q6af7522fj78df2ae79eae7fca@mail.gmail.com> It must be Friday. Some free advice: don't name your test file "raakt.rb". :) On 5/25/07, Chris McMahon wrote: > Error from the standalone script also Windows and Mac: > > mechanize.rb:334:in `to_absolute_uri': no history. please specify an > absolute URL (RuntimeError) > from /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.8/lib/mechanize.rb:170:in > `get' > from ./raakt.rb:12 > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require' > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require' > from raakt2.rb:4 > > The error below is from the command-line script. > > On 5/25/07, Chris McMahon wrote: > > Hmm, error on both Windows and Mac from the demo script: > > > > raakt.rb:14: uninitialized constant Raakt (NameError) > > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > > `gem_original_require' > > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > > `require' > > from raakt.rb:3 > From charley.baker at gmail.com Fri May 25 15:17:44 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 25 May 2007 13:17:44 -0600 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <465722A7.6010608@pettichord.com> References: <46412CAC.1030801@gmail.com> <464166F7.6030000@pettichord.com> <4645231D.9000608@gmail.com> <4649CD89.4040103@pettichord.com> <970956b0705161448l7de55a0dke43adc9cc888d5aa@mail.gmail.com> <4650FB4D.6050005@gmail.com> <46565E9C.6020909@gmail.com> <465722A7.6010608@pettichord.com> Message-ID: I updated the :action and :method info. I'll take a look at the chart which is rather interesting, useful and may point out some discrepancies. -c On 5/25/07, Bret Pettichord wrote: > > Jeff Fry wrote: > > Hey y'all, I'm resending these in the hopes of getting info from folks > > who know what watir actually does better than I do. If you are up for > > updating the wiki chart, great...but if you just want to email me some > > corrections, that'd be totally fine too. I'll happily update the chart. > If you want further review, i think someone will need to read through > the unit tests and compare what is in them with what is in your chart. > Thanks for putting this together. I think people will find it very useful. > > 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/20070525/b758f1d9/attachment.html From peter.krantz at gmail.com Fri May 25 15:31:49 2007 From: peter.krantz at gmail.com (Peter Krantz) Date: Fri, 25 May 2007 21:31:49 +0200 Subject: [Wtr-general] Basic accessibility testing with Watir and RAAKT... In-Reply-To: <045e01c79ee5$4ec8f280$6400a8c0@laptop> References: <7b9ad66d0705250312m4e854eebtea12e7a6de69068c@mail.gmail.com> <045e01c79ee5$4ec8f280$6400a8c0@laptop> Message-ID: <7b9ad66d0705251231t277d82aas61a22d962e91e8ea@mail.gmail.com> On 5/25/07, Paul Rogers wrote: > this now means that every time a page is loaded, the accessability checks > get run Nice code sample. Didn't know you could do that in Watir. May I use it as an example in the Raakt wiki? Regards, Peter From forum-watir-users at openqa.org Fri May 25 15:36:47 2007 From: forum-watir-users at openqa.org (Norm) Date: Fri, 25 May 2007 14:36:47 CDT Subject: [Wtr-general] Watir Development Gem 1.5.1.1192 Released In-Reply-To: <26677633.781180075413526.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <33160844.11291180121837431.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Perfect, my issue with rubyw and ie-new-process is resolved by upgrading to 1.5.1.1192! Thanks Bret! From forum-watir-users at openqa.org Fri May 25 15:37:20 2007 From: forum-watir-users at openqa.org (Norm) Date: Fri, 25 May 2007 14:37:20 CDT Subject: [Wtr-general] ie-new-process and rubyw.exe? bug? In-Reply-To: <27549464.7901180036949291.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <26680892.11361180121870086.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Installed 1.5.1.1192 gem, problem with rubyw and ie-new-process is resolved! From jeff.fry at gmail.com Fri May 25 15:51:37 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Fri, 25 May 2007 12:51:37 -0700 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: References: <46412CAC.1030801@gmail.com> <464166F7.6030000@pettichord.com> <4645231D.9000608@gmail.com> <4649CD89.4040103@pettichord.com> <970956b0705161448l7de55a0dke43adc9cc888d5aa@mail.gmail.com> <4650FB4D.6050005@gmail.com> <46565E9C.6020909@gmail.com> <465722A7.6010608@pettichord.com> Message-ID: <970956b0705251251u6aedd507he1efc895293f922c@mail.gmail.com> Hey Charley - thanks for adding the :action and :method info. And thanks to both Charley and Bret for the kind words. I do hope the chart proves useful. In the new version of the Rdoc (not yet checked in) I have replaced lists of supported attributes for each method with a link to this wiki page. Hopefully that will make it easier for us to keep this info current. BTW, I just added :href as a supported attribute for links. I don't recall if I ever saw this documented anywhere (it may be something I just tried one day, and it worked). I don't think it was in the most recent version of the rdoc, but it's on the wiki now. If anyone out there looks at this chart and sees a supported attribute that's not listed, please chime in or just add it. Jeff On 5/25/07, Charley Baker wrote: > > I updated the :action and :method info. I'll take a look at the chart > which is rather interesting, useful and may point out some discrepancies. > > -c > > On 5/25/07, Bret Pettichord wrote: > > > > Jeff Fry wrote: > > > Hey y'all, I'm resending these in the hopes of getting info from folks > > > who know what watir actually does better than I do. If you are up for > > > updating the wiki chart, great...but if you just want to email me some > > > > > corrections, that'd be totally fine too. I'll happily update the > > chart. > > If you want further review, i think someone will need to read through > > the unit tests and compare what is in them with what is in your chart. > > Thanks for putting this together. I think people will find it very > > useful. > > > > Bret > > _______________________________________________ > > 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 > -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070525/afb9b340/attachment.html From msofaer at modeln.com Fri May 25 16:05:41 2007 From: msofaer at modeln.com (Michael Sofaer) Date: Fri, 25 May 2007 13:05:41 -0700 Subject: [Wtr-general] Seg-faults with >4 ie windows (hello) In-Reply-To: <6F8CBA5E01C02842B0E19554310C1CF10639D94B@hdqmail1.modeln.com> Message-ID: <6F8CBA5E01C02842B0E19554310C1CF10639E471@hdqmail1.modeln.com> Looks like this issue has gone away with the new development gem, thanks, Bret! From bret at pettichord.com Fri May 25 16:08:55 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 25 May 2007 15:08:55 -0500 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <970956b0705251251u6aedd507he1efc895293f922c@mail.gmail.com> References: <46412CAC.1030801@gmail.com> <464166F7.6030000@pettichord.com> <4645231D.9000608@gmail.com> <4649CD89.4040103@pettichord.com> <970956b0705161448l7de55a0dke43adc9cc888d5aa@mail.gmail.com> <4650FB4D.6050005@gmail.com> <46565E9C.6020909@gmail.com> <465722A7.6010608@pettichord.com> <970956b0705251251u6aedd507he1efc895293f922c@mail.gmail.com> Message-ID: <46574257.800@pettichord.com> > Hey Charley - thanks for adding the :action and :method info. > > And thanks to both Charley and Bret for the kind words. I do hope the > chart proves useful. In the new version of the Rdoc (not yet checked > in) I have replaced lists of supported attributes for each method with > a link to this wiki page. Hopefully that will make it easier for us to > keep this info current. > > BTW, I just added :href as a supported attribute for links. I don't > recall if I ever saw this documented anywhere (it may be something I > just tried one day, and it worked). I don't think it was in the most > recent version of the rdoc, but it's on the wiki now. If anyone out > there looks at this chart and sees a supported attribute that's not > listed, please chime in or just add it. Rather than spend too much effort trying to keep the rdoc and the wiki in sync, i suggest that you embed a link to the wiki in the rdoc. Bret From jeff.fry at gmail.com Fri May 25 16:17:41 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Fri, 25 May 2007 13:17:41 -0700 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <46574257.800@pettichord.com> References: <46412CAC.1030801@gmail.com> <4645231D.9000608@gmail.com> <4649CD89.4040103@pettichord.com> <970956b0705161448l7de55a0dke43adc9cc888d5aa@mail.gmail.com> <4650FB4D.6050005@gmail.com> <46565E9C.6020909@gmail.com> <465722A7.6010608@pettichord.com> <970956b0705251251u6aedd507he1efc895293f922c@mail.gmail.com> <46574257.800@pettichord.com> Message-ID: <970956b0705251317k2c6bf465s8fb5244c52ae61ca@mail.gmail.com> On 5/25/07, Bret Pettichord wrote: > > > Rather than spend too much effort trying to keep the rdoc and the wiki > in sync, i suggest that you embed a link to the wiki in the rdoc. Yeah, I think I just didn't express myself clearly there. I've added links to the wiki in the rdoc under each of these methods. I'll be posting my changes by Tuesday. What I meant with :href was that I couldn't find it documented anywhere, and so I added it to the wiki...and it made me wonder what else I don't have on the chart yet. Cheers, Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070525/cdcf5f5c/attachment.html From forum-watir-users at openqa.org Fri May 25 16:19:37 2007 From: forum-watir-users at openqa.org (Bach Le) Date: Fri, 25 May 2007 15:19:37 CDT Subject: [Wtr-general] Question about IE.new_process and Vista In-Reply-To: <465720F6.1030404@pettichord.com> Message-ID: <33055198.11621180124407136.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> So here is how I fixed my problem: 1. Goto the Control Panel 2. Click on User Accounts 3. Click on User Accounts again 4. Select the account you are using 5. Click "Turn User Account Control on or off" 6. Turn User Account Control off This allowed Shell.Application.Window to find the correct window when IE is created in a test. Hope that helps everyone else. I'll update the JIRA ticket as well. From paul.rogers at shaw.ca Fri May 25 16:23:50 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 25 May 2007 14:23:50 -0600 Subject: [Wtr-general] Basic accessibility testing with Watir and RAAKT... References: <7b9ad66d0705250312m4e854eebtea12e7a6de69068c@mail.gmail.com> <045e01c79ee5$4ec8f280$6400a8c0@laptop> <7b9ad66d0705251231t277d82aas61a22d962e91e8ea@mail.gmail.com> Message-ID: <048c01c79f0a$9b301f20$6400a8c0@laptop> absolutely - test it first though as I did it off the top of my head Paul ----- Original Message ----- From: "Peter Krantz" To: Sent: Friday, May 25, 2007 1:31 PM Subject: Re: [Wtr-general] Basic accessibility testing with Watir and RAAKT... > On 5/25/07, Paul Rogers wrote: > >> this now means that every time a page is loaded, the accessability checks >> get run > > Nice code sample. Didn't know you could do that in Watir. May I use it > as an example in the Raakt wiki? > > Regards, > > Peter > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Fri May 25 16:43:31 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 25 May 2007 14:43:31 -0600 Subject: [Wtr-general] RDOC - Help determining what needs documentation References: <46412CAC.1030801@gmail.com> <464166F7.6030000@pettichord.com> <4645231D.9000608@gmail.com> <4649CD89.4040103@pettichord.com> <970956b0705161448l7de55a0dke43adc9cc888d5aa@mail.gmail.com> <4650FB4D.6050005@gmail.com> <46565E9C.6020909@gmail.com> <465722A7.6010608@pettichord.com> Message-ID: <04c101c79f0d$6b804c70$6400a8c0@laptop> for images, 1.4 let you use :src which was the url of the image. I cant test it on the latest as all my gems are broken :-( ----- Original Message ----- From: Charley Baker To: wtr-general at rubyforge.org Sent: Friday, May 25, 2007 1:17 PM Subject: Re: [Wtr-general] RDOC - Help determining what needs documentation I updated the :action and :method info. I'll take a look at the chart which is rather interesting, useful and may point out some discrepancies. -c On 5/25/07, Bret Pettichord wrote: Jeff Fry wrote: > Hey y'all, I'm resending these in the hopes of getting info from folks > who know what watir actually does better than I do. If you are up for > updating the wiki chart, great...but if you just want to email me some > corrections, that'd be totally fine too. I'll happily update the chart. If you want further review, i think someone will need to read through the unit tests and compare what is in them with what is in your chart. Thanks for putting this together. I think people will find it very useful. Bret _______________________________________________ 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/20070525/2f7425f6/attachment-0001.html From msofaer at modeln.com Fri May 25 18:16:35 2007 From: msofaer at modeln.com (Michael Sofaer) Date: Fri, 25 May 2007 15:16:35 -0700 Subject: [Wtr-general] Losing ie handle on multiple concurrencies In-Reply-To: <04c101c79f0d$6b804c70$6400a8c0@laptop> Message-ID: <6F8CBA5E01C02842B0E19554310C1CF10639E5D1@hdqmail1.modeln.com> The newest gem has fixed the problem I was having with segmentation faults, and I have been able to get up to 8 concurrent windows running, but now I am hitting a new problem when I try to get to 12. As I get up around 12 ie instances running, new instances seem to be created without the handle getting back to Watir, they just sit at my home page doing nothing, and never close. This is a problem beyond just having one failed test instance because they start to pile up and drain resources, crashing the scripts when then get to the mid 30s. I put a "puts $!" in the script to see what it was telling me, and I got a collection of various errors. Most of these show up many times in the full output: visible OLE error code:0 in HRESULT error code:0x80010108 The object invoked has disconnected from its clients. unknown property or method `visible' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. OLE error code:0 in HRESULT error code:0x80010108 The object invoked has disconnected from its clients. unknown property or method `hwnd' HRESULT error code:0x800706ba The RPC server is unavailable. unknown property or method `hwnd' HRESULT error code:0x800706be The remote procedure call failed. unknown property or method `visible' HRESULT error code:0x800706ba The RPC server is unavailable. c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:1733:in `method_missing': unknown property or method `quit' (WIN32OLERuntimeError) HRESULT error code:0x800706ba From jeff.fry at gmail.com Sun May 27 18:03:18 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Sun, 27 May 2007 15:03:18 -0700 Subject: [Wtr-general] RDOC - Help determining what needs documentation In-Reply-To: <04c101c79f0d$6b804c70$6400a8c0@laptop> References: <46412CAC.1030801@gmail.com> <464166F7.6030000@pettichord.com> <4645231D.9000608@gmail.com> <4649CD89.4040103@pettichord.com> <970956b0705161448l7de55a0dke43adc9cc888d5aa@mail.gmail.com> <4650FB4D.6050005@gmail.com> <46565E9C.6020909@gmail.com> <465722A7.6010608@pettichord.com> <04c101c79f0d$6b804c70$6400a8c0@laptop> Message-ID: <465A0026.2000803@gmail.com> Paul Rogers wrote: > for images, 1.4 let you use :src which was the url of the image. I > cant test it on the latest as all my gems are broken :-( Thanks. I just updated the table with :src. Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070527/a3b01022/attachment.html From carl.l.shaulis at convergys.com Sun May 27 18:06:10 2007 From: carl.l.shaulis at convergys.com (carl.l.shaulis at convergys.com) Date: Sun, 27 May 2007 17:06:10 -0500 Subject: [Wtr-general] Carl L Shaulis is out of the office. Message-ID: I will be out of the office starting 05/26/2007 and will not return until 06/10/2007. If you need immediate assistance please try Cari Spruiell or my cell phone at 512-560-5773. Thanks! -- "NOTICE: The information contained in this electronic mail transmission is intended by Convergys Corporation for the use of the named individual or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone (collect), so that the sender's address records can be corrected." From bret at pettichord.com Sun May 27 19:42:27 2007 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 27 May 2007 18:42:27 -0500 Subject: [Wtr-general] Losing ie handle on multiple concurrencies In-Reply-To: <6F8CBA5E01C02842B0E19554310C1CF10639E5D1@hdqmail1.modeln.com> References: <6F8CBA5E01C02842B0E19554310C1CF10639E5D1@hdqmail1.modeln.com> Message-ID: <465A1763.1010000@pettichord.com> Michael Sofaer wrote: > The newest gem has fixed the problem I was having with segmentation > faults, and I have been able to get up to 8 concurrent windows running, > but now I am hitting a new problem when I try to get to 12. > > Michael, Please start a new thread for this. You replied to the RDOC thread, changing the subject. But i use a threaded newsreader, that watches the reply to ID's and therefore can tell (despite the title change) that it is part of the RDOC thread. Bret From ajitesh.srinetra at gmail.com Mon May 28 04:10:18 2007 From: ajitesh.srinetra at gmail.com (Ajitesh Srinetra) Date: Mon, 28 May 2007 13:40:18 +0530 Subject: [Wtr-general] Error while calculating day of the year Message-ID: <4f6da15b0705280110p67958162r7fb255bcfea37d31@mail.gmail.com> I want to get the day of the year of the any date . I am using the function yday The code i am using in my testcase is require 'date' positivedate=(Time.now).strftime("%Y/%m/%d") day_of_the_year = yday(Time.now) puts "#{day_of_the_year}" But it is unable to recognise the function yday and throwing error NoMethodError: undefined method `yday' for main:Object from (irb):13 I have seen in date.rb the function, yday() is present so no problems with ruby version Ajitesh Srinetra -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070528/c2b054a9/attachment.html From angrez at gmail.com Mon May 28 04:57:56 2007 From: angrez at gmail.com (Angrez Singh) Date: Mon, 28 May 2007 14:27:56 +0530 Subject: [Wtr-general] Error while calculating day of the year In-Reply-To: <4f6da15b0705280110p67958162r7fb255bcfea37d31@mail.gmail.com> References: <4f6da15b0705280110p67958162r7fb255bcfea37d31@mail.gmail.com> Message-ID: Hi, yday() is method that is defined for object of Time class. But your method invocation of yday() doesn't seems to be on object of time class. following should work require 'date' positivedate=(Time.now) # Object of time class day_of_the_year = positivedate.yday() # Invoke method on object of Time class. puts "#{day_of_the_year}" - Angrez On 5/28/07, Ajitesh Srinetra wrote: > > I want to get the day of the year of the any date . > I am using the function yday > The code i am using in my testcase is > > > require 'date' > positivedate=(Time.now).strftime("%Y/%m/%d") > day_of_the_year = yday( Time.now) > puts "#{day_of_the_year}" > > > But it is unable to recognise the function yday and throwing error > > NoMethodError: undefined method `yday' for main:Object > from (irb):13 > I have seen in date.rb the function, yday() is present so no problems > with ruby version > > Ajitesh Srinetra > > _______________________________________________ > 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/20070528/f9cb0755/attachment.html From manishs at gs-lab.com Mon May 28 05:44:43 2007 From: manishs at gs-lab.com (Manish Sapariya) Date: Mon, 28 May 2007 15:14:43 +0530 Subject: [Wtr-general] test, please ignore Message-ID: <465AA48B.1070708@gs-lab.com> From manish at gslab.com Mon May 28 06:45:11 2007 From: manish at gslab.com (Manish Sapariya) Date: Mon, 28 May 2007 16:15:11 +0530 Subject: [Wtr-general] Automating gmail: nor click on "Compose Mail", neither fire_event works Message-ID: <465AB2B7.5080600@gslab.com> Hi All, I am trying to automate sending mail using gmail. I could locate the "Compose Mail" div and make it flash using, irb(main):100:0> ie.frame(:name, "main").frame(:name,"v1").span(:text,"Compose M ail").flash However, the click() or fire_event("onclick") does not seem to be working. irb(main):109:0> ie.frame(:name, "main").frame(:name,"v1").span(:text,"Compose M ail").flash => nil irb(main):110:0> ie.frame(:name, "main").frame(:name,"v1").span(:text,"Compose M ail").fire_event("onmousedown") => "" irb(main):111:0> irb(main):111:0> ie.frame(:name, "main").frame(:name,"v1").span(:text,"Compose M ail").click => 0.5 irb(main):112:0> After playing a while with firebug extension on firefox and gmail, I could figure out that it is sending out onmousedown event. However I noted that the firebug reports that the it sends out the X-Y co-ordinates of the click as well. I tried simple onmousedown event as shown above, however it did not help. I am not sure if need to the X-Y co-ordinate as well, for it to work? And How is the question? Any ideas? Thanks, Manish P.S. : Firebug on firefox was an excellent help to understand the events? Is there any equivalent for IE? From forum-watir-users at openqa.org Mon May 28 06:48:49 2007 From: forum-watir-users at openqa.org (Eoin) Date: Mon, 28 May 2007 05:48:49 CDT Subject: [Wtr-general] FireWatir doesn't ignore if it doesn't exists but In-Reply-To: <46449C1C.2040306@pettichord.com> Message-ID: <24841576.2401180349359278.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> You were indeed correct Bret. They have fixed the issue now and will be available in the next firewatir gem or from source if needed quickly More detauis here: [Firewatir Bug #28|http://code.google.com/p/firewatir/issues/detail?id=28&can=4&q=] From zeljko.filipin at gmail.com Mon May 28 07:49:21 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 28 May 2007 13:49:21 +0200 Subject: [Wtr-general] Automating gmail: nor click on "Compose Mail", neither fire_event works In-Reply-To: <465AB2B7.5080600@gslab.com> References: <465AB2B7.5080600@gslab.com> Message-ID: On 5/28/07, Manish Sapariya wrote: > > P.S. : Firebug on firefox was an excellent help to understand the > events? Is there > any equivalent for IE? Hi Manish, Take a look at Internet Explorer Developer Toolbar ( http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en ). Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070528/a214fdb6/attachment.html From manish at gslab.com Mon May 28 08:04:19 2007 From: manish at gslab.com (Manish Sapariya) Date: Mon, 28 May 2007 17:34:19 +0530 Subject: [Wtr-general] Automating gmail: nor click on "Compose Mail", neither fire_event works In-Reply-To: References: <465AB2B7.5080600@gslab.com> Message-ID: <465AC543.1060902@gslab.com> ?eljko Filipin wrote: > Take a look at Internet Explorer Developer Toolbar ( > http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en > ). > > Zeljko Hi Zelko, I am actively using dev toolbar. However I needed to know what kind of events are generated when I actually click on "Compose Mail". I didnot find any way to do achieve this in dev tool bar, if I am not missing anything obvious. Using Firebug I can select a element and select to log all events for that element. This was great help to figure out what goes under the hood when I access the page. Thanks anyways. Regards, Manish From forum-watir-users at openqa.org Mon May 28 11:51:05 2007 From: forum-watir-users at openqa.org (devya) Date: Mon, 28 May 2007 10:51:05 CDT Subject: [Wtr-general] How to access frames inside DIV tag Message-ID: <21839534.351180367496336.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I can access the links inside div tag, but not the frame. ie.frame(:name ,"main").div(:id, "d_v1").frames gives following error msg - NoMethodError: undefined method `frames' for # From jeff.fry at gmail.com Mon May 28 13:37:10 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Mon, 28 May 2007 10:37:10 -0700 Subject: [Wtr-general] More rdoc changes Message-ID: <465B1346.8000502@gmail.com> Hey all, I just submitted more rdoc (and associated) changes. This batch of changes includes: * Took the class def out of changes.rb, license.rb, readme.rb * Updated the rakefile.rb to add the above to the rdoc * Watir.rb: took out all references to :beforeText and :afterText * Watir.rb: replaced 'how' lists with a link to http://wiki.openqa.org/display/WTR/Methods+supported+by+Element whenever appropriate * Updated changes.rb with info from wiki (both http://wiki.openqa.org/pages/viewrecentblogposts.action?key=WTR and http://wiki.openqa.org/display/WTR/Watir+1.5+Summary) Any who are interested, please again review and give feedback for improvement...especially for anything that is incomplete or inaccurate. I am guessing that this is fairly close to done for 1.5, minus omissions that others find, and not counting some additional changes I expect to make to the wiki Methods by Element page, such as including simple and more complex sample usage examples. One other note: Changes.rb is now a combination of major features (from http://wiki.openqa.org/display/WTR/Watir+1.5+Summary) and other changes (from the gem release notes). If there's anything from before 1.5.1.1100 that deserves to be in changes.rb - or anything else that should be added/removed/changed - please let me know. Cheers, Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070528/d50b09d3/attachment.html From forum-watir-users at openqa.org Tue May 29 02:21:29 2007 From: forum-watir-users at openqa.org (sapna) Date: Tue, 29 May 2007 01:21:29 CDT Subject: [Wtr-general] How to give the next line b/w the sentences for window text. Message-ID: <25247230.2121180419720634.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, This is Sapna, Kindly help me out with the problem below. There are code written for testing window text and compair with the actual one. In the application the first line of the text is what I need to compair but will take all the 3 lines so had to put all the lines in the win_text1 variable. Please let me know if it can select only the first line or let me know by selecting all the lines how to put each sentence in the next line. win_text1= *'Line1: Your Account Preferences have been updated**. Line 2: Make more changes. Line 3: View account summary page.' a=$ie.table(:index, 4) puts a[1][2] assert_equal(win_text1, a[1][1].to_s, 'Manage Account Preferences, Windows text1 is mismatching with the Actual') Regards Sapna From forum-watir-users at openqa.org Tue May 29 03:51:56 2007 From: forum-watir-users at openqa.org (Maloy kanti debnath) Date: Tue, 29 May 2007 02:51:56 CDT Subject: [Wtr-general] not able to click ok for the pop up , after a selection from select list Message-ID: <25645049.3681180425146216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> hi , I have a problem here i am not able to catch a pop up after i select from a select list (I am not clicking anything at this juncture. The popup comes immediately after i select a particular value from a select list)..... i tried the code which i found in the forums but its not working ... i am writing the code that i found in the forums and please check if it is correct or not .. and give me a solution.... def startClicker(ie, button) # Strart a new thread that will dismiss the JSPopup. t = Thread.new { w = WinClicker.new hwnd = $ie.enabled_popup(10) if nil == hwnd w.clickWindowsButton_hwnd(hwnd, button) t.join w = nil end } end startClicker( $ie, 'OK') table = $ie.frame('Meeting').frame('content').frame('score').table(:index,6) return_value = returning_the_value_of_a_field_along_with_its_cell(table,'US') table[return_value[1]].select_list(:name,'applicationListForm.application[52].disposition').select('Inactivate') # this is the 'selection' that gives out a 'popup' message Thanks, Maloy. From zeljko.filipin at gmail.com Tue May 29 04:09:11 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 29 May 2007 10:09:11 +0200 Subject: [Wtr-general] How to give the next line b/w the sentences for window text. In-Reply-To: <25247230.2121180419720634.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <25247230.2121180419720634.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Sapna, Can you post html snippet with text you want checked? Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070529/0bdb9473/attachment.html From forum-watir-users at openqa.org Tue May 29 04:15:28 2007 From: forum-watir-users at openqa.org (devya) Date: Tue, 29 May 2007 03:15:28 CDT Subject: [Wtr-general] How to access frames inside DIV tag In-Reply-To: <21839534.351180367496336.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <28071838.3811180426558296.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> You can directly access frames that are inside div element using ie.frame(:name, "main").frame(:name,"v2") * frame v2 is inside the DIV element. One question - why can't we access controls inside frame directly? Why do we have to reference those controls through frames? e.g. If link userid is present in one frame then we need to access it using ie.frame(:name, "main").link(:text, "userid") if this link is present in one table or form then we can directly access it using ie.link(:text, "userid") From forum-watir-users at openqa.org Tue May 29 05:15:13 2007 From: forum-watir-users at openqa.org (Fletch) Date: Tue, 29 May 2007 04:15:13 CDT Subject: [Wtr-general] maxLength Validation Message-ID: <28313714.4041180430143366.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello All, I have been looking for a solution to this problem, and was wondering if anyone could give me some advice. I noticed yesterday that WATIR did not pay any attention to the maxLength of the text_field. I have tried using name.set("abc") and name.value = "abc" but both are still going over the allowed limit. The solution that I have come up with (and it is not a good solution) is to truncate the name. nameSize = name.size maxSize = frame.text_field(:name, 'Name').maxLength if (vinSize > maxSize) puts("Bigger than maxLength - #{vinSize} -- #{maxSize}") name = name[0, maxSize] end This does the job in so far as the maxLength limits are observed, but is there a better solution to the problem? Thanks, PMF. From forum-watir-users at openqa.org Tue May 29 06:23:02 2007 From: forum-watir-users at openqa.org (sapna) Date: Tue, 29 May 2007 05:23:02 CDT Subject: [Wtr-general] How to get the all the content of list box into variable Message-ID: <33993063.4111180434212323.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi. Please let me know how to store in a variable the content of the list box and use that variable to compaire with the default value. Regards Sapna From forum-watir-users at openqa.org Tue May 29 06:31:35 2007 From: forum-watir-users at openqa.org (sapna) Date: Tue, 29 May 2007 05:31:35 CDT Subject: [Wtr-general] How to give the next line b/w the sentences for window text. In-Reply-To: Message-ID: <25468537.4511180434725424.JavaMail.oqa-j2ee@openqa01.managed.contegix.com>

    Your Account Preferences have been updated.

    Make
    more changes.
    View account summary page.

    From zeljko.filipin at gmail.com Tue May 29 07:42:10 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 29 May 2007 13:42:10 +0200 Subject: [Wtr-general] How to give the next line b/w the sentences for window text. In-Reply-To: <25468537.4511180434725424.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <25468537.4511180434725424.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: If I understood you correctly, you want to know if "Your Account Preferences have been updated." text appears at page. You can do it like this. ie.text.include?("Your Account Preferences have been updated.") => true Let me know if I misunderstood you. Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070529/6f80e185/attachment.html From zeljko.filipin at gmail.com Tue May 29 07:47:44 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 29 May 2007 13:47:44 +0200 Subject: [Wtr-general] How to get the all the content of list box into variable In-Reply-To: <33993063.4111180434212323.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <33993063.4111180434212323.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 5/29/07, sapna wrote: > > Please let me know how to store in a variable the content of the list box > and use that variable to compaire with the default value. Sapna, It would help if you post relevant html snippet when posting question. For example, I do not know what do you mean by list box. I will assume that you have this and you want to get contents. You can do it like this: ie.select_list(:index, 1).getAllContents => ["Volvo", "Saab"] Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070529/4e2777d1/attachment.html From shalinigupta2006 at gmail.com Tue May 29 08:04:25 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Tue, 29 May 2007 17:34:25 +0530 Subject: [Wtr-general] How to get the all the content of list box into variable In-Reply-To: References: <33993063.4111180434212323.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <7523f5800705290504k5f18c166v93c103e2424a130b@mail.gmail.com> hi, u can try this ary=$ie.select_list(:name, "ctl00$header1$AddLocations1$lstAvailable").getAllContents() $ie.select_list(:name, "ctl00$header1$AddLocations1$lstAvailable").select(ary[0].to_s) u can compare this.. hope it will work. regards shalini gupta On 5/29/07, ?eljko Filipin wrote: > > On 5/29/07, sapna wrote: > > > > Please let me know how to store in a variable the content of the list > > box and use that variable to compaire with the default value. > > > Sapna, > > It would help if you post relevant html snippet when posting question. For > example, I do not know what do you mean by list box. I will assume that you > have this > > > > and you want to get contents. You can do it like this: > > ie.select_list(:index, 1).getAllContents > => ["Volvo", "Saab"] > > Zeljko > -- > ZeljkoFilipin.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/20070529/72c98064/attachment-0001.html From manish at gslab.com Tue May 29 08:33:39 2007 From: manish at gslab.com (Manish Sapariya) Date: Tue, 29 May 2007 18:03:39 +0530 Subject: [Wtr-general] Automating gmail: nor click on "Compose Mail", neither fire_event works In-Reply-To: <465AB2B7.5080600@gslab.com> References: <465AB2B7.5080600@gslab.com> Message-ID: <465C1DA3.5090102@gslab.com> Manish Sapariya wrote: > Hi All, > I am trying to automate sending mail using gmail. I could > locate the "Compose Mail" div and make it flash using, > > > irb(main):100:0> ie.frame(:name, > "main").frame(:name,"v1").span(:text,"Compose M > ail").flash > > However, > the click() or fire_event("onclick") does not seem to be working. > I have work around, which I think would be helpful to document in form of reply. After playing around the app bit more, I have figured out a way to click on "Compose Mail" You can enable the key board shortcuts and use send_keys("c") for compose mail. About the events though, I am clueless as to why fire_event() did not help in this case. I think following link have clue to the problem, however I dont think I quite understand it. http://ajaxcookbook.org/event-handling-memory-leaks/ What I understand from here is that gmail is registering the event handlers dynamically and I have to figure out, how the registration javascript is invoked. I thought mousemove/mouseover action might invoke this code, but then realize that there are no handler for these event themselves, in the first place. So event registration for gmail control, which uses addEventListener is still mistery to me, I am on my way to completion using keyboard shortcut though. I hope I will have enough keyboard shortcut's defined to automate other functionality, or else I will have to start the hunt for finding out the answer to addEventListner code invocation. This brings another question: Is it possible to dump all javascript code snippets using watir? I could not find the code for event registration anywhere, though I could see lots of SCRIPT object it was painful to go through them all manually using devtool bar. Thanks for any help. Regards, Manish From zeljko.filipin at gmail.com Tue May 29 08:42:17 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 29 May 2007 14:42:17 +0200 Subject: [Wtr-general] Automating gmail: nor click on "Compose Mail", neither fire_event works In-Reply-To: <465C1DA3.5090102@gslab.com> References: <465AB2B7.5080600@gslab.com> <465C1DA3.5090102@gslab.com> Message-ID: Manish, Are you working for Google, or are you automating Gmail for some other reason. I am asking because, if you work for Google, you could ask developers how to click Compose Mail link. I am really interested to know the answer. Another workaround would be to switch to "basic HTML" view, I guess there is no magic there. Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070529/2e09de14/attachment.html From paul.rogers at shaw.ca Tue May 29 12:17:39 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 29 May 2007 10:17:39 -0600 Subject: [Wtr-general] Automating gmail: nor click on "Compose Mail", neither fire_event works In-Reply-To: References: <465AB2B7.5080600@gslab.com> <465C1DA3.5090102@gslab.com> Message-ID: there is a ruby gmailer library, which, if you are just trying to send and receive email is probably a much better bet -------------- next part -------------- Manish, Are you working for Google, or are you automating Gmail for some other reason. I am asking because, if you work for Google, you could ask developers how to click Compose Mail link. I am really interested to know the answer. Another workaround would be to switch to "basic HTML" view, I guess there is no magic there. Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070529/b66e556b/attachment.html -------------- next part -------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Tue May 29 13:30:49 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 29 May 2007 12:30:49 -0500 Subject: [Wtr-general] maxLength Validation In-Reply-To: <28313714.4041180430143366.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28313714.4041180430143366.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <465C6349.7070604@pettichord.com> Fletch wrote: > I have been looking for a solution to this problem, and was wondering if anyone could give me some advice. > I noticed yesterday that WATIR did not pay any attention to the maxLength of the text_field. > > I have tried using name.set("abc") and name.value = "abc" but both are still going over the allowed limit. > > The solution that I have come up with (and it is not a good solution) is to truncate the name. > > nameSize = name.size > maxSize = frame.text_field(:name, 'Name').maxLength > if (vinSize > maxSize) > puts("Bigger than maxLength - #{vinSize} -- #{maxSize}") > name = name[0, maxSize] > end > > This does the job in so far as the maxLength limits are observed, but is there a better solution to the problem? > > This has been a frequently mentioned problem. I think we should consider it a defect in Watir. Please go ahead and open a Jira ticket on it, and we can go ahead and fix it. The TextField#set method should limit to max length automatically. Bret From paul.rogers at shaw.ca Tue May 29 14:25:25 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 29 May 2007 12:25:25 -0600 Subject: [Wtr-general] maxLength Validation In-Reply-To: <465C6349.7070604@pettichord.com> References: <28313714.4041180430143366.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <465C6349.7070604@pettichord.com> Message-ID: Im sure there is code in the set method to limit it to the max size - did it somehow get broken? Paul ----- Original Message ----- From: Bret Pettichord Date: Tuesday, May 29, 2007 11:30 am Subject: Re: [Wtr-general] maxLength Validation > Fletch wrote: > > I have been looking for a solution to this problem, and was > wondering if anyone could give me some advice. > > I noticed yesterday that WATIR did not pay any attention to the > maxLength of the text_field. > > > > I have tried using name.set("abc") and name.value = "abc" but > both are still going over the allowed limit. > > > > The solution that I have come up with (and it is not a good > solution) is to truncate the name. > > > > nameSize = name.size > > maxSize = frame.text_field(:name, 'Name').maxLength > > if (vinSize > maxSize) > > puts("Bigger than maxLength - #{vinSize} -- #{maxSize}") > > name = name[0, maxSize] > > end > > > > This does the job in so far as the maxLength limits are > observed, but is there a better solution to the problem? > > > > > This has been a frequently mentioned problem. I think we should > consider > it a defect in Watir. Please go ahead and open a Jira ticket on > it, and > we can go ahead and fix it. > > The TextField#set method should limit to max length automatically. > > Bret > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Tue May 29 15:22:07 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 29 May 2007 14:22:07 -0500 Subject: [Wtr-general] maxLength Validation In-Reply-To: References: <28313714.4041180430143366.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <465C6349.7070604@pettichord.com> Message-ID: <465C7D5F.6030306@pettichord.com> Paul Rogers wrote: > Im sure there is code in the set method to limit it to the max size - did it somehow get broken? > > It's certainly possible. We don't have any unit tests for this feature, and the code supporting it is wrapped in a begin/rescue block. So if it fails, it would fail silently. Bret From paul.rogers at shaw.ca Tue May 29 20:04:31 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 29 May 2007 18:04:31 -0600 Subject: [Wtr-general] maxLength Validation In-Reply-To: <465C6349.7070604@pettichord.com> References: <28313714.4041180430143366.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <465C6349.7070604@pettichord.com> Message-ID: I opened jira 157 and added a patch for the unit test and html I'll try and take a look at the set method itself later on ----- Original Message ----- From: Bret Pettichord Date: Tuesday, May 29, 2007 11:30 am Subject: Re: [Wtr-general] maxLength Validation > Fletch wrote: > > I have been looking for a solution to this problem, and was > wondering if anyone could give me some advice. > > I noticed yesterday that WATIR did not pay any attention to the > maxLength of the text_field. > > > > I have tried using name.set("abc") and name.value = "abc" but > both are still going over the allowed limit. > > > > The solution that I have come up with (and it is not a good > solution) is to truncate the name. > > > > nameSize = name.size > > maxSize = frame.text_field(:name, 'Name').maxLength > > if (vinSize > maxSize) > > puts("Bigger than maxLength - #{vinSize} -- #{maxSize}") > > name = name[0, maxSize] > > end > > > > This does the job in so far as the maxLength limits are > observed, but is there a better solution to the problem? > > > > > This has been a frequently mentioned problem. I think we should > consider > it a defect in Watir. Please go ahead and open a Jira ticket on > it, and > we can go ahead and fix it. > > The TextField#set method should limit to max length automatically. > > Bret > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From manish at gslab.com Tue May 29 22:08:24 2007 From: manish at gslab.com (Manish Sapariya) Date: Wed, 30 May 2007 07:38:24 +0530 Subject: [Wtr-general] Automating gmail: nor click on "Compose Mail", neither fire_event works In-Reply-To: References: <465AB2B7.5080600@gslab.com> <465C1DA3.5090102@gslab.com> Message-ID: <465CDC98.9060701@gslab.com> ?eljko Filipin wrote: > Are you working for Google, or are you automating Gmail for some other > reason. I am asking because, if you work for Google, you could ask > developers how to click Compose Mail link. I am really interested to > know the answer. Another workaround would be to switch to "basic HTML" > view, I guess there is no magic there. No, I dont work for google, and I don't have access to the internals, and thats what I am trying to understand. As I mentioned in my mail, I have work around even in the Ajax'ed gmail, but I am sure there will be something else coming up in my way. I need to drive the Ajax'ed gmail and hence all the effort. Anyways, thanks for all the pointers. I shall keep the list updated. Regards, Manish From paul.rogers at shaw.ca Wed May 30 00:05:06 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 29 May 2007 22:05:06 -0600 Subject: [Wtr-general] maxLength Validation References: <28313714.4041180430143366.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <465C6349.7070604@pettichord.com> Message-ID: <009701c7a26f$b4eb7d70$6400a8c0@laptop> I added the patch for watir.rb to the jira ticket Paul ----- Original Message ----- From: "Paul Rogers" To: Sent: Tuesday, May 29, 2007 6:04 PM Subject: Re: [Wtr-general] maxLength Validation >I opened jira 157 and added a patch for the unit test and html > I'll try and take a look at the set method itself later on > > ----- Original Message ----- > From: Bret Pettichord > Date: Tuesday, May 29, 2007 11:30 am > Subject: Re: [Wtr-general] maxLength Validation > >> Fletch wrote: >> > I have been looking for a solution to this problem, and was >> wondering if anyone could give me some advice. >> > I noticed yesterday that WATIR did not pay any attention to the >> maxLength of the text_field. >> > >> > I have tried using name.set("abc") and name.value = "abc" but >> both are still going over the allowed limit. >> > >> > The solution that I have come up with (and it is not a good >> solution) is to truncate the name. >> > >> > nameSize = name.size >> > maxSize = frame.text_field(:name, 'Name').maxLength >> > if (vinSize > maxSize) >> > puts("Bigger than maxLength - #{vinSize} -- #{maxSize}") >> > name = name[0, maxSize] >> > end >> > >> > This does the job in so far as the maxLength limits are >> observed, but is there a better solution to the problem? >> > >> > >> This has been a frequently mentioned problem. I think we should >> consider >> it a defect in Watir. Please go ahead and open a Jira ticket on >> it, and >> we can go ahead and fix it. >> >> The TextField#set method should limit to max length automatically. >> >> Bret >> _______________________________________________ >> 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 Wed May 30 01:33:46 2007 From: forum-watir-users at openqa.org (sapna) Date: Wed, 30 May 2007 00:33:46 CDT Subject: [Wtr-general] How to give the next line b/w the sentences for window text. In-Reply-To: Message-ID: <23788219.271180503257059.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks a lot Zeljko that's exactly I wanted and It's working for me. From forum-watir-users at openqa.org Wed May 30 01:35:01 2007 From: forum-watir-users at openqa.org (sapna) Date: Wed, 30 May 2007 00:35:01 CDT Subject: [Wtr-general] How to get the all the content of list box into variable In-Reply-To: <7523f5800705290504k5f18c166v93c103e2424a130b@mail.gmail.com> Message-ID: <23175286.341180503331196.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks a lot Zeljko this is what I was looking for. From forum-watir-users at openqa.org Wed May 30 05:46:45 2007 From: forum-watir-users at openqa.org (sapna) Date: Wed, 30 May 2007 04:46:45 CDT Subject: [Wtr-general] Fetching Today's date in the mm/dd/yyyy Message-ID: <27424601.1721180518435582.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, Can you tell me how to fetch today's date and decrement month or day or year. This is basically to test the functionality of date which must be today or in the past. Regards Sapna From angrez at gmail.com Wed May 30 06:13:31 2007 From: angrez at gmail.com (Angrez Singh) Date: Wed, 30 May 2007 15:43:31 +0530 Subject: [Wtr-general] Fetching Today's date in the mm/dd/yyyy In-Reply-To: <27424601.1721180518435582.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <27424601.1721180518435582.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi, You can refer to following link for more details on how to format date. http://www.ruby.ch/ProgrammingRuby/htmlC/ref_c_time.html#strftime - Angrez On 5/30/07, sapna wrote: > > Hi, > > Can you tell me how to fetch today's date and decrement month or day or > year. This is basically to test the functionality of date which must be > today or in the past. > > > Regards > Sapna > _______________________________________________ > 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/20070530/c9a33f12/attachment.html From zeljko.filipin at gmail.com Wed May 30 06:23:24 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 30 May 2007 12:23:24 +0200 Subject: [Wtr-general] Fetching Today's date in the mm/dd/yyyy In-Reply-To: References: <27424601.1721180518435582.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Sapna, This is how to get date formated like you need. Time.now.strftime("%m/%d/%Y") => "05/30/2007" You can get yesterdays date by subtracting seconds from current time. t = Time.now-(60*60*24) => Tue May 29 12:21:02 Central European Standard Time 2007 t.strftime("%m/%d/%Y") => "05/29/2007" Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070530/10d4a83a/attachment.html From aidy.lewis at googlemail.com Wed May 30 10:38:31 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Wed, 30 May 2007 15:38:31 +0100 Subject: [Wtr-general] instantiate a class that inherits from Test::Unit Message-ID: <7ac2300c0705300738g660a9241u5be5b618507c351e@mail.gmail.com> #Hi #Is it possible to instantiate a class that inherits from Test::Unit require 'test\unit' class Login < Test::Unit::TestCase def username;$ie.text_field(:name, 'username');end def password;$ie.text_field(:name, 'password');end def sign_in;$ie.button(:alt, /Log in/);end def check_main_screen_objects assert(self.username.exists?) assert(self.password.exists?) assert(self.sign_in.exists?) end end login = Login.new login.check_main_screen_objects #if not how can I get round this? #Aidy From forum-watir-users at openqa.org Wed May 30 11:16:05 2007 From: forum-watir-users at openqa.org (Fletch) Date: Wed, 30 May 2007 10:16:05 CDT Subject: [Wtr-general] 'Require' Lots Of Files Message-ID: <37626291.5621180538195256.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello Again All, I have created a couple of large test suites, which use LOTS of requires require 'dir/test1' require 'dir/test2' ... require 'dir/test25' In an effort to create tidier looking code, is it possible to use something like Java would have to import, or 'require' all the files in one line. import dir.* Thanks, Fletch. From paul.rogers at shaw.ca Wed May 30 11:21:28 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 30 May 2007 09:21:28 -0600 Subject: [Wtr-general] 'Require' Lots Of Files In-Reply-To: <37626291.5621180538195256.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <37626291.5621180538195256.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: I use this method: def require_files_in_dir( start_dir ) files = Dir[ start_dir] files.each do |f| require f end end ----- Original Message ----- From: Fletch Date: Wednesday, May 30, 2007 9:16 am Subject: [Wtr-general] 'Require' Lots Of Files > Hello Again All, > > I have created a couple of large test suites, which use LOTS of > requires > require 'dir/test1' > require 'dir/test2' > ... > require 'dir/test25' > > In an effort to create tidier looking code, is it possible to use > something like Java would have to import, or 'require' all the > files in one line. > > import dir.* > > Thanks, > > Fletch. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Wed May 30 11:39:02 2007 From: forum-watir-users at openqa.org (Fletch) Date: Wed, 30 May 2007 10:39:02 CDT Subject: [Wtr-general] 'Require' Lots Of Files In-Reply-To: Message-ID: <33556232.6331180539572589.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for the reply - not to sound silly at all, but where do I put this method? All the require files normally go at the top of the file, but I have tried putting the code everywhere I can think of and still have had no luck. -- require className def test1 end def test2 end end -- Ideally it will replace the require, but I can not obviously put a method up there (can I?). Thanks, Fletch. From paul.rogers at shaw.ca Wed May 30 11:43:05 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 30 May 2007 09:43:05 -0600 Subject: [Wtr-general] 'Require' Lots Of Files In-Reply-To: <33556232.6331180539572589.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <33556232.6331180539572589.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: def require_files_in_dir .... end require_files_in_dir( 'c:\') require_files_in_dir( 'c:\temp') ----- Original Message ----- From: Fletch Date: Wednesday, May 30, 2007 9:39 am Subject: Re: [Wtr-general] 'Require' Lots Of Files > Thanks for the reply - not to sound silly at all, but where do I > put this method? > > All the require files normally go at the top of the file, but I > have tried putting the code everywhere I can think of and still > have had no luck. > > -- > > require > > className > def test1 > end > def test2 > end > end > > -- > > Ideally it will replace the require, but I can not obviously put a > method up there (can I?). > > Thanks, > > Fletch. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Wed May 30 11:46:25 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 30 May 2007 09:46:25 -0600 Subject: [Wtr-general] 'Require' Lots Of Files In-Reply-To: <33556232.6331180539572589.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <33556232.6331180539572589.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: just saw your other question.. doing def some_method end def some_other_method end class Foo end class Foo2 end makes the some_method and some_other_method accessable to all - what ruby does is adds them to class Object, which is the super class of everything - you can see this by doing the following in irb def x ; puts 'x'; end Object.instance_methods Paul ----- Original Message ----- From: Fletch Date: Wednesday, May 30, 2007 9:39 am Subject: Re: [Wtr-general] 'Require' Lots Of Files > Thanks for the reply - not to sound silly at all, but where do I > put this method? > > All the require files normally go at the top of the file, but I > have tried putting the code everywhere I can think of and still > have had no luck. > > -- > > require > > className > def test1 > end > def test2 > end > end > > -- > > Ideally it will replace the require, but I can not obviously put a > method up there (can I?). > > Thanks, > > Fletch. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Wed May 30 11:59:56 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 30 May 2007 09:59:56 -0600 Subject: [Wtr-general] 'Require' Lots Of Files In-Reply-To: References: <33556232.6331180539572589.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: actually it seems you have to use it like this require_files_in_dir( 'c:\*.rb') ----- Original Message ----- From: Paul Rogers Date: Wednesday, May 30, 2007 9:43 am Subject: Re: [Wtr-general] 'Require' Lots Of Files > > def require_files_in_dir > .... > end > > require_files_in_dir( 'c:\') > require_files_in_dir( 'c:\temp') > > > > ----- Original Message ----- > From: Fletch > Date: Wednesday, May 30, 2007 9:39 am > Subject: Re: [Wtr-general] 'Require' Lots Of Files > > > Thanks for the reply - not to sound silly at all, but where do I > > put this method? > > > > All the require files normally go at the top of the file, but I > > have tried putting the code everywhere I can think of and still > > have had no luck. > > > > -- > > > > require > > > > className > > def test1 > > end > > def test2 > > end > > end > > > > -- > > > > Ideally it will replace the require, but I can not obviously put > a > > method up there (can I?). > > > > Thanks, > > > > Fletch. > > _______________________________________________ > > 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 Wed May 30 12:07:41 2007 From: forum-watir-users at openqa.org (Fletch) Date: Wed, 30 May 2007 11:07:41 CDT Subject: [Wtr-general] 'Require' Lots Of Files In-Reply-To: Message-ID: <30479463.6581180541291438.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks, I still can not get it sorted. My methods are set up in a (java style) static context - FILENAME.methodName, and when I use the method for the requires, I am getting an uninitialized constant error message. From forum-watir-users at openqa.org Wed May 30 12:30:22 2007 From: forum-watir-users at openqa.org (Bach Le) Date: Wed, 30 May 2007 11:30:22 CDT Subject: [Wtr-general] 'Require' Lots Of Files In-Reply-To: <37626291.5621180538195256.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <37944876.6651180542652069.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> What I do is if I have to require a certain set of files repeatedly, I just place it in another .rb file and require that .rb file which will in turn require all of the files you need. So I would define a file called requirements.rb and then inside that file place require 'xxxxx' require 'yyyyy' require 'zzzzz' and in the ruby script i'm running, put require 'requirements.rb' or something that way you don't require files you don't need From forum-watir-users at openqa.org Wed May 30 12:54:18 2007 From: forum-watir-users at openqa.org (Mark) Date: Wed, 30 May 2007 11:54:18 CDT Subject: [Wtr-general] Count checked checkbox In-Reply-To: Message-ID: <38076355.6731180544090207.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> an alternative could be: irb> ie.form(:index, 1).checkboxes.find_all{|checkbox| checkbox.checked?} From charley.baker at gmail.com Wed May 30 13:37:53 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 30 May 2007 11:37:53 -0600 Subject: [Wtr-general] instantiate a class that inherits from Test::Unit In-Reply-To: <7ac2300c0705300738g660a9241u5be5b618507c351e@mail.gmail.com> References: <7ac2300c0705300738g660a9241u5be5b618507c351e@mail.gmail.com> Message-ID: Hi Aidy, You can mix in the assertions if that's all you're looking for: On 5/30/07, aidy lewis wrote: > > #Hi > #Is it possible to instantiate a class that inherits from Test::Unit > > require 'test\unit\assertions' > class Login #< Test::Unit::TestCase include Test::Unit::Assertions > > > def username;$ie.text_field(:name, 'username');end > def password;$ie.text_field(:name, 'password');end > def sign_in;$ie.button(:alt, /Log in/);end > > def check_main_screen_objects > assert(self.username.exists?) > assert(self.password.exists?) > assert(self.sign_in.exists?) > end > > end > > login = Login.new > login.check_main_screen_objects > > > #if not how can I get round this? > > #Aidy > _______________________________________________ > 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/20070530/6442321c/attachment.html From clayg at yahoo-inc.com Wed May 30 13:44:12 2007 From: clayg at yahoo-inc.com (Clayton John Givens) Date: Wed, 30 May 2007 13:44:12 -0400 Subject: [Wtr-general] 'Require' Lots Of Files In-Reply-To: <37944876.6651180542652069.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <37626291.5621180538195256.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <37944876.6651180542652069.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <39B566E555954E4BBD34718E06A9A42502650138@NYC-EXVS01.ds.corp.yahoo.com> Why not put all those files into a gem? -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bach Le Sent: Wednesday, May 30, 2007 10:30 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] 'Require' Lots Of Files What I do is if I have to require a certain set of files repeatedly, I just place it in another .rb file and require that .rb file which will in turn require all of the files you need. So I would define a file called requirements.rb and then inside that file place require 'xxxxx' require 'yyyyy' require 'zzzzz' and in the ruby script i'm running, put require 'requirements.rb' or something that way you don't require files you don't need _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From forum-watir-users at openqa.org Wed May 30 15:01:55 2007 From: forum-watir-users at openqa.org (Fanny) Date: Wed, 30 May 2007 14:01:55 CDT Subject: [Wtr-general] How click on save button in file download In-Reply-To: Message-ID: <26143493.671180551745688.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I'm having the same problem and I was wondering if anybody had found a solution. My program works well until I click on the download button, and then the popup window for saving shows up. It keeps running but doesn't click on the save button. I tried the previous code, but it doesn't work... ie.button(:value, "Download File").click autoit = WIN32OLE.new("AutoItX3.Control") autoit.WinWait("File Download", "", 5) autoit.ControlClick("File Download", "", "Save") autoit.WinWait("Save As", "Save &in", 5) autoit.ControlSetText("Save As", "Save &in", "Edit1", "path\filename.ext") autoit.ControlClick("Save As", "Save &in", "Save") Is there something to download to be able to use it in watir? Can I just include this in my other coding, or do I need to run it aside? Satine From bret at pettichord.com Wed May 30 15:23:59 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 30 May 2007 14:23:59 -0500 Subject: [Wtr-general] 'Require' Lots Of Files In-Reply-To: <37626291.5621180538195256.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <37626291.5621180538195256.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <465DCF4F.5050603@pettichord.com> Fletch wrote: > I have created a couple of large test suites, which use LOTS of requires > > require 'dir/test1' > require 'dir/test2' > ... > require 'dir/test25' > > In an effort to create tidier looking code, is it possible to use something like Java would have to import, or 'require' all the files in one line. > > import dir.* > Replace your require's with this: Dir['dir/*.rb'].each{|x| require x} From bret at pettichord.com Wed May 30 15:26:09 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 30 May 2007 14:26:09 -0500 Subject: [Wtr-general] instantiate a class that inherits from Test::Unit In-Reply-To: <7ac2300c0705300738g660a9241u5be5b618507c351e@mail.gmail.com> References: <7ac2300c0705300738g660a9241u5be5b618507c351e@mail.gmail.com> Message-ID: <465DCFD1.7070204@pettichord.com> aidy lewis wrote: > #Is it possible to instantiate a class that inherits from Test::Unit > Yes it is. Why do you ask? Did you try this and run into trouble? What kind of trouble? From bret at pettichord.com Wed May 30 23:27:10 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 30 May 2007 22:27:10 -0500 Subject: [Wtr-general] Microsoft Support for Ruby Message-ID: <465E408E.3030304@pettichord.com> Some of you may have seen some of the recent announcements from Microsoft regarding their plans to support Ruby in the .Net environment. This is an excellent post that analyzes the impact that this may have: http://martinfowler.com/bliki/RubyMicrosoft.html Bret From forum-watir-users at openqa.org Thu May 31 01:20:02 2007 From: forum-watir-users at openqa.org (kumari) Date: Thu, 31 May 2007 00:20:02 CDT Subject: [Wtr-general] Not able to find the title of newly opened window. Message-ID: <31585769.5831180588832842.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi when i click on a table.the table opens a new window with a title which was not there in table.so i am facing a problem to identify the new window title.How can i get the TITLE of window ? as i may not click on same table all the time. From manish at gslab.com Thu May 31 02:48:36 2007 From: manish at gslab.com (Manish Sapariya) Date: Thu, 31 May 2007 12:18:36 +0530 Subject: [Wtr-general] How click on save button in file download In-Reply-To: <26143493.671180551745688.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <26143493.671180551745688.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <465E6FC4.20908@gslab.com> You need to invoke following two code snippets in two different thread/process. i.e. You spawn new thread/process and invoke the click handler code and then in the main thread execute the click code. ===click code=== > > ie.button(:value, "Download File").click > > ====click handler code===== > autoit = WIN32OLE.new("AutoItX3.Control") > autoit.WinWait("File Download", "", 5) > autoit.ControlClick("File Download", "", "Save") > autoit.WinWait("Save As", "Save &in", 5) > autoit.ControlSetText("Save As", "Save &in", "Edit1", "path\filename.ext") > autoit.ControlClick("Save As", "Save &in", "Save") > Look at the javascript dialog handling tests in the watir unit-tests sample & and WindowHelper.rb in the watir source, to figure out how exactly this code works. Hope this helps. Regards, Manish From aidy.lewis at googlemail.com Thu May 31 03:20:30 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Thu, 31 May 2007 08:20:30 +0100 Subject: [Wtr-general] instantiate a class that inherits from Test::Unit In-Reply-To: <465DCFD1.7070204@pettichord.com> References: <7ac2300c0705300738g660a9241u5be5b618507c351e@mail.gmail.com> <465DCFD1.7070204@pettichord.com> Message-ID: <7ac2300c0705310020m4c450855ubcb1476ce1994e4e@mail.gmail.com> On 30/05/07, Bret Pettichord wrote: > aidy lewis wrote: > > #Is it possible to instantiate a class that inherits from Test::Unit > > > Yes it is. Why do you ask? Did you try this and run into trouble? What > kind of trouble? Hi Bret, If I write this require 'test\unit' class Login < Test::Unit::TestCase end login = Login.new I receive 'in `initialize': wrong number of arguments (0 for 1) (ArgumentError)' Cheers Aidy From forum-watir-users at openqa.org Thu May 31 03:47:19 2007 From: forum-watir-users at openqa.org (Fletch) Date: Thu, 31 May 2007 02:47:19 CDT Subject: [Wtr-general] 'Require' Lots Of Files In-Reply-To: <465DCF4F.5050603@pettichord.com> Message-ID: <32836420.7541180597669805.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> That did the trick. Thanks. Fletch. From shalinigupta2006 at gmail.com Thu May 31 04:10:07 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 31 May 2007 13:40:07 +0530 Subject: [Wtr-general] how to count the no of link in a datatable Message-ID: <7523f5800705310110n7988a1a7radccf17bcbbede01@mail.gmail.com> hi, i want to count no of links. in my project there is a data table ,which contains some links.i want to coun the links.. here is the HTML.
    List of objects that violate the largest number of programming rules. Click on the hyperlinks below for more details about the object.
    Object Name Object Full Name Violation Count New in Top 10? Changed count?
    CASTSERVER.CASTPUBS_SHIKHA..CreateSale 9 No No
    CASTSERVER.CASTPUBS_SHIKHA..CallCreateSale 7 No No
    CASTSERVER.CASTPUBS_SHIKHA..DeliverOrder 7 No No
    DeliverOrderLine CASTSERVER.CASTPUBS_SHIKHA..DeliverOrderLine 7 No No
    [C:\cast_source_code\casta\rsc\clia\clia_ms2k\MS2K\Cobol].TEST6 6 No No
    CreateNewOrderLine CASTSERVER.CASTPUBS_SHIKHA..CreateNewOrderLine 6 No No
    IM NOT ABLE TO TRY ANY THING..AS I DONT HAVE ANY CLUE. Regards shalini gupta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070531/a4f23d3e/attachment-0001.html From zeljko.filipin at gmail.com Thu May 31 04:21:46 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 31 May 2007 10:21:46 +0200 Subject: [Wtr-general] how to count the no of link in a datatable In-Reply-To: <7523f5800705310110n7988a1a7radccf17bcbbede01@mail.gmail.com> References: <7523f5800705310110n7988a1a7radccf17bcbbede01@mail.gmail.com> Message-ID: Hi Shalini, Try this. links_in_table = 0 => 0 ie.table(:index, 1).links.each { links_in_table += 1 } => 0 links_in_table => 2 Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070531/b7ded22b/attachment.html From shalinigupta2006 at gmail.com Thu May 31 05:02:16 2007 From: shalinigupta2006 at gmail.com (SHALINI GUPTA) Date: Thu, 31 May 2007 14:32:16 +0530 Subject: [Wtr-general] how to count the no of link in a datatable In-Reply-To: References: <7523f5800705310110n7988a1a7radccf17bcbbede01@mail.gmail.com> Message-ID: <7523f5800705310202n79ae06c8s408b382fe9e953e0@mail.gmail.com> On 5/31/07, ?eljko Filipin wrote: > > Hi Shalini, > > Try this. > > links_in_table = 0 > => 0 > > ie.table(:index, 1).links.each { links_in_table += 1 } > => 0 > > links_in_table > => 2 > > Zeljko > -- > ZeljkoFilipin.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/20070531/efe9d200/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: CAST AD Governance Dashboard - Details on-correct.zip Type: application/zip Size: 8461 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20070531/efe9d200/attachment.zip From aidy.lewis at googlemail.com Thu May 31 06:24:24 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Thu, 31 May 2007 11:24:24 +0100 Subject: [Wtr-general] count number of indexes on a page Message-ID: <7ac2300c0705310324q90d7b4fr17a82cd0cbff40aa@mail.gmail.com> Hi, Does anyone know how to count the number of indexes on a page? Thanks Aidy From forum-watir-users at openqa.org Thu May 31 06:43:15 2007 From: forum-watir-users at openqa.org (vijay) Date: Thu, 31 May 2007 05:43:15 CDT Subject: [Wtr-general] A query on Wa