From chaya_b_s at yahoo.co.in Mon Jan 2 00:46:57 2006 From: chaya_b_s at yahoo.co.in (chaya shetty) Date: Mon, 2 Jan 2006 05:46:57 +0000 (GMT) Subject: [Wtr-general] Is there way to find out the parent nodes and child nodes of a tree structure in watir? Message-ID: <20060102054657.59905.qmail@web8314.mail.in.yahoo.com> Hi, The application under test has got a tree structure. I want to write a test case which invovles navigating through the tree structure and verifying whether the correct screen is displayed when the corresponding link is clicked. I am able to navigate through the tree structure by using the link index.I am retrieving the innertext of the link and then verifying whether that text is present on the other frame. The code that I am using is link_index = 1 while(ie.frame(:index,tree_frame_index).link(:index,link_index).exists?) link_text = ie.frame(:index,tree_frame_index).link(:index,link_index).innerText ie.frame(:index,tree_frame_index).link(:index,link_index).click if $ie.frame(:index,text_frame_index).contains_text(link_text) puts "Test passed" else puts "Test failed" end link_index = link_index + 1 end Here the text of the child nodes are same for all the parent nodes. How do I know whether the text displayed of the child node belongs to the corresponding parent node? Is there way by which we can find out the parent nodes and child nodes of a tree structure in watir? Send instant messages to your online friends http://in.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060102/ff7d5cd5/attachment.html From amithashettyb at yahoo.co.in Mon Jan 2 00:55:51 2006 From: amithashettyb at yahoo.co.in (Amitha Shetty) Date: Mon, 2 Jan 2006 05:55:51 +0000 (GMT) Subject: [Wtr-general] How can I open and attach file using file_field method? Message-ID: <20060102055551.20258.qmail@web8510.mail.in.yahoo.com> Hi, How can I open and attach file using file_field method? when I try, ie.file_field(:id,'uploaded_file').set('C:\file.txt') I get "choose file"-window open .It waits for me, to choose a file and click "open" or whatever the button is called) , after that it continues normally, by submitting the file_field content. Why doesn't he choose a file by himself?How do I handle this? I have ensured that there is no space in the path and the file exists in C: ) I get the same error when I run filefield_test in Unittests in watir folder. Thanks, Amitha Send instant messages to your online friends http://in.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060102/5d9decee/attachment.html From Mark_Cain at rl.gov Tue Jan 3 13:53:22 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Tue, 3 Jan 2006 10:53:22 -0800 Subject: [Wtr-general] How can I open and attach file using file_fieldmethod? Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D4D8@EX5V.rl.gov> You could try something like-you will need to tweak it to work for your application: $path = "C\:\\watir_bonus\\working\\Approach.doc" $ie.frame(:index, 5).file_field(:id, "fileName").set("#{$path}") $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinWait("Choose file", "Do you want to open or save this file?", 3) $autoit.WinActivate("Choose file") $autoit.WinWait("Choose file", "Look &in", 3) $autoit.ControlSetText("Choose file", "", "Edit1", "#{$path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.frame(:index, 5).button(:name, "submitLinkManagerForm").click --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Amitha Shetty Sent: Sunday, January 01, 2006 9:56 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] How can I open and attach file using file_fieldmethod? Hi, How can I open and attach file using file_field method? when I try, ie.file_field(:id,'uploaded_file').set('C:\file.txt') I get "choose file"-window open .It waits for me, to choose a file and click "open" or whatever the button is called) , after that it continues normally, by submitting the file_field content. Why doesn't he choose a file by himself?How do I handle this? I have ensured that there is no space in the path and the file exists in C: ) I get the same error when I run filefield_test in Unittests in watir folder. Thanks, Amitha Send instant messages to your online friends http://in.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060103/4aa49f61/attachment.html From roy_sin at yahoo.com Tue Jan 3 20:42:34 2006 From: roy_sin at yahoo.com (Roy Sin) Date: Tue, 3 Jan 2006 17:42:34 -0800 (PST) Subject: [Wtr-general] my existing scripts give LoadError after I installed the latest tarball Message-ID: <20060104014234.8527.qmail@web52903.mail.yahoo.com> Hi Wtr, I used to have my watir installation in c:\Program files\watir. I downloaded the latest tarball because I want to use the xpath feature. I installed it under c:\watir. I can cd to unittests folder and run the sample rb files. But when I tried to run my existing scripts in eclipse I get the error below: C:/Program Files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__': No such file to load -- setup (LoadError) from C:/Program Files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require' from C:/TestAutomation/workspace/QA_TestAutomation/gmmsunittests_Staging/logintoRP.rb:9 any idea! __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From bret at pettichord.com Tue Jan 3 22:46:07 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 3 Jan 2006 21:46:07 -0600 Subject: [Wtr-general] my existing scripts give LoadError after I installed the latest tarball In-Reply-To: <20060104014234.8527.qmail@web52903.mail.yahoo.com> References: <20060104014234.8527.qmail@web52903.mail.yahoo.com> Message-ID: The problem is on line 9 of loginRP.rb. What code is on that line? On 1/3/06, Roy Sin wrote: > > Hi Wtr, > > I used to have my watir installation in c:\Program > files\watir. I downloaded the latest tarball because I want > to use the xpath feature. I installed it under c:\watir. I > can cd to unittests folder and run the sample rb files. But > when I tried to run my existing scripts in eclipse I get > the error below: > > > C:/Program > Files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > `require__': No such file to load -- setup (LoadError) > from C:/Program > Files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > `require' > from > > C:/TestAutomation/workspace/QA_TestAutomation/gmmsunittests_Staging/logintoRP.rb:9 > > > any idea! > > > > __________________________________________ > Yahoo! DSL ? Something to write home about. > Just $16.99/mo. or less. > dsl.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/20060103/e9a0fd16/attachment.html From ChintakrindiMeghana at managementdynamics.com Wed Jan 4 08:45:11 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Wed, 4 Jan 2006 08:45:11 -0500 Subject: [Wtr-general] PDF Testing using the Watir Message-ID: Hi Can we test the PDF documents using the WATIR ? If yes, can anyone explain me how to do it. Thanks Meghanath Management Dynamics, Inc. ChintakrindiMeghana at ManagementDynamics.com Phone: 240.453.6507 Cell: 240.372.6241 www.ManagementDynamics.com The information contained in this e-mail message, including any attachments, constitutes proprietary and confidential information of Management Dynamics, Inc. and is intended only for the personal and confidential use of the recipient or recipients named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender immediately by e-mail and delete the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060104/7827e527/attachment.html From Malcolm.Beaton at conchango.com Wed Jan 4 09:10:00 2006 From: Malcolm.Beaton at conchango.com (Beaton, Malcolm) Date: Wed, 4 Jan 2006 14:10:00 -0000 Subject: [Wtr-general] Keeping all global variable in a file Message-ID: Hi Ben I haven't tried Sathya Shankar's method but the one I use follows You can do this by placing them in a file and requiring it at the beginning of the script All my variables for a web site I'm testing are held in the file 'C:\RubyScripts\my\folder\setup' To load this when the script kicks off I place <> before the script body but after the <> line So the top of the script looks like this require 'watir' include Watir require 'C:\RubyScripts\my\folder\setup' # all set up Var for this script require 'C:\RubyScripts\my\folder\CustomMethods'# Custom Method Calls (You can also do this with custom methods that you will need in multiple scripts, that's what the last line is) The file 'C:\RubyScripts\my\folder\setup' is pretty much just a list of stuff like $myVar1 = A $myVar2 = 'Zebedee' $myArr1 = [1, 2, 3, 4, 5] Etc Hope this helps Malcolm Beaton Technical Consultant Conchango 'Innovative Change in Business' D +44 (0) 1784 222127 S +44 (0) 1784 222222 M +44 (0) 777 071 3121 malcolm.beaton at conchango.com http://www.conchango.com No.2 New Media Age - Top 10 Technology Agencies 2004 No.5 New Media Age - Top 20 Interactive Agencies 2004 No.3 Marketing - Top 100 New Media Agencies 2005 Winner - Best Travel Website - New Media Age 2005 Winner - Best Retail Website - British Interactive Media Association (BIMA) 2004 Winner - Information Management Business Intelligence Project of the Year 2003 Winner - Microsoft European Business Intelligence Solutions Award 2003 More awards > -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Torres, Ben (HQP) Sent: 30 December 2005 21:54 To: wtr-general at rubyforge.org Subject: [Wtr-general] Keeping all global variable in a file Hi, Can I keep all my global variables in a separate file from my script files and have several script files use these variables? If so, how? Thanks in advance, Ben _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _____________________________________________________________________ This e-mail has been scanned for viruses by MessageLabs. The information contained in this message is confidential and is intended for the addressee only. If you have received this message in error, please notify Conchango plc as soon as possible. The unauthorised use, disclosure, copying or alteration of this message is prohibited and may be unlawful. The internet cannot guarantee the integrity of this message and therefore Conchango plc will not be liable for the message if modified. Reg. Heritage House, Church Road, Egham, Surrey, TW20 9QD T 44 (0) 1784 222 222 F 44 (0) 1784 222 200 E talktous at conchango.com No. 2598884 From Malcolm.Beaton at conchango.com Wed Jan 4 12:15:04 2006 From: Malcolm.Beaton at conchango.com (Beaton, Malcolm) Date: Wed, 4 Jan 2006 17:15:04 -0000 Subject: [Wtr-general] selecting cells in Excell using activecell Message-ID: Maybe a little out of scope for this group but I am trying to write and retrieve cell data from Excel iteratively with ruby using the activecell property. Only problem is it does not seem to work. My script is basically require 'win32ole' application = WIN32OLE.new('Excel.Application') application.visible = TRUE workbook = application.Workbooks.Add(); worksheet = workbook.Worksheets(1); (1..4).each do |x| dirArray = ['North','South','East','West'] worksheet.Range('A' + (x.to_s)).value = dirArray[(x-1)] end sheet = application.activesheet sheet.activecell.offset(1,0).activate and I always get the error excell.rb:47:in `method_missing': Unknown property or method `activecell' (WIN32OLERuntimeError) Am I missing a lib or something? I can find no reference to other people having this issue Any help would be appreciated Malcolm Beaton _____________________________________________________________________ This e-mail has been scanned for viruses by MessageLabs. The information contained in this message is confidential and is intended for the addressee only. If you have received this message in error, please notify Conchango plc as soon as possible. The unauthorised use, disclosure, copying or alteration of this message is prohibited and may be unlawful. The internet cannot guarantee the integrity of this message and therefore Conchango plc will not be liable for the message if modified. Reg. Heritage House, Church Road, Egham, Surrey, TW20 9QD T 44 (0) 1784 222 222 F 44 (0) 1784 222 200 E talktous at conchango.com No. 2598884 From Mark_Cain at rl.gov Wed Jan 4 13:04:52 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Wed, 4 Jan 2006 10:04:52 -0800 Subject: [Wtr-general] selecting cells in Excell using activecell Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D4DE@EX5V.rl.gov> This you might find helpful http://rubygarden.org/ruby?ScriptingExcel Also, I was playing around with your script and this worked for me: sheet = application sheet.activecell.offset(1,0).activate --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Beaton, Malcolm Sent: Wednesday, January 04, 2006 9:15 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] selecting cells in Excell using activecell Maybe a little out of scope for this group but I am trying to write and retrieve cell data from Excel iteratively with ruby using the activecell property. Only problem is it does not seem to work. My script is basically require 'win32ole' application = WIN32OLE.new('Excel.Application') application.visible = TRUE workbook = application.Workbooks.Add(); worksheet = workbook.Worksheets(1); (1..4).each do |x| dirArray = ['North','South','East','West'] worksheet.Range('A' + (x.to_s)).value = dirArray[(x-1)] end sheet = application.activesheet sheet.activecell.offset(1,0).activate and I always get the error excell.rb:47:in `method_missing': Unknown property or method `activecell' (WIN32OLERuntimeError) Am I missing a lib or something? I can find no reference to other people having this issue Any help would be appreciated Malcolm Beaton _____________________________________________________________________ This e-mail has been scanned for viruses by MessageLabs. The information contained in this message is confidential and is intended for the addressee only. If you have received this message in error, please notify Conchango plc as soon as possible. The unauthorised use, disclosure, copying or alteration of this message is prohibited and may be unlawful. The internet cannot guarantee the integrity of this message and therefore Conchango plc will not be liable for the message if modified. Reg. Heritage House, Church Road, Egham, Surrey, TW20 9QD T 44 (0) 1784 222 222 F 44 (0) 1784 222 200 E talktous at conchango.com No. 2598884 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From roy_sin at yahoo.com Wed Jan 4 13:06:54 2006 From: roy_sin at yahoo.com (Roy Sin) Date: Wed, 4 Jan 2006 10:06:54 -0800 (PST) Subject: [Wtr-general] my existing scripts give LoadError after I installed the latest tarball In-Reply-To: Message-ID: <20060104180654.37452.qmail@web52912.mail.yahoo.com> My mistake, has nothing to do with my new installation of Watir. On line 9 was to require 'setup' which was in the same directory but I just reorganized my scripts by component/module and didn't copy the setup.rb thanks --- Bret Pettichord wrote: > The problem is on line 9 of loginRP.rb. > > What code is on that line? > > On 1/3/06, Roy Sin wrote: > > > > Hi Wtr, > > > > I used to have my watir installation in c:\Program > > files\watir. I downloaded the latest tarball because I > want > > to use the xpath feature. I installed it under > c:\watir. I > > can cd to unittests folder and run the sample rb files. > But > > when I tried to run my existing scripts in eclipse I > get > > the error below: > > > > > > C:/Program > > > Files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > > `require__': No such file to load -- setup (LoadError) > > from C:/Program > > > Files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > > `require' > > from > > > > > C:/TestAutomation/workspace/QA_TestAutomation/gmmsunittests_Staging/logintoRP.rb:9 > > > > > > any idea! > > > > > > > > __________________________________________ > > Yahoo! DSL ??? Something to write home about. > > Just $16.99/mo. or less. > > dsl.yahoo.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 > __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From Malcolm.Beaton at conchango.com Wed Jan 4 16:27:07 2006 From: Malcolm.Beaton at conchango.com (Beaton, Malcolm) Date: Wed, 4 Jan 2006 21:27:07 -0000 Subject: [Wtr-general] selecting cells in Excell using activecell Message-ID: THANK YOU MARK Works a treat Now excuse my ignorance but why does <> work but <> not work? My experience with Applescript suggests I was in the wrong object but the ruby objects still confuse me a little Malcolm Beaton -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: 04 January 2006 18:05 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] selecting cells in Excell using activecell This you might find helpful http://rubygarden.org/ruby?ScriptingExcel Also, I was playing around with your script and this worked for me: sheet = application sheet.activecell.offset(1,0).activate --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Beaton, Malcolm Sent: Wednesday, January 04, 2006 9:15 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] selecting cells in Excell using activecell Maybe a little out of scope for this group but I am trying to write and retrieve cell data from Excel iteratively with ruby using the activecell property. Only problem is it does not seem to work. My script is basically require 'win32ole' application = WIN32OLE.new('Excel.Application') application.visible = TRUE workbook = application.Workbooks.Add(); worksheet = workbook.Worksheets(1); (1..4).each do |x| dirArray = ['North','South','East','West'] worksheet.Range('A' + (x.to_s)).value = dirArray[(x-1)] end sheet = application.activesheet sheet.activecell.offset(1,0).activate and I always get the error excell.rb:47:in `method_missing': Unknown property or method `activecell' (WIN32OLERuntimeError) Am I missing a lib or something? I can find no reference to other people having this issue Any help would be appreciated Malcolm Beaton _____________________________________________________________________ This e-mail has been scanned for viruses by MessageLabs. The information contained in this message is confidential and is intended for the addressee only. If you have received this message in error, please notify Conchango plc as soon as possible. The unauthorised use, disclosure, copying or alteration of this message is prohibited and may be unlawful. The internet cannot guarantee the integrity of this message and therefore Conchango plc will not be liable for the message if modified. Reg. Heritage House, Church Road, Egham, Surrey, TW20 9QD T 44 (0) 1784 222 222 F 44 (0) 1784 222 200 E talktous at conchango.com No. 2598884 _______________________________________________ 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 _____________________________________________________________________ This e-mail has been scanned for viruses by MessageLabs. The information contained in this message is confidential and is intended for the addressee only. If you have received this message in error, please notify Conchango plc as soon as possible. The unauthorised use, disclosure, copying or alteration of this message is prohibited and may be unlawful. The internet cannot guarantee the integrity of this message and therefore Conchango plc will not be liable for the message if modified. Reg. Heritage House, Church Road, Egham, Surrey, TW20 9QD T 44 (0) 1784 222 222 F 44 (0) 1784 222 200 E talktous at conchango.com No. 2598884 From David.J.Solis at wellsfargo.com Wed Jan 4 16:42:29 2006 From: David.J.Solis at wellsfargo.com (David.J.Solis at wellsfargo.com) Date: Wed, 4 Jan 2006 15:42:29 -0600 Subject: [Wtr-general] Navigating in JavaScript popup Message-ID: <493148DCF171954FBBF8E8AAB261638C0574CC@msgswbmnmsp35.wellsfargo.com> I have a java calendar in my web app that when selecting a date from the calendar pre-fills a text box. The text box is read only. I can't write to the text box because of the read only restriction so I'm forced to have to click on a button to invoke the calendar and select a date. When a date is clicked on the calendar, the text box populates and the calendar closes automatically. Any ideas on how to navigate and select objects in the popup? Here is a snippet of the code I'm automating. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060104/92de54f6/attachment.html From roy_sin at yahoo.com Wed Jan 4 17:29:50 2006 From: roy_sin at yahoo.com (Roy Sin) Date: Wed, 4 Jan 2006 14:29:50 -0800 (PST) Subject: [Wtr-general] assert_match question Message-ID: <20060104222950.37435.qmail@web52906.mail.yahoo.com> Hi Wtr, I have a begin end as shown below where I do an assert_match to see if the html match a string variable that I stored as greenStopTime = '12:26PM to 12:29PM' -------- begin assert_match(greenStopTime, $ie.frame("cpmain").html.to_s) puts("4 min Stop duration TEST PASSED\n") rescue => e puts("TEST FAILED Didn't find the 4 min stop. " + e.message + "\n") end -------- TEST FAILED Didn't find the 4 min stop. undefined method `html' for # I'm getting an undefined method for html. I believe i require all the files i need. Any idea! thks __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From bret at pettichord.com Wed Jan 4 19:40:52 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 4 Jan 2006 18:40:52 -0600 Subject: [Wtr-general] Navigating in JavaScript popup In-Reply-To: <493148DCF171954FBBF8E8AAB261638C0574CC@msgswbmnmsp35.wellsfargo.com> References: <493148DCF171954FBBF8E8AAB261638C0574CC@msgswbmnmsp35.wellsfargo.com> Message-ID: Can you directly change its value? Thus: ie.text(:id, "barportlet{actionForm.assetDoWrittenApproval}").value = "1/1/06" Bret On 1/4/06, David.J.Solis at wellsfargo.com wrote: > > I have a java calendar in my web app that when selecting a date from the > calendar pre-fills a text box. The text box is read only. I can't write to > the text box because of the read only restriction so I'm forced to have to > click on a button to invoke the calendar and select a date. When a date is > clicked on the calendar, the text box populates and the calendar closes > automatically. Any ideas on how to navigate and select objects in the popup? > Here is a snippet of the code I'm automating. > > ="barportlet{actionForm.assetDoWrittenApproval}" value="" readonly> > onmouseover="this.className='tbBtnItemOverCalendar'" onmouseout=" > this.className='tbBtnItemOffCalendar'" onClick= > "calendar_popup('assetDoWrittenApproval')"> > > > > > > > _______________________________________________ > 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/20060104/b87dda14/attachment.html From zeljko.filipin at gmail.com Thu Jan 5 03:30:33 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Thu, 5 Jan 2006 09:30:33 +0100 Subject: [Wtr-general] assert_match question In-Reply-To: <20060104222950.37435.qmail@web52906.mail.yahoo.com> References: <20060104222950.37435.qmail@web52906.mail.yahoo.com> Message-ID: I think that your error message "undefined method `html' for Frame" means that "html" method is not defined for Frame class. Zeljko 2006/1/4, Roy Sin :> Hi Wtr,> I have a begin end as shown below where I do an> assert_match to see if the html match a string variable> that I stored as> greenStopTime = '12:26PM to 12:29PM'> --------> begin> assert_match(greenStopTime,> $ie.frame("cpmain").html.to_s)> puts("4 min Stop duration TEST PASSED\n")> rescue => e> puts("TEST FAILED Didn't find the 4 min stop. " +> e.message + "\n")> end> --------> TEST FAILED Didn't find the 4 min stop. undefined method> `html' for #>> I'm getting an undefined method for html. I believe i> require all the files i need. Any idea!>> thks>>>> __________________________________________> Yahoo! DSL ? Something to write home about.> Just $16.99/mo. or less.> dsl.yahoo.com>> _______________________________________________> Wtr-general mailing list> Wtr-general at rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general> From ChintakrindiMeghana at managementdynamics.com Thu Jan 5 06:56:18 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Thu, 5 Jan 2006 06:56:18 -0500 Subject: [Wtr-general] PDF Testing using the Watir Message-ID: Hi All Yesterday I posted a request reagarding the PDF testing using Watir. But still so far there are no responses for this thread. Once again I am asking , is it possible to use Watir for testing the PDF documents. Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Wednesday, January 04, 2006 8:45 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] PDF Testing using the Watir Hi Can we test the PDF documents using the WATIR ? If yes, can anyone explain me how to do it. Thanks Meghanath Management Dynamics, Inc. ChintakrindiMeghana at ManagementDynamics.com Phone: 240.453.6507 Cell: 240.372.6241 www.ManagementDynamics.com The information contained in this e-mail message, including any attachments, constitutes proprietary and confidential information of Management Dynamics, Inc. and is intended only for the personal and confidential use of the recipient or recipients named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender immediately by e-mail and delete the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060105/8e23544f/attachment.html From zeljko.filipin at gmail.com Thu Jan 5 07:08:58 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Thu, 5 Jan 2006 13:08:58 +0100 Subject: [Wtr-general] PDF Testing using the Watir In-Reply-To: Message-ID: <003301c611f0$cf88f380$c6e7fea9@officezg.wa> As far as I know, no. But maybe you can test pdf files using some other ruby library. Zeljko _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 05, 2006 12:56 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] PDF Testing using the Watir Hi All Yesterday I posted a request reagarding the PDF testing using Watir. But still so far there are no responses for this thread. Once again I am asking , is it possible to use Watir for testing the PDF documents. Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Wednesday, January 04, 2006 8:45 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] PDF Testing using the Watir Hi Can we test the PDF documents using the WATIR ? If yes, can anyone explain me how to do it. Thanks Meghanath Management Dynamics, Inc. ChintakrindiMeghana at ManagementDynamics.com Phone: 240.453.6507 Cell: 240.372.6241 www.ManagementDynamics.com The information contained in this e-mail message, including any attachments, constitutes proprietary and confidential information of Management Dynamics, Inc. and is intended only for the personal and confidential use of the recipient or recipients named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender immediately by e-mail and delete the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060105/71aebba5/attachment.html From chaya_b_s at yahoo.co.in Thu Jan 5 07:45:27 2006 From: chaya_b_s at yahoo.co.in (chaya shetty) Date: Thu, 5 Jan 2006 12:45:27 +0000 (GMT) Subject: [Wtr-general] How can I open and attach file using file_field method? In-Reply-To: <20060102055551.20258.qmail@web8510.mail.in.yahoo.com> Message-ID: <20060105124527.32510.qmail@web8321.mail.in.yahoo.com> Hi, I tried with path = "C\:Watir\Text.doc" ie.file_field(:value,'Value').set(#{path}) $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinActivate("Choose file") $autoit.ControlSetText("Choose file", "", "Edit1", "#{path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.button(:name, "Submit").click But the same behaviour persists. i.e. the "Choose File" window opens and waits till you manually select the file. Can't ie.file_field(:value,'Value').set(#{path}) automatically set the path? Thanks Chaya --Mark Amitha Shetty wrote: Hi, How can I open and attach file using file_field method? when I try, ie.file_field(:id,'uploaded_file').set('C:\file.txt') I get "choose file"-window open .It waits for me, to choose a file and click "open" or whatever the button is called) , after that it continues normally, by submitting the file_field content. Why doesn't he choose a file by himself?How do I handle this? I have ensured that there is no space in the path and the file exists in C: ) I get the same error when I run filefield_test in Unittests in watir folder. Thanks, Amitha Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060105/9e7bc5d0/attachment.html From Mark_Cain at rl.gov Thu Jan 5 10:24:50 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Thu, 5 Jan 2006 07:24:50 -0800 Subject: [Wtr-general] How can I open and attach file using file_fieldmethod? Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D4E5@EX5V.rl.gov> Yes, the problem is (:value, 'Value') in this line: ie.file_field(:value,'Value').set(#{path}) The file_field supports these attributes: :id, :name, :index. Do a view source and find out what the attribute values for your tag. If for some reason your developers were lazy and didn't give the tag an id or name attribute, use index. If there are more than one tag on the page the indexing starts top-most down with 1 and increments from there. Here is the usage portion for file_field from Watir.rb: # This is the main method for accessing a file field. Usually an HTML tag. # * how - symbol - how we access the field , :index, :id, :name etc # * what - string, int or re , what we are looking for, # # returns a FileField object # # Typical Usage # # ie.file_field(:id, 'up_1') # access the file upload field with an ID of up_1 # ie.file_field(:name, 'upload') # access the file upload field with a name of upload # ie.file_field(:index, 2) # access the second file upload on the page ( 1 based, so the first field is accessed with :index,1) Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of chaya shetty Sent: Thursday, January 05, 2006 4:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How can I open and attach file using file_fieldmethod? Hi, I tried with path = "C\:Watir\Text.doc" ie.file_field(:value,'Value').set(#{path}) $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinActivate("Choose file") $autoit.ControlSetText("Choose file", "", "Edit1", "#{path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.button(:name, "Submit").click But the same behaviour persists. i.e. the "Choose File" window opens and waits till you manually select the file. Can't ie.file_field(:value,'Value').set(#{path}) automatically set the path? Thanks Chaya --Mark Amitha Shetty wrote: Hi, How can I open and attach file using file_field method? when I try, ie.file_field(:id,'uploaded_file').set('C:\file.txt') I get "choose file"-window open .It waits for me, to choose a file and click "open" or whatever the button is called) , after that it continues normally, by submitting the file_field content. Why doesn't he choose a file by himself?How do I handle this? I have ensured that there is no space in the path and the file exists in C: ) I get the same error when I run filefield_test in Unittests in watir folder. Thanks, Amitha Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060105/a73ca67f/attachment.html From Carol.Haney at zsassociates.com Thu Jan 5 12:27:40 2006 From: Carol.Haney at zsassociates.com (Carol.Haney at zsassociates.com) Date: Thu, 5 Jan 2006 11:27:40 -0600 Subject: [Wtr-general] CN=Carol Haney/OU=SD/O=ZSAssociates is out of the office. Message-ID: I will be out of the office starting 01/05/2006 and will not return until 01/06/2006. I am out of the office today but checking email. From jon at pdxfishguy.com Thu Jan 5 18:20:49 2006 From: jon at pdxfishguy.com (Jon Passmore) Date: Thu, 5 Jan 2006 18:20:49 -0500 Subject: [Wtr-general] Newbie - How to get value found by searching for regular expression? Message-ID: I can verify that a value exists that matches a regular expression, but how can I return that value? example: I add a record and it returns a page with a dynamically generated ID. The value does not have any tags that will help me locate it so I have to search using a regular expression. pageContainsText(/[0-9]{8}-[0-9]/) This works great, but what do I do if I want to return that value and assign it to a variable? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060105/dacc8441/attachment.html From roy_sin at yahoo.com Thu Jan 5 19:20:27 2006 From: roy_sin at yahoo.com (Roy Sin) Date: Thu, 5 Jan 2006 16:20:27 -0800 (PST) Subject: [Wtr-general] assert_match question In-Reply-To: Message-ID: <20060106002027.30930.qmail@web52902.mail.yahoo.com> I uninstalled the latest tarball and installed Watir again from the one-click installer and ran my scripts. I didn't get the undefined method 'html' error and my scripts completed sucessfully. --- Zeljko Filipin wrote: > I think that your error message > "undefined method `html' for Frame" > means that "html" method is not defined for Frame class. > Zeljko > 2006/1/4, Roy Sin :> Hi Wtr,> I have a > begin end as shown below where I do an> assert_match to > see if the html match a string variable> that I stored > as> greenStopTime = '12:26PM to 12:29PM'> --------> > begin> assert_match(greenStopTime,> > $ie.frame("cpmain").html.to_s)> puts("4 min Stop > duration TEST PASSED\n")> rescue => e> > puts("TEST FAILED Didn't find the 4 min stop. " +> > e.message + "\n")> end> --------> TEST FAILED Didn't find > the 4 min stop. undefined method> `html' for > #>> I'm getting an undefined > method for html. I believe i> require all the files i > need. Any idea!>> thks>>>> > __________________________________________> Yahoo! DSL ??? > Something to write home about.> Just $16.99/mo. or less.> > dsl.yahoo.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 > __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From roy_sin at yahoo.com Thu Jan 5 19:21:09 2006 From: roy_sin at yahoo.com (Roy Sin) Date: Thu, 5 Jan 2006 16:21:09 -0800 (PST) Subject: [Wtr-general] assert_match question In-Reply-To: Message-ID: <20060106002109.77877.qmail@web52908.mail.yahoo.com> I uninstalled the latest tarball and installed Watir again from the one-click installer and ran my scripts. I didn't get the undefined method 'html' error and my scripts completed sucessfully. --- Zeljko Filipin wrote: > I think that your error message > "undefined method `html' for Frame" > means that "html" method is not defined for Frame class. > Zeljko > 2006/1/4, Roy Sin :> Hi Wtr,> I have a > begin end as shown below where I do an> assert_match to > see if the html match a string variable> that I stored > as> greenStopTime = '12:26PM to 12:29PM'> --------> > begin> assert_match(greenStopTime,> > $ie.frame("cpmain").html.to_s)> puts("4 min Stop > duration TEST PASSED\n")> rescue => e> > puts("TEST FAILED Didn't find the 4 min stop. " +> > e.message + "\n")> end> --------> TEST FAILED Didn't find > the 4 min stop. undefined method> `html' for > #>> I'm getting an undefined > method for html. I believe i> require all the files i > need. Any idea!>> thks>>>> > __________________________________________> Yahoo! DSL ??? > Something to write home about.> Just $16.99/mo. or less.> > dsl.yahoo.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 > __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From roy_sin at yahoo.com Thu Jan 5 20:45:25 2006 From: roy_sin at yahoo.com (Roy Sin) Date: Thu, 5 Jan 2006 17:45:25 -0800 (PST) Subject: [Wtr-general] interesting behavior of require in my TestSuite to run test cases in a sequential order... Message-ID: <20060106014526.67677.qmail@web52910.mail.yahoo.com> Hi Wtr, I have a few classes, each class is a test case for a Report and I'm trying to run them all together in a TestSuite. Here is my reports_testsuite.rb : require 'login' # run Test Cases in the order listed below require 'stopRpt_test' require 'landmarkSumRpt_test' require 'mileageSumRpt_test' ... But when i ran it, landmarkSumRpt runs first follow by mileageSumRpt , then the last one is StopRpt. I even tried to prefix with 'test1_stopRpt_test' 'test2_landmarkSumRpt_test' 'test3_mileageSumRpt_test' but still test1_stopRpt_test will run last. I also puts a text at the beginning of each of my test cases to know when each one starts but instead I get: Stop Report Test Case running... Landmark Summary Test Case running... Mileage Summary Test Case running... Loaded suite C:/TestAutomation/workspace/QA_TestAutomation/gmmsunittests_Staging/reports/reports_testsuite1 Started Has anyone experience this type of situation? thanks __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From chaya_b_s at yahoo.co.in Fri Jan 6 00:26:51 2006 From: chaya_b_s at yahoo.co.in (chaya shetty) Date: Fri, 6 Jan 2006 05:26:51 +0000 (GMT) Subject: [Wtr-general] How can I open and attach file using file_fieldmethod? In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D4E5@EX5V.rl.gov> Message-ID: <20060106052651.76204.qmail@web8323.mail.in.yahoo.com> Hi, There is only one file field in the page and hence I tried with path = "C\:Watir\Text.doc" ie.file_field(:index,1).set(#{path}) $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinActivate("Choose file") $autoit.ControlSetText("Choose file", "", "Edit1", "#{path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.button(:name, "Submit").click But still the same behaviour was seen. The file field was accessed and the "Choose File" window opened and waited till I manually selected the file. Thanks Chaya "Cain, Mark" wrote: v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} st1\:*{behavior:url(#default#ieooui) } Yes, the problem is (:value, ?Value?) in this line: ie.file_field(:value,'Value').set(#{path}) The file_field supports these attributes: :id, :name, :index. Do a view source and find out what the attribute values for your tag. If for some reason your developers were lazy and didn?t give the tag an id or name attribute, use index. If there are more than one tag on the page the indexing starts top-most down with 1 and increments from there. Here is the usage portion for file_field from Watir.rb: # This is the main method for accessing a file field. Usually an HTML tag. # * how - symbol - how we access the field , :index, :id, :name etc # * what - string, int or re , what we are looking for, # # returns a FileField object # # Typical Usage # # ie.file_field(:id, 'up_1') # access the file upload field with an ID of up_1 # ie.file_field(:name, 'upload') # access the file upload field with a name of upload # ie.file_field(:index, 2) # access the second file upload on the page ( 1 based, so the first field is accessed with :index,1) Hope this helps, --Mark --------------------------------- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of chaya shetty Sent: Thursday, January 05, 2006 4:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How can I open and attach file using file_fieldmethod? Hi, I tried with path = "C\:Watir\Text.doc" ie.file_field(:value,'Value').set(#{path}) $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinActivate("Choose file") $autoit.ControlSetText("Choose file", "", "Edit1", "#{path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.button(:name, "Submit").click But the same behaviour persists. i.e. the "Choose File" window opens and waits till you manually select the file. Can't ie.file_field(:value,'Value').set(#{path}) automatically set the path? Thanks Chaya --Mark Amitha Shetty wrote: Hi, How can I open and attach file using file_field method? when I try, ie.file_field(:id,'uploaded_file').set('C:\file.txt') I get "choose file"-window open .It waits for me, to choose a file and click "open" or whatever the button is called) , after that it continues normally, by submitting the file_field content. Why doesn't he choose a file by himself?How do I handle this? I have ensured that there is no space in the path and the file exists in C: ) I get the same error when I run filefield_test in Unittests in watir folder. Thanks, Amitha Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060106/85401572/attachment.html From shilpa_sainani at yahoo.com Fri Jan 6 05:15:40 2006 From: shilpa_sainani at yahoo.com (Shilpa Sainani) Date: Fri, 6 Jan 2006 02:15:40 -0800 (PST) Subject: [Wtr-general] Javascript alert/confirm Message-ID: <20060106101540.16699.qmail@web51304.mail.yahoo.com> Hi, I am new to watir and its a great tool:). I need help. I am trying to use it to autoamte my web application and there are a lot of javascript alerts/confirms in the application. I have run the autoIT unittests and they run successfully. HOwever, I do not know how to make my testscript click OK on a javasscript alert which is triggered as part of the workflow. Any ideas? Thanks! __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From Mark_Cain at rl.gov Fri Jan 6 10:01:31 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Fri, 6 Jan 2006 07:01:31 -0800 Subject: [Wtr-general] How can I open and attach file usingfile_fieldmethod? Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D4EE@EX5V.rl.gov> Replace all your $autoit lines with this: $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinWait("Choose file", "Do you want to open or save this file?", 3) $autoit.WinActivate("Choose file") $autoit.WinWait("Choose file", "Look &in", 3) $autoit.ControlSetText("Choose file", "", "Edit1", "#{$path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") I don't know if it will make a difference but my script needed the WinWait's left in to work right. Also, it took a little time for autoit to find the window so don't get impatient. Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of chaya shetty Sent: Thursday, January 05, 2006 9:27 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How can I open and attach file usingfile_fieldmethod? Hi, There is only one file field in the page and hence I tried with path = "C\:Watir\Text.doc" ie.file_field(:index,1).set(#{path}) $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinActivate("Choose file") $autoit.ControlSetText("Choose file", "", "Edit1", "#{path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.button(:name, "Submit").click But still the same behaviour was seen. The file field was accessed and the "Choose File" window opened and waited till I manually selected the file. Thanks Chaya "Cain, Mark" wrote: Yes, the problem is (:value, 'Value') in this line: ie.file_field(:value,'Value').set(#{path}) ! The file_field supports these attributes: :id, :name, :index. Do a view source and find out what the attribute values for your tag. If for some reason your developers were lazy and didn't give the tag an id or name attribute, use index. If there are more than one tag on the page the indexing starts top-most down with 1 and increments from there. Here is the usage portion for file_field from Watir.rb: # This is the main me! thod for accessing a file field. Usually an HTML tag. # * how - symbol - how we access the field , :index, :id, :name etc # * what - string, int or re , what we are looking for, # # returns a FileField object # # Typical Usage # # ie.file_field(:id, 'up_1') # access the file upload field with an ID of up_1 # ie.file_field(:name, 'upload') # access the file upload field with a name of upload # ie.file_field(:index, 2) # access the second file upload on the page ( 1 based, so the first field is accessed with :index,1) Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of chaya shetty Sent: Thursday, January 05, 2006 4:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How can I open and attach file using file_fieldmethod? Hi, I tried with path = "C\:Watir\Text.doc" ie.file_field(:value,'Value').set(#{path}) $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinActivate("Choose file") $autoit.ControlSetText("Choose file", "", "Edit1", "#{path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.button(:name, "Submit").click But the same behaviour persists. i.e. the "Choose File" window opens and waits till you manually select the file. Can't ie.file_field(:value,'Value').set(#{path}) automatically set the path? Thanks Chaya --Mark Amitha Shetty wrote: Hi, How can I open and attach file using file_field method? when I try, ie.file_field(:id,'uploaded_file').set('C:\file.txt') I get "choose file"-window open .It waits for me, to choose a file and click "open" or whatever the button is called) , after that it continues normally, by submitting the file_field content. Why doesn't he choose a file by himself?How do I handle this? I have ensured that there is no space in the path and the file exists in C: ) I get the same error when I run filefield_test in Unittests in watir folder. Thanks, Amitha Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060106/fada3fd3/attachment.html From Mark_Cain at rl.gov Fri Jan 6 10:08:46 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Fri, 6 Jan 2006 07:08:46 -0800 Subject: [Wtr-general] Javascript alert/confirm Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D4EF@EX5V.rl.gov> This has worked pretty well for me. #Put this method in your script: 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 #Then call it right before you click the button (or whatever) that causes the javascript popup to display: startClicker("OK" , 3) $ie.button("Submit").click You can look at the unittest that come with the Watir package for more good examples. Hope this helps, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shilpa Sainani Sent: Friday, January 06, 2006 2:16 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Javascript alert/confirm Hi, I am new to watir and its a great tool:). I need help. I am trying to use it to autoamte my web application and there are a lot of javascript alerts/confirms in the application. I have run the autoIT unittests and they run successfully. HOwever, I do not know how to make my testscript click OK on a javasscript alert which is triggered as part of the workflow. Any ideas? Thanks! __________________________________________ Yahoo! DSL - Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From ardhazes at yahoo.com Sat Jan 7 14:21:05 2006 From: ardhazes at yahoo.com (e aldaz) Date: Sat, 7 Jan 2006 19:21:05 +0000 (GMT) Subject: [Wtr-general] Watir and Java Script onClick difficulties Message-ID: <20060107192105.78113.qmail@web51811.mail.yahoo.com> Dear All I am quite new to Ruby and Watir (but have bought and read the famous PickAke). I have had quite a lot of success using Watir on normal HTML pages, however i am having all sorts of trouble with some java script. I was wondering if someone could: 1.- Tell me where to find documentation on using watir with pages that have javascript 2.- Help me with this particular example, i need to click on a button called entrar, that appears as an image in "http://www.gruposantander.es" under "Supernet acceso particulares" From what i gather if i need to click on a button or image or link that starts some java script i need to do something like: ie.button(...).fire_event("onClick") or ie.image(...)..fire_event("onClick") etc.. However i have not been able to get the onClick that appears on the following HTML table (frow view source of the page) to fire, Transmisión segura de sus datos
personales, SSL 128 bits   Any ideas how to do it? I have tried $ie.link(:url, "#").fire_event("onClick") but I get irb(main):029:0> ie.link(:url,"#").fire_event("onClick") Watir::Exception::UnknownObjectException: Unable to locate object, using url and # I've also tried beforeText, afterText,etc.. but can't seem to get it to work Using index i can activate other links, but not this particular one Any help much appreciated ! Thanks Eduardo From mb at michaelbolton.net Sat Jan 7 15:12:36 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Sat, 7 Jan 2006 15:12:36 -0500 Subject: [Wtr-general] interesting behavior of require in my TestSuite torun test cases in a sequential order... Message-ID: <000b01c613c6$b3ad01b0$6801a8c0@Koko> Looks to me like they're running in alphabetical order. But why are you using /require/ instead of calling them? ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Roy Sin Sent: January 5, 2006 8:45 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] interesting behavior of require in my TestSuite torun test cases in a sequential order... Hi Wtr, I have a few classes, each class is a test case for a Report and I'm trying to run them all together in a TestSuite. Here is my reports_testsuite.rb : require 'login' # run Test Cases in the order listed below require 'stopRpt_test' require 'landmarkSumRpt_test' require 'mileageSumRpt_test' ... But when i ran it, landmarkSumRpt runs first follow by mileageSumRpt , then the last one is StopRpt. I even tried to prefix with 'test1_stopRpt_test' 'test2_landmarkSumRpt_test' 'test3_mileageSumRpt_test' but still test1_stopRpt_test will run last. I also puts a text at the beginning of each of my test cases to know when each one starts but instead I get: Stop Report Test Case running... Landmark Summary Test Case running... Mileage Summary Test Case running... Loaded suite C:/TestAutomation/workspace/QA_TestAutomation/gmmsunittests_Staging/reports/ reports_testsuite1 Started Has anyone experience this type of situation? thanks __________________________________________ Yahoo! DSL - Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From mb at michaelbolton.net Sat Jan 7 15:12:36 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Sat, 7 Jan 2006 15:12:36 -0500 Subject: [Wtr-general] Newbie - How to get value found by searching forregular expression? Message-ID: <000c01c613c6$b48930e0$6801a8c0@Koko> If you change the regular expression from /[0-9]{8}-[0-9]/ to /([0-9]{8}-[0-9])/ then after the match, the variable $1 will contain the contents of the matched string. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jon Passmore Sent: January 5, 2006 6:21 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Newbie - How to get value found by searching forregular expression? I can verify that a value exists that matches a regular expression, but how can I return that value? example: I add a record and it returns a page with a dynamically generated ID. The value does not have any tags that will help me locate it so I have to search using a regular expression. pageContainsText(/[0-9]{8}-[0-9]/) This works great, but what do I do if I want to return that value and assign it to a variable? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060107/858da6fe/attachment.html From mb at michaelbolton.net Sat Jan 7 15:12:36 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Sat, 7 Jan 2006 15:12:36 -0500 Subject: [Wtr-general] PDF Testing using the Watir Message-ID: <001101c613c6$b52c9cd0$6801a8c0@Koko> I don't know how to answer your question in a way that would be helpful to you; one reason that you haven't got a response may be that your question is too general to inspire an answer. What do you mean by your question? What specific problem do you want to address? What testing problem do you want Watir to help you to solve? If the question is, "can I confirm that .PDF with a given name exists at such-and-such and address", WATIR might be able to help. If the question is, "can Watir help me to ensure that the content in the PDF addresses a given user's concerns", the answer is probably no. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: January 5, 2006 6:56 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] PDF Testing using the Watir Hi All Yesterday I posted a request reagarding the PDF testing using Watir. But still so far there are no responses for this thread. Once again I am asking , is it possible to use Watir for testing the PDF documents. Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Wednesday, January 04, 2006 8:45 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] PDF Testing using the Watir Hi Can we test the PDF documents using the WATIR ? If yes, can anyone explain me how to do it. Thanks Meghanath Management Dynamics, Inc. ChintakrindiMeghana at ManagementDynamics.com Phone: 240.453.6507 Cell: 240.372.6241 www.ManagementDynamics.com The information contained in this e-mail message, including any attachments, constitutes proprietary and confidential information of Management Dynamics, Inc. and is intended only for the personal and confidential use of the recipient or recipients named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender immediately by e-mail and delete the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060107/5bdc681f/attachment.html From mb at michaelbolton.net Sat Jan 7 15:12:36 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Sat, 7 Jan 2006 15:12:36 -0500 Subject: [Wtr-general] selecting cells in Excell using activecell Message-ID: <001601c613c6$b5fdf690$6801a8c0@Koko> Hang on a sec. By assigning sheet = application, you're setting the sheet objection to the application object--which means you've lost access to the sheet object by reassigning it. If you simply said application.activecell.offset(1,0).activate you'd get the same effect, and you'd still have a sheet object. This is because ActiveCell is a property of the application, not of the workbook nor of the worksheet. You can confirm this by opening up an Excel sheet, choosing the menu bar's Tools / Macro / Visual Basic Editor, and then pressing F2 for the Object Browser. Double-click on ActiveCell and you'll see (about a third of the way up from the bottom of the screen) that it's a global property of Excel.Application. I presume this is because the authors of Excel's OLE Automation only wanted one active cell in the entire application, not one active cell per worksheet or workbook, but reading the minds of those folks is difficult. Note that none of this has anything to do with Ruby per se. They're not "the Ruby objects" here; they're OLE/COM objects. You would have encountered the same kinds of confusion were you using Visual Basic. (Lord knows I did.) One fine day, I'll write a really good Ruby-Excel interface. Don't hold your breath, though. :) ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Beaton, Malcolm Sent: January 4, 2006 4:27 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] selecting cells in Excell using activecell THANK YOU MARK Works a treat Now excuse my ignorance but why does <> work but <> not work? My experience with Applescript suggests I was in the wrong object but the ruby objects still confuse me a little Malcolm Beaton -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: 04 January 2006 18:05 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] selecting cells in Excell using activecell This you might find helpful http://rubygarden.org/ruby?ScriptingExcel Also, I was playing around with your script and this worked for me: sheet = application sheet.activecell.offset(1,0).activate --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Beaton, Malcolm Sent: Wednesday, January 04, 2006 9:15 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] selecting cells in Excell using activecell Maybe a little out of scope for this group but I am trying to write and retrieve cell data from Excel iteratively with ruby using the activecell property. Only problem is it does not seem to work. My script is basically require 'win32ole' application = WIN32OLE.new('Excel.Application') application.visible = TRUE workbook = application.Workbooks.Add(); worksheet = workbook.Worksheets(1); (1..4).each do |x| dirArray = ['North','South','East','West'] worksheet.Range('A' + (x.to_s)).value = dirArray[(x-1)] end sheet = application.activesheet sheet.activecell.offset(1,0).activate and I always get the error excell.rb:47:in `method_missing': Unknown property or method `activecell' (WIN32OLERuntimeError) Am I missing a lib or something? I can find no reference to other people having this issue Any help would be appreciated Malcolm Beaton _____________________________________________________________________ This e-mail has been scanned for viruses by MessageLabs. The information contained in this message is confidential and is intended for the addressee only. If you have received this message in error, please notify Conchango plc as soon as possible. The unauthorised use, disclosure, copying or alteration of this message is prohibited and may be unlawful. The internet cannot guarantee the integrity of this message and therefore Conchango plc will not be liable for the message if modified. Reg. Heritage House, Church Road, Egham, Surrey, TW20 9QD T 44 (0) 1784 222 222 F 44 (0) 1784 222 200 E talktous at conchango.com No. 2598884 _______________________________________________ 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 _____________________________________________________________________ This e-mail has been scanned for viruses by MessageLabs. The information contained in this message is confidential and is intended for the addressee only. If you have received this message in error, please notify Conchango plc as soon as possible. The unauthorised use, disclosure, copying or alteration of this message is prohibited and may be unlawful. The internet cannot guarantee the integrity of this message and therefore Conchango plc will not be liable for the message if modified. Reg. Heritage House, Church Road, Egham, Surrey, TW20 9QD T 44 (0) 1784 222 222 F 44 (0) 1784 222 200 E talktous at conchango.com No. 2598884 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From mb at michaelbolton.net Sat Jan 7 15:12:36 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Sat, 7 Jan 2006 15:12:36 -0500 Subject: [Wtr-general] Is there way to find the parent nodes and child nodesof a tree structure in watir? Message-ID: <001701c613c6$b6a002f0$6801a8c0@Koko> On Mon, 26 Dec 2005 05:04:31 +0000 (GMT) chaya shetty wrote: Hi, The application under test has got a tree structure. I want to write a test case which invovles navigating through the tree structure and verifying whether the correct screen is displayed when the corresponding link is clicked. I am able to navigate through the tree structure by using the link index.I am retrieving the innertext of the link and then verifying whether that text is present on the other frame. The code that I am using link_index = 1 while(ie.frame(:index,tree_frame_index).link(:index,link_index).exists?) link_text = ie.frame(:index,tree_frame_index).link(:index,link_index).innerText ie.frame(:index,tree_frame_index).link(:index,link_index).click if $ie.frame(:index,text_frame_index).contains_text(link_text) puts "Test passed" else puts "Test failed" end link_index = link_index + 1 end Here the text of the child nodes are same for all the parent nodes. How do I know whether the text displayed of the child node belongs to the corresponding parent node? How would you know this if you /weren't/ using WATIR? That is, how would you determine correctness if you were clicking on the links manually and observing with own your eyes and brain? Is there way by which we can find out the parent nodes and child nodes of a tree structure in watir? If I understand your question correctly, you should be able to walk the application's pages as you're doing above (using Watir) and build a tree structure based on hashes (and hashes of hashes) or stacks (using Ruby). But so far as I know, there's no guarantee anywhere in Web-land that a given page is the parent of another. Several pages higher in a hierarchy can be pointing to the same page lower in it; thus a page can have many "parents". Pages can be related as parents and children simultaneously. That is, in math-speak, Web sites can be viewed as graphs, but there's nothing (other than someone's mental organizing model) that says that they are trees. Moveover, neither Ruby nor Watir knows anything about what constitutes correctness. Correctness will have to come from the heuristics that you program into your tests. That's why (for example), I would change "Test passed" and "Test failed" above to "child page contains text found in link on parent page" -- I would at least make that translation in my head. I know this might not get you what you want, but I hope it clarifies things. ---Michael B. DevelopSense: Software Testing in Plain English http://www.developsense.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060107/0390d4e1/attachment.html From mb at michaelbolton.net Sat Jan 7 15:12:36 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Sat, 7 Jan 2006 15:12:36 -0500 Subject: [Wtr-general] Link that can not be found Message-ID: <001c01c613c6$b73d5460$6801a8c0@Koko> I'm resending this message because I don't believe that it ever appeared on the list. If it did, please pardon me. ---Michael B. A while back, someone wrote: > I am having the problem with the link of the following form: > Sign in > And it appears that the both lines below can not find the link to click: > ie.link(:name, "Sign in").click > ie.link(:name, "Sign in").click And someone else replied: > The portion of data you are looking at is the "text" of the link, not the name... > so, > ie.link( :text, "Sign in" ).click > should work. To which I TRIED to reply: Which actually raises an interesting point: somewhere in the Watir documentation is the notion that the easiest way to find the link is by id--the id= attribute inside the Anchor tag, which apparently is preferred under current markup language standards, or name--the name= attribute inside the Anchor tag, which is apparently deprecated. Looking by :text means that if the text on the link changes, the test breaks. The theory is that an id attribute will be changed less often than the text. That seems like a reasonable presumption in many cases. The HTML you use in your example might be part of a tutorial that you're doing, or it might be part of an application that you're testing. If the latter, you can ask the programmer nicely for more testability by asking for id attributes in the markup. I've found www.w3schools.com to be a useful resource for learning about markup language, browsers, and topics related to Web technology. Do others have similar places that they'd recommend? ---Michael B. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060107/7a805640/attachment.html From jkohl at telusplanet.net Sat Jan 7 22:02:36 2006 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Sat, 7 Jan 2006 20:02:36 -0700 Subject: [Wtr-general] PDF Testing using the Watir In-Reply-To: <001101c613c6$b52c9cd0$6801a8c0@Koko> Message-ID: <000001c613ff$fb011c20$6500a8c0@tintin> PDF::Writer is probably the tool you'd want to look at: http://ruby-pdf.rubyforge.org/index.html but it currently doesn't support reading PDF docs. That feature is planned though, hopefully it will come out sometime this year: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/152071 -Jonathan ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Michael Bolton Sent: January 7, 2006 1:13 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] PDF Testing using the Watir I don't know how to answer your question in a way that would be helpful to you; one reason that you haven't got a response may be that your question is too general to inspire an answer. What do you mean by your question? What specific problem do you want to address? What testing problem do you want Watir to help you to solve? If the question is, "can I confirm that .PDF with a given name exists at such-and-such and address", WATIR might be able to help. If the question is, "can Watir help me to ensure that the content in the PDF addresses a given user's concerns", the answer is probably no. ---Michael B. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: January 5, 2006 6:56 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] PDF Testing using the Watir Hi All Yesterday I posted a request reagarding the PDF testing using Watir. But still so far there are no responses for this thread. Once again I am asking , is it possible to use Watir for testing the PDF documents. Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Wednesday, January 04, 2006 8:45 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] PDF Testing using the Watir Hi Can we test the PDF documents using the WATIR ? If yes, can anyone explain me how to do it. Thanks Meghanath Management Dynamics, Inc. ChintakrindiMeghana at ManagementDynamics.com Phone: 240.453.6507 Cell: 240.372.6241 www.ManagementDynamics.com The information contained in this e-mail message, including any attachments, constitutes proprietary and confidential information of Management Dynamics, Inc. and is intended only for the personal and confidential use of the recipient or recipients named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender immediately by e-mail and delete the original message. From PGarigue at EXTEND.COM Sun Jan 8 00:44:04 2006 From: PGarigue at EXTEND.COM (Pierre Garigue) Date: Sun, 8 Jan 2006 00:44:04 -0500 Subject: [Wtr-general] Newbie - How to get value found by searchingforregular expression? Message-ID: the tutorial http://gnosis.cx/publish/programming/regular_expressions.html had a few other things on regular expressions but you want the Ruby the pickaxe book http://www.pixelmech.com/notebook/2005/12/programming-ruby-the-pickaxe-book/ it has a whole chapter on using regular expressions in ruby -----Original Message----- From: Michael Bolton [mailto:mb at michaelbolton.net] Sent: Sat 07-Jan-06 3:12 PM To: wtr-general at rubyforge.org Cc: Subject: Re: [Wtr-general] Newbie - How to get value found by searchingforregular expression? If you change the regular expression from /[0-9]{8}-[0-9]/ to /([0-9]{8}-[0-9])/ then after the match, the variable $1 will contain the contents of the matched string. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jon Passmore Sent: January 5, 2006 6:21 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Newbie - How to get value found by searching forregular expression? I can verify that a value exists that matches a regular expression, but how can I return that value? example: I add a record and it returns a page with a dynamically generated ID. The value does not have any tags that will help me locate it so I have to search using a regular expression. pageContainsText(/[0-9]{8}-[0-9]/) This works great, but what do I do if I want to return that value and assign it to a variable? From PGarigue at EXTEND.COM Sun Jan 8 01:01:37 2006 From: PGarigue at EXTEND.COM (Pierre Garigue) Date: Sun, 8 Jan 2006 01:01:37 -0500 Subject: [Wtr-general] Link that can not be found Message-ID: my experience is that asking for unique ID for links can work out well. What about for form items as well? Cheers Pierre Garigue -----Original Message----- From: Michael Bolton [mailto:mb at michaelbolton.net] Sent: Sat 07-Jan-06 3:12 PM To: wtr-general at rubyforge.org Cc: Subject: Re: [Wtr-general] Link that can not be found I'm resending this message because I don't believe that it ever appeared on the list. If it did, please pardon me. ---Michael B. A while back, someone wrote: > I am having the problem with the link of the following form: > Sign in > And it appears that the both lines below can not find the link to click: > ie.link(:name, "Sign in").click > ie.link(:name, "Sign in").click And someone else replied: > The portion of data you are looking at is the "text" of the link, not the name... > so, > ie.link( :text, "Sign in" ).click > should work. To which I TRIED to reply: Which actually raises an interesting point: somewhere in the Watir documentation is the notion that the easiest way to find the link is by id--the id= attribute inside the Anchor tag, which apparently is preferred under current markup language standards, or name--the name= attribute inside the Anchor tag, which is apparently deprecated. Looking by :text means that if the text on the link changes, the test breaks. The theory is that an id attribute will be changed less often than the text. That seems like a reasonable presumption in many cases. The HTML you use in your example might be part of a tutorial that you're doing, or it might be part of an application that you're testing. If the latter, you can ask the programmer nicely for more testability by asking for id attributes in the markup. I've found www.w3schools.com to be a useful resource for learning about markup language, browsers, and topics related to Web technology. Do others have similar places that they'd recommend? ---Michael B. From mb at michaelbolton.net Sun Jan 8 21:35:20 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Sun, 8 Jan 2006 21:35:20 -0500 Subject: [Wtr-general] Newbie - How to get value found bysearchingforregular expression? In-Reply-To: Message-ID: <006b01c614c5$6108b030$6801a8c0@Koko> Thanks Pierre--added to the list. If you want to master regular expressions, you may wish to check out (*ahem*) _Mastering Regular Expressions_, an O'Reilly book by Jeffrey Friedl. The first few chapters are really helpful. The later ones discuss deterministic finite-state automata and non-deterministic finite-state automata--one would have to be geekier than I to appreciate them in their fullness. Regular expressions vary a good deal from implementation to implementation, so Pierre's resources may be more immediately useful to Rubyists. ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Pierre Garigue Sent: January 8, 2006 12:44 AM To: wtr-general at rubyforge.org; wtr-general at rubyforge.org Subject: Re: [Wtr-general] Newbie - How to get value found bysearchingforregular expression? the tutorial http://gnosis.cx/publish/programming/regular_expressions.html had a few other things on regular expressions but you want the Ruby the pickaxe book http://www.pixelmech.com/notebook/2005/12/programming-ruby-the-pickaxe-book/ it has a whole chapter on using regular expressions in ruby [---Pierre Garigue, too shy to sign] -----Original Message----- From: Michael Bolton [mailto:mb at michaelbolton.net] Sent: Sat 07-Jan-06 3:12 PM To: wtr-general at rubyforge.org Cc: Subject: Re: [Wtr-general] Newbie - How to get value found by searchingforregular expression? If you change the regular expression from /[0-9]{8}-[0-9]/ to /([0-9]{8}-[0-9])/ then after the match, the variable $1 will contain the contents of the matched string. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jon Passmore Sent: January 5, 2006 6:21 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Newbie - How to get value found by searching forregular expression? I can verify that a value exists that matches a regular expression, but how can I return that value? example: I add a record and it returns a page with a dynamically generated ID. The value does not have any tags that will help me locate it so I have to search using a regular expression. pageContainsText(/[0-9]{8}-[0-9]/) This works great, but what do I do if I want to return that value and assign it to a variable? _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From zeljko.filipin at gmail.com Mon Jan 9 04:46:48 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Mon, 9 Jan 2006 10:46:48 +0100 Subject: [Wtr-general] Link that can not be found In-Reply-To: <001c01c613c6$b73d5460$6801a8c0@Koko> References: <001c01c613c6$b73d5460$6801a8c0@Koko> Message-ID: +1 for www.w3schools.com Zeljko 2006/1/7, Michael Bolton : > > I'm resending this message because I don't believe that it ever appeared on > the list. If it did, please pardon me. > > ---Michael B. > > A while back, someone wrote: > > I am having the problem with the link of the following form: > > > Sign in > > > And it appears that the both lines below can not find the link to click: > > ie.link(:name, "Sign in").click > > ie.link(:name, "Sign in").click > > And someone else replied: > > The portion of data you are looking at is the "text" of the link, not the > name... > > > so, > > > ie.link( :text, "Sign in" ).click > > > should work. > > To which I TRIED to reply: > > > Which actually raises an interesting point: somewhere in the Watir > documentation is the notion that the easiest way to find the link is by > id--the id= attribute inside the Anchor tag, which apparently is preferred > under current markup language standards, or name--the name= attribute > inside the Anchor tag, which is apparently deprecated. Looking by :text > means that if the text on the link changes, the test breaks. The theory is > that an id attribute will be changed less often than the text. That seems > like a reasonable presumption in many cases. The HTML you use in your > example might be part of a tutorial that you're doing, or it might be part > of an application that you're testing. If the latter, you can ask the > programmer nicely for more testability by asking for id attributes in the > markup. > > I've found www.w3schools.com to be a useful resource for learning about > markup language, browsers, and topics related to Web technology. Do others > have similar places that they'd recommend? > > ---Michael B. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > From Mark_Cain at rl.gov Mon Jan 9 11:24:07 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Mon, 9 Jan 2006 08:24:07 -0800 Subject: [Wtr-general] Watir and Java Script onClick difficulties Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D4F2@EX5V.rl.gov> Try this, I was able to get it to work here: def test_ClickEvent $ie.goto("http://www.gruposantander.es/") table = $ie.table(:index, 10) table[9][1].image(:src, /imagenes\/boton_entrar.gif/).fire_event("onClick") end Also, the .flash method is useful to find were you are on the page when working with indexes. table = $ie.table(:index, 10).flash Hope this helps, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of e aldaz Sent: Saturday, January 07, 2006 11:21 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Watir and Java Script onClick difficulties Dear All I am quite new to Ruby and Watir (but have bought and read the famous PickAke). I have had quite a lot of success using Watir on normal HTML pages, however i am having all sorts of trouble with some java script. I was wondering if someone could: 1.- Tell me where to find documentation on using watir with pages that have javascript 2.- Help me with this particular example, i need to click on a button called entrar, that appears as an image in "http://www.gruposantander.es" under "Supernet acceso particulares" From what i gather if i need to click on a button or image or link that starts some java script i need to do something like: ie.button(...).fire_event("onClick") or ie.image(...)..fire_event("onClick") etc.. However i have not been able to get the onClick that appears on the following HTML table (frow view source of the page) to fire, Transmisión segura de sus datos

personales, SSL 128 bits   Any ideas how to do it? I have tried $ie.link(:url, "#").fire_event("onClick") but I get irb(main):029:0> ie.link(:url,"#").fire_event("onClick") Watir::Exception::UnknownObjectException: Unable to locate object, using url and # I've also tried beforeText, afterText,etc.. but can't seem to get it to work Using index i can activate other links, but not this particular one Any help much appreciated ! Thanks Eduardo _______________________________________________ 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/20060109/44f98a63/attachment.html From ardhazes at yahoo.com Mon Jan 9 16:44:48 2006 From: ardhazes at yahoo.com (e aldaz) Date: Mon, 9 Jan 2006 21:44:48 +0000 (GMT) Subject: [Wtr-general] Watir and Java Script onClick difficulties In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D4F2@EX5V.rl.gov> Message-ID: <20060109214448.72835.qmail@web51814.mail.yahoo.com> Mark, It works great, thank you very much, i'll keep on trying with the rest now! --- "Cain, Mark" wrote: > Try this, I was able to get it to work here: > > > > def test_ClickEvent > > $ie.goto("http://www.gruposantander.es/") > > > > table = $ie.table(:index, 10) > > table[9][1].image(:src, > /imagenes\/boton_entrar.gif/).fire_event("onClick") > > > > end > > > > Also, the .flash method is useful to find were you > are on the page when > working with indexes. > > table = $ie.table(:index, 10).flash > > > > Hope this helps, > > > > --Mark > > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf > Of e aldaz > Sent: Saturday, January 07, 2006 11:21 AM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] Watir and Java Script onClick > difficulties > > > > Dear All > > > > I am quite new to Ruby and Watir (but have bought > and > > read the famous PickAke). > > I have had quite a lot of success using Watir on > > normal HTML pages, however i am having all sorts of > > trouble with some java script. > > I was wondering if someone could: > > > > 1.- Tell me where to find documentation on using > watir > > with pages that have javascript > > > > 2.- Help me with this particular example, i need to > > click on a button called entrar, that appears as an > > image in "http://www.gruposantander.es" under > > "Supernet acceso particulares" > > From what i gather if i need to click on a > button > > or image or link that starts some java script i need > > to do something like: > > ie.button(...).fire_event("onClick") > > or > > ie.image(...)..fire_event("onClick") > > etc.. > > > > However i have not been able to get the onClick > > that appears on the following HTML table (frow view > > source of the page) to fire, > > > > > valign="middle" class="TextoUtilidadesNegro"> > href="#" onClick="checkloginparticulares();return > > false;"> > width="84" height="17" border="0" > > alt="Transmisión segura de sus datos > > personales, SSL 128 bits">   > > > > Any ideas how to do it? > > I have tried $ie.link(:url, > > "#").fire_event("onClick") > > but I get > > irb(main):029:0> > > ie.link(:url,"#").fire_event("onClick") > > Watir::Exception::UnknownObjectException: Unable to > > locate object, using url and # > > > > I've also tried beforeText, afterText,etc.. but > can't > > seem to get it to work > > Using index i can activate other links, but not this > > particular one > > > > Any help much appreciated ! > > Thanks > > Eduardo > > > > > > _______________________________________________ > > 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 christopher.mcmahon at gmail.com Mon Jan 9 18:41:11 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 9 Jan 2006 17:41:11 -0600 Subject: [Wtr-general] selecting cells in Excell using activecell In-Reply-To: <001601c613c6$b5fdf690$6801a8c0@Koko> References: <001601c613c6$b5fdf690$6801a8c0@Koko> Message-ID: <72799cd70601091541y4d6f72d0p6177cf2f6564eeeb@mail.gmail.com> > One fine day, I'll write a really good Ruby-Excel interface. Don't hold > your breath, though. :) > > ---Michael B. If you're serious, I know some people who might help. I know other people who'd use such an interface, too. Some encouragement: it's a classic example of a DSL, and we all know how easy it is do DSLs in Ruby. And you really need the practice implementing a Domain Specific Language, don't you? All the cool kids are doing it... -Chris From ash_mita at yahoo.com Tue Jan 10 03:52:57 2006 From: ash_mita at yahoo.com (Asmita Srivastava) Date: Tue, 10 Jan 2006 00:52:57 -0800 (PST) Subject: [Wtr-general] Wtr-general Digest, Vol 26, Issue 9 In-Reply-To: Message-ID: <20060110085257.36042.qmail@web51605.mail.yahoo.com> Hi, This is in response to the Message -1 (Subject : Link that can not be found) Links can be recognized by its id,index and url . For links where no id or index defined , it can be accessed using url ie. for : Sign in we can use $ie.link(:url,/some address/).click example to click on link DCK to click on this link the watir code will be $ie.link(:url,/'>RTMaint.do/).click This will work Regards, 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: Link that can not be found (Zeljko Filipin) 2. Re: Watir and Java Script onClick difficulties (Cain, Mark) 3. Re: Watir and Java Script onClick difficulties (e aldaz) 4. Re: selecting cells in Excell using activecell (Chris McMahon) ---------------------------------------------------------------------- Message: 1 Date: Mon, 9 Jan 2006 10:46:48 +0100 From: Zeljko Filipin Subject: Re: [Wtr-general] Link that can not be found To: wtr-general at rubyforge.org Message-ID: Content-Type: text/plain; charset=ISO-8859-1 +1 for www.w3schools.com Zeljko 2006/1/7, Michael Bolton : > > I'm resending this message because I don't believe that it ever appeared on > the list. If it did, please pardon me. > > ---Michael B. > > A while back, someone wrote: > > I am having the problem with the link of the following form: > > > Sign in > > > And it appears that the both lines below can not find the link to click: > > ie.link(:name, "Sign in").click > > ie.link(:name, "Sign in").click > > And someone else replied: > > The portion of data you are looking at is the "text" of the link, not the > name... > > > so, > > > ie.link( :text, "Sign in" ).click > > > should work. > > To which I TRIED to reply: > > > Which actually raises an interesting point: somewhere in the Watir > documentation is the notion that the easiest way to find the link is by > id--the id= attribute inside the Anchor tag, which apparently is preferred > under current markup language standards, or name--the name= attribute > inside the Anchor tag, which is apparently deprecated. Looking by :text > means that if the text on the link changes, the test breaks. The theory is > that an id attribute will be changed less often than the text. That seems > like a reasonable presumption in many cases. The HTML you use in your > example might be part of a tutorial that you're doing, or it might be part > of an application that you're testing. If the latter, you can ask the > programmer nicely for more testability by asking for id attributes in the > markup. > > I've found www.w3schools.com to be a useful resource for learning about > markup language, browsers, and topics related to Web technology. Do others > have similar places that they'd recommend? > > ---Michael B. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > ------------------------------ Message: 2 Date: Mon, 9 Jan 2006 08:24:07 -0800 From: "Cain, Mark" Subject: Re: [Wtr-general] Watir and Java Script onClick difficulties To: Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D4F2 at EX5V.rl.gov> Content-Type: text/plain; charset="us-ascii" Try this, I was able to get it to work here: def test_ClickEvent $ie.goto("http://www.gruposantander.es/") table = $ie.table(:index, 10) table[9][1].image(:src, /imagenes\/boton_entrar.gif/).fire_event("onClick") end Also, the .flash method is useful to find were you are on the page when working with indexes. table = $ie.table(:index, 10).flash Hope this helps, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of e aldaz Sent: Saturday, January 07, 2006 11:21 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Watir and Java Script onClick difficulties Dear All I am quite new to Ruby and Watir (but have bought and read the famous PickAke). I have had quite a lot of success using Watir on normal HTML pages, however i am having all sorts of trouble with some java script. I was wondering if someone could: 1.- Tell me where to find documentation on using watir with pages that have javascript 2.- Help me with this particular example, i need to click on a button called entrar, that appears as an image in "http://www.gruposantander.es" under "Supernet acceso particulares" >From what i gather if i need to click on a button or image or link that starts some java script i need to do something like: ie.button(...).fire_event("onClick") or ie.image(...)..fire_event("onClick") etc.. However i have not been able to get the onClick that appears on the following HTML table (frow view source of the page) to fire, valign="middle" class="TextoUtilidadesNegro"> href="#" onClick="checkloginparticulares();return false;"> width="84" height="17" border="0" alt="Transmisi?n segura de sus datos personales, SSL 128 bits"> Any ideas how to do it? I have tried $ie.link(:url, "#").fire_event("onClick") but I get irb(main):029:0> ie.link(:url,"#").fire_event("onClick") Watir::Exception::UnknownObjectException: Unable to locate object, using url and # I've also tried beforeText, afterText,etc.. but can't seem to get it to work Using index i can activate other links, but not this particular one Any help much appreciated ! Thanks Eduardo _______________________________________________ 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/20060109/44f98a63/attachment-0001.htm ------------------------------ Message: 3 Date: Mon, 9 Jan 2006 21:44:48 +0000 (GMT) From: e aldaz Subject: Re: [Wtr-general] Watir and Java Script onClick difficulties To: wtr-general at rubyforge.org Message-ID: <20060109214448.72835.qmail at web51814.mail.yahoo.com> Content-Type: text/plain; charset=iso-8859-1 Mark, It works great, thank you very much, i'll keep on trying with the rest now! --- "Cain, Mark" wrote: > Try this, I was able to get it to work here: > > > > def test_ClickEvent > > $ie.goto("http://www.gruposantander.es/") > > > > table = $ie.table(:index, 10) > > table[9][1].image(:src, > /imagenes\/boton_entrar.gif/).fire_event("onClick") > > > > end > > > > Also, the .flash method is useful to find were you > are on the page when > working with indexes. > > table = $ie.table(:index, 10).flash > > > > Hope this helps, > > > > --Mark > > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf > Of e aldaz > Sent: Saturday, January 07, 2006 11:21 AM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] Watir and Java Script onClick > difficulties > > > > Dear All > > > > I am quite new to Ruby and Watir (but have bought > and > > read the famous PickAke). > > I have had quite a lot of success using Watir on > > normal HTML pages, however i am having all sorts of > > trouble with some java script. > > I was wondering if someone could: > > > > 1.- Tell me where to find documentation on using > watir > > with pages that have javascript > > > > 2.- Help me with this particular example, i need to > > click on a button called entrar, that appears as an > > image in "http://www.gruposantander.es" under > > "Supernet acceso particulares" > > From what i gather if i need to click on a > button > > or image or link that starts some java script i need > > to do something like: > > ie.button(...).fire_event("onClick") > > or > > ie.image(...)..fire_event("onClick") > > etc.. > > > > However i have not been able to get the onClick > > that appears on the following HTML table (frow view > > source of the page) to fire, > > > > > > valign="middle" class="TextoUtilidadesNegro">> > href="#" onClick="checkloginparticulares();return > > false;">> > width="84" height="17" border="0" > > alt="Transmisi?n segura de sus datos > > personales, SSL 128 bits"> > > > > Any ideas how to do it? > > I have tried $ie.link(:url, > > "#").fire_event("onClick") > > but I get > > irb(main):029:0> > > ie.link(:url,"#").fire_event("onClick") > > Watir::Exception::UnknownObjectException: Unable to > > locate object, using url and # > > > > I've also tried beforeText, afterText,etc.. but > can't > > seem to get it to work > > Using index i can activate other links, but not this > > particular one > > > > Any help much appreciated ! > > Thanks > > Eduardo > > > > > > _______________________________________________ > > 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: 4 Date: Mon, 9 Jan 2006 17:41:11 -0600 From: Chris McMahon Subject: Re: [Wtr-general] selecting cells in Excell using activecell To: wtr-general at rubyforge.org Message-ID: <72799cd70601091541y4d6f72d0p6177cf2f6564eeeb at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 > One fine day, I'll write a really good Ruby-Excel interface. Don't hold > your breath, though. :) > > ---Michael B. If you're serious, I know some people who might help. I know other people who'd use such an interface, too. Some encouragement: it's a classic example of a DSL, and we all know how easy it is do DSLs in Ruby. And you really need the practice implementing a Domain Specific Language, don't you? All the cool kids are doing it... -Chris ------------------------------ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general End of Wtr-general Digest, Vol 26, Issue 9 ****************************************** --------------------------------- Yahoo! Photos ? Showcase holiday pictures in hardcover Photo Books. You design it and we?ll bind it! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060110/3c3cd770/attachment.html From mb at michaelbolton.net Tue Jan 10 09:39:00 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Tue, 10 Jan 2006 09:39:00 -0500 Subject: [Wtr-general] selecting cells in Excell using activecell In-Reply-To: <72799cd70601091541y4d6f72d0p6177cf2f6564eeeb@mail.gmail.com> Message-ID: <009a01c615f3$a544bee0$6801a8c0@Koko> From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: January 9, 2006 6:41 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] selecting cells in Excell using activecell > One fine day, I'll write a really good Ruby-Excel interface. Don't hold > your breath, though. :) > > ---Michael B. >If you're serious, I know some people who might help. I know other >people who'd use such an interface, too. >Some encouragement: it's a classic example of a DSL, and we all know >how easy it is do DSLs in Ruby. And you really need the practice >implementing a Domain Specific Language, don't you? All the cool >kids are doing it... >-Chris I wonder how many people would be thrown by my desire to build objects like CellPointers, and calls like p = CellPointer.new() p.goto("$A$5") which don't exist in current Excel-speak. ---Michael B. From christopher.mcmahon at gmail.com Tue Jan 10 10:12:35 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 10 Jan 2006 09:12:35 -0600 Subject: [Wtr-general] selecting cells in Excell using activecell In-Reply-To: <009a01c615f3$a544bee0$6801a8c0@Koko> References: <72799cd70601091541y4d6f72d0p6177cf2f6564eeeb@mail.gmail.com> <009a01c615f3$a544bee0$6801a8c0@Koko> Message-ID: <72799cd70601100712h2aae2bb5wdda07d93cde61653@mail.gmail.com> > I wonder how many people would be thrown by my desire to build objects like > CellPointers, and calls like > > p = CellPointer.new() > p.goto("$A$5") Go for it. What causes me to pull my hair out are the inability to address a cell by column number in the Range function; and all of the goofy numerical constants, like "-4161" to go to the end of the row. -Chris From PGarigue at EXTEND.COM Tue Jan 10 10:37:08 2006 From: PGarigue at EXTEND.COM (Pierre Garigue) Date: Tue, 10 Jan 2006 10:37:08 -0500 Subject: [Wtr-general] selecting cells in Excell using activecell Message-ID: I think a few would be. One you have a cell object it would be pretty easy to set them a formula, a display etc. I would by kid of cool to read data from Excel, and output to a spreadsheet. Cheers Pierre -----Original Message----- From: Michael Bolton [mailto:mb at michaelbolton.net] Sent: Tuesday, January 10, 2006 9:39 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] selecting cells in Excell using activecell From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: January 9, 2006 6:41 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] selecting cells in Excell using activecell > One fine day, I'll write a really good Ruby-Excel interface. Don't hold > your breath, though. :) > > ---Michael B. >If you're serious, I know some people who might help. I know other >people who'd use such an interface, too. >Some encouragement: it's a classic example of a DSL, and we all know >how easy it is do DSLs in Ruby. And you really need the practice >implementing a Domain Specific Language, don't you? All the cool >kids are doing it... >-Chris I wonder how many people would be thrown by my desire to build objects like CellPointers, and calls like p = CellPointer.new() p.goto("$A$5") which don't exist in current Excel-speak. ---Michael B. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From pat at cappelaere.com Tue Jan 10 17:02:35 2006 From: pat at cappelaere.com (Pat Cappelaere) Date: Tue, 10 Jan 2006 17:02:35 -0500 Subject: [Wtr-general] WATIR 1.4.1 Did something happen? In-Reply-To: Message-ID: I just did a gem install watir Watir.rb now shows # Version "$Revision: 1.211.2.2 $" It used to be at least 1.269 (But I do not have that file anymore...) And it appears that elements_by_xpath are undefined... Did something happen? Thanks. Pat. From Ben.Torres at rhi.com Tue Jan 10 19:38:59 2006 From: Ben.Torres at rhi.com (Torres, Ben (HQP)) Date: Tue, 10 Jan 2006 16:38:59 -0800 Subject: [Wtr-general] Read In from external file Message-ID: <1641BB0AA7287848817A63C3EE9677D50A269CB2@hqp-ex-mb05.na.msds.rhi.com> Hello, Can Watir read from an external file and plug that data into a script? If so, how? Ex: I have var1 = city, var2 = state, var3 = zip. Can I have a file containing just different values for these variables and have the script take in these values: "San Francisco","California","94404" "Dallas","Texas","32345" "Miami","Florida","22342" So I will have my script run 3 times and each run will grab 1 line. Thanks in advance, Ben From ati.ozgur at gmail.com Tue Jan 10 20:10:14 2006 From: ati.ozgur at gmail.com (Atilla Ozgur) Date: Wed, 11 Jan 2006 03:10:14 +0200 Subject: [Wtr-general] Read In from external file In-Reply-To: <1641BB0AA7287848817A63C3EE9677D50A269CB2@hqp-ex-mb05.na.msds.rhi.com> References: <1641BB0AA7287848817A63C3EE9677D50A269CB2@hqp-ex-mb05.na.msds.rhi.com> Message-ID: since watir uses ruby for scripting, you can do that. Look for this page. http://www.rubycentral.com/book/tut_io.html but a simple example aFile = File.new("testfile.txt") aFile.each_line {|line| puts "Got #{line.dump}" vars = line.split(",") city = vars[0] state = vars[1] postal_code = vars[2] puts city puts state puts postal_code puts } with your file, this will output Got "\"San Francisco\",\"California\",\"94404\"\n" "San Francisco" "California" "94404" Got "\"Dallas\",\"Texas\",\"32345\"\n" "Dallas" "Texas" "32345" Got "\"Miami\",\"Florida\",\"22342\"" "Miami" "Florida" "22342" From spammer.sbt at gmail.com Tue Jan 10 20:21:05 2006 From: spammer.sbt at gmail.com (Steve Tangsombatvisit) Date: Tue, 10 Jan 2006 17:21:05 -0800 Subject: [Wtr-general] Read In from external file References: <1641BB0AA7287848817A63C3EE9677D50A269CB2@hqp-ex-mb05.na.msds.rhi.com> Message-ID: <00c201c6164d$522d4830$6bb0a042@corp.lyris.com> Hi Ben, That's very easy to do via Ruby 1. Create file object using the following code input_file = File.open("data.txt", "r") 2. There are many ways to iterate through the file or read data from the file depending on what you need to do. To go through the file line-by-line it would be input_file.each_line{|line| line = line.chop() .... .... .... } 3. Then close the handle when you are done input_file.close() Hope that helps. Steve ----- Original Message ----- From: "Torres, Ben (HQP)" To: Sent: Tuesday, January 10, 2006 4:38 PM Subject: [Wtr-general] Read In from external file > Hello, > > Can Watir read from an external file and plug that data into a script? > If so, how? > > Ex: I have var1 = city, var2 = state, var3 = zip. Can I have a file > containing just different values for these variables and have the script > take in these values: > > "San Francisco","California","94404" > "Dallas","Texas","32345" > "Miami","Florida","22342" > > So I will have my script run 3 times and each run will grab 1 line. > > Thanks in advance, > Ben > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From zeljko.filipin at gmail.com Wed Jan 11 05:55:38 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 11 Jan 2006 11:55:38 +0100 Subject: [Wtr-general] WATIR 1.4.1 Did something happen? In-Reply-To: References: Message-ID: I guess that you used to install watir from "Download tarball". Gem version is usually older. Also, I think that elements_by_xpath is not included in 1.4.1, only in HEAD (but I am not sure). Zeljko 2006/1/10, Pat Cappelaere : > I just did a gem install watir > Watir.rb now shows # Version "$Revision: 1.211.2.2 $" > It used to be at least 1.269 (But I do not have that file anymore...) > And it appears that elements_by_xpath are undefined... > Did something happen? > Thanks. > Pat. > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From zeljko.filipin at gmail.com Wed Jan 11 05:58:00 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 11 Jan 2006 11:58:00 +0100 Subject: [Wtr-general] Read In from external file In-Reply-To: <1641BB0AA7287848817A63C3EE9677D50A269CB2@hqp-ex-mb05.na.msds.rhi.com> References: <1641BB0AA7287848817A63C3EE9677D50A269CB2@hqp-ex-mb05.na.msds.rhi.com> Message-ID: I use yaml (http://yaml4r.sourceforge.net/). Try it, you will love it. Zeljko 2006/1/11, Torres, Ben (HQP) : > Hello, > > Can Watir read from an external file and plug that data into a script? > If so, how? > > Ex: I have var1 = city, var2 = state, var3 = zip. Can I have a file > containing just different values for these variables and have the script > take in these values: > > "San Francisco","California","94404" > "Dallas","Texas","32345" > "Miami","Florida","22342" > > So I will have my script run 3 times and each run will grab 1 line. > > Thanks in advance, > Ben > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From PGarigue at EXTEND.COM Wed Jan 11 11:11:04 2006 From: PGarigue at EXTEND.COM (Pierre Garigue) Date: Wed, 11 Jan 2006 11:11:04 -0500 Subject: [Wtr-general] Read In from external file Message-ID: I write my yaml data by hand, this has helped me check that everything is OK. ------------------ require 'yaml' require 'pp' info_for_test = YAML::load( File.open('data_for_test.yml' )) pp info_for_test --------------------------------------- Since I came from the Perl world, I tend to think that all the world's problems can be solved by always using a hash. So as you can imagine, info_for_test would be a hash variable. -pierre garigue -----Original Message----- From: Zeljko Filipin [mailto:zeljko.filipin at gmail.com] Sent: Wednesday, January 11, 2006 5:58 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Read In from external file I use yaml (http://yaml4r.sourceforge.net/). Try it, you will love it. Zeljko 2006/1/11, Torres, Ben (HQP) : > Hello, > > Can Watir read from an external file and plug that data into a script? > If so, how? > > Ex: I have var1 = city, var2 = state, var3 = zip. Can I have a file > containing just different values for these variables and have the script > take in these values: > > "San Francisco","California","94404" > "Dallas","Texas","32345" > "Miami","Florida","22342" > > So I will have my script run 3 times and each run will grab 1 line. > > Thanks in advance, > Ben > > > _______________________________________________ > 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 peppers at gmail.com Wed Jan 11 11:31:30 2006 From: peppers at gmail.com (Terry Peppers) Date: Wed, 11 Jan 2006 10:31:30 -0600 Subject: [Wtr-general] Design Problems Message-ID: <8ca48b420601110831h670e4247rd05bfe16ca41b0bf@mail.gmail.com> I'm kind of @ a crossroads right now and I think my inexperience as a developer is beginning to shine pretty hard. Here's my general problem: I'm trying to compose a generic test that I can use to test many different sites - however, each site behaves slightly different then the other sites. So I'm @ a bit of a design quandry. An example: class OrderTest < Test::Unit::TestCase def setup @ie = IE.new @ie.goto("http://www.store1.com") @ie.wait end def order_something # pick a product @ie.link(:name, "some_product).click # do some assertions # ... # click @ie.button(:name, "done").click # fill in some data # do some assertions # ... @ie.text_field(:name, "fname").set("Terry") @ie.text_field(:name, "lname").set("Peppers") @ie.text_field(:name, "address").set("123 Foo") @ie.text_field(:name, "zip").set("90210") @ie.text_field(:name, "city").set("Foobar") @ie.text_field(:name, "state").set("FO") # click @ie.button(:name, "submit").click # do some assertions # ... end def teardown @ie.close end end So this example works great for 'store1' but what happens if I want to test 'store2.' 'Store2' requires a credit card and wants to ask you some questions. Right now I'm cluttering up my test case with a lot of conditionals/case statements so that it can react accordingly, but that doesn't seem really elegant to me. Does anyone know of a better way to do this? I was chewing on possibly creating a 'order_something' object that could insert the proper steps and assertions based on the 'store' that it's testing - but to be honest I'm not even sure how to do that. Also, maybe this is a place where exceptions should be used - I don't think so, but I don't know. Any ideas? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060111/2195712f/attachment.html From christopher.mcmahon at gmail.com Wed Jan 11 11:48:00 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 11 Jan 2006 10:48:00 -0600 Subject: [Wtr-general] Design Problems In-Reply-To: <8ca48b420601110831h670e4247rd05bfe16ca41b0bf@mail.gmail.com> References: <8ca48b420601110831h670e4247rd05bfe16ca41b0bf@mail.gmail.com> Message-ID: <72799cd70601110848x519c4a9dt3f8d1f9912c654bb@mail.gmail.com> Hi Terry... I hope better programmers than me comment, this is a really good question. > Right now I'm cluttering up my test case with a lot of conditionals/case > statements so that it can react accordingly, but that doesn't seem really > elegant to me. Does anyone know of a better way to do this? A general design rule of thumb is to substitute methods for conditionals. I know that sounds all abstract and stuff, but here's a concrete example. I have an app that shows 10 things at a time on an arbitrarily large number of pages. So I'll write a method like this: def check_for_next_page @ie.links.each do |link| if link.href =~ /b_start/ and link.text =~ /Next/ and link.text =~ /items/ process_next_page_method link.click end end end #def So above that I have another method that will process the page *if the page exists*: def process_next_page_method @ie.links.each do |link| if link.href =~ /IWantThisLink/ link.href =~/\d+/ @data_array<<$& #puts $& end end #def That way only one conditional per page, one conditional per link per page. I hope that makes sense, good luck. BTW, I bet if you google something like "ruby conditionals methods" you might find useful stuff, too. -Chris From mb at michaelbolton.net Wed Jan 11 12:30:10 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Wed, 11 Jan 2006 12:30:10 -0500 Subject: [Wtr-general] Design Problems In-Reply-To: <8ca48b420601110831h670e4247rd05bfe16ca41b0bf@mail.gmail.com> Message-ID: <000001c616d4$ac74ee60$6801a8c0@Koko> I would like gently to suggest that your inexperience as a developer isn't the problem here. This is a fundamental question about test automation in general. You're not alone; I'm not convinced that very many people have thought particularly hard about it. I think enough time has gone by that people now understand that a debugger will neither find nor fix your bugs. In a similar kind of way, WATIR will not use or test your application; YOU will. WATIR will help you to do that by pressing keys or performing mouse clicks, scanning the screen and reacting to patterns that you've told it about, and doing all that really quickly. So: if Store 2 requires you to answer some questions, what would those questions be? If Store 2 requires you to behave differently, what are the differences? At what point do they diverge from the behaviours for Store 1? The fundamental problem is: what do you mean by "a generic test"? For me to answer this question in a way that would help you, I would have to know what you would do manually and cognitively if you didn't have WATIR available. Then solving the programming problem is relatively straightforward. Relatively. And I don't think you'll need our help as much as you might think you do. One way you can do some of the things that you're doing below is to take the "do some assertions" part, and wrap those into a method that /isn't/ a test_something method, and to take the stuff where you enter data and do something similar, such that we might see def test_store_1 login_to_store_1 order_some_product fill_in_some_data click_submit logout end def_test_store_2 login_to_store_2 order_some_product fill_in_some_data click_submit logout end def login_to_store_1 enter_user_name_and_password end def login_to_store_2 enter_user_name_and_password enter_credit_card_info answer_some_questions end def fill_in_some_data @ie.text_field(:name, "fname").set("Terry") @ie.text_field(:name, "lname").set("Peppers") @ie.text_field(:name, "address").set("123 Foo") @ie.text_field(:name, "zip").set("90210") @ie.text_field(:name, "city").set("Foobar") @ie.text_field(:name, "state").set("FO") end def click_submit @ie.button(:name, "submit").click end On the other hand, if the stores themselves don't behave generically, then the tests will have to incorporate behaviour that's appropriate to the differences: def_test_store_2 login_to_store_2 jump_through_extra_store_2_hoops order_some_product fill_in_some_generic_data fill_in_other_stuff_specific_to_store_2 click_submit logout end You see? ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Terry Peppers Sent: January 11, 2006 11:32 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Design Problems I'm kind of @ a crossroads right now and I think my inexperience as a developer is beginning to shine pretty hard. Here's my general problem: I'm trying to compose a generic test that I can use to test many different sites - however, each site behaves slightly different then the other sites. So I'm @ a bit of a design quandry. An example: class OrderTest < Test::Unit::TestCase def setup @ie = IE.new @ie.goto("http://www.store1.com") @ie.wait end def order_something # pick a product @ie.link(:name, "some_product).click # do some assertions # ... # click @ie.button(:name, "done").click # fill in some data # do some assertions # ... @ie.text_field(:name, "fname").set("Terry") @ie.text_field(:name, "lname").set("Peppers") @ie.text_field(:name, "address").set("123 Foo") @ie.text_field(:name, "zip").set("90210") @ie.text_field(:name, "city").set("Foobar") @ie.text_field(:name, "state").set("FO") # click @ie.button(:name, "submit").click # do some assertions # ... end def teardown @ie.close end end So this example works great for 'store1' but what happens if I want to test 'store2.' 'Store2' requires a credit card and wants to ask you some questions. Right now I'm cluttering up my test case with a lot of conditionals/case statements so that it can react accordingly, but that doesn't seem really elegant to me. Does anyone know of a better way to do this? I was chewing on possibly creating a 'order_something' object that could insert the proper steps and assertions based on the 'store' that it's testing - but to be honest I'm not even sure how to do that. Also, maybe this is a place where exceptions should be used - I don't think so, but I don't know. Any ideas? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060111/0a5dcd8b/attachment.html From spammer.sbt at gmail.com Wed Jan 11 15:34:12 2006 From: spammer.sbt at gmail.com (Steve Tangsombatvisit) Date: Wed, 11 Jan 2006 12:34:12 -0800 Subject: [Wtr-general] Design Problems References: <8ca48b420601110831h670e4247rd05bfe16ca41b0bf@mail.gmail.com> Message-ID: <019701c616ee$6249f780$6bb0a042@corp.lyris.com> >> Does anyone know of a better way to do this? I was chewing on possibly creating a 'order_something' object that could insert the proper steps and assertions based on the 'store' that it's testing - but to >> be honest I'm not even sure how to do that. Also, maybe this is a place where exceptions should be used - I don't think so, but I don't know. Any ideas? Hi Terry, I think your on the right path with this thought. Perhaps create one main Store object with characteristics common to all Stores (ie logon, user name, password, account number) and then have child Stores inherit from the parent Store object with more specific charactersitics. You then initialize each Store accordingly and define them only in the specific test case they are needed. As you'll probably see, there are many ways to approach this. How i have approached something like this in the past is would be to give each Store object a "setup" and "test" method, which is then called from within the specific test cases. This way, your main test file would be tiny. You can then write your individual test script as a method inside your Store objects. I don't know if this will help you cut down on the amount of code you need to write class OrderTest < Test::Unit::TestCase def setup end def test_store_01 store_1 = Store.new(..) store_1.setup() assert (store_1.test()..... end def test_store_02 store_2= Store.new(..) store_2.setup() assert (store_1.test()..... end def test_store_03 store_3= Store.new(..) store_3.setup() assert (store_1.test()..... end def teardown end end Hope that helps. Steve Tang -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060111/972b5426/attachment.html From David.J.Solis at wellsfargo.com Wed Jan 11 18:14:35 2006 From: David.J.Solis at wellsfargo.com (David.J.Solis at wellsfargo.com) Date: Wed, 11 Jan 2006 17:14:35 -0600 Subject: [Wtr-general] Assert error when calling a script from a different file Message-ID: <493148DCF171954FBBF8E8AAB261638C0574E2@msgswbmnmsp35.wellsfargo.com> I'm calling a class from a file within a loop in separate file from my test script. The objective is to iterate through my script n... number of times. The call from the loop works fine, but the asserts in the in my test script are not working Here is my loop that lives in a separate file: require 'cdd_154' $aaa=001; $aaaa=10; @temp = CDD_154.new for $aaa in ($aaa..$aaaa) @temp.test_questions end Here is my class in my test script: #includes: require 'watir' #test::unit requires require 'win32ole' # to read from a spreadsheet require 'test/unit' require 'test/unit/testcase' require 'test/unit/autorunner' require 'watir' require 'watir/testUnitAddons' $test_site = 'http://www.testsite.com' class CDD_154 < Test::Unit::TestCase def initialize() end def test_questions then comes my code with some assetions end This the error I get one it reaches my first assert c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:115:in `add_assertion': undefined met hod `add_assertion' for nil:NilClass (NoMethodError) from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:353:in `_wrap_assertio n' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:38:in `assert' from ./cdd_154.rb:59:in `test_questions' from C:/_Watir/examples/tester1.rb:10 from C:/_Watir/examples/tester1.rb:9:in `each' from C:/_Watir/examples/tester1.rb:9 Any ideas on what I'm doing wrong? David Solis WELLS FARGO PCS TECHNOLOGY - ( Phone: (415) 267-0154 ( Cell: (415) 385-3286 MAC: A0103-241 8 Email: david.j.solis at wellsfargo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060111/2f3a8cb4/attachment.html From chaya_b_s at yahoo.co.in Thu Jan 12 01:11:14 2006 From: chaya_b_s at yahoo.co.in (chaya shetty) Date: Thu, 12 Jan 2006 06:11:14 +0000 (GMT) Subject: [Wtr-general] How can I open and attach file usingfile_fieldmethod? In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D4EE@EX5V.rl.gov> Message-ID: <20060112061114.26555.qmail@web8323.mail.in.yahoo.com> Hi, I tried as said...Even then I am facing the same problem. Code Used: $path = "C:/Watir/file.txt" $ie.file_field(:name,"srcfile").set($path) $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinWait("Choose file", "Do you want to open or save this file?", 3) $autoit.WinActivate("Choose file") $autoit.WinWait("Choose file", "Look &in", 3) $autoit.ControlSetText("Choose file", "", "Edit1", "#{$path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.button(:name, "Open").click The file field highlights(yellow)and opens choose file dialog along with another ruby file with contents: # # setFileDialog.rb # # # This file contains the file dialog when it runs as a separate process $LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), '..')) puts $LOAD_PATH require 'watir/winClicker' filepath = "invalid path passed to setFileDialog.rb" filepath = ARGV[0] unless ARGV[0] == nil clicker= WinClicker.new clicker.setFileRequesterFileName(filepath) clicker = nil Then it waits for me to manually select the file and attach. I have ensured that the path is correct and there is a text file viz. file in the Watir folder. Thanks, Chaya "Cain, Mark" wrote: v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} st1\:*{behavior:url(#default#ieooui) } Replace all your $autoit lines with this: $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinWait("Choose file", "Do you want to open or save this file?", 3) $autoit.WinActivate("Choose file") $autoit.WinWait("Choose file", "Look &in", 3) $autoit.ControlSetText("Choose file", "", "Edit1", "#{$path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") I don?t know if it will make a difference but my script needed the WinWait?s left in to work right. Also, it took a little time for autoit to find the window so don?t get impatient. Hope this helps, --Mark --------------------------------- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of chaya shetty Sent: Thursday, January 05, 2006 9:27 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How can I open and attach file usingfile_fieldmethod? Hi, There is only one file field in the page and hence I tried with path = "C\:Watir\Text.doc" ie.file_field(:index,1).set(#{path}) $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinActivate("Choose file") $autoit.ControlSetText("Choose file", "", "Edit1", "#{path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.button(:name, "Submit").click But still the same behaviour was seen. The file field was accessed and the "Choose File" window opened and waited till I manually selected the file. Thanks Chaya "Cain, Mark" wrote: Yes, the problem is (:value, ?Value?) in this line: ie.file_field(:value,'Value').set(#{path}) ! The file_field supports these attributes: :id, :name, :index. Do a view source and find out what the attribute values for your tag. If for some reason your developers were lazy and didn?t give the tag an id or name attribute, use index. If there are more than one tag on the page the indexing starts top-most down with 1 and increments from there. Here is the usage portion for file_field from Watir.rb: # This is the main me! thod for accessing a file field. Usually an HTML tag. # * how - symbol - how we access the field , :index, :id, :name etc # * what - string, int or re , what we are looking for, # # returns a FileField object # # Typical Usage # # ie.file_field(:id, 'up_1') # access the file upload field with an ID of up_1 # ie.file_field(:name, 'upload') # access the file upload field with a name of upload # ie.file_field(:index, 2) # access the second file upload on the page ( 1 based, so the first field is accessed with :index,1) Hope this helps, --Mark --------------------------------- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of chaya shetty Sent: Thursday, January 05, 2006 4:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How can I open and attach file using file_fieldmethod? Hi, I tried with path = "C\:Watir\Text.doc" ie.file_field(:value,'Value').set(#{path}) $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinActivate("Choose file") $autoit.ControlSetText("Choose file", "", "Edit1", "#{path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.button(:name, "Submit").click But the same behaviour persists. i.e. the "Choose File" window opens and waits till you manually select the file. Can't ie.file_field(:value,'Value').set(#{path}) automatically set the path? Thanks Chaya --Mark Amitha Shetty wrote: Hi, How can I open and attach file using file_field method? when I try, ie.file_field(:id,'uploaded_file').set('C:\file.txt') I get "choose file"-window open .It waits for me, to choose a file and click "open" or whatever the button is called) , after that it continues normally, by submitting the file_field content. Why doesn't he choose a file by himself?How do I handle this? I have ensured that there is no space in the path and the file exists in C: ) I get the same error when I run filefield_test in Unittests in watir folder. Thanks, Amitha Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060112/e4fadac3/attachment.html From Mark_Cain at rl.gov Thu Jan 12 10:26:05 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Thu, 12 Jan 2006 07:26:05 -0800 Subject: [Wtr-general] How can I open and attach file using file_field method? Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D4FE@EX5V.rl.gov> What behavior do you see? When my script runs I see a Dos window open with focus (just like WinClicker), then the file chooser window open under the Dos window. The Dos window scrolls through all the objects open and finally gets to the File Chooser window, the document name (from $path) appears in the file name field, the open button is clicked and that information is transferred to the file_field text boxes. Finally the submit button is clicked and the file is attached. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of chaya shetty Sent: Wednesday, January 11, 2006 10:11 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How can I open and attach fileusingfile_fieldmethod? Hi, I tried as said...Even then I am facing the same problem. Code Used: $path = "C:/Watir/file.txt" $ie.file_field(:name,"srcfile").set($path) $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinWait("Choose file", "Do you want to open or save this file?", 3) $autoit.WinActivate("Choose file") $autoit.WinWait("Choose file", "Look &in", 3) $autoit.ControlSetText("Choose file", "", "Edit1", "#{$path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.button(:name, "Open").click The file field highlights(yellow)and opens choose file dialog along with another ruby file with contents: # # setFileDialog.rb # # # This file contains the file dialog when it runs as a separate process $LOAD_PATH <&! lt; File.expand_path(File.join(File.dirname(__FILE__), '..')) puts $LOAD_PATH require 'watir/winClicker' filepath = "invalid path passed to setFileDialog.rb" filepath = ARGV[0] unless ARGV[0] == nil clicker= WinClicker.new clicker.setFileRequesterFileName(filepath) clicker = nil Then it waits for me to manually select the file and attach. I have ensured that the path is correct and there is a text file viz. file in the Watir folder. Thanks, Chaya "Cain, Mark" wrote: Replace all your $autoit lines with this: $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinWait("Choose file", "Do you want to open or save this file?", 3) $autoit.WinActivate("Choose file") $autoit.WinWait("Choose file", "Look &in", 3) $autoit.ControlSetText("Choose file", "", "Edit1", "#{$path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") I don't know if it will make a difference but my script needed the WinWait's left in to work right. Also, it took a little time for autoit to find the window so don't get impatient. Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of chaya shetty Sent: Thursday, January 05, 2006 9:27 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How can I open and attach file usingfile_fieldmethod? Hi, There is only one file field in the page and hence I tried with path = "C\:Watir\Text.doc" ie.file_field(:index,1).set(#{path}) $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinActivate("Choose file") $autoit.ControlSetText("Choose file", "", "Edit1", "#{path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.button(:name, "Submit").click B! ut still the same behaviour was seen. The file field was accessed and the "Choose File" window opened and waited till I manually selected the file. Thanks Chaya "Cain, Mark" wrote: Yes, the problem is (:value, 'Value') in this line: ie.file_field(:value,'Value').set(#{path}) ! The file_field supports these attributes: :id, :name, :index. Do a view source and find out what the attribute values for your tag. If for some reason your developers were lazy and didn't give the tag an id or name attribute, use index. If there are more than one tag on the page the indexing starts top-most down with 1 and increments from there. Here is the usage portion for file_field from Watir.rb: # This is the main me! thod for accessing a file field. Usually an HTML tag. # * how - symbol - how we access the field , :index, :id, :name etc # * what - string, int or re , what we are looking for, # # returns a FileField object # # Typical Usage # # ie.file_field(:id, 'up_1') # access the file upload field with an ID of up_1 # ie.file_field(:name, 'upload') # access the file upload field with a name of upload # ie.file_field(:index, 2) # access the second file upload on the page ( 1 based, so the first field is accessed with :index,1) Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of chaya shetty Sent: Thursday, January 05, 2006 4:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How can I open and attach file using file_fieldmethod? Hi, I tried with path = "C\:Watir\Text.doc" ie.file_field(:value,'Value').set(#{path}) $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinActivate("Choose file") $autoit.ControlSetText("Choose file", "", "Edit1", "#{path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.button(:name, "Submit").click But the same behaviour persists. i.e. the "Choose File" window opens and waits till you manually select the file. Can't ie.file_field(:value,'Value').set(#{path}) automatically set the path? Thanks Chaya --Mark Amitha Shetty wrote: Hi, How can I open and attach file using file_field method? when I try, ie.file_field(:id,'uploaded_file').set('C:\file.txt') I get "choose file"-window open .It waits for me, to choose a file and click "open" or whatever the button is called) , after that it continues normally, by submitting the file_field content. Why doesn't he choose a file by himself?How do I handle this? I have ensured that there is no space in the path and the file exists in C: ) I get the same error when I run filefield_test in Unittests in watir folder. Thanks, Amitha Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060112/25a6b901/attachment.html From bret at pettichord.com Thu Jan 12 10:31:15 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 12 Jan 2006 09:31:15 -0600 Subject: [Wtr-general] Design Problems In-Reply-To: <8ca48b420601110831h670e4247rd05bfe16ca41b0bf@mail.gmail.com> References: <8ca48b420601110831h670e4247rd05bfe16ca41b0bf@mail.gmail.com> Message-ID: My sense is that you are trying too hard. First use cut and paste to create the tests you want, each as a simple linear set of steps, often duplicated. Then look at where the duplication is and remove it, by putting the common code in methods. As you do this, try to pick logical groupings and give the methods names that make it obvious what steps they include. When you are done, you will have a bunch of test_methods, each of which calls a lot of generic methods, with some code that is specific to the particular test. Bret On 1/11/06, Terry Peppers wrote: > > > I'm kind of @ a crossroads right now and I think my inexperience as a > developer is beginning to shine pretty hard. Here's my general problem: I'm > trying to compose a generic test that I can use to test many different sites > - however, each site behaves slightly different then the other sites. So I'm > @ a bit of a design quandry. > > An example: > > class OrderTest < Test::Unit::TestCase > def setup > @ie = IE.new > @ie.goto("http://www.store1.com") > @ie.wait > end > > def order_something > # pick a product > @ie.link(:name, "some_product).click > > # do some assertions > # ... > > # click > @ie.button(:name, "done").click > > # fill in some data > # do some assertions > # ... > @ie.text_field(:name, "fname").set("Terry") > @ie.text_field(:name, "lname").set("Peppers") > @ie.text_field(:name, "address").set("123 Foo") > @ie.text_field(:name, "zip").set("90210") > @ie.text_field(:name, "city").set("Foobar") > @ie.text_field(:name, "state").set("FO") > > # click > @ie.button(:name, "submit").click > > # do some assertions > # ... > end > > def teardown > @ie.close > end > end > > So this example works great for 'store1' but what happens if I want to > test 'store2.' 'Store2' requires a credit card and wants to ask you some > questions. > > Right now I'm cluttering up my test case with a lot of conditionals/case > statements so that it can react accordingly, but that doesn't seem really > elegant to me. Does anyone know of a better way to do this? I was chewing on > possibly creating a 'order_something' object that could insert the proper > steps and assertions based on the 'store' that it's testing - but to be > honest I'm not even sure how to do that. Also, maybe this is a place where > exceptions should be used - I don't think so, but I don't know. Any ideas? > _______________________________________________ > 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/20060112/d3a6fe3e/attachment.html From chaya_b_s at yahoo.co.in Thu Jan 12 23:45:15 2006 From: chaya_b_s at yahoo.co.in (chaya shetty) Date: Fri, 13 Jan 2006 04:45:15 +0000 (GMT) Subject: [Wtr-general] How can I open and attach file using file_field method? In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D4FE@EX5V.rl.gov> Message-ID: <20060113044515.92772.qmail@web8309.mail.in.yahoo.com> Hi, Code Used: $path = "C:/Watir/file.txt" $ie.file_field(:name,"srcfile").set($path) $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinWait("Choose file", "Do you want to open or save this file?", 3) $autoit.WinActivate("Choose file") $autoit.WinWait("Choose file", "Look &in", 3) $autoit.ControlSetText("Choose file", "", "Edit1", "#{$path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.button(:name, "Open").click When I run this code the file field highlights(yellow) and the 'Choose File' dialog opens. But the path is not set in the 'Choose File ' dialog. Along with this there is another file ' setFileDialog.rb ' that opens automatically. The contents of ' setFileDialog.rb ' are as follows: # # # This file contains the file dialog when it runs as a separate process $LOAD_PATH <&! lt; File.expand_path(File.join(File.dirname(__FILE__), '..')) puts $LOAD_PATH require 'watir/winClicker' filepath = "invalid path passed to setFileDialog.rb" filepath = ARGV[0] unless ARGV[0] == nil clicker= WinClicker.new clicker.setFileRequesterFileName(filepath) clicker = nil Thanks Chaya Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060113/4c1d2c8f/attachment.html From hgs at dmu.ac.uk Fri Jan 13 09:51:37 2006 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Fri, 13 Jan 2006 14:51:37 +0000 (WET) Subject: [Wtr-general] Unit testing Message-ID: I have had a problem with tests not completing on Windows XP professional with the ruby182-15.exe windows installer, and Watir-1.4.1.exe. I have attempted a fix, shown in the diff below, using timeout, but for reasons I don't understand, it doesn't time out. In exploring this I found a typo in setup.rb which I show a patch for below. Also, I encountered problems at first because of the active content warnings in IE. I have left the warning popup to display every time, because I don't always notice the yellowish stripe at the top of the page. While this popup was present, the tests could not function. Maybe there is a way to turn it off when doing Watir tests and restore it to its previous setting afterwards? [I've had to take the plunge and just remove it. I can't remember how to get it back.] Thank you, Hugh hgs at de-7y8kdn8cclnc /cygdrive/c/Program Files/Watir/unittests $ diff -u all_tests{,_new}.rb --- all_tests.rb 2005-04-30 00:21:07.000000000 +0100 +++ all_tests_new.rb 2006-01-13 13:42:36.328125000 +0000 @@ -2,9 +2,15 @@ $LOAD_PATH.unshift TOPDIR require 'unittests/setup.rb' +require 'timeout' +DELAY = 3 * 60 Dir.chdir TOPDIR -$all_tests.each {|x| require x} +$all_tests.each do |x| + Timeout::timeout(DELAY) do + require x + end +end hgs at de-7y8kdn8cclnc /cygdrive/c/Program Files/Watir/unittests $ diff -u setup{,_new}.rb --- setup.rb 2005-08-22 07:38:29.000000000 +0100 +++ setup_new.rb 2006-01-13 13:06:43.453125000 +0000 @@ -17,7 +17,7 @@ # will be revised to use autoit # takes 15 seconds to run 'images', # failing tests; also assumes working dir is unittests - 'screen_capture', # is always visible; takes 25 secons + 'screen_capture', # is always visible; takes 25 seconds 'filefield', # is always visible; takes 40 seconds 'jscript', 'js_events', # is always visible hgs at de-7y8kdn8cclnc /cygdrive/c/Program Files/Watir/unittests $ The test output is below: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\hgs>cd C:\Program Files\Watir\unittests C:\Program Files\Watir\unittests>all_tests_new.rb Loaded suite C:/Program Files/Watir/unittests/all_tests_new Started ........FFF..F.F........F..FFF....F.F.................Starting win setFileDialog in new process. Setting text file://C:/Program Files/Watir/unittests/html/fileu pload.html Starting app: c:/ruby/lib/ruby/site_ruby/1.8/watir/setFileDialog.rb file://C:/Pr ogram Files/Watir/unittests/html/fileupload.html ...........-----------Objects in page ------------- id= src= button name=b1 id=b2 value=Click Me al t= src= id= id= value=0 id= value=0 checkbox name=check1 id= value=10 al t= src= checkbox name=check1 id= value=20 al t= src= checkbox name=check1 id= value=30 al t= src= radio name=r1 id= value=a al t= src= radio name=r1 id= value=b al t= src= radio name=r1 id= value=c al t= src= radio name=r1 id= value=d al t= src= text name= id=t1 value= al t= src= text name= id=t2 value= al t= src= select-one name=s1 id= value= select-multiple name=s2 id= value= submit name= id= value=Submit al t= src= reset name= id=reset_button value=Reset al t= src= text name=g1 id= value=textfield al t= src= button name=g1 id= value=button al t= src= checkbox name=g1 id= value=1 al t= src= radio name=g1 id= value=2 al t= src= text name= id=g1 value=textfield_id al t= src= button name= id=g1 value=button_id al t= src= checkbox name= id=g1 value=1_id al t= src= radio name= id=g1 value=2_id al t= src= text name=tt1 id= value= al t= src= image name=imm id= value= al t=submit src=file:///C:/Program%20Files/Watir/unittests/html/images/but ton.jpg hidden name=hid1 id= value= al t= src= hidden name= id=hidden_1 value= al t= src= button name= id= value=Show Hidden al t= src= text name=vis1 id= value= al t= src= text name=vis2 id= value= al t= src= . CVS Revision: "$Revision: 1.6 $"

  • ListItem1
  • ListItem2
















These objects all have the same name




These objects all have the same id
This form is has a submit bu tton that is an image
This is in a form. The form has hidden objects.
The first has a name - hid1
The second has an id- h idden_1 Click This Button to see the values in th ese boxes

.CVS Revision: "$Revision: 1.6 $" ListItem1 ListItem2 1 2 1 2 3 4 5 6 These objects all have the same name These objects all have the same id This form is has a submit button that is an image This is in a form. The form has hidden objects. The first has a name - hid1 The second has an id- hidden_1 Click This Button to see the values in these boxe s .There are 4 forms Form name: id: method: get action: pass.html Form name: test2 id: method: get action: pass2.html Form name: buttonsubmit id: method: get action: pass.html Form name: has_a_hidden id: method: get action: ...............FF.FF.FEEFFiring event to make button enabled Clicking the button E.F..F From witlessbird at bitsandpixels.org Fri Jan 13 09:59:12 2006 From: witlessbird at bitsandpixels.org (Dmitri Dolguikh) Date: Fri, 13 Jan 2006 09:59:12 -0500 Subject: [Wtr-general] RPC Server unavailable Message-ID: <1aa3b8a50601130659y13cbf966tcda1bb13b7c6a8be@mail.gmail.com> Hi list, I keep getting the following error intemittently: WIN32OLERuntimeError: Unknown property or method `document' HRESULT error code:0x800706ba The RPC server is unavailable. when trying to access a link on a page. The test is being run in Windows 2003 Server under IE 6.0.379.0, with high-security turned off. We're trying to use Watir for automated acceptance testing; while running tests on desktops (under Windows XP) wasn't an issue at all, we're seeing the errors above when running tests using CruiseControl. Cheers, -Dmitri From hgs at dmu.ac.uk Fri Jan 13 10:08:54 2006 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Fri, 13 Jan 2006 15:08:54 +0000 (WET) Subject: [Wtr-general] Unit testing In-Reply-To: References: Message-ID: Excuse me following up to myself. Having read further down the instructions, I've permitted active content and now get: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\hgs>cd "\Program Files\Watir\unittests" C:\Program Files\Watir\unittests>all_tests_new.rb Loaded suite C:/Program Files/Watir/unittests/all_tests_new Started ......................................................Starting win setFileDialog in new process. Setting text file://C:/Program Files/Watir/unittests/html/fileu pload.html Starting app: c:/ruby/lib/ruby/site_ruby/1.8/watir/setFileDialog.rb file://C:/Pr ogram Files/Watir/unittests/html/fileupload.html ...........-----------Objects in page ------------- id= src= button name=b1 id=b2 value=Click Me al t= src= id= id= value=0 id= value=0 checkbox name=check1 id= value=10 al t= src= checkbox name=check1 id= value=20 al t= src= checkbox name=check1 id= value=30 al t= src= radio name=r1 id= value=a al t= src= radio name=r1 id= value=b al t= src= radio name=r1 id= value=c al t= src= radio name=r1 id= value=d al t= src= text name= id=t1 value= al t= src= text name= id=t2 value= al t= src= select-one name=s1 id= value= select-multiple name=s2 id= value= submit name= id= value=Submit al t= src= reset name= id=reset_button value=Reset al t= src= text name=g1 id= value=textfield al t= src= button name=g1 id= value=button al t= src= checkbox name=g1 id= value=1 al t= src= radio name=g1 id= value=2 al t= src= text name= id=g1 value=textfield_id al t= src= button name= id=g1 value=button_id al t= src= checkbox name= id=g1 value=1_id al t= src= radio name= id=g1 value=2_id al t= src= text name=tt1 id= value= al t= src= image name=imm id= value= al t=submit src=file:///C:/Program%20Files/Watir/unittests/html/images/but ton.jpg hidden name=hid1 id= value= al t= src= hidden name= id=hidden_1 value= al t= src= button name= id= value=Show Hidden al t= src= text name=vis1 id= value= al t= src= text name=vis2 id= value= al t= src= . CVS Revision: "$Revision: 1.6 $"

  • ListItem1
  • ListItem2
















These objects all have the same name




These objects all have the same id
This form is has a submit bu tton that is an image
This is in a form. The form has hidden objects.
The first has a name - hid1
The second has an id- h idden_1 Click This Button to see the values in th ese boxes

.CVS Revision: "$Revision: 1.6 $" ListItem1 ListItem2 1 2 1 2 3 4 5 6 These objects all have the same name These objects all have the same id This form is has a submit button that is an image This is in a form. The form has hidden objects. The first has a name - hid1 The second has an id- hidden_1 Click This Button to see the values in these boxe s .There are 4 forms Form name: id: method: get action: pass.html Form name: test2 id: method: get action: pass2.html Form name: buttonsubmit id: method: get action: pass.html Form name: has_a_hidden id: method: get action: ..................F..FEE.Firing event to make button enabled Clicking the button ..................F.Starting start rubyw c:\ruby\lib\ruby\SITE_R~1\1.8\watir\cli ckJSDialog.rb OK 0.5 Starting start rubyw c:\ruby\lib\ruby\SITE_R~1\1.8\watir\clickJSDialog.rb Cancel 0.5 FStarting start rubyw c:\ruby\lib\ruby\SITE_R~1\1.8\watir\clickJSDialog.rb OK 0. 5 ......................................F............................F Finished in 182.734 seconds. 1) Failure: test_imageHasLoaded(TC_Images) [C:/Program Files/Watir/unittests/../unittests/im ages_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_fi le_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_fi le_block' C:/Program Files/Watir/unittests/../unittests/images_test.rb:143:in `test_sa ve_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_fi le_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_fi le_block' C:/Program Files/Watir/unittests/../unittests/images_test.rb:153:in `test_sa ve_local_image_returns_original_page' 5) Failure: test_navigation(TC_Navigate) [C:/Program Files/Watir/unittests/../unittests/navi gate_test.rb:19]: <"file://c:/program%20files/watir/unittests/html/buttons1.html"> expected but wa s <"file://c:/program files/watir/unittests/html/buttons1.html">. 6) Failure: test_confirm(TC_PopUps) [C:/Program Files/Watir/unittests/../unittests/popups_te st.rb:36]: is not true. 7) Failure: test_links_and_images_in_table(TC_Tables) [C:/Program Files/Watir/unittests/../u nittests/table_test.rb:165]: <"106"> expected but was <"28">. 8) Failure: test_showLinks(TC_showlinks) [C:/Program Files/Watir/unittests/../unittests/links_test.rb:163:in `test_sh owLinks' C:/Program Files/Watir/unittests/../unittests/links_test.rb:163:in `each_wi th_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_wi th_index' C:/Program Files/Watir/unittests/../unittests/links_test.rb:163:in `test_sh owLinks']: <"1 file:///c:/program%20files/watir/unittests/html/ links2.html test1"> expected to be =~ . 182 tests, 1036 assertions, 6 failures, 2 errors C:\Program Files\Watir\unittests> HTH Hugh From bret at pettichord.com Fri Jan 13 10:50:40 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 13 Jan 2006 09:50:40 -0600 Subject: [Wtr-general] Unit testing In-Reply-To: References: Message-ID: On 1/13/06, Hugh Sasse wrote: > > Also, I encountered problems at first because of the active content > warnings in IE. I have left the warning popup to display every > time, because I don't always notice the yellowish stripe at the top > of the page. While this popup was present, the tests could not > function. Maybe there is a way to turn it off when doing Watir > tests and restore it to its previous setting afterwards? [I've had > to take the plunge and just remove it. I can't remember how to get > it back.] I see you've since read our instructions that indicate that this setting needs to be changed to make the unit tests run. This is the setting is in Tools-> Internet Options, Advanced Pane, Security section, called "Allow active content to run in files on My Computer". You don't need to turn this setting on for Watir in general, but it is required for the unit tests. It is the nature of this kind of setting that it can't be set automatically (e.g. from the unit tests). That would undermine it's ability to control security. At least that's my understanding: if anyone knows otherwise, speak up. I would love to take care of this automatically in the unit tests. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060113/96ef2331/attachment.html From mb at michaelbolton.net Fri Jan 13 11:02:14 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Fri, 13 Jan 2006 11:02:14 -0500 Subject: [Wtr-general] RPC Server unavailable In-Reply-To: <1aa3b8a50601130659y13cbf966tcda1bb13b7c6a8be@mail.gmail.com> Message-ID: <007401c6185a$bd1570a0$6801a8c0@Koko> Hi, Dmitri... After a little research, I'm not at all sure if there's anything WATIR-specific about this problem, or that there's anything that can be done in WATIR to mitigate it. The error message is sadly very general. I found these two documents that might shed some light on the problem. http://www.aspfaq.com/show.asp?id=2267 http://support.microsoft.com/default.aspx/kb/265340 Alas shedding light is not the same as /solving/ the problem. Sorry. ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Dmitri Dolguikh Sent: January 13, 2006 9:59 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] RPC Server unavailable Hi list, I keep getting the following error intemittently: WIN32OLERuntimeError: Unknown property or method `document' HRESULT error code:0x800706ba The RPC server is unavailable. when trying to access a link on a page. The test is being run in Windows 2003 Server under IE 6.0.379.0, with high-security turned off. We're trying to use Watir for automated acceptance testing; while running tests on desktops (under Windows XP) wasn't an issue at all, we're seeing the errors above when running tests using CruiseControl. Cheers, -Dmitri _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Fri Jan 13 11:10:54 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 13 Jan 2006 10:10:54 -0600 Subject: [Wtr-general] RPC Server unavailable In-Reply-To: <1aa3b8a50601130659y13cbf966tcda1bb13b7c6a8be@mail.gmail.com> References: <1aa3b8a50601130659y13cbf966tcda1bb13b7c6a8be@mail.gmail.com> Message-ID: Dmitri, This error happens when you close and then open IE windows. The problem is that IE#close is asynchronous. It returns, but the IE RPC server (IE is itself made up of a server bit and a client bit both running on your machine connected via RPC) is still in the process of shutting down. Then the IE#new happens, and a new client is created using the IE RPC server that is in the process of shutting down. Then it shuts down. There are three workarounds to this problem. 1. Add time delays between the ie.close and ie.new or ie.start. This will give a chance for the ie.close to really close. 2. Don't close IE -- just reuse the existing client between tests. 3. Create an additional IE. As long as this lives, the IE server will continue to live and you can close and create IE windows without worry. I presume you are using Watir 1.4. The watir library in HEAD uses option 3 to avoid this problem. The best solution would be to make ie.close synchronous. John Kordyback has an idea for how to make this happen. Bret On 1/13/06, Dmitri Dolguikh wrote: > > Hi list, > > I keep getting the following error intemittently: > > WIN32OLERuntimeError: Unknown property or method `document' > HRESULT error code:0x800706ba > The RPC server is unavailable. > > when trying to access a link on a page. The test is being run in > Windows 2003 Server under IE 6.0.379.0, with high-security turned off. > > We're trying to use Watir for automated acceptance testing; while > running tests on desktops (under Windows XP) wasn't an issue at all, > we're seeing the errors above when running tests using CruiseControl. > > Cheers, > -Dmitri > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060113/28a0a1b4/attachment.html From bret at pettichord.com Fri Jan 13 11:18:44 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 13 Jan 2006 10:18:44 -0600 Subject: [Wtr-general] Assert error when calling a script from a different file In-Reply-To: <493148DCF171954FBBF8E8AAB261638C0574E2@msgswbmnmsp35.wellsfargo.com> References: <493148DCF171954FBBF8E8AAB261638C0574E2@msgswbmnmsp35.wellsfargo.com> Message-ID: The simple solution is to add this code to cdd_154.rb: require 'test/unit/assertions' include Test::Unit::Assertions Note that doing this will end up not having these assertions show up in the assertion count you get when you run the tests. Bret On 1/11/06, David.J.Solis at wellsfargo.com wrote: > > I'm calling a class from a file within a loop in separate file from my > test script. The objective is to iterate through my script n... number of > times. The call from the loop works fine, but the asserts in the in my test > script are not working > > *Here is my loop that lives in a separate file:* > > require 'cdd_154' > $aaa=001; $aaaa=10; > @temp = CDD_154.new > for $aaa in ($aaa..$aaaa) > @temp.test_questions > end > > *Here is my class in my test script:* > > #includes: > require 'watir' > #test::unit requires > require 'win32ole' # to read from a spreadsheet > require 'test/unit' > require 'test/unit/testcase' > require 'test/unit/autorunner' > require 'watir' > require 'watir/testUnitAddons' > > $test_site = 'http://www.testsite.com' > > class CDD_154 < Test::Unit::TestCase > > def initialize() > end > > def test_questions > > *then comes my code with some assetions* > > end > > This the error I get one it reaches my first assert > c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:115:in `add_assertion': > undefined met > hod `add_assertion' for nil:NilClass (NoMethodError) > from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:353:in > `_wrap_assertio > n' > from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:38:in `assert' > from ./cdd_154.rb:59:in `test_questions' > from C:/_Watir/examples/tester1.rb:10 > from C:/_Watir/examples/tester1.rb:9:in `each' > from C:/_Watir/examples/tester1.rb:9 > > Any ideas on what I'm doing wrong? > > > > *David Solis* > > *WELLS **FARGO** ** PCS TECHNOLOGY ** -* > > *(* Phone: (415) 267-0154 > > *(* Cell: (415) 385-3286 > > MAC: A0103-241 > > 8 Email: david.j.solis at wellsfargo.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/20060113/3586b779/attachment.html From hgs at dmu.ac.uk Fri Jan 13 12:18:52 2006 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Fri, 13 Jan 2006 17:18:52 +0000 (WET) Subject: [Wtr-general] Unit testing In-Reply-To: References: Message-ID: On Fri, 13 Jan 2006, Bret Pettichord wrote: > On 1/13/06, Hugh Sasse wrote: > > > > Also, I encountered problems at first because of the active content > > warnings in IE. I have left the warning popup to display every > > > I see you've since read our instructions that indicate that this setting > needs to be changed to make the unit tests run. Maybe the warning could be integrated into the test? I don't know how to interrogate the registry, I'm more at home on unix. > > This is the setting is in Tools-> Internet Options, Advanced Pane, Security > section, called "Allow active content to run in files on My Computer". You Yes. [A rather silly name given the ambiguity with the My Computer icon etc on the desktop, but I digress. Frequently!] > don't need to turn this setting on for Watir in general, but it is required > for the unit tests. It is the nature of this kind of setting that it can't > be set automatically (e.g. from the unit tests). That would undermine it's > ability to control security. At least that's my understanding: if anyone > knows otherwise, speak up. I would love to take care of this automatically > in the unit tests. The page your further documentation links to: http://www.winxptutor.com/lmzunlock.htm says: WORKAROUND In some cases, say when you're building and testing a webpage locally (Local Machine Zone), you may still see the Information Bar when the web page executes any script, initiates a Pop-up windows, or a download. For testing purposes, one needs to follow any of these workarounds: * Rename the .HTM file to .HTA (Example.. Index.HTM to Index.HTA and test the file locally). HTA files have more privileges than the HTM files, can run active content on Local Machine by default. -or- * add the Mark Of The Web code such as to a Web page, where the (0023) value is the string length of your URL that follows it and Contoso is the name of your Web site. The above is an extract from Local Machine Zone Lockdown - Developer Implications. See page for more information about the two workarounds above. However, I have just tried the approach with hta and it doesn't work for me. See the patchcluster below (not sure if I can attach it to this list, so it's included.) Hugh > > Bret > --- attachToExistingWindow_test_orig.rb 2006-01-13 16:48:40.468750000 +0000 +++ attachToExistingWindow_test.rb 2006-01-13 16:52:57.593750000 +0000 @@ -12,7 +12,7 @@ end def test_ExistingWindow - goto_page 'buttons1.html' + goto_page 'buttons1.hta' ie3=nil assert_raises( NoMatchingWindowFoundException ) { ie3 = IE.attach(:title , "missing") } @@ -29,7 +29,7 @@ assert_equal( "Test page for buttons" , ie3.title) ie3=nil - ie3 = IE.attach(:url, /buttons1.html/ ) + ie3 = IE.attach(:url, /buttons1.hta/ ) assert_equal( "Test page for buttons" , ie3.title) ie3=nil --- buttons_test_orig.rb 2006-01-13 16:48:40.468750000 +0000 +++ buttons_test.rb 2006-01-13 16:53:49.828125000 +0000 @@ -8,11 +8,11 @@ include Watir def setup - $ie.goto($htmlRoot + "buttons1.html") + $ie.goto($htmlRoot + "buttons1.hta") end def goto_frames_page() - $ie.goto($htmlRoot + "frame_buttons.html") + $ie.goto($htmlRoot + "frame_buttons.hta") end def aatest_Spinner --- checkbox_test_orig.rb 2006-01-13 16:48:40.484375000 +0000 +++ checkbox_test.rb 2006-01-13 16:54:08.484375000 +0000 @@ -8,7 +8,7 @@ include Watir def setup() - $ie.goto($htmlRoot + "checkboxes1.html") + $ie.goto($htmlRoot + "checkboxes1.hta") end def test_checkbox_properties --- css_test_orig.rb 2006-01-13 16:48:40.484375000 +0000 +++ css_test.rb 2006-01-13 16:54:28.218750000 +0000 @@ -41,7 +41,7 @@ end def gotoCSSPage() - $ie.goto($htmlRoot + "cssTest.html") + $ie.goto($htmlRoot + "cssTest.hta") end def test_SuccessMessage --- div_test_orig.rb 2006-01-13 16:48:40.515625000 +0000 +++ div_test.rb 2006-01-13 16:54:43.750000000 +0000 @@ -8,7 +8,7 @@ include Watir def setup() - $ie.goto($htmlRoot + "div.html") + $ie.goto($htmlRoot + "div.hta") end def test_divs @@ -176,4 +176,4 @@ end assert_equal( count-1 , $ie.ps.length) end -end \ No newline at end of file +end --- errorchecker_test_orig.rb 2006-01-13 16:48:40.531250000 +0000 +++ errorchecker_test.rb 2006-01-13 16:55:22.734375000 +0000 @@ -17,11 +17,11 @@ } $ie.add_checker(button_checker ) - assert_raises( RuntimeError ) { goto_page('forms3.html') } - assert_nothing_raised { goto_page('buttons1.html') } + assert_raises( RuntimeError ) { goto_page('forms3.hta') } + assert_nothing_raised { goto_page('buttons1.hta') } $ie.disable_checker( button_checker ) - assert_nothing_raised { goto_page('forms3.html') } + assert_nothing_raised { goto_page('forms3.hta') } end --- filefield_test_orig.rb 2006-01-13 16:48:40.531250000 +0000 +++ filefield_test.rb 2006-01-13 16:55:42.203125000 +0000 @@ -8,7 +8,7 @@ include Watir def gotoPage() - $ie.goto($htmlRoot + "fileupload.html") + $ie.goto($htmlRoot + "fileupload.hta") end def test_fileField_Exists @@ -20,7 +20,7 @@ assert_false($ie.fileField(:name, "missing").exists?) assert_false($ie.fileField(:name,"totallybogus").exists?) #pop one open and put something in it. - $ie.fileField(:name,"file1").set($htmlRoot + "fileupload.html") + $ie.fileField(:name,"file1").set($htmlRoot + "fileupload.hta") #click the upload button $ie.button(:name,"upload").click --- form_test_orig.rb 2006-01-13 16:48:40.562500000 +0000 +++ form_test.rb 2006-01-13 16:57:55.953125000 +0000 @@ -6,7 +6,7 @@ class TC_Forms2 < Test::Unit::TestCase def setup() - $ie.goto($htmlRoot + "forms2.html") + $ie.goto($htmlRoot + "forms2.hta") end def test_Form_Exists @@ -22,7 +22,7 @@ assert($ie.form(:method, "get").exists?) assert_false($ie.form(:method, "missing").exists?) - assert($ie.form(:action, "pass.html").exists?) + assert($ie.form(:action, "pass.hta").exists?) assert_false($ie.form(:action, "missing").exists?) end @@ -35,7 +35,7 @@ class TC_Form_Display < Test::Unit::TestCase include MockStdoutTestCase def test_showforms - $ie.goto($htmlRoot + "forms2.html") + $ie.goto($htmlRoot + "forms2.hta") $stdout = @mockout $ie.showForms assert_equal(< Hey folks, Travis Illig, an engineer at my company took my initial prototype for NUnit/Watir integration to the n'th degree and has posted his stuff on his blog and on CodeProject. If you're an NUnit and Watir house, I encourage you to take a look. http://www.paraesthesia.com/blog/comments.php?id=949_0_1_0_C Scott Hanselman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060113/8d5c135b/attachment.html From marco.neri at police.vic.gov.au Sun Jan 15 19:32:25 2006 From: marco.neri at police.vic.gov.au (Neri, Marco) Date: Mon, 16 Jan 2006 11:32:25 +1100 Subject: [Wtr-general] wet ModalDialog problem ? Message-ID: Hi ( this is more of a wet than watir issue but I'm hoping someone else can help ) I'm using wet (0.5.3) to open a custom confirm delete dialog using : Browser("title:=Victoria Police - Attendance").Link("text:=Delete").click_without_blocking puts(Browser("title:=Victoria Police - Attendance").Dialog("title:=Confirmation -- Web Page Dialog").to_s) Browser("title:=Victoria Police - Attendance").Dialog("title:=Confirmation -- Web Page Dialog").Button("text:=Yes").click #puts(Browser("title:=Victoria Police - Attendance").Dialog("title:=Confirmation -- Web Page Dialog").Button("text:=Yes").to_s) The dialog opens but the line to click the yes button times out and an exception is thrown. If I comment out out the click and uncomment the puts I see that the ModalDialog button function returns nil so It cannot find the button. here's a snippet from the source.

Are you sure you want to delete this record?

I'm at a loss as to why. Marco ======================================================= The information contained in this email and any files attached may be confidential information to the intended recipient and may be the subject of legal professional privilege or public interest immunity. If you are not the intended recipient, any use, disclosure or copying is unauthorised. If you have received this document in error please telephone 1300 307 082 ******************************************************************* This footnote also confirms that this email message has been swept for the presence of computer viruses. ******************************************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060116/3a44c2e7/attachment.html From raghu at qantom.com Sun Jan 15 21:38:47 2006 From: raghu at qantom.com (Raghu Venkataramana) Date: Mon, 16 Jan 2006 08:08:47 +0530 Subject: [Wtr-general] wet ModalDialog problem ? In-Reply-To: References: Message-ID: <43CB0737.6050409@qantom.com> If it is a HTML modal dialog, unfortunately it wont work. WET has a good support for javascript popups but currently doesn't support modal dialogs. Raghu Neri, Marco wrote: > Hi ( this is more of a wet than watir issue but I'm hoping someone > else can help ) > > I'm using wet (0.5.3) to open a custom confirm delete dialog using : > > Browser("title:=Victoria Police - > Attendance").Link("text:=Delete").click_without_blocking > puts(Browser("title:=Victoria Police - > Attendance").Dialog("title:=Confirmation -- Web Page Dialog").to_s) > Browser("title:=Victoria Police - > Attendance").Dialog("title:=Confirmation -- Web Page > Dialog").Button("text:=Yes").click > #puts(Browser("title:=Victoria Police - > Attendance").Dialog("title:=Confirmation -- Web Page > Dialog").Button("text:=Yes").to_s) > > The dialog opens but the line to click the yes button times out and an > exception is thrown. If I comment out out the click and uncomment the > puts I see that the ModalDialog button function returns nil so It > cannot find the button. > > here's a snippet from the source. > > >

Are you sure you want to delete this record?

>
> > >
> > I'm at a loss as to why. > > Marco > > > > > > ======================================================= > > The information contained in this email and any files attached may > > be confidential information to the intended recipient and may be > > the subject of legal professional privilege or public interest immunity. > > > > If you are not the intended recipient, any use, disclosure or copying is > > unauthorised. > > > > If you have received this document in error please telephone 1300 307 082 > > > > ******************************************************************* > > This footnote also confirms that this email message has been swept > > for the presence of computer viruses. > > ******************************************************************* > > > >------------------------------------------------------------------------ > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > From marco.neri at police.vic.gov.au Mon Jan 16 01:06:15 2006 From: marco.neri at police.vic.gov.au (Neri, Marco) Date: Mon, 16 Jan 2006 17:06:15 +1100 Subject: [Wtr-general] wet ModalDialog problem ? Message-ID: Ok. Thanks for that. Now that I understand it's not a javascript modal dialog I'll try to do this .. Start a new thread before launching the dialog ( with a suitable time delay ) In the new thread try to use the attach method of watir object to attach to the dialog by url or title Then click the yes button using standard watir button click ( get developers to add in either name or value tags ) M I'm open to other suggestions ... -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Raghu Venkataramana Sent: Monday, 16 January 2006 13:39 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] wet ModalDialog problem ? If it is a HTML modal dialog, unfortunately it wont work. WET has a good support for javascript popups but currently doesn't support modal dialogs. Raghu Neri, Marco wrote: > Hi ( this is more of a wet than watir issue but I'm hoping someone > else can help ) > > I'm using wet (0.5.3) to open a custom confirm delete dialog using : > > Browser("title:=Victoria Police - > Attendance").Link("text:=Delete").click_without_blocking > puts(Browser("title:=Victoria Police - > Attendance").Dialog("title:=Confirmation -- Web Page Dialog").to_s) > Browser("title:=Victoria Police - > Attendance").Dialog("title:=Confirmation -- Web Page > Dialog").Button("text:=Yes").click > #puts(Browser("title:=Victoria Police - > Attendance").Dialog("title:=Confirmation -- Web Page > Dialog").Button("text:=Yes").to_s) > > The dialog opens but the line to click the yes button times out and an > exception is thrown. If I comment out out the click and uncomment the > puts I see that the ModalDialog button function returns nil so It > cannot find the button. > > here's a snippet from the source. > > >

Are you sure you want to delete this record?

id="confirmbuttons"> > >
> > I'm at a loss as to why. > > Marco > > > > > > ======================================================= > > The information contained in this email and any files attached may > > be confidential information to the intended recipient and may be > > the subject of legal professional privilege or public interest immunity. > > > > If you are not the intended recipient, any use, disclosure or copying > is > > unauthorised. > > > > If you have received this document in error please telephone 1300 307 > 082 > > > > ******************************************************************* > > This footnote also confirms that this email message has been swept > > for the presence of computer viruses. > > ******************************************************************* > > > >----------------------------------------------------------------------- >- > >_______________________________________________ >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 information contained in this email and any files attached may be confidential information to the intended recipient and may be the subject of legal professional privilege or public interest immunity. If you are not the intended recipient, any use, disclosure or copying is unauthorised. If you have received this document in error please telephone 1300 307 082 ******************************************************************* This footnote also confirms that this email message has been swept for the presence of computer viruses. ******************************************************************* From jimche218 at gmail.com Mon Jan 16 04:53:40 2006 From: jimche218 at gmail.com (che jim) Date: Mon, 16 Jan 2006 17:53:40 +0800 Subject: [Wtr-general] How to judge whether the ruby is stopped or not In-Reply-To: <5397f6f80601152026l291d7b47q@mail.gmail.com> References: <5397f6f80601152026l291d7b47q@mail.gmail.com> Message-ID: <5397f6f80601160153w114069d5n@mail.gmail.com> Hi all I found sometimes the ruby will stop in a page without any actions.Inthat time I want to refresh that page in order to let ruby continue to do. But I don't know how to do it.For example in the code below: ie.link(:text,"Next").click Sometimes ruby will stop in this sentence,I want to refresh the page when ruby stop in this sentence for a long time.So how to code this? Thank you for any help jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060116/0000069d/attachment.html From Mark_Cain at rl.gov Mon Jan 16 10:18:04 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Mon, 16 Jan 2006 07:18:04 -0800 Subject: [Wtr-general] How can I open and attach file using file_fieldmethod? Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D501@EX5V.rl.gov> Here is one thing I see that was a problem for me. I need to escape the backslashes and colon in my file path. Try using this: $path = "C\:\\Watir\\file.txt" Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Thursday, January 12, 2006 7:26 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How can I open and attach file using file_fieldmethod? What behavior do you see? When my script runs I see a Dos window open with focus (just like WinClicker), then the file chooser window open under the Dos window. The Dos window scrolls through all the objects open and finally gets to the File Chooser window, the document name (from $path) appears in the file name field, the open button is clicked and that information is transferred to the file_field text boxes. Finally the submit button is clicked and the file is attached. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of chaya shetty Sent: Wednesday, January 11, 2006 10:11 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How can I open and attach fileusingfile_fieldmethod? Hi, I tried as said...Even then I am facing the same problem. Code Used: $path = "C:/Watir/file.txt" $ie.file_field(:name,"srcfile").set($path) $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinWait("Choose file", "Do you want to open or save this file?", 3) $autoit.WinActivate("Choose file") $autoit.WinWait("Choose file", "Look &in", 3) $autoit.ControlSetText("Choose file", "", "Edit1", "#{$path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.button(:name, "Open").click The file field highlights(yellow)and opens choose file dialog along with another ruby file with contents: # # setFileDialog.rb # # # This file contains the file dialog when it runs as a separate process $LOAD_PATH <&! lt; File.expand_path(File.join(File.dirname(__FILE__), '..')) puts $LOAD_PATH require 'watir/winClicker' filepath = "invalid path passed to setFileDialog.rb" filepath = ARGV[0] unless ARGV[0] == nil clicker= WinClicker.new clicker.setFileRequesterFileName(filepath) clicker = nil Then it waits for me to manually select the file and attach. I have ensured that the path is correct and there is a text file viz. file in the Watir folder. Thanks, Chaya "Cain, Mark" wrote: Replace all your $autoit lines with this: $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinWait("Choose file", "Do you want to open or save this file?", 3) $autoit.WinActivate("Choose file") $autoit.WinWait("Choose file", "Look &in", 3) $autoit.ControlSetText("Choose file", "", "Edit1", "#{$path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") I don't know if it will make a difference but my script needed the WinWait's left in to work right. Also, it took a little time for autoit to find the window so don't get impatient. Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of chaya shetty Sent: Thursday, January 05, 2006 9:27 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How can I open and attach file usingfile_fieldmethod? Hi, There is only one file field in the page and hence I tried with path = "C\:Watir\Text.doc" ie.file_field(:index,1).set(#{path}) $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinActivate("Choose file") $autoit.ControlSetText("Choose file", "", "Edit1", "#{path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.button(:name, "Submit").click B! ut still the same behaviour was seen. The file field was accessed and the "Choose File" window opened and waited till I manually selected the file. Thanks Chaya "Cain, Mark" wrote: Yes, the problem is (:value, 'Value') in this line: ie.file_field(:value,'Value').set(#{path}) ! The file_field supports these attributes: :id, :name, :index. Do a view source and find out what the attribute values for your tag. If for some reason your developers were lazy and didn't give the tag an id or name attribute, use index. If there are more than one tag on the page the indexing starts top-most down with 1 and increments from there. Here is the usage portion for file_field from Watir.rb: # This is the main me! thod for accessing a file field. Usually an HTML tag. # * how - symbol - how we access the field , :index, :id, :name etc # * what - string, int or re , what we are looking for, # # returns a FileField object # # Typical Usage # # ie.file_field(:id, 'up_1') # access the file upload field with an ID of up_1 # ie.file_field(:name, 'upload') # access the file upload field with a name of upload # ie.file_field(:index, 2) # access the second file upload on the page ( 1 based, so the first field is accessed with :index,1) Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of chaya shetty Sent: Thursday, January 05, 2006 4:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How can I open and attach file using file_fieldmethod? Hi, I tried with path = "C\:Watir\Text.doc" ie.file_field(:value,'Value').set(#{path}) $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinActivate("Choose file") $autoit.ControlSetText("Choose file", "", "Edit1", "#{path}") $autoit.ControlClick("Choose file", "Look &in", "&Open") $ie.button(:name, "Submit").click But the same behaviour persists. i.e. the "Choose File" window opens and waits till you manually select the file. Can't ie.file_field(:value,'Value').set(#{path}) automatically set the path? Thanks Chaya --Mark Amitha Shetty wrote: Hi, How can I open and attach file using file_field method? when I try, ie.file_field(:id,'uploaded_file').set('C:\file.txt') I get "choose file"-window open .It waits for me, to choose a file and click "open" or whatever the button is called) , after that it continues normally, by submitting the file_field content. Why doesn't he choose a file by himself?How do I handle this? I have ensured that there is no space in the path and the file exists in C: ) I get the same error when I run filefield_test in Unittests in watir folder. Thanks, Amitha Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Send instant messages to your online friends http://in.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060116/46d0c60b/attachment.html From bret at pettichord.com Mon Jan 16 14:19:54 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 16 Jan 2006 13:19:54 -0600 Subject: [Wtr-general] Link that can not be found In-Reply-To: <001c01c613c6$b73d5460$6801a8c0@Koko> References: <001c01c613c6$b73d5460$6801a8c0@Koko> Message-ID: > > Which actually raises an interesting point: somewhere in the Watir > documentation is the notion that the easiest way to find the link is by > id--the id= attribute inside the Anchor tag, which apparently is preferred > under current markup language standards, or name--the name= attribute > inside the Anchor tag, which is apparently deprecated. Looking by :text > means that if the text on the link changes, the test breaks. The theory > is that an id attribute will be changed less often than the text. That > seems like a reasonable presumption in many cases. The HTML you use in your > example might be part of a tutorial that you're doing, or it might be part > of an application that you're testing. If the latter, you can ask the > programmer nicely for more testability by asking for id attributes in the > markup. Michael, since you've offered to write Watir documentation, i thought i should make a few points of minor clarification. These issues you mention are really not pertinent to the Watir documentation per se. Rather they describe testing principles that true whether you are using Watir or some other tool. The id attribute indeed tends to be the must useful identifier for testing. This is because, by specification, it is unique on a page. The name attribute is not necessary unique. In some cases, it is proper for two fields to have the same name attribute -- if they do the same thing. A good example would be to suppose that for page design reasons a page had two search fields. Properly they would have the same name, but different id's. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060116/2a58974d/attachment.html From mb at michaelbolton.net Mon Jan 16 14:51:32 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Mon, 16 Jan 2006 14:51:32 -0500 Subject: [Wtr-general] Link that can not be found In-Reply-To: Message-ID: <001a01c61ad6$406cbf30$6801a8c0@Koko> Thanks, Bret. Even though it's not an issue exclusive to WATIR or its documentation, I'd contend that it's relevant. Many people (partly because of the price, for example) will be coming at test automation for the first time through WATIR. I wouldn't necessarily put this sort of gloss in (say) the entry on the "link" method, but I might put it into an appendix or a footnote. Reasonable? ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: January 16, 2006 2:20 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Link that can not be found Which actually raises an interesting point: somewhere in the Watir documentation is the notion that the easiest way to find the link is by id--the id= attribute inside the Anchor tag, which apparently is preferred under current markup language standards, or name--the name= attribute inside the Anchor tag, which is apparently deprecated. Looking by :text means that if the text on the link changes, the test breaks. The theory is that an id attribute will be changed less often than the text. That seems like a reasonable presumption in many cases. The HTML you use in your example might be part of a tutorial that you're doing, or it might be part of an application that you're testing. If the latter, you can ask the programmer nicely for more testability by asking for id attributes in the markup. Michael, since you've offered to write Watir documentation, i thought i should make a few points of minor clarification. These issues you mention are really not pertinent to the Watir documentation per se. Rather they describe testing principles that true whether you are using Watir or some other tool. The id attribute indeed tends to be the must useful identifier for testing. This is because, by specification, it is unique on a page. The name attribute is not necessary unique. In some cases, it is proper for two fields to have the same name attribute -- if they do the same thing. A good example would be to suppose that for page design reasons a page had two search fields. Properly they would have the same name, but different id's. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060116/9014c110/attachment.html From sergio.pinon at us.g4s.com Mon Jan 16 15:33:25 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Mon, 16 Jan 2006 12:33:25 -0800 Subject: [Wtr-general] A testing framework Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1CFD@bugatti.ems.securicor.com> I recently spent sometime coming up with a simpler way to test my projects running from nant and using xml as the test. I would love to get some feedback on what ones think or ways that it can be improved. I have attached the entire framework for your review. Thanks Sergio Pi?on Senior Software Engineer Information Technology Department G4S Justice Services Inc. 30201 Aventura Rancho Santa Margarita, CA 92688 Tel: (949) 635-1600 x325 Fax: (949) 635-1614 sergio.pinon at us.g4s.com This company is part of the Group 4 Securicor group of companies. This communication contains information which may be confidential, personal and/or privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s), please note that any distribution, forwarding, copying or use of this communication or the information in it is strictly prohibited. Any personal views expressed in this e-mail are those of the individual sender and the Company does not endorse or accept responsibility for them. Prior to taking any action based upon this e-mail message, you should seek appropriate confirmation of its authenticity. This message has been checked for viruses on behalf of the Company. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060116/4a88b409/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: testing framework.zip Type: application/x-zip-compressed Size: 12027 bytes Desc: testing framework.zip Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060116/4a88b409/attachment.bin From sergio.pinon at us.g4s.com Mon Jan 16 15:48:54 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Mon, 16 Jan 2006 12:48:54 -0800 Subject: [Wtr-general] Testing framework Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1D00@bugatti.ems.securicor.com> Also I forgot to submit the xsl files I used for CruiseControl.NET to display the results. Sergio Pi?on Senior Software Engineer Information Technology Department G4S Justice Services Inc. 30201 Aventura Rancho Santa Margarita, CA 92688 Tel: (949) 635-1600 x325 Fax: (949) 635-1614 sergio.pinon at us.g4s.com This company is part of the Group 4 Securicor group of companies. This communication contains information which may be confidential, personal and/or privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s), please note that any distribution, forwarding, copying or use of this communication or the information in it is strictly prohibited. Any personal views expressed in this e-mail are those of the individual sender and the Company does not endorse or accept responsibility for them. Prior to taking any action based upon this e-mail message, you should seek appropriate confirmation of its authenticity. This message has been checked for viruses on behalf of the Company. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060116/8c071628/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rubysummary.xsl Type: application/octet-stream Size: 7315 bytes Desc: rubysummary.xsl Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060116/8c071628/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: rubytests.xsl Type: application/octet-stream Size: 8007 bytes Desc: rubytests.xsl Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060116/8c071628/attachment-0001.obj From christopher.mcmahon at gmail.com Mon Jan 16 16:11:15 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 16 Jan 2006 15:11:15 -0600 Subject: [Wtr-general] A testing framework In-Reply-To: <6554B86C58B86F43B66363ED5CF6ED05DC1CFD@bugatti.ems.securicor.com> References: <6554B86C58B86F43B66363ED5CF6ED05DC1CFD@bugatti.ems.securicor.com> Message-ID: <72799cd70601161311y14757b90qaaf8dfaef56787c5@mail.gmail.com> Hi Sergio > I recently spent sometime coming up with a simpler way to test my projects > running from nant and using xml as the test. I would love to get some > feedback on what ones think or ways that it can be improved. I have attached > the entire framework for your review. At a glance, I can see what you're doing here. (Although I'm sure I fail to grasp the finer points from such a quick look.) If you don't mind a couple of questions... Your XML tests seem to contain 3 elements, control_type, control_object, and control_action, of which some take parameters. What drove these design decisions? That is, it seems efficient and useful in context, I wonder the process by which you arrived at this design. Also, I'm about to have to integrate some Ruby (not Watir) tests with CC.NET, and it would be great to hear what you had to do to get your Ruby code to interact nicely with CruiseControl. Thanks... -Chris From sergio.pinon at us.g4s.com Mon Jan 16 16:21:25 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Mon, 16 Jan 2006 13:21:25 -0800 Subject: [Wtr-general] A testing framework Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1D05@bugatti.ems.securicor.com> In regards to your first question I think the thought process behind that design was that I wanted something robust enough to be able to handle any web testing. I didn't want to have to write if statements for each control on each page so after researching I figured the easiest way would be to write libraries for each control type and then within those libraries handle every event that could be raised for each object type. Basically those are the core elements I felt that were needed to run a test. Secondly, for CruiseControl, all you need to do I smodify the config files to include your xsl files and then write your xsl files to be able to parse your xml and create the output. It was actually quite simple. Sergio -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: Monday, January 16, 2006 1:11 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] A testing framework Hi Sergio > I recently spent sometime coming up with a simpler way to test my projects > running from nant and using xml as the test. I would love to get some > feedback on what ones think or ways that it can be improved. I have attached > the entire framework for your review. At a glance, I can see what you're doing here. (Although I'm sure I fail to grasp the finer points from such a quick look.) If you don't mind a couple of questions... Your XML tests seem to contain 3 elements, control_type, control_object, and control_action, of which some take parameters. What drove these design decisions? That is, it seems efficient and useful in context, I wonder the process by which you arrived at this design. Also, I'm about to have to integrate some Ruby (not Watir) tests with CC.NET, and it would be great to hear what you had to do to get your Ruby code to interact nicely with CruiseControl. Thanks... -Chris _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Mon Jan 16 16:41:22 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 16 Jan 2006 15:41:22 -0600 Subject: [Wtr-general] Link that can not be found In-Reply-To: <001a01c61ad6$406cbf30$6801a8c0@Koko> References: <001a01c61ad6$406cbf30$6801a8c0@Koko> Message-ID: It really depends on what kind of documentation you are writing. You originally asked whether these notions were implicit to Watir, and the answer is no. Are they relevant? yes. In fact, Watir was designed to make these kinds of things *explicit*. By contrast, Watir's predecessor, IEController, *implicitly* referred to objects via names. And Selenium, *implicitly* treats references by name as references by id in some specific situations (or is it the other way around?). The fuzzy matching used by some of the commercial tools also makes these issues less distinct with them. In the context of Watir itself, however, any of these methods (name, id, text) are equally good. It is only the larger context of specific applications and the practices used to develop them that you can say thatone method may be better than another. Some of the most valuable writing might be to describe how to do effective automated testing using Watir. Watir allows this key issue of identification method to be explicit and simple, without having to go into window maps or other configuration settings or lengthy tool explanations. One of my primary motivations for developing Watir was to facilitate this kind of writing. But I would hesitate to call this kind of thing "Watir documentation". Consider Mike Kelly's performance testing article. He orginally had his examples written JRobot (i think) but ported them to Watir to increase the accessibility of the article. BTW, i think where you are taking this is in a direction that by convention goes under the label "best practices". Bret On 1/16/06, Michael Bolton wrote: > > Thanks, Bret. > > Even though it's not an issue exclusive to WATIR or its documentation, I'd > contend that it's relevant. Many people (partly because of the price, for > example) will be coming at test automation for the first time through > WATIR. I wouldn't necessarily put this sort of gloss in (say) the entry on > the "link" method, but I might put it into an appendix or a footnote. > Reasonable? > > ---Michael B. > > ------------------------------ > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Bret Pettichord > *Sent:* January 16, 2006 2:20 PM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] Link that can not be found > > Which actually raises an interesting point: somewhere in the Watir > > documentation is the notion that the easiest way to find the link is by > > id--the id= attribute inside the Anchor tag, which apparently is preferred > > under current markup language standards, or name--the name= attribute > > inside the Anchor tag, which is apparently deprecated. Looking by :text > > means that if the text on the link changes, the test breaks. The theory > > is that an id attribute will be changed less often than the text. That > > seems like a reasonable presumption in many cases. The HTML you use in your > > example might be part of a tutorial that you're doing, or it might be part > > of an application that you're testing. If the latter, you can ask the > > programmer nicely for more testability by asking for id attributes in the > > markup. > > > Michael, since you've offered to write Watir documentation, i thought i > should make a few points of minor clarification. > > These issues you mention are really not pertinent to the Watir > documentation per se. Rather they describe testing principles that true > whether you are using Watir or some other tool. > > The id attribute indeed tends to be the must useful identifier for > testing. This is because, by specification, it is unique on a page. The name > attribute is not necessary unique. In some cases, it is proper for two > fields to have the same name attribute -- if they do the same thing. A good > example would be to suppose that for page design reasons a page had two > search fields. Properly they would have the same name, but different id's. > > 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/20060116/2218b60b/attachment.html From jimche218 at gmail.com Tue Jan 17 00:30:09 2006 From: jimche218 at gmail.com (che jim) Date: Tue, 17 Jan 2006 13:30:09 +0800 Subject: [Wtr-general] How to implement this function Message-ID: <5397f6f80601162130j2c1fe409w@mail.gmail.com> Hi all Sometimes I found that the page was loading so slowly even more then 10 minutes. So I want to refresh the page when met this problem.Could anybody give me some advice to do it? For example ie.link(:text,"abc").click if (the time of page loading more than 1 minute) refresh page end So how the code should be written? Thank you for any help Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060117/e8412893/attachment.html From peppers at gmail.com Tue Jan 17 12:51:42 2006 From: peppers at gmail.com (Terry Peppers) Date: Tue, 17 Jan 2006 11:51:42 -0600 Subject: [Wtr-general] Clicking Links in an Image Map Message-ID: <8ca48b420601170951j130a0061o8bb9561cd508efab@mail.gmail.com> First off, I wanted to thank Chris and Brett for responding to my 'Design Problems' question last week. Both comments were incredibly helpful. That, and I had a total RTFM manual moment when it came to creating functions in my test cases. Thanks a ton for the responses. New question, though. I was digging through the Watir mailing list archive looking for any information about how to access links that are in an image map. Didn't come up with anything and was wondering if there was a way to do this? I've created a function that basically goes through a page, grabs all the links, puts them in an array and then I have another function that takes in that array and clicks all the applicable links. Examples: def get_links() @links = Array.new @ie.links.each do |link| @links.push(link.href) end return @links end def click_links(pages) pages.each do |page| puts "Step: Click the \"#{page}\" link" @ie.link(:url, page).click @ie_pop = IE.attach(:url, page) @ie_pop.wait # do some assertions here @ie_pop.close end end def test_links @list = get_links() click_links(@list) end I keep printing out the array '@links' in the 'test_links' method and I don't see the links that happen to be in image maps. Do I need to write another function that looks @ at image maps and put those into another array? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060117/cc8c3ca0/attachment.html From info at reatlas.com Tue Jan 17 16:18:53 2006 From: info at reatlas.com (Ethan Herdrick) Date: Tue, 17 Jan 2006 13:18:53 -0800 Subject: [Wtr-general] Weird: Autoit through VPN connection not functioning Message-ID: <91f48dbf0601171318xf76eb32vccb135009d23e08c@mail.gmail.com> Hello! I'm making a watir script to automate the downloading of some files from a corporate intranet site. It works fine when I run it on my laptop when my laptop is directly plugged into the corporate network. However, when I have the same laptop at home and am using a VPN connection get into the same corporate network, it does not work. What happens is, using watir to click on links still works fine but it isn't handling the "File Download" dialog. (My script detects that the "File Download" dialog exists, then clicks "Save", then detects if the "Save As" dialog exists, then fills in the "File Name" field, then clicks "Save") By watching my log messages, I see that none of the autoit functions that should block are blocking. autoit.ControlClick isn't doing a click, but isn't blocking either, nor is autoit.ControlSetText. Even autoit.WinWait isn't blocking until the proper dialog exists. Why should the fact that I am using VPN matter? Am I missing some other factor? Perhaps I should point that my browser is configured to run a company-mandated chunk of JavaScript upon startup which configures to browser to use a proxy server. I don't think that is causing the problem. Thank you for your time and attention! From DBoyt at anteon.com Tue Jan 17 16:20:47 2006 From: DBoyt at anteon.com (Boyt, Darrel) Date: Tue, 17 Jan 2006 16:20:47 -0500 Subject: [Wtr-general] Selecting a table cell Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC8F506DC@HQ-EXVS02.anteon.com> I want to select a cell in a table and copy it to the clipboard. I know I can use send_keys("^a^c") to have AutoItX select an entire page and copy it to the Windows clipboard, but I want just one cell in a table copied. Any idea how to do this???? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama From jon at pdxfishguy.com Tue Jan 17 18:57:46 2006 From: jon at pdxfishguy.com (Jon Passmore) Date: Tue, 17 Jan 2006 18:57:46 -0500 Subject: [Wtr-general] threads to close security - working unless it doesn't come up. Message-ID: <23e5589a4fdb4a60bd5d4f76bf7db56f@pdxfishguy.com> I am testing stuff on two different servers. on one server I get a security alert which I am taking care of with this: a = thread.new { code here... } b = Thread.new { sleep 1; helper = WindowHelper.new; helper.push_security_alert_yes; } If the security alert doesn't pop up as is true on the second server, the code in A just sits there like it is waiting for b to finish up and join it. Please help. Thanks. Jon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060117/2518054b/attachment.html From bagee at aventail.com Tue Jan 17 19:32:12 2006 From: bagee at aventail.com (Bill Agee) Date: Tue, 17 Jan 2006 16:32:12 -0800 Subject: [Wtr-general] threads to close security - working unless it doesn'tcome up. Message-ID: <30561FB511309F44A56833A491C9FEC6026A2051@exchange2.in.aventail.com> I think that happens because the autoit WinWait call inside the 'push_security_alert_yes' method doesn't have a timeout value. So it waits forever, looking for the "Security Alert" window. You can check out the details of how that popup is dismissed by looking in your local copy of WindowHelper.rb (which should be in \ruby\lib\ruby\site_ruby\1.8\watir\). A good way to work around this might be to write your own autoit method that copies exactly what 'push_security_alert_yes' does, but with a timeout added. As a quick test you could try adding this to your "b" thread (after commenting out the WindowHelper stuff in the thread): require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') autoit.WinWait "Security Alert", "", 5 autoit.Send "{TAB}" autoit.Send "{TAB}" autoit.Send "{SPACE}" I think that should work (I didn't test it, though). The only major difference between that and 'push_security_alert_yes' is the "5" value added to the end of WinWait. So I guess if you don't mind editing the library you could make the change (or add a new method) in WindowHelper.rb. But in the long term, the change might get lost in an upgrade or something, so... Docs on WinWait and many more useful autoit functions are in AutoItX.chm (or http://www.autoitscript.com/autoit3/docs/functions.htm). Thanks Bill -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jon Passmore Sent: Tuesday, January 17, 2006 3:58 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] threads to close security - working unless it doesn'tcome up. I am testing stuff on two different servers. on one server I get a security alert which I am taking care of with this: a = thread.new { code here... } b = Thread.new { sleep 1; helper = WindowHelper.new; helper.push_security_alert_yes; } If the security alert doesn't pop up as is true on the second server, the code in A just sits there like it is waiting for b to finish up and join it. Please help. Thanks. Jon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060117/89d97250/attachment.html From mb at michaelbolton.net Tue Jan 17 20:33:12 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Tue, 17 Jan 2006 20:33:12 -0500 Subject: [Wtr-general] Selecting a table cell In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC8F506DC@HQ-EXVS02.anteon.com> Message-ID: <002001c61bcf$25b7caa0$6801a8c0@Koko> This is how it looks to me: Watir contains a Table object, whose [n](where n is an index) returns a row, whose [n](where n is an index) returns the cell in the nth column. Then you can use clip.rb (at http://segment7.net/projects/ruby/snippets/clip.rb) or something of its ilk to copy the data to the clipboard. HTH, ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: January 17, 2006 4:21 PM To: WATIR mailing list Subject: [Wtr-general] Selecting a table cell I want to select a cell in a table and copy it to the clipboard. I know I can use send_keys("^a^c") to have AutoItX select an entire page and copy it to the Windows clipboard, but I want just one cell in a table copied. Any idea how to do this???? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Tue Jan 17 22:15:57 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 17 Jan 2006 21:15:57 -0600 Subject: [Wtr-general] Weird: Autoit through VPN connection not functioning In-Reply-To: <91f48dbf0601171318xf76eb32vccb135009d23e08c@mail.gmail.com> References: <91f48dbf0601171318xf76eb32vccb135009d23e08c@mail.gmail.com> Message-ID: I wonder if doing the equivalent kinds of commands using Ruby wrappers, as for example with the WET win32 library, would run into the same problem or not. Bret On 1/17/06, Ethan Herdrick wrote: > > Hello! > > I'm making a watir script to automate the downloading of some files > from a corporate intranet site. It works fine when I run it on my > laptop when my laptop is directly plugged into the corporate network. > However, when I have the same laptop at home and am using a VPN > connection get into the same corporate network, it does not work. > > What happens is, using watir to click on links still works fine but it > isn't handling the "File Download" dialog. (My script detects that > the "File Download" dialog exists, then clicks "Save", then detects if > the "Save As" dialog exists, then fills in the "File Name" field, then > clicks "Save") By watching my log messages, I see that none of the > autoit functions that should block are blocking. autoit.ControlClick > isn't doing a click, but isn't blocking either, nor is > autoit.ControlSetText. Even autoit.WinWait isn't blocking until the > proper dialog exists. > > Why should the fact that I am using VPN matter? Am I missing some > other factor? Perhaps I should point that my browser is configured to > run a company-mandated chunk of JavaScript upon startup which > configures to browser to use a proxy server. I don't think that is > causing the problem. > > Thank you for your time and attention! > > _______________________________________________ > 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/20060117/b03c5102/attachment.html From angrez at gmail.com Wed Jan 18 00:14:03 2006 From: angrez at gmail.com (Angrez Singh) Date: Wed, 18 Jan 2006 10:44:03 +0530 Subject: [Wtr-general] Clicking Links in an Image Map In-Reply-To: <8ca48b420601170951j130a0061o8bb9561cd508efab@mail.gmail.com> References: <8ca48b420601170951j130a0061o8bb9561cd508efab@mail.gmail.com> Message-ID: Hi Terry, If that Image map is not inside a FRAME(currently xpath extension doesn't work for FRAMES) you can use XPath extension to identify the element inside image map. You can download the tar ball from the HEAD and read the examples provided in 'Support for XPath in Watir.doc' under the documents directory. The syntax for identifying the link would be like this: ie.link(:xpath, [xpath to the link under image map]) Regards, Angrez P.S.: This will work only if image map is not inside any frames. On 1/17/06, Terry Peppers wrote: > > First off, I wanted to thank Chris and Brett for responding to my 'Design > Problems' question last week. Both comments were incredibly helpful. That, > and I had a total RTFM manual moment when it came to creating functions in > my test cases. Thanks a ton for the responses. > > New question, though. I was digging through the Watir mailing list archive > looking for any information about how to access links that are in an image > map. Didn't come up with anything and was wondering if there was a way to do > this? I've created a function that basically goes through a page, grabs all > the links, puts them in an array and then I have another function that takes > in that array and clicks all the applicable links. Examples: > > def get_links() > @links = Array.new > @ie.links.each do |link| > @links.push(link.href) > end > return @links > end > > def click_links(pages) > pages.each do |page| > puts "Step: Click the \"#{page}\" link" > @ie.link(:url, page).click > @ie_pop = IE.attach(:url, page) > @ie_pop.wait > # do some assertions here > @ie_pop.close > end > end > > def test_links > @list = get_links() > click_links(@list) > end > > I keep printing out the array '@links' in the 'test_links' method and I > don't see the links that happen to be in image maps. Do I need to write > another function that looks @ at image maps and put those into another > array? > > _______________________________________________ > 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/20060118/6a2f706c/attachment.html From bret at pettichord.com Wed Jan 18 10:55:39 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 18 Jan 2006 09:55:39 -0600 Subject: [Wtr-general] Clicking Links in an Image Map In-Reply-To: <8ca48b420601170951j130a0061o8bb9561cd508efab@mail.gmail.com> References: <8ca48b420601170951j130a0061o8bb9561cd508efab@mail.gmail.com> Message-ID: We don't have any support in Watir right now for image maps per se. I'm supposing you want a way to specify a portion of the image that you want clicked on. Bret On 1/17/06, Terry Peppers wrote: > > First off, I wanted to thank Chris and Brett for responding to my 'Design > Problems' question last week. Both comments were incredibly helpful. That, > and I had a total RTFM manual moment when it came to creating functions in > my test cases. Thanks a ton for the responses. > > New question, though. I was digging through the Watir mailing list archive > looking for any information about how to access links that are in an image > map. Didn't come up with anything and was wondering if there was a way to do > this? I've created a function that basically goes through a page, grabs all > the links, puts them in an array and then I have another function that takes > in that array and clicks all the applicable links. Examples: > > def get_links() > @links = Array.new > @ie.links.each do |link| > @links.push(link.href) > end > return @links > end > > def click_links(pages) > pages.each do |page| > puts "Step: Click the \"#{page}\" link" > @ie.link(:url, page).click > @ie_pop = IE.attach(:url, page) > @ie_pop.wait > # do some assertions here > @ie_pop.close > end > end > > def test_links > @list = get_links() > click_links(@list) > end > > I keep printing out the array '@links' in the 'test_links' method and I > don't see the links that happen to be in image maps. Do I need to write > another function that looks @ at image maps and put those into another > array? > > _______________________________________________ > 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/20060118/45cf95ff/attachment.html From DBoyt at anteon.com Wed Jan 18 17:56:32 2006 From: DBoyt at anteon.com (Boyt, Darrel) Date: Wed, 18 Jan 2006 17:56:32 -0500 Subject: [Wtr-general] Selecting a table cell Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC8F50B18@HQ-EXVS02.anteon.com> Using send_keys("^a^c") works fine for selecting an entire page as long as the focus isn't on a control like a textbox or button. But I want to select and copy a cell in a table -- including it's formatting -- so I can paste it into Word (or something). This may seem like an academic exercise, but I see some merit in being able to do this sort of thing to capture what is actually being displayed in the browser for troubleshooting purposes. The screen_capture method is fine for capturing the visible window, but oftentimes the data you need goes beyond what's visible. Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of "Michael Bolton" Sent: January 17, 2006 8:33 PM To: WATIR mailing list Subject: Re: [Wtr-general] Selecting a table cell This is how it looks to me: Watir contains a Table object, whose [n](where n is an index) returns a row, whose [n](where n is an index) returns the cell in the nth column. Then you can use clip.rb (at http://segment7.net/projects/ruby/snippets/clip.rb) or something of its ilk to copy the data to the clipboard. HTH, ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: January 17, 2006 4:21 PM To: WATIR mailing list Subject: [Wtr-general] Selecting a table cell I want to select a cell in a table and copy it to the clipboard. I know I can use send_keys("^a^c") to have AutoItX select an entire page and copy it to the Windows clipboard, but I want just one cell in a table copied. Any idea how to do this???? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama From BPaatsch at activevoice.com Wed Jan 18 19:30:39 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Wed, 18 Jan 2006 18:30:39 -0600 Subject: [Wtr-general] New to watir Windows/Linux Message-ID: Hello, I just run across watir and have a few question: (1): Does it only work on Windows? Or could it be installed and run on Linux? (2): What browsers does it support? Thanks, Bernd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060118/7087b582/attachment.html From angrez at gmail.com Thu Jan 19 00:21:01 2006 From: angrez at gmail.com (Angrez Singh) Date: Thu, 19 Jan 2006 10:51:01 +0530 Subject: [Wtr-general] New to watir Windows/Linux In-Reply-To: References: Message-ID: Hi Bernd, (1): Does it only work on Windows? Or could it be installed and run on > Linux? > Yes, it works only on Windows (2): What browsers does it support? > Currently only IE, though efforts are going on to support more browsers as well. Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060119/080a7e53/attachment.html From jhobbsjr at gmail.com Thu Jan 19 10:24:49 2006 From: jhobbsjr at gmail.com (John Hobbs) Date: Thu, 19 Jan 2006 10:24:49 -0500 Subject: [Wtr-general] Access denied problem is driving me nuts Message-ID: <30078ddb0601190724k51f9997fla917d6a12c7e8177@mail.gmail.com> I have an "access denied" problem that is driving me nuts. Here is the scenario: When I log into our test system using the official URL, such as https://hostname/testsystem/, I get "access denied" when I try to access any of the frames using Watir. In IE, I am able to right click and view the source of all the frames. If place an entry in my host file, such as "ip address tabasco", and access the system using https://tobasco/testsystem/..... My "access denied" problem goes away. I can access any of the frames. Watir works like a charm. Question: 1. If I can view the source in IE, shouldn't I be able to view the source using Watir? 2. Why does placing an entry in my hosts file make my "access denied" problems go away? Thanks John From David.J.Solis at wellsfargo.com Thu Jan 19 16:55:21 2006 From: David.J.Solis at wellsfargo.com (David.J.Solis at wellsfargo.com) Date: Thu, 19 Jan 2006 15:55:21 -0600 Subject: [Wtr-general] The difference between require vs. include Message-ID: <493148DCF171954FBBF8E8AAB261638C2E36E8@msgswbmnmsp35.wellsfargo.com> This question may have already been answered although I couldn't find it in forum. What is the difference between using 'require' and using 'include'? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060119/4b42ba01/attachment.html From dara.lillis at kiodex.com Thu Jan 19 17:29:01 2006 From: dara.lillis at kiodex.com (Dara Lillis) Date: Thu, 19 Jan 2006 14:29:01 -0800 Subject: [Wtr-general] The difference between require vs. include Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E19B87B@ehost011-27.exch011.intermedia.net> To quote Pickaxe (the standard Ruby reference): The Ruby include statement simply makes a reference to a named module. If that module is in a separate file, you must use require to drag that file in before using include. [...] a Ruby include does not simply copy the module's instance methods into the class. Instead, it makes a reference from the class to the included module. Pickaxe is the nickname of the book "Programming Ruby: The Pragmatic Programmers Guide" by Dave Thomas et al. An online version of the 1st edition is available. Here's a link to the section relevant to the above. http://www.whytheluckystiff.net/ruby/pickaxe/html/tut_modules.html ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David.J.Solis at wellsfargo.com Sent: Thursday, January 19, 2006 4:55 PM To: Wtr-general at rubyforge.org Subject: [Wtr-general] The difference between require vs. include This question may have already been answered although I couldn't find it in forum. What is the difference between using 'require' and using 'include'? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060119/71c84bad/attachment.html From welkin_inc at hotmail.com Fri Jan 20 03:25:08 2006 From: welkin_inc at hotmail.com (Andrew McFarlane) Date: Fri, 20 Jan 2006 01:25:08 -0700 Subject: [Wtr-general] Variable Number and Type of Method Parameters? Message-ID: I am testing an application whose UI controls are often difficult to specify. Sometimes I can uniquely identify a control with one attribute, and sometimes I need 3 or 4. Sometimes I can't see the difference between multiple controls, so I need to use an index value as one of those 3 or 4 attributes. With WATIR, can I specify a control by using a variable number and kind of parameters? I have a watered-down-not-thread-safe-has-synchronization-problems Perl tool (that I would like to toss) emulated from WATIR where I can say: $browser->link( innerText => 'Modify', nameProp => qr(modifyProductContract), outerHTML => qr((Pro|Select|Value) Service), index => 4 )->click; I see that I can use regex's with WATIR (very good), so I just need to make sure that I can pass in any number of control attributes and values before I embrace WATIR. If I can, how do I do it? A hash? Something else? Thanks. Andrew McFarlane From angrez at gmail.com Fri Jan 20 03:35:05 2006 From: angrez at gmail.com (Angrez Singh) Date: Fri, 20 Jan 2006 14:05:05 +0530 Subject: [Wtr-general] Variable Number and Type of Method Parameters? In-Reply-To: References: Message-ID: Hi, I think XPath extenstion to WATiR would be helpful in this case. Please download the tar ball from HEAD and read the supporting document in the 'docs' directory. Regards, Angrez On 1/20/06, Andrew McFarlane wrote: > > I am testing an application whose UI controls are often difficult to > specify. Sometimes I can uniquely identify a control with one attribute, > and sometimes I need 3 or 4. Sometimes I can't see the difference between > multiple controls, so I need to use an index value as one of those 3 or 4 > attributes. With WATIR, can I specify a control by using a variable > number > and kind of parameters? > > I have a watered-down-not-thread-safe-has-synchronization-problems Perl > tool > (that I would like to toss) emulated from WATIR where I can say: > > $browser->link( innerText => 'Modify', nameProp => > qr(modifyProductContract), outerHTML => qr((Pro|Select|Value) Service), > index => 4 )->click; > > I see that I can use regex's with WATIR (very good), so I just need to > make > sure that I can pass in any number of control attributes and values before > I > embrace WATIR. > > If I can, how do I do it? A hash? Something else? > > Thanks. > > Andrew McFarlane > > > _______________________________________________ > 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/20060120/a9654e2f/attachment.html From sergio.pinon at us.g4s.com Fri Jan 20 12:01:05 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Fri, 20 Jan 2006 09:01:05 -0800 Subject: [Wtr-general] Variable Number and Type of Method Parameters? Message-ID: <6554B86C58B86F43B66363ED5CF6ED052E6692@bugatti.ems.securicor.com> Not sure if you guys realize it but there is an xml library available in Ruby called REXML and from there you can use it in your WATIR scripts. I don't know if you saw my last post but I had written a small testing framework on top of Ruby and WATIR that utilizes REXML so that I can store my controls in an XML file and reference them from there. If you get a chance you might want to take a look to see how you can use the REXML library. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org on behalf of Angrez Singh Sent: Fri 1/20/2006 12:35 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Variable Number and Type of Method Parameters? Hi, I think XPath extenstion to WATiR would be helpful in this case. Please download the tar ball from HEAD and read the supporting document in the 'docs' directory. Regards, Angrez On 1/20/06, Andrew McFarlane wrote: I am testing an application whose UI controls are often difficult to specify. Sometimes I can uniquely identify a control with one attribute, and sometimes I need 3 or 4. Sometimes I can't see the difference between multiple controls, so I need to use an index value as one of those 3 or 4 attributes. With WATIR, can I specify a control by using a variable number and kind of parameters? I have a watered-down-not-thread-safe-has-synchronization-problems Perl tool (that I would like to toss) emulated from WATIR where I can say: $browser->link( innerText => 'Modify', nameProp => qr(modifyProductContract), outerHTML => qr((Pro|Select|Value) Service), index => 4 )->click; I see that I can use regex's with WATIR (very good), so I just need to make sure that I can pass in any number of control attributes and values before I embrace WATIR. If I can, how do I do it? A hash? Something else? Thanks. Andrew McFarlane _______________________________________________ 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: 5553 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060120/87c07eab/attachment.bin From angrez at gmail.com Fri Jan 20 13:55:45 2006 From: angrez at gmail.com (Angrez Singh) Date: Sat, 21 Jan 2006 00:25:45 +0530 Subject: [Wtr-general] Variable Number and Type of Method Parameters? In-Reply-To: <6554B86C58B86F43B66363ED5CF6ED052E6692@bugatti.ems.securicor.com> References: <6554B86C58B86F43B66363ED5CF6ED052E6692@bugatti.ems.securicor.com> Message-ID: Hi Sergio, The XPath extension internally uses REXML only to find the elements in IE DOM. Regards, Angrez On 1/20/06, Sergio Pinon wrote: > > Not sure if you guys realize it but there is an xml library available in > Ruby called REXML and from there you can use it in your WATIR scripts. I > don't know if you saw my last post but I had written a small testing > framework on top of Ruby and WATIR that utilizes REXML so that I can store > my controls in an XML file and reference them from there. If you get a > chance you might want to take a look to see how you can use the REXML > library. > > Sergio > > ________________________________ > > From: wtr-general-bounces at rubyforge.org on behalf of Angrez Singh > Sent: Fri 1/20/2006 12:35 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Variable Number and Type of Method Parameters? > > > Hi, > > I think XPath extenstion to WATiR would be helpful in this case. Please > download the tar ball from HEAD and read the supporting document in the > 'docs' directory. > > Regards, > Angrez > > > On 1/20/06, Andrew McFarlane wrote: > > I am testing an application whose UI controls are often difficult > to > specify. Sometimes I can uniquely identify a control with one > attribute, > and sometimes I need 3 or 4. Sometimes I can't see the difference > between > multiple controls, so I need to use an index value as one of those > 3 or 4 > attributes. With WATIR, can I specify a control by using a > variable number > and kind of parameters? > > I have a watered-down-not-thread-safe-has-synchronization-problems > Perl tool > (that I would like to toss) emulated from WATIR where I can say: > > $browser->link( innerText => 'Modify', nameProp => > qr(modifyProductContract), outerHTML => qr((Pro|Select|Value) > Service), > index => 4 )->click; > > I see that I can use regex's with WATIR (very good), so I just > need to make > sure that I can pass in any number of control attributes and > values before I > embrace WATIR. > > If I can, how do I do it? A hash? Something else? > > Thanks. > > Andrew McFarlane > > > _______________________________________________ > 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/20060121/1e788b01/attachment.html From sergio.pinon at us.g4s.com Fri Jan 20 14:12:37 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Fri, 20 Jan 2006 11:12:37 -0800 Subject: [Wtr-general] Variable Number and Type of Method Parameters? Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1E8E@bugatti.ems.securicor.com> I don't understand. You're saying that WATIR uses REXML to allow Xpath expressions against the IE DOM? Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Angrez Singh Sent: Friday, January 20, 2006 10:56 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Variable Number and Type of Method Parameters? Hi Sergio, The XPath extension internally uses REXML only to find the elements in IE DOM. Regards, Angrez On 1/20/06, Sergio Pinon < sergio.pinon at us.g4s.com> wrote: Not sure if you guys realize it but there is an xml library available in Ruby called REXML and from there you can use it in your WATIR scripts. I don't know if you saw my last post but I had written a small testing framework on top of Ruby and WATIR that utilizes REXML so that I can store my controls in an XML file and reference them from there. If you get a chance you might want to take a look to see how you can use the REXML library. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org on behalf of Angrez Singh Sent: Fri 1/20/2006 12:35 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Variable Number and Type of Method Parameters? Hi, I think XPath extenstion to WATiR would be helpful in this case. Please download the tar ball from HEAD and read the supporting document in the 'docs' directory. Regards, Angrez On 1/20/06, Andrew McFarlane wrote: I am testing an application whose UI controls are often difficult to specify. Sometimes I can uniquely identify a control with one attribute, and sometimes I need 3 or 4. Sometimes I can't see the difference between multiple controls, so I need to use an index value as one of those 3 or 4 attributes. With WATIR, can I specify a control by using a variable number and kind of parameters? I have a watered-down-not-thread-safe-has-synchronization-problems Perl tool (that I would like to toss) emulated from WATIR where I can say: $browser->link( innerText => 'Modify', nameProp => qr(modifyProductContract), outerHTML => qr((Pro|Select|Value) Service), index => 4 )->click; I see that I can use regex's with WATIR (very good), so I just need to make sure that I can pass in any number of control attributes and values before I embrace WATIR. If I can, how do I do it? A hash? Something else? Thanks. Andrew McFarlane _______________________________________________ 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/20060120/64c7cf50/attachment.html From john.l.gordon at wamu.net Fri Jan 20 17:29:57 2006 From: john.l.gordon at wamu.net (Gordon, John) Date: Fri, 20 Jan 2006 14:29:57 -0800 Subject: [Wtr-general] How to Have Watir Run Unattended? Message-ID: Hi all, Does anyone know how to set up Watir to run unattended? I'm having troubles trying to do this using a Scheduled Task. Requirements: 1) Execute a Watir script without having to have a user login to the computer to execute it (e.g via a Service or Scheduled task). 2) Have the script notify the developers when testing fails (via email or updating a web page). I'm trying to set up a Watir script to serve as a "heart beat" of sorts for my web site. The idea is that I have a watir script constantly running that tests a website and notifies our development team (via email or a status web page) when the scripts fail. I thought I would do it by creating a Windows Scheduled task that would periodically call my Watir Script. I'm getting an error when I execute this scheduled task, however. The error is: Failed to create WIN32OLE object from `InternetExplorer.Application' HRESULT error code:0x80070005 Access is denied. The script runs fine when I execute it via a command prompt. The user the Scheduled Task is running under is an admin account, so that should be fine too. The only thing I'm doing in the script is calling IE.new(); that's where the error occurs. I'm wondering if the problem is due to IE being a GUI app and scheduled tasks don't display GUI's. I tested this by creating a Scheduled Task to simply instantiate an instance of IE; it worked without errors. Here's the test I'm running: require 'watir' require 'test/unit' require 'ftools' class TC_MyCompany < Test::Unit::TestCase include Watir def test_hello_world @ie = IE.new() #BOOM!! Error happens here. @ie.close() t = Time.now time_stamp = t.strftime("Printed on %m/%d/%Y at %I:%M%p") File.open('E:\Watir\hello.txt', "w+") { |msg_file| msg_file.write("successfully opened IE at #{time_stamp}") } rescue File.open('E:\Watir\hello.txt', "w+") { |msg_file| msg_file.write($!) } end end Thanks for any help you can offer! John -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060120/2787cee1/attachment.html From sergio.pinon at us.g4s.com Fri Jan 20 17:51:10 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Fri, 20 Jan 2006 14:51:10 -0800 Subject: [Wtr-general] How to Have Watir Run Unattended? Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1ED1@bugatti.ems.securicor.com> I know this may be a little bit of extra work but here is what we do and it works fine. We use CruiseControl.Net which is a service that runs on our build machine and runs at timed intervals or we can force it as well. But then from CruiseControl we have a Nant build kickoff that executes our build scripts which one of the things that is done in that is to execute our WATIR scripts. Hope this helps. But as you can see it can be done and with minimal setup really. CruiseControl and Nant are both very easy to setup and get running. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Gordon, John Sent: Friday, January 20, 2006 2:30 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] How to Have Watir Run Unattended? Hi all, Does anyone know how to set up Watir to run unattended? I'm having troubles trying to do this using a Scheduled Task. Requirements: 1) Execute a Watir script without having to have a user login to the computer to execute it (e.g via a Service or Scheduled task). 2) Have the script notify the developers when testing fails (via email or updating a web page). I'm trying to set up a Watir script to serve as a "heart beat" of sorts for my web site. The idea is that I have a watir script constantly running that tests a website and notifies our development team (via email or a status web page) when the scripts fail. I thought I would do it by creating a Windows Scheduled task that would periodically call my Watir Script. I'm getting an error when I execute this scheduled task, however. The error is: Failed to create WIN32OLE object from `InternetExplorer.Application' HRESULT error code:0x80070005 Access is denied. The script runs fine when I execute it via a command prompt. The user the Scheduled Task is running under is an admin account, so that should be fine too. The only thing I'm doing in the script is calling IE.new(); that's where the error occurs. I'm wondering if the problem is due to IE being a GUI app and scheduled tasks don't display GUI's. I tested this by creating a Scheduled Task to simply instantiate an instance of IE; it worked without errors. Here's the test I'm running: require 'watir' require 'test/unit' require 'ftools' class TC_MyCompany < Test::Unit::TestCase include Watir def test_hello_world @ie = IE.new() #BOOM!! Error happens here. @ie.close() t = Time.now time_stamp = t.strftime("Printed on %m/%d/%Y at %I:%M%p") File.open('E:\Watir\hello.txt', "w+") { |msg_file| msg_file.write("successfully opened IE at #{time_stamp}") } rescue File.open('E:\Watir\hello.txt', "w+") { |msg_file| msg_file.write($!) } end end Thanks for any help you can offer! John -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060120/72116865/attachment.html From tallpaul at gmail.com Fri Jan 20 18:50:03 2006 From: tallpaul at gmail.com (Paul Czyzewski) Date: Fri, 20 Jan 2006 15:50:03 -0800 Subject: [Wtr-general] How to Have Watir Run Unattended? In-Reply-To: References: Message-ID: > Does anyone know how to set up Watir to run unattended? I'm having troubles > trying to do this using a Scheduled Task. Hi, I started looking into this a month ago and sidetracked. However, it appeared that a scheduled task *would* work, but not if the computer (desktop) was locked. I don't remember the error message, but it appeared to be that the browser wouldn't launch if the desktop was locked, so it may be the same thing you saw. Since setting a computer to never lock is a security issue, we think we've going to have such a machine in the server room, where it's physically secure. hope this helps. Paul Czyzewski From BPaatsch at activevoice.com Fri Jan 20 18:58:04 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Fri, 20 Jan 2006 17:58:04 -0600 Subject: [Wtr-general] How is it possible to specify to look for a specific text in a sp ecific tag? Message-ID: I am fairly new to watir and think it is a great tool. I have following code that fails to execute. if ie.contains_text(:id, "current" :text, "Groups") puts "Login Failed!: " else puts "Login Passed!" How is it possible to specify to look for a specific text in a specific tag? Thanks, Bernd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060120/b48f23a4/attachment.html From sergio.pinon at us.g4s.com Fri Jan 20 19:27:26 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Fri, 20 Jan 2006 16:27:26 -0800 Subject: [Wtr-general] How is it possible to specify to look for a specifictext in a sp ecific tag? Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1EE1@bugatti.ems.securicor.com> It's acutally quite simple. You can get the object like you would normally then use the ole object and then check the innerHTML or innerText since at that point you are just using the IE DOM you can basically do anything you would from javascript in IE. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Friday, January 20, 2006 3:58 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] How is it possible to specify to look for a specifictext in a sp ecific tag? I am fairly new to watir and think it is a great tool. I have following code that fails to execute. if ie.contains_text(:id, "current" :text, "Groups") puts "Login Failed!: " else puts "Login Passed!" How is it possible to specify to look for a specific text in a specific tag? Thanks, Bernd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060120/268a205c/attachment.html From sergio.pinon at us.g4s.com Fri Jan 20 19:29:28 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Fri, 20 Jan 2006 16:29:28 -0800 Subject: [Wtr-general] How is it possible to specify to look for a specifictext in a sp ecific tag? Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1EE2@bugatti.ems.securicor.com> And actually an even easier way would be to get the Text property of the control and then do a check that way as well. There are several options that you have available. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Friday, January 20, 2006 3:58 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] How is it possible to specify to look for a specifictext in a sp ecific tag? I am fairly new to watir and think it is a great tool. I have following code that fails to execute. if ie.contains_text(:id, "current" :text, "Groups") puts "Login Failed!: " else puts "Login Passed!" How is it possible to specify to look for a specific text in a specific tag? Thanks, Bernd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060120/37b73c0a/attachment.html From BPaatsch at activevoice.com Fri Jan 20 19:58:45 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Fri, 20 Jan 2006 18:58:45 -0600 Subject: [Wtr-general] How is it possible to specify to look for aspec ifictext in a sp ecific tag? Message-ID: Could you give me an example? I am fairly new to web testing. Thanks. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Friday, January 20, 2006 4:29 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How is it possible to specify to look for aspecifictext in a sp ecific tag? And actually an even easier way would be to get the Text property of the control and then do a check that way as well. There are several options that you have available. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Friday, January 20, 2006 3:58 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] How is it possible to specify to look for a specifictext in a sp ecific tag? I am fairly new to watir and think it is a great tool. I have following code that fails to execute. if ie.contains_text(:id, "current" :text, "Groups") puts "Login Failed!: " else puts "Login Passed!" How is it possible to specify to look for a specific text in a specific tag? Thanks, Bernd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060120/f67f7259/attachment.html From BPaatsch at activevoice.com Fri Jan 20 20:01:47 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Fri, 20 Jan 2006 19:01:47 -0600 Subject: [Wtr-general] How to click a button that has no id or name attribute Message-ID: I have this input button that I like to click. Unfortunate it has not id or name attribute attached to it. How can I click the button? --Bernd > *************************************** > Bernd Paatsch > Software Quality Assurance Engineer > Active Voice LLC > e-mail: bpaatsch at activevoice.com > Phone: (206) 441-4700 x1026 > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060120/810fe19a/attachment.html From BPaatsch at activevoice.com Fri Jan 20 20:08:48 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Fri, 20 Jan 2006 19:08:48 -0600 Subject: [Wtr-general] How to click a button that has no id or name at tribute Message-ID: My mistake. I had a typo in the code. ie.button(:value, "Login").click works just fine. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Friday, January 20, 2006 5:02 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] How to click a button that has no id or name attribute I have this input button that I like to click. Unfortunate it has not id or name attribute attached to it. How can I click the button? --Bernd *************************************** Bernd Paatsch Software Quality Assurance Engineer Active Voice LLC e-mail: bpaatsch at activevoice.com Phone: (206) 441-4700 x1026 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060120/770f7922/attachment.html From sergio.pinon at us.g4s.com Fri Jan 20 20:13:06 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Fri, 20 Jan 2006 17:13:06 -0800 Subject: [Wtr-general] How to click a button that has no id or name attribute Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1EE7@bugatti.ems.securicor.com> You can just click the button by using the value attribute: browser.button(:value, "Login").click; That should work just fine. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Friday, January 20, 2006 5:02 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] How to click a button that has no id or name attribute I have this input button that I like to click. Unfortunate it has not id or name attribute attached to it. How can I click the button? --Bernd *************************************** Bernd Paatsch Software Quality Assurance Engineer Active Voice LLC e-mail: bpaatsch at activevoice.com Phone: (206) 441-4700 x1026 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060120/bc83d0f4/attachment.html From sergio.pinon at us.g4s.com Fri Jan 20 20:18:24 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Fri, 20 Jan 2006 17:18:24 -0800 Subject: [Wtr-general] How is it possible to specify to look foraspec ifictext in a sp ecific tag? Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1EE8@bugatti.ems.securicor.com> So if you have the control reference already then what you would do is: control_text = ie_browser.[control reference].text; if (control_text.index([text you are looking for]) != nil) The text is in the control. else The text is not in the control end Should be good with that. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Friday, January 20, 2006 4:59 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] How is it possible to specify to look foraspec ifictext in a sp ecific tag? Could you give me an example? I am fairly new to web testing. Thanks. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Friday, January 20, 2006 4:29 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How is it possible to specify to look for aspecifictext in a sp ecific tag? And actually an even easier way would be to get the Text property of the control and then do a check that way as well. There are several options that you have available. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Friday, January 20, 2006 3:58 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] How is it possible to specify to look for a specifictext in a sp ecific tag? I am fairly new to watir and think it is a great tool. I have following code that fails to execute. if ie.contains_text(:id, "current" :text, "Groups") puts "Login Failed!: " else puts "Login Passed!" How is it possible to specify to look for a specific text in a specific tag? Thanks, Bernd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060120/588ec252/attachment.html From witlessbird at bitsandpixels.org Sat Jan 21 08:51:17 2006 From: witlessbird at bitsandpixels.org (Dmitri Dolguikh) Date: Sat, 21 Jan 2006 09:51:17 -0400 Subject: [Wtr-general] How to Have Watir Run Unattended? In-Reply-To: References: Message-ID: <1aa3b8a50601210551o725c1836vae20bb70df3dc749@mail.gmail.com> We use CruiseControl (continuos integration tool) on Windows; the machine is configured to autmatically login on startup. If you choose to go with CruiseControl, I'd recommend not to run in windows service mode - we has some issues with watir opening IE windows in that mode. Cheers, -Dmitri On 1/20/06, Paul Czyzewski wrote: > > Does anyone know how to set up Watir to run unattended? I'm having troubles > > trying to do this using a Scheduled Task. > > Hi, > I started looking into this a month ago and sidetracked. However, > it appeared that a scheduled task *would* work, but not if the > computer (desktop) was locked. I don't remember the error message, > but it appeared to be that the browser wouldn't launch if the desktop > was locked, so it may be the same thing you saw. > > Since setting a computer to never lock is a security issue, we > think we've going to have such a machine in the server room, where > it's physically secure. > > hope this helps. > Paul Czyzewski > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Sun Jan 22 15:30:58 2006 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 22 Jan 2006 14:30:58 -0600 Subject: [Wtr-general] Access denied problem is driving me nuts In-Reply-To: References: <30078ddb0601190724k51f9997fla917d6a12c7e8177@mail.gmail.com> Message-ID: > > On 1/19/06, John Hobbs wrote: > > > > 1. If I can view the source in IE, shouldn't I be able to view the > > source using Watir? > > > Not in cases analologous to what would happen during a "cross-site" > scripting attack. > > > > 2. Why does placing an entry in my hosts file make my "access denied" > > problems go away? > > > Cross-site scripting is when when scripts from one site try to access > content from another. Today's browsers prevent this from happening. Watir > runs into to the same barriers when you navigate from a page hosted from one > site to a frame hosted by another. Your hosts file change makes all these > frames & pages come from a single site. > > It would be great if someone on this list would put together a wiki page > describing this problem. > > Bret > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060122/2b99bbf5/attachment.html From angrez at gmail.com Sun Jan 22 23:51:06 2006 From: angrez at gmail.com (Angrez Singh) Date: Mon, 23 Jan 2006 10:21:06 +0530 Subject: [Wtr-general] Variable Number and Type of Method Parameters? In-Reply-To: <6554B86C58B86F43B66363ED5CF6ED05DC1E8E@bugatti.ems.securicor.com> References: <6554B86C58B86F43B66363ED5CF6ED05DC1E8E@bugatti.ems.securicor.com> Message-ID: Hi, > I don't understand. You're saying that WATIR uses REXML to allow Xpath > expressions against the IE DOM? > Correct. - Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/30d17497/attachment.html From martin.xus at gmail.com Mon Jan 23 06:47:11 2006 From: martin.xus at gmail.com (martin xus) Date: Mon, 23 Jan 2006 19:47:11 +0800 Subject: [Wtr-general] Why WindowHelper dosen't work? Message-ID: <47eb19540601230347n57d2e4a3gaa3dae63479c4e42@mail.gmail.com> I write the following code: require 'watir' require 'watir/WindowHelper' test_url = "test.html" ie = Watir::IE.new ie.goto(test_url) Thread.new{WindowHelper.new.push_confirm_button_ok} Thread.new(WindowHelper.new.push_alert_button) ie.close and the html as following: WindowHelper Test But it dosen't work.I don't know why?I wanna help. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/8063e66d/attachment.html From bret at pettichord.com Mon Jan 23 10:58:39 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 23 Jan 2006 09:58:39 -0600 Subject: [Wtr-general] Variable Number and Type of Method Parameters? In-Reply-To: References: Message-ID: Right now Watir normally only supports a single attribute. You may want to look at Wet, which supports multiple attributes. Or, as Angrez has suggested, use xpath. Bret On 1/20/06, Andrew McFarlane wrote: > > I am testing an application whose UI controls are often difficult to > specify. Sometimes I can uniquely identify a control with one attribute, > and sometimes I need 3 or 4. Sometimes I can't see the difference between > multiple controls, so I need to use an index value as one of those 3 or 4 > attributes. With WATIR, can I specify a control by using a variable > number > and kind of parameters? > > I have a watered-down-not-thread-safe-has-synchronization-problems Perl > tool > (that I would like to toss) emulated from WATIR where I can say: > > $browser->link( innerText => 'Modify', nameProp => > qr(modifyProductContract), outerHTML => qr((Pro|Select|Value) Service), > index => 4 )->click; > > I see that I can use regex's with WATIR (very good), so I just need to > make > sure that I can pass in any number of control attributes and values before > I > embrace WATIR. > > If I can, how do I do it? A hash? Something else? > > Thanks. > > Andrew McFarlane > > > _______________________________________________ > 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/20060123/a3f502c3/attachment.html From BPaatsch at activevoice.com Mon Jan 23 13:22:36 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Mon, 23 Jan 2006 12:22:36 -0600 Subject: [Wtr-general] Tricky checkbox selection Message-ID: Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/32dc714c/attachment.html From BPaatsch at activevoice.com Mon Jan 23 13:25:10 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Mon, 23 Jan 2006 12:25:10 -0600 Subject: [Wtr-general] Tricky checkbox selection Message-ID: Forgot the in the html sample. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/81467b35/attachment.html From sergio.pinon at us.g4s.com Mon Jan 23 13:44:58 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Mon, 23 Jan 2006 10:44:58 -0800 Subject: [Wtr-general] Tricky checkbox selection Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1F22@bugatti.ems.securicor.com> Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/6f54798d/attachment.html From BPaatsch at activevoice.com Mon Jan 23 13:46:38 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Mon, 23 Jan 2006 12:46:38 -0600 Subject: [Wtr-general] Tricky checkbox selection Message-ID: Unfortunately I do not know the value beforehand. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/c9627e03/attachment.html From Mark_Cain at rl.gov Mon Jan 23 13:50:00 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Mon, 23 Jan 2006 10:50:00 -0800 Subject: [Wtr-general] Tricky checkbox selection Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D51A@EX5V.rl.gov> When you installed Watir, the API doc was also installed. This is straight from that doc: checkbox(how, what=nil ,value=nil) This is the main method for accessing a check box. Usually an HTML tag. * how - symbol - how we access the check box , :index, :id, :name etc * what - string, int or re , what we are looking for, * value - string - when there are multiple objects with different value attributes, this can be used to find the correct object returns a CheckBox object Valid values for 'how' are :index - find the item using the index in the container ( a container can be a document, a TableCell, a Span, a Div or a P index is 1 based :name - find the item using the name attribute :id - find the item using the id attribute :beforeText - finds the item immediately before the specified text :afterText - finds the item immediately after the specified text Typical usage ie.checkbox(:id, 'send_email') # access the check box with an id of send_mail ie.checkbox(:name, 'send_copy') # access the check box with a name of send_copy ie.checkbox(:name, /n_/ ) # access the first check box whose name matches n_ ie.checkbox(:index, 2) # access the second check box on the page ( 1 based, so the first field is accessed with :index,1) In many instances, checkboxes on an html page have the same name, but are identified by different values. An example is shown next. Daily Email Weekly Email Monthly Email Watir can access these using the following: ie.checkbox(:id, 'day_to_send' , 'monday' ) # access the check box with an id of day_to_send and a value of monday => ie.checkbox(:name ,'email_frequency', 'weekly') # access the check box with a name of email_frequency and a value of 'weekly' There are some very good examples in the unittests located in the install directory for Watir. Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/693f0bac/attachment.html From sergio.pinon at us.g4s.com Mon Jan 23 14:12:29 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Mon, 23 Jan 2006 11:12:29 -0800 Subject: [Wtr-general] Tricky checkbox selection Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1F2F@bugatti.ems.securicor.com> Well the other thing to do is try the code below. What you do is get the underlying javascript object of the page and then interact with it as you would with javascript. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName("Add_member[]")[index of control].checked = true; ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/7c728594/attachment.html From David.J.Solis at wellsfargo.com Mon Jan 23 14:30:34 2006 From: David.J.Solis at wellsfargo.com (David.J.Solis at wellsfargo.com) Date: Mon, 23 Jan 2006 13:30:34 -0600 Subject: [Wtr-general] Random number generation. Message-ID: <493148DCF171954FBBF8E8AAB261638C0574EB@msgswbmnmsp35.wellsfargo.com> I have 2 questions: Can I use method names other then "test_sometest" in my script. For example, I have a method that performs a calculation and returns a value and passes that value to test method. Unless I rename my calculation method as "test_calculation" the method is not executed. I know that my class is inheriting from test::unit, but do I need to precede every method name with "test"? Secondly, I am trying to generate test users for my test by generating a random number and the concatenating that number to a string "test" so that the result is "test12345", for example. I'm using rand(max-0) to generate the number, but it returns a big number. So I tried stripping the number and then concatenating but it didn't work. Ultimately, I would like to have generate names with 5 digits randomly like the example above. Any ideas? def Random_name $rand_num = rand(max=0) $rand_num =~ /^0???/ $rand_user = $rand_num.to_s puts ("tester"+ ($rand_user)) return $rand_user end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/30fe6c6e/attachment.html From christopher.mcmahon at gmail.com Mon Jan 23 14:40:50 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 23 Jan 2006 13:40:50 -0600 Subject: [Wtr-general] Random number generation. In-Reply-To: <493148DCF171954FBBF8E8AAB261638C0574EB@msgswbmnmsp35.wellsfargo.com> References: <493148DCF171954FBBF8E8AAB261638C0574EB@msgswbmnmsp35.wellsfargo.com> Message-ID: <72799cd70601231140u273de3d0h7e256b9d7505be35@mail.gmail.com> > but do I need to precede every method name with > "test"? Yes. That's how test/unit works. > Secondly, I am trying to generate test users for my test by generating a > random number and the concatenating that number to a string "test" so that > the result is "test12345", for example. > > I'm using rand(max-0) to generate the number, but it returns a big number. > So I tried stripping the number and then concatenating but it didn't work. > Ultimately, I would like to have generate names with 5 digits randomly like > the example above. Any ideas? I stashed some code like this over at agilistas.org, stolen from Jeff Wood: def random_text( length ) output = "" length.times do output << ('A'..'Z').to_a[ rand(26) ] end output end then, where ever you need it : just call it random_text( 42 ) # for 42 chars of random text ... -Chris From sergio.pinon at us.g4s.com Mon Jan 23 14:56:51 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Mon, 23 Jan 2006 11:56:51 -0800 Subject: [Wtr-general] Random number generation. Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1F32@bugatti.ems.securicor.com> I don't know too much about the first problem that you are having but as for your second one try this. I changed the max to be no higher than 99999 and then you get a maximum of 5 digits. If you have less then I just concat zeros on the end. Hope this helps. Sergio def Random_number $rand_num = rand(max=99999).to_s() while $rand_num.length < 5 $rand_num << "0" end puts ("tester"+ ($rand_num)) return $rand_num end ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David.J.Solis at wellsfargo.com Sent: Monday, January 23, 2006 11:31 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Random number generation. I have 2 questions: Can I use method names other then "test_sometest" in my script. For example, I have a method that performs a calculation and returns a value and passes that value to test method. Unless I rename my calculation method as "test_calculation" the method is not executed. I know that my class is inheriting from test::unit, but do I need to precede every method name with "test"? Secondly, I am trying to generate test users for my test by generating a random number and the concatenating that number to a string "test" so that the result is "test12345", for example. I'm using rand(max-0) to generate the number, but it returns a big number. So I tried stripping the number and then concatenating but it didn't work. Ultimately, I would like to have generate names with 5 digits randomly like the example above. Any ideas? def Random_name $rand_num = rand(max=0) $rand_num =~ /^0???/ $rand_user = $rand_num.to_s puts ("tester"+ ($rand_user)) return $rand_user end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/874fe739/attachment.html From mb at michaelbolton.net Mon Jan 23 15:29:36 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Mon, 23 Jan 2006 15:29:36 -0500 Subject: [Wtr-general] Random number generation. In-Reply-To: <493148DCF171954FBBF8E8AAB261638C0574EB@msgswbmnmsp35.wellsfargo.com> Message-ID: <005801c6205b$ba99eb40$6801a8c0@Koko> > Can I use method names other then "test_sometest" in my script. For example, I have a method that performs a calculation and returns a value and passes that value to test method. Unless I rename my calculation method as "test_calculation" the method is not executed. I know that my class is inheriting from test::unit, but do I need to precede every method name with "test"? I'm not sure I understand this question. Can you give us a f'rinstance? I would have thought that you can include a method "some_method" in your class and call it explicitly from within something called "test_method". I think I've done that, and it would startle me if that weren't so. However, if I am to be startled, you should be able to put that calculation and that method in another class, at least, and call that class. If necessary, you could do it as a class method, and call the method without having to create an object to get the benefit of the method. [quoting] Secondly, I am trying to generate test users for my test by generating a random number and the concatenating that number to a string "test" so that the result is "test12345", for example. I'm using rand(max-0) to generate the number, but it returns a big number. So I tried stripping the number and then concatenating but it didn't work. Ultimately, I would like to have generate names with 5 digits randomly like the example above. Any ideas? def Random_name $rand_num = rand(max=0) $rand_num =~ /^0???/ $rand_user = $rand_num.to_s puts ("tester"+ ($rand_user)) return $rand_user end [/quoting] Is the problem that the name has to be a certain length, and thus numeric part of the name must be five digits always? def random_name # give us a random number where the integer part is up to five digits long $random_five_digits = rand(100_000) # make it a string $random_five_digits = $random_five_digits.to_s # if it's shorter than five characters, pad it with leading zeroes $random_five_digits = $random_five_digits.rjust(5, "0") #prepend the "tester" part (as your code reads, or "test", as your description reads) $random_user = "tester" + $random_five_digits end or, more concisely, def random_name #object.method.method is sooooo cool, albeit a little harder to read... $random_five_digits = rand(100_000).to_s.rjust(5, "0") $random_user = "tester" + $random_five_digits end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/6c5c6a68/attachment.html From christopher.mcmahon at gmail.com Mon Jan 23 00:42:05 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Sun, 22 Jan 2006 23:42:05 -0600 Subject: [Wtr-general] Access denied problem is driving me nuts In-Reply-To: References: <30078ddb0601190724k51f9997fla917d6a12c7e8177@mail.gmail.com> Message-ID: <72799cd70601222142k5d43f151p2966be981c545179@mail.gmail.com> > > > 2. Why does placing an entry in my hosts file make my "access denied" > > > problems go away? > > > > > > Cross-site scripting is when when scripts from one site try to access > content from another. Today's browsers prevent this from happening. Watir > runs into to the same barriers when you navigate from a page hosted from one > site to a frame hosted by another. Your hosts file change makes all these > frames & pages come from a single site. I didn't know that. What a nice, easy workaround. > > It would be great if someone on this list would put together a wiki page > describing this problem. At the moment, I've got a million other things going on, but this is right up my alley. If anyone else wants this, please make some noise. -Chris From BPaatsch at activevoice.com Mon Jan 23 16:18:46 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Mon, 23 Jan 2006 15:18:46 -0600 Subject: [Wtr-general] Tricky checkbox selection Message-ID: I have almost none javascript experience. How do I get the underlying java script object of that page? _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying javascript object of the page and then interact with it as you would with javascript. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName("Add_member[]")[index of control].checked = true; _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/53ce73fa/attachment.html From mb at michaelbolton.net Mon Jan 23 16:20:09 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Mon, 23 Jan 2006 16:20:09 -0500 Subject: [Wtr-general] Random number generation. In-Reply-To: <6554B86C58B86F43B66363ED5CF6ED05DC1F32@bugatti.ems.securicor.com> Message-ID: <008201c62062$d0c4a570$6801a8c0@Koko> Hey! Someone worked hard on String::rjust()! Put it to good use! :) ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: January 23, 2006 2:57 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Random number generation. I don't know too much about the first problem that you are having but as for your second one try this. I changed the max to be no higher than 99999 and then you get a maximum of 5 digits. If you have less then I just concat zeros on the end. Hope this helps. Sergio def Random_number $rand_num = rand(max=99999).to_s() while $rand_num.length < 5 $rand_num << "0" end puts ("tester"+ ($rand_num)) return $rand_num end _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David.J.Solis at wellsfargo.com Sent: Monday, January 23, 2006 11:31 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Random number generation. I have 2 questions: Can I use method names other then "test_sometest" in my script. For example, I have a method that performs a calculation and returns a value and passes that value to test method. Unless I rename my calculation method as "test_calculation" the method is not executed. I know that my class is inheriting from test::unit, but do I need to precede every method name with "test"? Secondly, I am trying to generate test users for my test by generating a random number and the concatenating that number to a string "test" so that the result is "test12345", for example. I'm using rand(max-0) to generate the number, but it returns a big number. So I tried stripping the number and then concatenating but it didn't work. Ultimately, I would like to have generate names with 5 digits randomly like the example above. Any ideas? def Random_name $rand_num = rand(max=0) $rand_num =~ /^0???/ $rand_user = $rand_num.to_s puts ("tester"+ ($rand_user)) return $rand_user end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/e12cacc1/attachment.html From sergio.pinon at us.g4s.com Mon Jan 23 16:28:02 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Mon, 23 Jan 2006 13:28:02 -0800 Subject: [Wtr-general] Tricky checkbox selection Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1F3D@bugatti.ems.securicor.com> That code I sent you does it already for you. When you call the getDocument() method it does it. Did you try the code and see if it works? Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:19 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection I have almost none javascript experience. How do I get the underlying java script object of that page? ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying javascript object of the page and then interact with it as you would with javascript. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName("Add_member[]")[index of control].checked = true; ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/22a58253/attachment.html From Mark_Cain at rl.gov Mon Jan 23 16:38:16 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Mon, 23 Jan 2006 13:38:16 -0800 Subject: [Wtr-general] Tricky checkbox selection Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D51B@EX5V.rl.gov> You don't need to just try something like this. $ie.checkbox(:name, /Add_member/i, "35").set You can use regular expressions for your attribute name if you know part of what that name will be at runtime-although it does get tricky when attribute names for an object are the same, in that case you can use :index. Indexes are 1 based currently (although I heard some rumbling as to think they will soon be zero based) and start with the first one on the page and continue through the last one on the page. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:19 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection I have almost none javascript experience. How do I get the underlying java script object of that page? ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying javascript object of the page and then interact with it as you would with javascript. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName("Add_member[]")[index of control].checked = true; ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/edf65333/attachment.html From BPaatsch at activevoice.com Mon Jan 23 16:43:15 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Mon, 23 Jan 2006 15:43:15 -0600 Subject: [Wtr-general] Tricky checkbox selection Message-ID: The table is generated by an underlining database and the values are different almost every time. Only the string in the second stays the same, e.g "Test1", "Test2", "Test3" Test1 Test2 Test3 _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Monday, January 23, 2006 1:38 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection You don't need to just try something like this. $ie.checkbox(:name, /Add_member/i, "35").set You can use regular expressions for your attribute name if you know part of what that name will be at runtime-although it does get tricky when attribute names for an object are the same, in that case you can use :index. Indexes are 1 based currently (although I heard some rumbling as to think they will soon be zero based) and start with the first one on the page and continue through the last one on the page. --Mark _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:19 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection I have almost none javascript experience. How do I get the underlying java script object of that page? _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying javascript object of the page and then interact with it as you would with javascript. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName("Add_member[]")[index of control].checked = true; _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/7a039adc/attachment.html From sergio.pinon at us.g4s.com Mon Jan 23 16:57:42 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Mon, 23 Jan 2006 13:57:42 -0800 Subject: [Wtr-general] Tricky checkbox selection Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1F42@bugatti.ems.securicor.com> Did you try the method I gave you? I wanted to know if it worked. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:43 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection The table is generated by an underlining database and the values are different almost every time. Only the string in the second stays the same, e.g "Test1", "Test2", "Test3" Test1 Test2 Test3 ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Monday, January 23, 2006 1:38 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection You don't need to just try something like this. $ie.checkbox(:name, /Add_member/i, "35").set You can use regular expressions for your attribute name if you know part of what that name will be at runtime-although it does get tricky when attribute names for an object are the same, in that case you can use :index. Indexes are 1 based currently (although I heard some rumbling as to think they will soon be zero based) and start with the first one on the page and continue through the last one on the page. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:19 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection I have almost none javascript experience. How do I get the underlying java script object of that page? ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying javascript object of the page and then interact with it as you would with javascript. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName("Add_member[]")[index of control].checked = true; ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/b7da4e61/attachment.html From Mark_Cain at rl.gov Mon Jan 23 17:07:27 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Mon, 23 Jan 2006 14:07:27 -0800 Subject: [Wtr-general] Tricky checkbox selection Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D51D@EX5V.rl.gov> When you do a view source on your page do these look this this: Test1 Test2 Test3 Or has "Add_member[]" been replaced with something? --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:43 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection The table is generated by an underlining database and the values are different almost every time. Only the string in the second stays the same, e.g "Test1", "Test2", "Test3" Test1 Test2 Test3 ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Monday, January 23, 2006 1:38 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection You don't need to just try something like this. $ie.checkbox(:name, /Add_member/i, "35").set You can use regular expressions for your attribute name if you know part of what that name will be at runtime-although it does get tricky when attribute names for an object are the same, in that case you can use :index. Indexes are 1 based currently (although I heard some rumbling as to think they will soon be zero based) and start with the first one on the page and continue through the last one on the page. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:19 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection I have almost none javascript experience. How do I get the underlying java script object of that page? ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying javascript object of the page and then interact with it as you would with javascript. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName("Add_member[]")[index of control].checked = true; ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/0f1ff51b/attachment.html From BPaatsch at activevoice.com Mon Jan 23 17:05:03 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Mon, 23 Jan 2006 16:05:03 -0600 Subject: [Wtr-general] Tricky checkbox selection Message-ID: Got a little sidetracked. variable = $ie.getDocument().getElementsByName("Add_member[]"); This gives me the list of all three input elements. Now I need to find the right index. That's what I am working on right now. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 1:58 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Did you try the method I gave you? I wanted to know if it worked. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:43 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection The table is generated by an underlining database and the values are different almost every time. Only the string in the second stays the same, e.g "Test1", "Test2", "Test3" Test1 Test2 Test3 _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Monday, January 23, 2006 1:38 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection You don't need to just try something like this. $ie.checkbox(:name, /Add_member/i, "35").set You can use regular expressions for your attribute name if you know part of what that name will be at runtime-although it does get tricky when attribute names for an object are the same, in that case you can use :index. Indexes are 1 based currently (although I heard some rumbling as to think they will soon be zero based) and start with the first one on the page and continue through the last one on the page. --Mark _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:19 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection I have almost none javascript experience. How do I get the underlying java script object of that page? _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying javascript object of the page and then interact with it as you would with javascript. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName("Add_member[]")[index of control].checked = true; _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/0af0081e/attachment.html From jon at pdxfishguy.com Mon Jan 23 17:06:55 2006 From: jon at pdxfishguy.com (Jon Passmore) Date: Mon, 23 Jan 2006 17:06:55 -0500 Subject: [Wtr-general] Getting rid of security alert no problem, but how do I detect this happening? Message-ID: <86d1ac4c5bd547bca4ba5568da6dcab4@pdxfishguy.com> How do I code so that if a security alert ever pops up it will be detected so I can close it? I had the question about how to close the security alert box answered earlier and I thank those who helped. Now I just need to figure out this last piece if anyone can help. Thanks. Jon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/bf0e0135/attachment.html From BPaatsch at activevoice.com Mon Jan 23 17:18:54 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Mon, 23 Jan 2006 16:18:54 -0600 Subject: [Wtr-general] Tricky checkbox selection Message-ID: "Add_member[]" is not replaced by something. The code below is exactly as I see it. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Monday, January 23, 2006 2:07 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection When you do a view source on your page do these look this this: Test1 Test2 Test3 Or has "Add_member[]" been replaced with something? --Mark _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:43 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection The table is generated by an underlining database and the values are different almost every time. Only the string in the second stays the same, e.g "Test1", "Test2", "Test3" Test1 Test2 Test3 _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Monday, January 23, 2006 1:38 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection You don't need to just try something like this. $ie.checkbox(:name, /Add_member/i, "35").set You can use regular expressions for your attribute name if you know part of what that name will be at runtime-although it does get tricky when attribute names for an object are the same, in that case you can use :index. Indexes are 1 based currently (although I heard some rumbling as to think they will soon be zero based) and start with the first one on the page and continue through the last one on the page. --Mark _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:19 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection I have almost none javascript experience. How do I get the underlying java script object of that page? _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying javascript object of the page and then interact with it as you would with javascript. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName("Add_member[]")[index of control].checked = true; _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/ae581b10/attachment.html From BPaatsch at activevoice.com Mon Jan 23 17:21:18 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Mon, 23 Jan 2006 16:21:18 -0600 Subject: [Wtr-general] Tricky checkbox selection Message-ID: variable = $ie.getDocument().getElementsByName('cbxSelectGroup[]'); puts variable.each{|i| print i, "\n"} puts variable.length As I said, I am new to javascript and ruby. The code returns: # # # etc. which I believe represents memory locations? How can I get the values? _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 1:58 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Did you try the method I gave you? I wanted to know if it worked. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:43 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection The table is generated by an underlining database and the values are different almost every time. Only the string in the second stays the same, e.g "Test1", "Test2", "Test3" Test1 Test2 Test3 _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Monday, January 23, 2006 1:38 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection You don't need to just try something like this. $ie.checkbox(:name, /Add_member/i, "35").set You can use regular expressions for your attribute name if you know part of what that name will be at runtime-although it does get tricky when attribute names for an object are the same, in that case you can use :index. Indexes are 1 based currently (although I heard some rumbling as to think they will soon be zero based) and start with the first one on the page and continue through the last one on the page. --Mark _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:19 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection I have almost none javascript experience. How do I get the underlying java script object of that page? _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying javascript object of the page and then interact with it as you would with javascript. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName("Add_member[]")[index of control].checked = true; _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/1b37d744/attachment.html From sergio.pinon at us.g4s.com Mon Jan 23 17:26:30 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Mon, 23 Jan 2006 14:26:30 -0800 Subject: [Wtr-general] Tricky checkbox selection Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1F47@bugatti.ems.securicor.com> Ok no problem. I was just checking to make sure everything worked ok. No rush. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 2:05 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Got a little sidetracked. variable = $ie.getDocument().getElementsByName("Add_member[]"); This gives me the list of all three input elements. Now I need to find the right index. That's what I am working on right now. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 1:58 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Did you try the method I gave you? I wanted to know if it worked. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:43 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection The table is generated by an underlining database and the values are different almost every time. Only the string in the second stays the same, e.g "Test1", "Test2", "Test3" Test1 Test2 Test3 ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Monday, January 23, 2006 1:38 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection You don't need to just try something like this. $ie.checkbox(:name, /Add_member/i, "35").set You can use regular expressions for your attribute name if you know part of what that name will be at runtime-although it does get tricky when attribute names for an object are the same, in that case you can use :index. Indexes are 1 based currently (although I heard some rumbling as to think they will soon be zero based) and start with the first one on the page and continue through the last one on the page. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:19 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection I have almost none javascript experience. How do I get the underlying java script object of that page? ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying javascript object of the page and then interact with it as you would with javascript. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName("Add_member[]")[index of control].checked = true; ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/48938781/attachment.html From sergio.pinon at us.g4s.com Mon Jan 23 17:50:34 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Mon, 23 Jan 2006 14:50:34 -0800 Subject: [Wtr-general] Tricky checkbox selection Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1F4A@bugatti.ems.securicor.com> If you are trying to see information about these object then try something like the following: variable = $ie.getDocument().getElementsByName('cbxSelectGroup[]'); puts variable.each{|i| print i.value, "\n"} puts variable.length Add the value property on to the end of your object. So you see I did i.value. That should show you the value. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 2:21 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection variable = $ie.getDocument().getElementsByName('cbxSelectGroup[]'); puts variable.each{|i| print i, "\n"} puts variable.length As I said, I am new to javascript and ruby. The code returns: # # # etc. which I believe represents memory locations? How can I get the values? ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 1:58 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Did you try the method I gave you? I wanted to know if it worked. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:43 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection The table is generated by an underlining database and the values are different almost every time. Only the string in the second stays the same, e.g "Test1", "Test2", "Test3" Test1 Test2 Test3 ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Monday, January 23, 2006 1:38 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection You don't need to just try something like this. $ie.checkbox(:name, /Add_member/i, "35").set You can use regular expressions for your attribute name if you know part of what that name will be at runtime-although it does get tricky when attribute names for an object are the same, in that case you can use :index. Indexes are 1 based currently (although I heard some rumbling as to think they will soon be zero based) and start with the first one on the page and continue through the last one on the page. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:19 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection I have almost none javascript experience. How do I get the underlying java script object of that page? ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying javascript object of the page and then interact with it as you would with javascript. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName("Add_member[]")[index of control].checked = true; ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/81627481/attachment.html From BPaatsch at activevoice.com Mon Jan 23 20:41:56 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Mon, 23 Jan 2006 19:41:56 -0600 Subject: [Wtr-general] Tricky checkbox selection Message-ID: It works. In order to see the whole input tag element and its attributes I have to write something like puts variable.each{|i| print i.class, i.name, i.value, "\n"} Is this correct? _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 2:51 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection If you are trying to see information about these object then try something like the following: variable = $ie.getDocument().getElementsByName('cbxSelectGroup[]'); puts variable.each{|i| print i.value, "\n"} puts variable.length Add the value property on to the end of your object. So you see I did i.value. That should show you the value. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 2:21 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection variable = $ie.getDocument().getElementsByName('cbxSelectGroup[]'); puts variable.each{|i| print i, "\n"} puts variable.length As I said, I am new to javascript and ruby. The code returns: # # # etc. which I believe represents memory locations? How can I get the values? _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 1:58 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Did you try the method I gave you? I wanted to know if it worked. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:43 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection The table is generated by an underlining database and the values are different almost every time. Only the string in the second stays the same, e.g "Test1", "Test2", "Test3" Test1 Test2 Test3 _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Monday, January 23, 2006 1:38 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection You don't need to just try something like this. $ie.checkbox(:name, /Add_member/i, "35").set You can use regular expressions for your attribute name if you know part of what that name will be at runtime-although it does get tricky when attribute names for an object are the same, in that case you can use :index. Indexes are 1 based currently (although I heard some rumbling as to think they will soon be zero based) and start with the first one on the page and continue through the last one on the page. --Mark _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:19 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection I have almost none javascript experience. How do I get the underlying java script object of that page? _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying javascript object of the page and then interact with it as you would with javascript. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName("Add_member[]")[index of control].checked = true; _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/3a978738/attachment.html From sergio.pinon at us.g4s.com Mon Jan 23 20:52:37 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Mon, 23 Jan 2006 17:52:37 -0800 Subject: [Wtr-general] Tricky checkbox selection Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1F53@bugatti.ems.securicor.com> That is close. You can't access the class attribute using class. You have to use className. But other than that yes you are right. Glad to here it worked out. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 5:42 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection It works. In order to see the whole input tag element and its attributes I have to write something like puts variable.each{|i| print i.class, i.name, i.value, "\n"} Is this correct? ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 2:51 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection If you are trying to see information about these object then try something like the following: variable = $ie.getDocument().getElementsByName('cbxSelectGroup[]'); puts variable.each{|i| print i.value, "\n"} puts variable.length Add the value property on to the end of your object. So you see I did i.value. That should show you the value. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 2:21 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection variable = $ie.getDocument().getElementsByName('cbxSelectGroup[]'); puts variable.each{|i| print i, "\n"} puts variable.length As I said, I am new to javascript and ruby. The code returns: # # # etc. which I believe represents memory locations? How can I get the values? ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 1:58 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Did you try the method I gave you? I wanted to know if it worked. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:43 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection The table is generated by an underlining database and the values are different almost every time. Only the string in the second stays the same, e.g "Test1", "Test2", "Test3" Test1 Test2 Test3 ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Monday, January 23, 2006 1:38 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection You don't need to just try something like this. $ie.checkbox(:name, /Add_member/i, "35").set You can use regular expressions for your attribute name if you know part of what that name will be at runtime-although it does get tricky when attribute names for an object are the same, in that case you can use :index. Indexes are 1 based currently (although I heard some rumbling as to think they will soon be zero based) and start with the first one on the page and continue through the last one on the page. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:19 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection I have almost none javascript experience. How do I get the underlying java script object of that page? ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying javascript object of the page and then interact with it as you would with javascript. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName("Add_member[]")[index of control].checked = true; ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/feec5e51/attachment.html From sergio.pinon at us.g4s.com Mon Jan 23 20:53:28 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Mon, 23 Jan 2006 17:53:28 -0800 Subject: [Wtr-general] Tricky checkbox selection Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1F54@bugatti.ems.securicor.com> The other thing you can try to do is use the outerHTML properyt which will show you the whole HTML tag. So you would do the following: puts variable.each{|i| print i.outerHTML, "\n"} Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 5:42 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection It works. In order to see the whole input tag element and its attributes I have to write something like puts variable.each{|i| print i.class, i.name, i.value, "\n"} Is this correct? ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 2:51 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection If you are trying to see information about these object then try something like the following: variable = $ie.getDocument().getElementsByName('cbxSelectGroup[]'); puts variable.each{|i| print i.value, "\n"} puts variable.length Add the value property on to the end of your object. So you see I did i.value. That should show you the value. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 2:21 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection variable = $ie.getDocument().getElementsByName('cbxSelectGroup[]'); puts variable.each{|i| print i, "\n"} puts variable.length As I said, I am new to javascript and ruby. The code returns: # # # etc. which I believe represents memory locations? How can I get the values? ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 1:58 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Did you try the method I gave you? I wanted to know if it worked. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:43 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection The table is generated by an underlining database and the values are different almost every time. Only the string in the second stays the same, e.g "Test1", "Test2", "Test3" Test1 Test2 Test3 ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Monday, January 23, 2006 1:38 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection You don't need to just try something like this. $ie.checkbox(:name, /Add_member/i, "35").set You can use regular expressions for your attribute name if you know part of what that name will be at runtime-although it does get tricky when attribute names for an object are the same, in that case you can use :index. Indexes are 1 based currently (although I heard some rumbling as to think they will soon be zero based) and start with the first one on the page and continue through the last one on the page. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:19 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection I have almost none javascript experience. How do I get the underlying java script object of that page? ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying javascript object of the page and then interact with it as you would with javascript. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName("Add_member[]")[index of control].checked = true; ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060123/0f3d3f8e/attachment.html From angrez at gmail.com Tue Jan 24 00:40:32 2006 From: angrez at gmail.com (Angrez Singh) Date: Tue, 24 Jan 2006 11:10:32 +0530 Subject: [Wtr-general] Tricky checkbox selection In-Reply-To: References: Message-ID: Hi Paatsch, How about using XPath to get the element in just one line of code rather then using the loops? In your case it would be something like this: ie.checkbox(:xpath, "//td[contains(., 'Test3')]/../td/input/").click() This XPath query first select the containing text Test3 (this is what you said is fixed and known before hand), then it goes to its parent i.e. and then traverse down the tree to first and then element inside that which is the checkbox element that you want. For using XPath download the tar ball from HEAD and read the documentation under the docs section. Hope this helps. Regards, Angrez From richardlaw at avanade.com Tue Jan 24 10:09:18 2006 From: richardlaw at avanade.com (Richard Lawrence) Date: Tue, 24 Jan 2006 07:09:18 -0800 Subject: [Wtr-general] close all IE windows Message-ID: <5A47CFC77DF94344807D620F09BE76FD13CC2891@MAIL2.corp.avanade.org> I'm trying to attach to and close all IE windows before and after my tests to ensure that there are no orphan IE windows. However, if there is an error in one of the open windows (due to an invalid address, for example), the attach calls fails like this: Watir::Exception::NavigationException: Cannot find server or DNS Error c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1160:in `check_for_http_error' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1141:in `set_defaults' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1135:in `call' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1436:in `run_error_checks' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in `each' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in `run_error_checks' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1419:in `wait' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1113:in `attach_init' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1104:in `attach' Is there a way I can disable error checking on these attach calls? I don't care if the content of the window is good; I just want to close it. Thanks, Richard ____________________________________________ Richard Lawrence | Senior Solution Developer, MCSD.NET Avanade(r) Inc | Rocky Mountain District, US West Region Mobile: 303.895.7688 www.avanade.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060124/1c4ad5d2/attachment.html From zeljko.filipin at gmail.com Tue Jan 24 10:21:19 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 24 Jan 2006 16:21:19 +0100 Subject: [Wtr-general] close all IE windows In-Reply-To: <5A47CFC77DF94344807D620F09BE76FD13CC2891@MAIL2.corp.avanade.org> References: <5A47CFC77DF94344807D620F09BE76FD13CC2891@MAIL2.corp.avanade.org> Message-ID: I think this will help. begin # attach to and close all IE windows rescue end I think that Bret Pettichord posted code that does what you need, but I can not find it now. Zeljko 2006/1/24, Richard Lawrence : > > > > I'm trying to attach to and close all IE windows before and after my tests > to ensure that there are no orphan IE windows. However, if there is an error > in one of the open windows (due to an invalid address, for example), the > attach calls fails like this: > > Watir::Exception::NavigationException: Cannot find > server or DNS Error > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1160:in > `check_for_http_error' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1141:in > `set_defaults' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1135:in `call' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1436:in > `run_error_checks' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in `each' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in > `run_error_checks' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1419:in `wait' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1113:in > `attach_init' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1104:in > `attach' > > > > Is there a way I can disable error checking on these attach calls? I don't > care if the content of the window is good; I just want to close it. > > > > Thanks, > > > > Richard > > ____________________________________________ > Richard Lawrence | Senior Solution Developer, MCSD.NET > Avanade(r) Inc | Rocky Mountain District, US West Region > Mobile: 303.895.7688 > www.avanade.com > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -- http://iskusivac.blog.hr/ From richardlaw at avanade.com Tue Jan 24 10:25:08 2006 From: richardlaw at avanade.com (Richard Lawrence) Date: Tue, 24 Jan 2006 07:25:08 -0800 Subject: [Wtr-general] close all IE windows Message-ID: <5A47CFC77DF94344807D620F09BE76FD13CC2912@MAIL2.corp.avanade.org> I've added a rescue block to deal with the exception, but that doesn't help me attach to windows that currently have an invalid web address. Effectively, what I'm looking for is a way to call attach without it calling wait internally. Is that possible somehow? Thanks, Richard -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: Tuesday, January 24, 2006 8:21 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] close all IE windows I think this will help. begin # attach to and close all IE windows rescue end I think that Bret Pettichord posted code that does what you need, but I can not find it now. Zeljko 2006/1/24, Richard Lawrence : > > > > I'm trying to attach to and close all IE windows before and after my tests > to ensure that there are no orphan IE windows. However, if there is an error > in one of the open windows (due to an invalid address, for example), the > attach calls fails like this: > > Watir::Exception::NavigationException: Cannot find > server or DNS Error > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1160:in > `check_for_http_error' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1141:in > `set_defaults' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1135:in `call' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1436:in > `run_error_checks' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in `each' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in > `run_error_checks' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1419:in `wait' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1113:in > `attach_init' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1104:in > `attach' > > > > Is there a way I can disable error checking on these attach calls? I don't > care if the content of the window is good; I just want to close it. > > > > Thanks, > > > > Richard > > ____________________________________________ > Richard Lawrence | Senior Solution Developer, MCSD.NET > Avanade(r) Inc | Rocky Mountain District, US West Region > Mobile: 303.895.7688 > www.avanade.com > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -- http://iskusivac.blog.hr/ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From David.J.Solis at wellsfargo.com Tue Jan 24 11:52:23 2006 From: David.J.Solis at wellsfargo.com (David.J.Solis at wellsfargo.com) Date: Tue, 24 Jan 2006 10:52:23 -0600 Subject: [Wtr-general] Tricky checkbox selection Message-ID: <493148DCF171954FBBF8E8AAB261638C0574ED@msgswbmnmsp35.wellsfargo.com> I ran into a similar problem and your suggestion worked great. However, I ran into slightly different problem. In my case, I have a list of users that can be updated and deleted. Every time I add a user, the value is increased by 1. For example, and so on... To find the last index value, I sorted the array to give the largest number. Knowing this I can delete the last user created. The problem is this: When I try to use any of the built in Array methods other than Sergio example, I get the following error: WIN32OLERuntimeError: Unknown property or method `sort' HRESULT error code:0x80020006 Unknown name. C:/Tests/TestSuites/tc_smoketest_suite.rb:93:in `method_missing' C:/Tests/TestSuites/tc_smoketest_suite.rb:93:in `test_delete_user C:/Tests/TestSuites/tc_smoketest_suite.rb:92:in `each' C:/Tests/TestSuites/tc_smoketest_suite.rb:92:in `test_delete_user What am I doing wrong? _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 2:27 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Ok no problem. I was just checking to make sure everything worked ok. No rush. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 2:05 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Got a little sidetracked. variable = $ie.getDocument().getElementsByName("Add_member[]"); This gives me the list of all three input elements. Now I need to find the right index. That's what I am working on right now. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 1:58 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Did you try the method I gave you? I wanted to know if it worked. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:43 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection The table is generated by an underlining database and the values are different almost every time. Only the string in the second stays the same, e.g "Test1", "Test2", "Test3" Test2 Test3 _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Monday, January 23, 2006 1:38 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection You don't need to just try something like this. $ie.checkbox(:name, /Add_member/i, "35").set You can use regular expressions for your attribute name if you know part of what that name will be at runtime-although it does get tricky when attribute names for an object are the same, in that case you can use :index. Indexes are 1 based currently (although I heard some rumbling as to think they will soon be zero based) and start with the first one on the page and continue through the last one on the page. --Mark _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 1:19 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection I have almost none javascript experience. How do I get the underlying java script object of that page? _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 11:12 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Well the other thing to do is try the code below. What you do is get the underlying javascript object of the page and then interact with it as you would with javascript. You get all the elements with the name you supply and then access the one you want using the indexer on that array. Then you just set the checked property of that object to true and it should work. Let me know how it turns out. ie_browser.getDocument().getElementsByName("Add_member[]")[index of control].checked = true; _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:47 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Tricky checkbox selection Unfortunately I do not know the value beforehand. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 10:45 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Do you know the value of the checkbox beforehand? If you do then just use this method: Ie_browser.checkbox(:name, "Add_member[]", "35").set(); This should be good to go. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Monday, January 23, 2006 10:23 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Tricky checkbox selection Hello, I have following html code and like to select the checkbox for "Test3". How can I do that? Test1 Subscriber208 Test2 Subscriber208 Test3 Subscriber208 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060124/97545954/attachment.html From ati.ozgur at gmail.com Tue Jan 24 12:24:45 2006 From: ati.ozgur at gmail.com (Atilla Ozgur) Date: Tue, 24 Jan 2006 19:24:45 +0200 Subject: [Wtr-general] close all IE windows In-Reply-To: <5A47CFC77DF94344807D620F09BE76FD13CC2912@MAIL2.corp.avanade.org> References: <5A47CFC77DF94344807D620F09BE76FD13CC2912@MAIL2.corp.avanade.org> Message-ID: Problem is IE is also works as File Explorer. Attach code does not work with file explorer behaviour. If your IE with invalid web address is a file explorer window you can not do that. As I understand from error, it may not be possible to do that On 1/24/06, Richard Lawrence wrote: > I've added a rescue block to deal with the exception, but that doesn't > help me attach to windows that currently have an invalid web address. > Effectively, what I'm looking for is a way to call attach without it > calling wait internally. Is that possible somehow? > > Thanks, > > Richard > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin > Sent: Tuesday, January 24, 2006 8:21 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] close all IE windows > > I think this will help. > > begin > # attach to and close all IE windows > rescue > end > > I think that Bret Pettichord posted code that does what you need, but > I can not find it now. > > Zeljko > > 2006/1/24, Richard Lawrence : > > > > > > > > I'm trying to attach to and close all IE windows before and after my > tests > > to ensure that there are no orphan IE windows. However, if there is an > error > > in one of the open windows (due to an invalid address, for example), > the > > attach calls fails like this: > > > > Watir::Exception::NavigationException: Cannot find > > server or DNS Error > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1160:in > > `check_for_http_error' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1141:in > > `set_defaults' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1135:in `call' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1436:in > > `run_error_checks' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in `each' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in > > `run_error_checks' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1419:in `wait' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1113:in > > `attach_init' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1104:in > > `attach' > > > > > > > > Is there a way I can disable error checking on these attach calls? I > don't > > care if the content of the window is good; I just want to close it. > > > > > > > > Thanks, > > > > > > > > Richard > > > > ____________________________________________ > > Richard Lawrence | Senior Solution Developer, MCSD.NET > > Avanade(r) Inc | Rocky Mountain District, US West Region > > Mobile: 303.895.7688 > > www.avanade.com > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > -- > http://iskusivac.blog.hr/ > > _______________________________________________ > 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 sergio.pinon at us.g4s.com Tue Jan 24 12:47:32 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Tue, 24 Jan 2006 09:47:32 -0800 Subject: [Wtr-general] Tricky checkbox selection Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC1F78@bugatti.ems.securicor.com> David, I would need to see the code to see what is happening. But if you are getting the collection of objects with the same name and then trying to sort that array you can't. The reason is that the array of controls is really not an array it is unique object collection. If you want to send me some code I can take a look at it and see what I can come up with. The other thing that may help though I don't know your circumstance is that you can use Xpath expressions against the DOM so you might be able to do something like that. See the previous post below that might be able to help you out. Sergio ------------------------------------------------------------------------ ------------------------------------------------------------------------ ------------------------------------------------------------------------ ------------------------------------------------ PREVIOUS POST: Hi Paatsch, How about using XPath to get the element in just one line of code rather then using the loops? In your case it would be something like this: ie.checkbox(:xpath, "//td[contains(., 'Test3')]/../td/input/").click() This XPath query first select the containing text Test3 (this is what you said is fixed and known before hand), then it goes to its parent i.e. and then traverse down the tree to first and then element inside that which is the checkbox element that you want. For using XPath download the tar ball from HEAD and read the documentation under the docs section. Hope this helps. Regards, Angrez ------------------------------------------------------------------------ ------------------------------------------------------------------------ ------------------------------------------------------------------------ ------------------------------------------------ ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David.J.Solis at wellsfargo.com Sent: Tuesday, January 24, 2006 8:52 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection I ran into a similar problem and your suggestion worked great. However, I ran into slightly different problem. In my case, I have a list of users that can be updated and deleted. Every time I add a user, the value is increased by 1. For example, and so on... To find the last index value, I sorted the array to give the largest number. Knowing this I can delete the last user created. The problem is this: When I try to use any of the built in Array methods other than Sergio example, I get the following error: WIN32OLERuntimeError: Unknown property or method `sort' HRESULT error code:0x80020006 Unknown name. C:/Tests/TestSuites/tc_smoketest_suite.rb:93:in `method_missing' C:/Tests/TestSuites/tc_smoketest_suite.rb:93:in `test_delete_user C:/Tests/TestSuites/tc_smoketest_suite.rb:92:in `each' C:/Tests/TestSuites/tc_smoketest_suite.rb:92:in `test_delete_user What am I doing wrong? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060124/4687ab98/attachment.html From carl.l.shaulis at convergys.com Tue Jan 24 13:21:02 2006 From: carl.l.shaulis at convergys.com (carl.l.shaulis at convergys.com) Date: Tue, 24 Jan 2006 12:21:02 -0600 Subject: [Wtr-general] File Download Message-ID: Good afternoon: I have two areas where I am currently blocked. The most important concern is dowloading a file. I use Winclicker successfully for handling other pop-ups in our application but when if comes to File Download it does not appear to work. Searching the archives I find reference to AutoIt, which I have never been able to get working successfully on my machine. I also have not had any luck with WET. What is the best way to execute a File Download today? A less important concern is the ability to view the source of a page and validate the content within the source. Can this be done using WATIR? Any tips, tricks and hints would be most appreciated! Thanks, Carl -- "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 mb at michaelbolton.net Tue Jan 24 13:47:09 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Tue, 24 Jan 2006 13:47:09 -0500 Subject: [Wtr-general] Tricky checkbox selection In-Reply-To: <493148DCF171954FBBF8E8AAB261638C0574ED@msgswbmnmsp35.wellsfargo.com> Message-ID: <015b01c62116$9ac337c0$6801a8c0@Koko> > To find the last index value, I sorted the array to give the largest number. Knowing this I can delete the last user created. The problem is this: When I try to use any of the built in Array methods other than Sergio example, I get the following error: WIN32OLERuntimeError: Unknown property or method `sort' HRESULT error code:0x80020006 Unknown name. C:/Tests/TestSuites/tc_smoketest_suite.rb:93:in `method_missing' C:/Tests/TestSuites/tc_smoketest_suite.rb:93:in `test_delete_user C:/Tests/TestSuites/tc_smoketest_suite.rb:92:in `each' C:/Tests/TestSuites/tc_smoketest_suite.rb:92:in `test_delete_user > What am I doing wrong? Posing a question about your code without letting us see it. <-gentle joke ---Michael B. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060124/b31b5189/attachment.html From richardlaw at avanade.com Tue Jan 24 13:48:38 2006 From: richardlaw at avanade.com (Richard Lawrence) Date: Tue, 24 Jan 2006 10:48:38 -0800 Subject: [Wtr-general] close all IE windows Message-ID: <5A47CFC77DF94344807D620F09BE76FD13CC3079@MAIL2.corp.avanade.org> It's not that. It's an address like "http://localhost:1505/Web" (the local address of the VS web server on a developer's machine) that a developer left in a smoke test instead of switching to the correct address for the build server. But since nothing is listening on 1505 on the build server, the attach call fails, and I'm left with an orphan IE window. Richard -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Atilla Ozgur Sent: Tuesday, January 24, 2006 10:25 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] close all IE windows Problem is IE is also works as File Explorer. Attach code does not work with file explorer behaviour. If your IE with invalid web address is a file explorer window you can not do that. As I understand from error, it may not be possible to do that On 1/24/06, Richard Lawrence wrote: > I've added a rescue block to deal with the exception, but that doesn't > help me attach to windows that currently have an invalid web address. > Effectively, what I'm looking for is a way to call attach without it > calling wait internally. Is that possible somehow? > > Thanks, > > Richard > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin > Sent: Tuesday, January 24, 2006 8:21 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] close all IE windows > > I think this will help. > > begin > # attach to and close all IE windows > rescue > end > > I think that Bret Pettichord posted code that does what you need, but > I can not find it now. > > Zeljko > > 2006/1/24, Richard Lawrence : > > > > > > > > I'm trying to attach to and close all IE windows before and after my > tests > > to ensure that there are no orphan IE windows. However, if there is an > error > > in one of the open windows (due to an invalid address, for example), > the > > attach calls fails like this: > > > > Watir::Exception::NavigationException: Cannot find > > server or DNS Error > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1160:in > > `check_for_http_error' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1141:in > > `set_defaults' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1135:in `call' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1436:in > > `run_error_checks' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in `each' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in > > `run_error_checks' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1419:in `wait' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1113:in > > `attach_init' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1104:in > > `attach' > > > > > > > > Is there a way I can disable error checking on these attach calls? I > don't > > care if the content of the window is good; I just want to close it. > > > > > > > > Thanks, > > > > > > > > Richard > > > > ____________________________________________ > > Richard Lawrence | Senior Solution Developer, MCSD.NET > > Avanade(r) Inc | Rocky Mountain District, US West Region > > Mobile: 303.895.7688 > > www.avanade.com > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > -- > http://iskusivac.blog.hr/ > > _______________________________________________ > 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 mb at michaelbolton.net Tue Jan 24 14:26:06 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Tue, 24 Jan 2006 14:26:06 -0500 Subject: [Wtr-general] close all IE windows In-Reply-To: <5A47CFC77DF94344807D620F09BE76FD13CC3079@MAIL2.corp.avanade.org> Message-ID: <016d01c6211c$05cbc8c0$6801a8c0@Koko> Get the developer to fix his bug? ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Richard Lawrence Sent: January 24, 2006 1:49 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] close all IE windows It's not that. It's an address like "http://localhost:1505/Web" (the local address of the VS web server on a developer's machine) that a developer left in a smoke test instead of switching to the correct address for the build server. But since nothing is listening on 1505 on the build server, the attach call fails, and I'm left with an orphan IE window. Richard -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Atilla Ozgur Sent: Tuesday, January 24, 2006 10:25 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] close all IE windows Problem is IE is also works as File Explorer. Attach code does not work with file explorer behaviour. If your IE with invalid web address is a file explorer window you can not do that. As I understand from error, it may not be possible to do that On 1/24/06, Richard Lawrence wrote: > I've added a rescue block to deal with the exception, but that doesn't > help me attach to windows that currently have an invalid web address. > Effectively, what I'm looking for is a way to call attach without it > calling wait internally. Is that possible somehow? > > Thanks, > > Richard > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin > Sent: Tuesday, January 24, 2006 8:21 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] close all IE windows > > I think this will help. > > begin > # attach to and close all IE windows > rescue > end > > I think that Bret Pettichord posted code that does what you need, but > I can not find it now. > > Zeljko > > 2006/1/24, Richard Lawrence : > > > > > > > > I'm trying to attach to and close all IE windows before and after my > tests > > to ensure that there are no orphan IE windows. However, if there is an > error > > in one of the open windows (due to an invalid address, for example), > the > > attach calls fails like this: > > > > Watir::Exception::NavigationException: Cannot find > > server or DNS Error > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1160:in > > `check_for_http_error' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1141:in > > `set_defaults' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1135:in `call' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1436:in > > `run_error_checks' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in `each' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in > > `run_error_checks' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1419:in `wait' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1113:in > > `attach_init' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1104:in > > `attach' > > > > > > > > Is there a way I can disable error checking on these attach calls? I > don't > > care if the content of the window is good; I just want to close it. > > > > > > > > Thanks, > > > > > > > > Richard > > > > ____________________________________________ > > Richard Lawrence | Senior Solution Developer, MCSD.NET > > Avanade(r) Inc | Rocky Mountain District, US West Region > > Mobile: 303.895.7688 > > www.avanade.com > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > -- > http://iskusivac.blog.hr/ > > _______________________________________________ > 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 richardlaw at avanade.com Tue Jan 24 14:34:47 2006 From: richardlaw at avanade.com (Richard Lawrence) Date: Tue, 24 Jan 2006 11:34:47 -0800 Subject: [Wtr-general] [(SPAM) - Tagged by Sybari Antispam] Re: close all IE windows Message-ID: <5A47CFC77DF94344807D620F09BE76FD13D2C80D@MAIL2.corp.avanade.org> Good plan. All I need now are developers who never check in bugs and I won't need to wrestle with smoke tests at all. Unfortunately, fixing the bug doesn't get rid of the orphan IE window from the last run of the test suite. And because of the way my team develops smoke tests for this app, this is a common pattern for a bug in smoke tests; the smoke test system ought to be able to catch and handle it gracefully. Richard -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Michael Bolton Sent: Tuesday, January 24, 2006 12:26 PM To: wtr-general at rubyforge.org Subject: [(SPAM) - Tagged by Sybari Antispam] Re: [Wtr-general] close all IE windows Get the developer to fix his bug? ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Richard Lawrence Sent: January 24, 2006 1:49 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] close all IE windows It's not that. It's an address like "http://localhost:1505/Web" (the local address of the VS web server on a developer's machine) that a developer left in a smoke test instead of switching to the correct address for the build server. But since nothing is listening on 1505 on the build server, the attach call fails, and I'm left with an orphan IE window. Richard -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Atilla Ozgur Sent: Tuesday, January 24, 2006 10:25 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] close all IE windows Problem is IE is also works as File Explorer. Attach code does not work with file explorer behaviour. If your IE with invalid web address is a file explorer window you can not do that. As I understand from error, it may not be possible to do that On 1/24/06, Richard Lawrence wrote: > I've added a rescue block to deal with the exception, but that doesn't > help me attach to windows that currently have an invalid web address. > Effectively, what I'm looking for is a way to call attach without it > calling wait internally. Is that possible somehow? > > Thanks, > > Richard > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin > Sent: Tuesday, January 24, 2006 8:21 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] close all IE windows > > I think this will help. > > begin > # attach to and close all IE windows > rescue > end > > I think that Bret Pettichord posted code that does what you need, but > I can not find it now. > > Zeljko > > 2006/1/24, Richard Lawrence : > > > > > > > > I'm trying to attach to and close all IE windows before and after my > tests > > to ensure that there are no orphan IE windows. However, if there is an > error > > in one of the open windows (due to an invalid address, for example), > the > > attach calls fails like this: > > > > Watir::Exception::NavigationException: Cannot find > > server or DNS Error > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1160:in > > `check_for_http_error' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1141:in > > `set_defaults' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1135:in `call' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1436:in > > `run_error_checks' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in `each' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in > > `run_error_checks' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1419:in `wait' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1113:in > > `attach_init' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1104:in > > `attach' > > > > > > > > Is there a way I can disable error checking on these attach calls? I > don't > > care if the content of the window is good; I just want to close it. > > > > > > > > Thanks, > > > > > > > > Richard > > > > ____________________________________________ > > Richard Lawrence | Senior Solution Developer, MCSD.NET > > Avanade(r) Inc | Rocky Mountain District, US West Region > > Mobile: 303.895.7688 > > www.avanade.com > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > -- > http://iskusivac.blog.hr/ > > _______________________________________________ > 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 BPaatsch at activevoice.com Tue Jan 24 15:16:31 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Tue, 24 Jan 2006 14:16:31 -0600 Subject: [Wtr-general] Modula test execution? Message-ID: Hello, I am new to ruby and watir, so this might be a very trivial question. Is there a elegant solution to have a modular test script approach? I have blocks of code that will be always the same for the web-site I am going to test, like "login", "search", "logout", etc. So my idea is to put those modules into separate files and then call them from a script called "testExecution.rb". What is your solution? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060124/5db6b59b/attachment.html From christopher.mcmahon at gmail.com Tue Jan 24 15:40:51 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 24 Jan 2006 14:40:51 -0600 Subject: [Wtr-general] Modula test execution? In-Reply-To: References: Message-ID: <72799cd70601241240r458fc02ay8b9c2fc155b14361@mail.gmail.com> > I am new to ruby and watir, so this might be a very trivial question. Welcome! > > Is there a elegant solution to have a modular test script approach? > > I have blocks of code that will be always the same for the web-site I am > going to test, like "login", "search", "logout", etc. So my idea is to put > those modules into separate files and then call them from a script called > "testExecution.rb". What is your solution? This is a classic refactoring exercise. Look up "Module" in the Pickaxe, or look around at the Watir distro for some fairly advanced examples. (I'm doing this right now on my current project, once you start, you'll get the hang of it quickly.) -Chris From billagee at gmail.com Tue Jan 24 16:26:39 2006 From: billagee at gmail.com (Bill Agee) Date: Tue, 24 Jan 2006 13:26:39 -0800 Subject: [Wtr-general] [(SPAM) - Tagged by Sybari Antispam] Re: close all IE windows In-Reply-To: <5A47CFC77DF94344807D620F09BE76FD13D2C80D@MAIL2.corp.avanade.org> References: <5A47CFC77DF94344807D620F09BE76FD13D2C80D@MAIL2.corp.avanade.org> Message-ID: <73e7817e0601241326s4822c45cqc38dcd40b685ff78@mail.gmail.com> On 1/24/06, Richard Lawrence wrote: ... > > Unfortunately, fixing the bug doesn't get rid of the orphan IE window > from the last run of the test suite. And because of the way my team > develops smoke tests for this app, this is a common pattern for a bug in > smoke tests; the smoke test system ought to be able to catch and handle > it gracefully. This happens to me all the time too. I've been meaning to try out this solution mentioned on the list in November: http://www.mail-archive.com/wtr-general%40rubyforge.org/msg01861.html I haven't tried it out yet, though. I think that was the solution someone referred to earlier in this thread. Thanks Bill From David.J.Solis at wellsfargo.com Tue Jan 24 16:31:37 2006 From: David.J.Solis at wellsfargo.com (David.J.Solis at wellsfargo.com) Date: Tue, 24 Jan 2006 15:31:37 -0600 Subject: [Wtr-general] Tricky checkbox selection Message-ID: <493148DCF171954FBBF8E8AAB261638C0574F0@msgswbmnmsp35.wellsfargo.com> Sorry guys...it would help if you can see what I'm doing. Here it is. This is the original code that produced the error: def test_delete_user # Delete a user @array_index=0; @login = Login.new($user, $password, $url, $submit_key) $ie.link(:text, "Admin authentication").click assert($ie.contains_text("Users List")) $index = $ie.getDocument().getElementsByName('selectedUsers'); @old_value = 0; puts $index.each{|i| print i.value, "\n" puts $index.sort # Error occurs here end _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Tuesday, January 24, 2006 9:48 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection David, I would need to see the code to see what is happening. But if you are getting the collection of objects with the same name and then trying to sort that array you can't. The reason is that the array of controls is really not an array it is unique object collection. If you want to send me some code I can take a look at it and see what I can come up with. The other thing that may help though I don't know your circumstance is that you can use Xpath expressions against the DOM so you might be able to do something like that. See the previous post below that might be able to help you out. Sergio ------------------------------------------------------------------------ ------------------------------------------------------------------------ ------------------------------------------------------------------------ ------------------------------------------------ PREVIOUS POST: Hi Paatsch, How about using XPath to get the element in just one line of code rather then using the loops? In your case it would be something like this: ie.checkbox(:xpath, "//td[contains(., 'Test3')]/../td/input/").click() This XPath query first select the containing text Test3 (this is what you said is fixed and known before hand), then it goes to its parent i.e. and then traverse down the tree to first and then element inside that which is the checkbox element that you want. For using XPath download the tar ball from HEAD and read the documentation under the docs section. Hope this helps. Regards, Angrez ------------------------------------------------------------------------ ------------------------------------------------------------------------ ------------------------------------------------------------------------ ------------------------------------------------ _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David.J.Solis at wellsfargo.com Sent: Tuesday, January 24, 2006 8:52 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection I ran into a similar problem and your suggestion worked great. However, I ran into slightly different problem. In my case, I have a list of users that can be updated and deleted. Every time I add a user, the value is increased by 1. For example, and so on... To find the last index value, I sorted the array to give the largest number. Knowing this I can delete the last user created. The problem is this: When I try to use any of the built in Array methods other than Sergio example, I get the following error: WIN32OLERuntimeError: Unknown property or method `sort' HRESULT error code:0x80020006 Unknown name. C:/Tests/TestSuites/tc_smoketest_suite.rb:93:in `method_missing' C:/Tests/TestSuites/tc_smoketest_suite.rb:93:in `test_delete_user C:/Tests/TestSuites/tc_smoketest_suite.rb:92:in `each' C:/Tests/TestSuites/tc_smoketest_suite.rb:92:in `test_delete_user What am I doing wrong? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060124/782c1a6d/attachment.html From BPaatsch at activevoice.com Tue Jan 24 17:05:47 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Tue, 24 Jan 2006 16:05:47 -0600 Subject: [Wtr-general] Modula test execution? Message-ID: Is it possible to have one global variable across multiple files? In the example below "$ie" is the global variable in the file "open.rb". File: Login: #Includes require 'watir' # the watir controller include Watir require 'open' require 'Login' #login include File: open.rb: def start #open the IE browser $ie = IE.new end #call start method... start $ie.goto(logIN.url) -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: Tuesday, January 24, 2006 12:41 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Modula test execution? > I am new to ruby and watir, so this might be a very trivial question. Welcome! > > Is there a elegant solution to have a modular test script approach? > > I have blocks of code that will be always the same for the web-site I > am going to test, like "login", "search", "logout", etc. So my idea is > to put those modules into separate files and then call them from a > script called "testExecution.rb". What is your solution? This is a classic refactoring exercise. Look up "Module" in the Pickaxe, or look around at the Watir distro for some fairly advanced examples. (I'm doing this right now on my current project, once you start, you'll get the hang of it quickly.) -Chris _______________________________________________ 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/20060124/72bcd667/attachment.html From BPaatsch at activevoice.com Tue Jan 24 17:23:34 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Tue, 24 Jan 2006 16:23:34 -0600 Subject: [Wtr-general] Modula test execution? Message-ID: I take it back. It works just fine. I had a typo in my code. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Tuesday, January 24, 2006 2:06 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Modula test execution? Is it possible to have one global variable across multiple files? In the example below "$ie" is the global variable in the file "open.rb". File: Login: #Includes require 'watir' # the watir controller include Watir require 'open' require 'Login' #login include File: open.rb: def start #open the IE browser $ie = IE.new end #call start method... start $ie.goto(logIN.url) -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org ] On Behalf Of Chris McMahon Sent: Tuesday, January 24, 2006 12:41 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Modula test execution? > I am new to ruby and watir, so this might be a very trivial question. Welcome! > > Is there a elegant solution to have a modular test script approach? > > I have blocks of code that will be always the same for the web-site I > am going to test, like "login", "search", "logout", etc. So my idea is > to put those modules into separate files and then call them from a > script called "testExecution.rb". What is your solution? This is a classic refactoring exercise. Look up "Module" in the Pickaxe, or look around at the Watir distro for some fairly advanced examples. (I'm doing this right now on my current project, once you start, you'll get the hang of it quickly.) -Chris _______________________________________________ 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/20060124/7e84114f/attachment.html From mb at michaelbolton.net Wed Jan 25 10:28:39 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Wed, 25 Jan 2006 10:28:39 -0500 Subject: [Wtr-general] [(SPAM) - Tagged by Sybari Antispam] Re: closeall IE windows In-Reply-To: <5A47CFC77DF94344807D620F09BE76FD13D2C80D@MAIL2.corp.avanade.org> Message-ID: <01f101c621c4$044cda90$6801a8c0@Koko> >>Get the developer to fix his bug? >Good plan. All I need now are developers who never check in bugs and I won't need to wrestle with smoke tests at all. Ideally, you should be wanting to get rid of the developers, and then you won't have to do /any/ tests. >Unfortunately, fixing the bug doesn't get rid of the orphan IE window from the last run of the test suite. And because of the way my team develops smoke tests for this app, this is a common pattern for a bug in smoke tests; the smoke test system ought to be able to catch and handle it gracefully. Ah. Well, the lovely thing about open-source interpreted code is that you can duplicate it and hack it. One very inelegant but brutally effective way that I might do it is to set a global variable and put a conditional (and an error message) around the call to check_http_error, thus if SMOKE_TEST puts "Ignoring call to check_http_error" else check_http_error end Another would be to use the Windows API to find the handle of the IE window and send the message to kill the process. ---Michael B. From bret at pettichord.com Wed Jan 25 10:36:17 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 25 Jan 2006 09:36:17 -0600 Subject: [Wtr-general] Modula test execution? In-Reply-To: References: Message-ID: I'm not sure what your question is. Do you need help doing this? Or do you have a method and want to compare yours with others that are possibly more "elegant"? This can be done very simply. Create your test methods using "def". Place them in testexecution.rb. Then put "require testexecution" in the scripts that use these methods. You can also use Modules if you want. They are arguably more "elegant" but that really depends on your situation. Bret On 1/24/06, Paatsch, Bernd wrote: > > Hello, > > I am new to ruby and watir, so this might be a very trivial question. > > Is there a elegant solution to have a modular test script approach? > > I have blocks of code that will be always the same for the web-site I am > going to test, like "login", "search", "logout", etc. So my idea is to put > those modules into separate files and then call them from a script called " > testExecution.rb". What is your solution? > > 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/20060125/d8843f54/attachment.html From bret at pettichord.com Wed Jan 25 10:37:06 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 25 Jan 2006 09:37:06 -0600 Subject: [Wtr-general] Modula test execution? In-Reply-To: References: Message-ID: On 1/24/06, Paatsch, Bernd wrote: > > Is it possible to have one global variable across multiple files? > Yes. In the example below "$ie" is the global variable in the file "open.rb". > > File: Login: > #Includes > require 'watir' # the watir controller > include Watir > require 'open' > require 'Login' #login include > > File: open.rb: > def start #open the IE browser > $ie = IE.new > end > > #call start method... > start > > $ie.goto(logIN.url) > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060125/63dabd26/attachment.html From dara.lillis at kiodex.com Wed Jan 25 12:01:24 2006 From: dara.lillis at kiodex.com (Dara Lillis) Date: Wed, 25 Jan 2006 09:01:24 -0800 Subject: [Wtr-general] close all IE windows Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E235805@ehost011-27.exch011.intermedia.net> I'm not sure if this will solve your problem, but I posted some code to the Wiki FAQ (http://watir.net/FAQ#Closing_all_open_IE_windows) a while ago to close all open IE windows: # close all open ie windows all_closed = 'unknown' while (all_closed != 'yes') begin #use a regexp that will match any title so all ie windows are forced closed header = Regexp.new(//) @ie = IE.attach(:title, header) @ie.close # catch the exception raised when there's now window to attach to. rescue NoMatchingWindowFoundException all_closed = 'yes' end end -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Michael Bolton Sent: Tuesday, January 24, 2006 2:26 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] close all IE windows Get the developer to fix his bug? ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Richard Lawrence Sent: January 24, 2006 1:49 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] close all IE windows It's not that. It's an address like "http://localhost:1505/Web" (the local address of the VS web server on a developer's machine) that a developer left in a smoke test instead of switching to the correct address for the build server. But since nothing is listening on 1505 on the build server, the attach call fails, and I'm left with an orphan IE window. Richard -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Atilla Ozgur Sent: Tuesday, January 24, 2006 10:25 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] close all IE windows Problem is IE is also works as File Explorer. Attach code does not work with file explorer behaviour. If your IE with invalid web address is a file explorer window you can not do that. As I understand from error, it may not be possible to do that On 1/24/06, Richard Lawrence wrote: > I've added a rescue block to deal with the exception, but that doesn't > help me attach to windows that currently have an invalid web address. > Effectively, what I'm looking for is a way to call attach without it > calling wait internally. Is that possible somehow? > > Thanks, > > Richard > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin > Sent: Tuesday, January 24, 2006 8:21 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] close all IE windows > > I think this will help. > > begin > # attach to and close all IE windows > rescue > end > > I think that Bret Pettichord posted code that does what you need, but > I can not find it now. > > Zeljko > > 2006/1/24, Richard Lawrence : > > > > > > > > I'm trying to attach to and close all IE windows before and after my > tests > > to ensure that there are no orphan IE windows. However, if there is an > error > > in one of the open windows (due to an invalid address, for example), > the > > attach calls fails like this: > > > > Watir::Exception::NavigationException: Cannot find server or DNS > > Error > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1160:in > > `check_for_http_error' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1141:in > > `set_defaults' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1135:in `call' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1436:in > > `run_error_checks' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in `each' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in > > `run_error_checks' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1419:in `wait' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1113:in > > `attach_init' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1104:in > > `attach' > > > > > > > > Is there a way I can disable error checking on these attach calls? I > don't > > care if the content of the window is good; I just want to close it. > > > > > > > > Thanks, > > > > > > > > Richard > > > > ____________________________________________ > > Richard Lawrence | Senior Solution Developer, MCSD.NET > > Avanade(r) Inc | Rocky Mountain District, US West Region > > Mobile: 303.895.7688 > > www.avanade.com > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > -- > http://iskusivac.blog.hr/ > > _______________________________________________ > 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 richardlaw at avanade.com Wed Jan 25 13:13:00 2006 From: richardlaw at avanade.com (Richard Lawrence) Date: Wed, 25 Jan 2006 10:13:00 -0800 Subject: [Wtr-general] close all IE windows Message-ID: <5A47CFC77DF94344807D620F09BE76FD13DA07ED@MAIL2.corp.avanade.org> My code is based on that code. It's the attach call that fails when the browser is pointed at an invalid page. Thanks, Richard -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Dara Lillis Sent: Wednesday, January 25, 2006 10:01 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] close all IE windows I'm not sure if this will solve your problem, but I posted some code to the Wiki FAQ (http://watir.net/FAQ#Closing_all_open_IE_windows) a while ago to close all open IE windows: # close all open ie windows all_closed = 'unknown' while (all_closed != 'yes') begin #use a regexp that will match any title so all ie windows are forced closed header = Regexp.new(//) @ie = IE.attach(:title, header) @ie.close # catch the exception raised when there's now window to attach to. rescue NoMatchingWindowFoundException all_closed = 'yes' end end -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Michael Bolton Sent: Tuesday, January 24, 2006 2:26 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] close all IE windows Get the developer to fix his bug? ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Richard Lawrence Sent: January 24, 2006 1:49 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] close all IE windows It's not that. It's an address like "http://localhost:1505/Web" (the local address of the VS web server on a developer's machine) that a developer left in a smoke test instead of switching to the correct address for the build server. But since nothing is listening on 1505 on the build server, the attach call fails, and I'm left with an orphan IE window. Richard -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Atilla Ozgur Sent: Tuesday, January 24, 2006 10:25 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] close all IE windows Problem is IE is also works as File Explorer. Attach code does not work with file explorer behaviour. If your IE with invalid web address is a file explorer window you can not do that. As I understand from error, it may not be possible to do that On 1/24/06, Richard Lawrence wrote: > I've added a rescue block to deal with the exception, but that doesn't > help me attach to windows that currently have an invalid web address. > Effectively, what I'm looking for is a way to call attach without it > calling wait internally. Is that possible somehow? > > Thanks, > > Richard > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin > Sent: Tuesday, January 24, 2006 8:21 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] close all IE windows > > I think this will help. > > begin > # attach to and close all IE windows > rescue > end > > I think that Bret Pettichord posted code that does what you need, but > I can not find it now. > > Zeljko > > 2006/1/24, Richard Lawrence : > > > > > > > > I'm trying to attach to and close all IE windows before and after my > tests > > to ensure that there are no orphan IE windows. However, if there is an > error > > in one of the open windows (due to an invalid address, for example), > the > > attach calls fails like this: > > > > Watir::Exception::NavigationException: Cannot find server or DNS > > Error > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1160:in > > `check_for_http_error' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1141:in > > `set_defaults' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1135:in `call' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1436:in > > `run_error_checks' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in `each' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in > > `run_error_checks' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1419:in `wait' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1113:in > > `attach_init' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1104:in > > `attach' > > > > > > > > Is there a way I can disable error checking on these attach calls? I > don't > > care if the content of the window is good; I just want to close it. > > > > > > > > Thanks, > > > > > > > > Richard > > > > ____________________________________________ > > Richard Lawrence | Senior Solution Developer, MCSD.NET > > Avanade(r) Inc | Rocky Mountain District, US West Region > > Mobile: 303.895.7688 > > www.avanade.com > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > -- > http://iskusivac.blog.hr/ > > _______________________________________________ > 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 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From ChintakrindiMeghana at managementdynamics.com Wed Jan 25 13:36:47 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Wed, 25 Jan 2006 13:36:47 -0500 Subject: [Wtr-general] Tab Click Message-ID: Hi All My web application contains two tabs in one of the transaction "Detail" and "Contents" After entering the data in the Detail page, using will be saving that record and clicks on "Contents". I am trying to make a script for that Can anyone help me out, how to click on "Contents". I tried with most of the objects, but its not going through. The following is the source code Thanks Meghanath -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060125/d67ff191/attachment.html From bret at pettichord.com Wed Jan 25 14:09:39 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 25 Jan 2006 13:09:39 -0600 Subject: [Wtr-general] Tab Click In-Reply-To: References: Message-ID: ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com> wrote: > > Hi All > > My web application contains two tabs in one of the transaction "Detail" > and "Contents" > After entering the data in the Detail page, using will be saving that > record and clicks on "Contents". > I am trying to make a script for that > Can anyone help me out, how to click on "Contents". > I tried with most of the objects, but its not going through. > The following is the source code > > > > > > > > Thanks > > Meghanath > > _______________________________________________ > 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/20060125/a114ff41/attachment.html From ChintakrindiMeghana at managementdynamics.com Wed Jan 25 15:06:33 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Wed, 25 Jan 2006 15:06:33 -0500 Subject: [Wtr-general] Tab Click Message-ID: Hi I aleady tried with that option , but its not working Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com > wrote: Hi All My web application contains two tabs in one of the transaction "Detail" and "Contents" After entering the data in the Detail page, using will be saving that record and clicks on "Contents". I am trying to make a script for that Can anyone help me out, how to click on "Contents". I tried with most of the objects, but its not going through. The following is the source code Thanks Meghanath _______________________________________________ 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/20060125/234eb4c8/attachment.html From chris.schmechel at gmail.com Wed Jan 25 15:51:48 2006 From: chris.schmechel at gmail.com (Chris Schmechel) Date: Wed, 25 Jan 2006 12:51:48 -0800 Subject: [Wtr-general] Question on clicking on link Message-ID: <7a754c960601251251i1a4d69dqd4260d75def43586@mail.gmail.com> Hi, I'm trying to automate clicking on the following link (ie. image on my HTML page):
which then takes me to the subsequent download page. I've tried the following without any luck: ie.link(:url, "download.html").click Any suggestions? Thanks in advance, Chris Schmechel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060125/bc423f08/attachment.html From bret at pettichord.com Wed Jan 25 16:08:58 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 25 Jan 2006 15:08:58 -0600 Subject: [Wtr-general] Tab Click In-Reply-To: References: Message-ID: How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com> wrote: > > Hi > > I aleady tried with that option , but its not working > > Thanks > Meghanath > > -----Original Message----- > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org]*On Behalf Of *Bret Pettichord > *Sent:* Wednesday, January 25, 2006 2:10 PM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] Tab Click > > ie.div(:id, 'LineTab').click > > On 1/25/06, Chintakrindi Meghanath > wrote: > > > > Hi All > > > > My web application contains two tabs in one of the transaction "Detail" > > and "Contents" > > After entering the data in the Detail page, using will be saving that > > record and clicks on "Contents". > > I am trying to make a script for that > > Can anyone help me out, how to click on "Contents". > > I tried with most of the objects, but its not going through. > > The following is the source code > > > > > > > > > > > > > > > > Thanks > > > > Meghanath > > > > _______________________________________________ > > 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/20060125/d69125ef/attachment.html From bret at pettichord.com Wed Jan 25 16:09:47 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 25 Jan 2006 15:09:47 -0600 Subject: [Wtr-general] Question on clicking on link In-Reply-To: <7a754c960601251251i1a4d69dqd4260d75def43586@mail.gmail.com> References: <7a754c960601251251i1a4d69dqd4260d75def43586@mail.gmail.com> Message-ID: What error do you get? On 1/25/06, Chris Schmechel wrote: > > Hi, > > I'm trying to automate clicking on the following link (ie. image on my > HTML page): > > width="162" height="35" border="0"> >
> > which then takes me to the subsequent download page. I've tried the > following without any luck: > > ie.link(:url, "download.html").click > > Any suggestions? > > Thanks in advance, > > Chris Schmechel > > _______________________________________________ > 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/20060125/6d1b0e8e/attachment.html From chris.schmechel at gmail.com Wed Jan 25 16:33:34 2006 From: chris.schmechel at gmail.com (Chris Schmechel) Date: Wed, 25 Jan 2006 13:33:34 -0800 Subject: [Wtr-general] Question on clicking on link Message-ID: <7a754c960601251333q37a085dfyd0d0620924e10ef0@mail.gmail.com> Thanks for the reply, it got me thinking. I found the problem: ie.link(:url, "download.html").click needs to become: ie.link(:url, /download.html/).click and it works! Now I'm running into another problem. Due to my browser security settings -- I'm getting the following ActiveX control upon download: "To help protect your security, Internet Explorer blocked this site from downloading files to your computer. Click here for options..." I'd like to be able to detect this and then issue the click on the download button (ie. start it going ). Afterwards, you get another dialog box: File Download - Security Warning. With the options to Run, Save, or Cancel the file download. How can I handle this as well? Thanks again! Chris Schmechel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060125/ec244259/attachment.html From peppers at gmail.com Wed Jan 25 19:56:36 2006 From: peppers at gmail.com (Terry Peppers) Date: Wed, 25 Jan 2006 18:56:36 -0600 Subject: [Wtr-general] close all IE windows Message-ID: <8ca48b420601251656wce75ccbtbd7ced06e61dbc2a@mail.gmail.com> Richard - With regard to closing all IE windows, something I unearthed this week is that sometimes Watir is a little too quick. What do I mean? Well, when some of the windows close in our sites, the application throws a 'Are you sure you want to leave?' window. I tried a bunch of different ways to attach that window to a new object and then close it - to no avail. So what I did stumble on was putting Watir to sleep for a little - let the window pop - try to attach and then close it. Something like this in a teardown method: def teardown @ie.close sleep 2 @ie_pop = IE.attach(:title, "Some Title") @ie_pop.close end You can also wrap that with a begin/resuce/end statement to catch any exceptions if there are cases where the window doesn't pop. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060125/1d1d89fa/attachment.html From bret at pettichord.com Wed Jan 25 22:17:50 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 25 Jan 2006 21:17:50 -0600 Subject: [Wtr-general] Fwd: close all IE windows In-Reply-To: References: <5A47CFC77DF94344807D620F09BE76FD13CC2891@MAIL2.corp.avanade.org> Message-ID: On 1/24/06, Richard Lawrence wrote: > > Is there a way I can disable error checking on these attach calls? I don't > care if the content of the window is good; I just want to close it. > This might work: class BetterIE << Watir::IE def add_checker; end end ie = BetterIE.attach("that crummy window") ie.close Let us know whether this works. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060125/cf91d310/attachment.html From dsolis at yahoo.com Thu Jan 26 00:00:58 2006 From: dsolis at yahoo.com (David Solis) Date: Wed, 25 Jan 2006 21:00:58 -0800 (PST) Subject: [Wtr-general] Another JavaScript Question Message-ID: <20060126050059.89138.qmail@web52914.mail.yahoo.com> All, I've been trying desperately for over week to figure out how to click on JavaScript button to no avail. I have tried just about everybody's suggestions. Mark Cain's solution posted last week looked very promising, but can't get it to work. Here is the code that contains the buttons (cancel & update) I need to click on:
Thanks David --------------------------------- Do you Yahoo!? With a free 1 GB, there's more in store with Yahoo! Mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060125/107de66b/attachment.html From bret at pettichord.com Thu Jan 26 00:23:40 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 25 Jan 2006 23:23:40 -0600 Subject: [Wtr-general] Another JavaScript Question In-Reply-To: <20060126050059.89138.qmail@web52914.mail.yahoo.com> References: <20060126050059.89138.qmail@web52914.mail.yahoo.com> Message-ID: Which button did you want to click? I don't know what "JavaScript Button" means. What did you try? What did Mark suggest? What happened? Did you get an error message? Bret On 1/25/06, David Solis wrote: > > All, > > I've been trying desperately for over week to figure out how to click on > JavaScript button to no avail. I have tried just about everybody's > suggestions. Mark Cain's solution posted last week looked very promising, > but can't get it to work. Here is the code that contains the buttons (cancel > & update) I need to click on: > > > > >
> > Thanks > > ! > David > > ------------------------------ > Do you Yahoo!? > With a free 1 GB, there's more in store with Yahoo! Mail. > > > _______________________________________________ > 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/20060125/a2ec9bb9/attachment.html From mb at michaelbolton.net Thu Jan 26 02:20:20 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Thu, 26 Jan 2006 02:20:20 -0500 Subject: [Wtr-general] Tricky checkbox selection In-Reply-To: <493148DCF171954FBBF8E8AAB261638C0574F0@msgswbmnmsp35.wellsfargo.com> Message-ID: <028301c62248$f6e377d0$6801a8c0@Koko> >From the fragment below, it appears that you're missing a closing brace: puts $index.each{|i| print i.value, "\n" puts $index.sort # Error occurs here I'm also confused by the puts at the beginning of the first line quoted above when there's a print within the block after "each". I don't see the reason for setting @old_value to 0, either. A comment? A more explicit variable name? ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David.J.Solis at wellsfargo.com Sent: January 24, 2006 4:32 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection Sorry guys...it would help if you can see what I'm doing. Here it is. This is the original code that produced the error: def test_delete_user # Delete a user @array_index=0; @login = Login.new($user, $password, $url, $submit_key) $ie.link(:text, "Admin authentication").click assert($ie.contains_text("Users List")) $index = $ie.getDocument().getElementsByName('selectedUsers'); @old_value = 0; puts $index.each{|i| print i.value, "\n" puts $index.sort # Error occurs here end _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Tuesday, January 24, 2006 9:48 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection David, I would need to see the code to see what is happening. But if you are getting the collection of objects with the same name and then trying to sort that array you can't. The reason is that the array of controls is really not an array it is unique object collection. If you want to send me some code I can take a look at it and see what I can come up with. The other thing that may help though I don't know your circumstance is that you can use Xpath expressions against the DOM so you might be able to do something like that. See the previous post below that might be able to help you out. Sergio ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- ------------------------------------ PREVIOUS POST: Hi Paatsch, How about using XPath to get the element in just one line of code rather then using the loops? In your case it would be something like this: ie.checkbox(:xpath, "//td[contains(., 'Test3')]/../td/input/").click() This XPath query first select the containing text Test3 (this is what you said is fixed and known before hand), then it goes to its parent i.e. and then traverse down the tree to first and then element inside that which is the checkbox element that you want. For using XPath download the tar ball from HEAD and read the documentation under the docs section. Hope this helps. Regards, Angrez ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- ------------------------------------ _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David.J.Solis at wellsfargo.com Sent: Tuesday, January 24, 2006 8:52 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection I ran into a similar problem and your suggestion worked great. However, I ran into slightly different problem. In my case, I have a list of users that can be updated and deleted. Every time I add a user, the value is increased by 1. For example, and so on... To find the last index value, I sorted the array to give the largest number. Knowing this I can delete the last user created. The problem is this: When I try to use any of the built in Array methods other than Sergio example, I get the following error: WIN32OLERuntimeError: Unknown property or method `sort' HRESULT error code:0x80020006 Unknown name. C:/Tests/TestSuites/tc_smoketest_suite.rb:93:in `method_missing' C:/Tests/TestSuites/tc_smoketest_suite.rb:93:in `test_delete_user C:/Tests/TestSuites/tc_smoketest_suite.rb:92:in `each' C:/Tests/TestSuites/tc_smoketest_suite.rb:92:in `test_delete_user What am I doing wrong? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060126/8507a55f/attachment.html From noreply at rubyforge.org Thu Jan 26 06:54:54 2006 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 26 Jan 2006 06:54:54 -0500 Subject: [Wtr-general] [ wtr-Bugs-3334 ] Images missing after installation from watir-1.4.1.exe Message-ID: <200601261154.k0QBss2k025318@rubyforge.org> Bugs item #3334, was opened at 2006-01-26 06:54 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=487&aid=3334&group_id=104 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Nobody (None) Assigned to: Nobody (None) Summary: Images missing after installation from watir-1.4.1.exe Initial Comment: Hi guys, after installation with the installer, the unittests fail because the images directory (in the html one) is missing. The solution for the moment is to extract them manually from the zip distribution. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=487&aid=3334&group_id=104 From richardlaw at avanade.com Thu Jan 26 09:52:00 2006 From: richardlaw at avanade.com (Richard Lawrence) Date: Thu, 26 Jan 2006 06:52:00 -0800 Subject: [Wtr-general] [(SPAM) - Tagged by Sybari Antispam] Re: closeall IE windows Message-ID: <5A47CFC77DF94344807D620F09BE76FD13DFCE7F@MAIL2.corp.avanade.org> Thanks, Bill. This turned out to be the only solution that worked dependably. Best, Richard -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bill Agee Sent: Tuesday, January 24, 2006 2:27 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] [(SPAM) - Tagged by Sybari Antispam] Re: closeall IE windows On 1/24/06, Richard Lawrence wrote: ... > > Unfortunately, fixing the bug doesn't get rid of the orphan IE window > from the last run of the test suite. And because of the way my team > develops smoke tests for this app, this is a common pattern for a bug in > smoke tests; the smoke test system ought to be able to catch and handle > it gracefully. This happens to me all the time too. I've been meaning to try out this solution mentioned on the list in November: http://www.mail-archive.com/wtr-general%40rubyforge.org/msg01861.html I haven't tried it out yet, though. I think that was the solution someone referred to earlier in this thread. Thanks Bill _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From ChintakrindiMeghana at managementdynamics.com Thu Jan 26 09:57:39 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Thu, 26 Jan 2006 09:57:39 -0500 Subject: [Wtr-general] Tab Click Message-ID: Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com> wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto: wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com > wrote: Hi All My web application contains two tabs in one of the transaction "Detail" and "Contents" After entering the data in the Detail page, using will be saving that record and clicks on "Contents". I am trying to make a script for that Can anyone help me out, how to click on "Contents". I tried with most of the objects, but its not going through. The following is the source code Thanks Meghanath _______________________________________________ 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/20060126/9536f940/attachment.html From chris.schmechel at gmail.com Thu Jan 26 10:24:39 2006 From: chris.schmechel at gmail.com (Chris Schmechel) Date: Thu, 26 Jan 2006 07:24:39 -0800 Subject: [Wtr-general] Automate a third-party plugin toolbar in IE? Message-ID: <7a754c960601260724xa754736wdcc26a5671075845@mail.gmail.com> Is it possible to automate a third-party plugin toolbar in the IE browser? I want to directly access the toolbar menus and the various lists to validate that I'm sent to the correct website. Thanks again, Chris Schmechel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060126/b6ae3e36/attachment.html From ati.ozgur at gmail.com Thu Jan 26 11:08:29 2006 From: ati.ozgur at gmail.com (Atilla Ozgur) Date: Thu, 26 Jan 2006 18:08:29 +0200 Subject: [Wtr-general] Automate a third-party plugin toolbar in IE? In-Reply-To: <7a754c960601260724xa754736wdcc26a5671075845@mail.gmail.com> References: <7a754c960601260724xa754736wdcc26a5671075845@mail.gmail.com> Message-ID: do you have an API for third-party plugin toolbar? If it has one, it may be possible. On 1/26/06, Chris Schmechel wrote: > > Is it possible to automate a third-party plugin toolbar in the IE browser? > I want to > directly access the toolbar menus and the various lists to validate that I'm > sent to > the correct website. > > Thanks again, > > Chris Schmechel > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From Mark_Cain at rl.gov Thu Jan 26 11:15:26 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Thu, 26 Jan 2006 08:15:26 -0800 Subject: [Wtr-general] Another JavaScript Question Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D52D@EX5V.rl.gov> This is what I would try given the html you sent. $ie.table( :index, 1 )[1][3].click If this table is nested inside other tables you will need to get the index number by counting the tables-starting at the top-most table-by doing a: 1. Right click in the web page and select 'View Source' 2. DO ctrl + f and put tags are the first bracket [the nth inside your table] -- the
tags are the second bracket [the nth inside your table] $ie.table( :index, 1 )[1][3].click You can use the flash method to figure out where you are on the page to debug. $ie.table( :index, 1 )[1][3].flash You could also use the fireEvent method if the click does not work for you. $ie.table( :index, 1 )[1][3].fireEvent("OnClick") Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David Solis Sent: Wednesday, January 25, 2006 9:01 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Another JavaScript Question All, I've been trying desperately for over week to figure out how to click on JavaScript button to no avail. I have tried just about everybody's suggestions. Mark Cain's solution posted last week looked very promising, but can't get it to work. Here is the code that contains the buttons (cancel & update) I need to click on:
Thanks ! David ________________________________ Do you Yahoo!? With a free 1 GB, there's more in store with Yahoo! Mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060126/9562c3be/attachment.html From sergio.pinon at us.g4s.com Thu Jan 26 12:38:03 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Thu, 26 Jan 2006 09:38:03 -0800 Subject: [Wtr-general] Another JavaScript Question Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC2015@bugatti.ems.securicor.com> This might be another possibility to try: Get the underlying javascript DOM object from the browser: js_dom = ie_browser.getDocument(); At this point you can execute any javascript methods you want against the browser. Since you don't have any name or id attributes you can get the objects by type. hyperlinks = js_dom.getElementsByTagName(""A"); At the point the hyperlinks variable represents a collection of all of the links in your page. So if you know the index of the hyperlink you can just do that. Or you can loop through them all and try to determine which one to use. hyperlinks[1].click() or for I in 0..hyperlinks.length do something with --> hyperlinks[i] end Of course this is just one option. I would say your best option would be to try and give these hyperlinks sometype of identifier. (name, id, etc...) Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David Solis Sent: Wednesday, January 25, 2006 9:01 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Another JavaScript Question All, I've been trying desperately for over week to figure out how to click on JavaScript button to no avail. I have tried just about everybody's suggestions. Mark Cain's solution posted last week looked very promising, but can't get it to work. Here is the code that contains the buttons (cancel & update) I need to click on:
Thanks ! David ________________________________ Do you Yahoo!? With a free 1 GB, there's more in store with Yahoo! Mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060126/bf95698b/attachment.html From ChintakrindiMeghana at managementdynamics.com Thu Jan 26 13:27:25 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Thu, 26 Jan 2006 13:27:25 -0500 Subject: [Wtr-general] Tab Click Message-ID: HI All Can anyone , give solution, I am struck at this point . Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 9:58 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com> wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto: wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com > wrote: Hi All My web application contains two tabs in one of the transaction "Detail" and "Contents" After entering the data in the Detail page, using will be saving that record and clicks on "Contents". I am trying to make a script for that Can anyone help me out, how to click on "Contents". I tried with most of the objects, but its not going through. The following is the source code Thanks Meghanath _______________________________________________ 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/20060126/70f9e61d/attachment.html From sgordonphd at gmail.com Thu Jan 26 13:30:02 2006 From: sgordonphd at gmail.com (Steven Gordon) Date: Thu, 26 Jan 2006 11:30:02 -0700 Subject: [Wtr-general] unexpected results when a table has cells with tables Message-ID: <709b71310601261030u2fecd354wb0d4644f24753d32@mail.gmail.com> I apologize if this is a known bug or an IE issue rather than a Watir issue - when a table has cells with tables in them, the outer table gives the wrong number of rows and the column_values(column_number) method does not work, even for columns in which all the cells are simple. For example, if I open a page with the following html with a Watir program:
Operation Value Status
Edit Print
Delete Email
Record 1
Printed Yesterday
Emailed Today
Edit Print
Delete Email
Record 2
Printed Today
Emailed Yesterday
Edit Print
Delete Email
Record 3
Printed Never
Emailed Never
Embedded Table Example Then the table "mytable" displays the following information: table 1: type: id: mytable name: value: disabled: false rows: 16 cols: 3 Whereas I would expect 3 rows and 3 columns. Furthermore, calling column_values(2) does not work at all, whereas I would expect [Record 1, Record 2, Record 3]. Is this a bug, or am I doing something wrong. Is there a workaround that would allow me to do things such as search the table to find what row has a particular value in a particular column even though the number of rows is incorrect. Thanks, Steven Gordon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060126/4d4e17fe/attachment.html From mb at michaelbolton.net Thu Jan 26 13:53:30 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Thu, 26 Jan 2006 13:53:30 -0500 Subject: [Wtr-general] Tab Click In-Reply-To: Message-ID: <006b01c622a9$cc88e9a0$6801a8c0@Koko> So ie.button(:text, "Contents").click doesn't work? What does your code look like? What have you tried? Have you seen any error messages? Have you stepped through it in IRB? ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: January 26, 2006 1:27 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click HI All Can anyone , give solution, I am struck at this point . Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 9:58 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com > wrote: Hi All My web application contains two tabs in one of the transaction "Detail" and "Contents" After entering the data in the Detail page, using will be saving that record and clicks on "Contents". I am trying to make a script for that Can anyone help me out, how to click on "Contents". I tried with most of the objects, but its not going through. The following is the source code Thanks Meghanath _______________________________________________ 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/20060126/5a882b9d/attachment.html From sergio.pinon at us.g4s.com Thu Jan 26 14:03:26 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Thu, 26 Jan 2006 11:03:26 -0800 Subject: [Wtr-general] Tab Click Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC2031@bugatti.ems.securicor.com> Some thoughts: Can you give the td that contains the text you want clicked an ID attribute. If so then you could try accessing the td directly and calling the click method on it. This can be done with javascript using the following code. ie_browser.getDocument().getElementById("[table cell id]").click() That should work if you can do something like that. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 10:27 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click HI All Can anyone , give solution, I am struck at this point . Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 9:58 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com > wrote: Hi All My web application contains two tabs in one of the transaction "Detail" and "Contents" After entering the data in the Detail page, using will be saving that record and clicks on "Contents". I am trying to make a script for that Can anyone help me out, how to click on "Contents". I tried with most of the objects, but its not going through. The following is the source code Thanks Meghanath _______________________________________________ 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/20060126/c2e7fa94/attachment.html From BPaatsch at activevoice.com Thu Jan 26 14:17:25 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Thu, 26 Jan 2006 13:17:25 -0600 Subject: [Wtr-general] Can following if statement be written simpler? Message-ID: Hello, I have following code below and wonder if it can be done simpler -- in one line? if nil != add.wacValNewSub ie2.radio(:name, add.wacTagNewSub).click $logger.log( " Action: selected radiobutton " + add.wacTagNewSub + ".") end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060126/aca2b591/attachment.html From bret at pettichord.com Thu Jan 26 14:33:22 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 26 Jan 2006 13:33:22 -0600 Subject: [Wtr-general] unexpected results when a table has cells with tables In-Reply-To: <709b71310601261030u2fecd354wb0d4644f24753d32@mail.gmail.com> References: <709b71310601261030u2fecd354wb0d4644f24753d32@mail.gmail.com> Message-ID: It's a Watir bug. I'm not sure what the correct fix or workaround would be. Bret On 1/26/06, Steven Gordon wrote: > > I apologize if this is a known bug or an IE issue rather than a Watir > issue - when a table has cells with tables in them, the outer table gives > the wrong number of rows and the column_values(column_number) method does > not work, even for columns in which all the cells are simple. > > For example, if I open a page with the following html with a Watir > program: > > > > > > > > > > > > > > > > > > > > > > > > > >
OperationValueStatus
> > > > > > > > > >
EditPrint
DeleteEmail
>
Record 1 > > > > > > > >
Printed Yesterday
Emailed Today
>
> > > > > > > > > >
EditPrint
DeleteEmail
>
Record 2 > > > > > > > >
Printed Today
Emailed Yesterday
>
> > > > > > > > > >
EditPrint
DeleteEmail
>
Record 3 > > > > > > > >
Printed Never
Emailed Never
>
> > > > Embedded Table Example > > Then the table "mytable" displays the following information: > > table 1: type: > id: mytable > name: > value: > disabled: false > rows: 16 > cols: 3 > > Whereas I would expect 3 rows and 3 columns. > > Furthermore, calling column_values(2) does not work at all, whereas I > would expect [Record 1, Record 2, Record 3]. > > Is this a bug, or am I doing something wrong. Is there a workaround that > would allow me to do things such as search the table to find what row has a > particular value in a particular column even though the number of rows is > incorrect. > > Thanks, > > Steven Gordon > > _______________________________________________ > 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/20060126/06b55dd1/attachment.html From ChintakrindiMeghana at managementdynamics.com Thu Jan 26 14:46:03 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Thu, 26 Jan 2006 14:46:03 -0500 Subject: [Wtr-general] Tab Click Message-ID: Hi Michael I tried with many different options. The source code looks as follows. I had not seen any error messages. I had not stepped thorugh the IRB, i will try that option Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Michael Bolton Sent: Thursday, January 26, 2006 1:54 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click So ie.button(:text, "Contents").click doesn't work? What does your code look like? What have you tried? Have you seen any error messages? Have you stepped through it in IRB? ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: January 26, 2006 1:27 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click HI All Can anyone , give solution, I am struck at this point . Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 9:58 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com> wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto: wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com > wrote: Hi All My web application contains two tabs in one of the transaction "Detail" and "Contents" After entering the data in the Detail page, using will be saving that record and clicks on "Contents". I am trying to make a script for that Can anyone help me out, how to click on "Contents". I tried with most of the objects, but its not going through. The following is the source code Thanks Meghanath _______________________________________________ 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/20060126/733c6988/attachment.html From ChintakrindiMeghana at managementdynamics.com Thu Jan 26 14:59:30 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Thu, 26 Jan 2006 14:59:30 -0500 Subject: [Wtr-general] Tab Click Message-ID: Hi I stepped through the IRB and getting the following error exception. I used link, button , image etc Watir::Exception::UnknownObjectException: Unable to locate object, using value a nd (?-mix:Contents) When I used "div", its not throwing any message, but no object is returned. Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 2:03 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Some thoughts: Can you give the td that contains the text you want clicked an ID attribute. If so then you could try accessing the td directly and calling the click method on it. This can be done with javascript using the following code. ie_browser.getDocument().getElementById("[table cell id]").click() That should work if you can do something like that. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 10:27 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click HI All Can anyone , give solution, I am struck at this point . Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 9:58 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com> wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto: wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com > wrote: Hi All My web application contains two tabs in one of the transaction "Detail" and "Contents" After entering the data in the Detail page, using will be saving that record and clicks on "Contents". I am trying to make a script for that Can anyone help me out, how to click on "Contents". I tried with most of the objects, but its not going through. The following is the source code Thanks Meghanath _______________________________________________ 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/20060126/2b83fe12/attachment.html From BPaatsch at activevoice.com Thu Jan 26 15:50:21 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Thu, 26 Jan 2006 14:50:21 -0600 Subject: [Wtr-general] IE window popups Message-ID: Hello, I am struggeling with IE windows popups. Is there a way (easy) to deal with following window? Sys.Process("IEXPLORE").Window("#32770", "Microsoft Internet Explorer", 1).Window("Button", "OK", 1).ChildCount -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060126/bf7464df/attachment.html From mb at michaelbolton.net Thu Jan 26 16:06:59 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Thu, 26 Jan 2006 16:06:59 -0500 Subject: [Wtr-general] Tab Click In-Reply-To: Message-ID: <009c01c622bc$72d78200$6801a8c0@Koko> When I said "source code", I meant your Ruby source, not the HTML source for the Web page. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: January 26, 2006 2:46 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi Michael I tried with many different options. The source code looks as follows. I had not seen any error messages. I had not stepped thorugh the IRB, i will try that option Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Michael Bolton Sent: Thursday, January 26, 2006 1:54 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click So ie.button(:text, "Contents").click doesn't work? What does your code look like? What have you tried? Have you seen any error messages? Have you stepped through it in IRB? ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: January 26, 2006 1:27 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click HI All Can anyone , give solution, I am struck at this point . Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 9:58 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com > wrote: Hi All My web application contains two tabs in one of the transaction "Detail" and "Contents" After entering the data in the Detail page, using will be saving that record and clicks on "Contents". I am trying to make a script for that Can anyone help me out, how to click on "Contents". I tried with most of the objects, but its not going through. The following is the source code Thanks Meghanath _______________________________________________ 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/20060126/dc9e7f56/attachment.html From sergio.pinon at us.g4s.com Thu Jan 26 16:11:48 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Thu, 26 Jan 2006 13:11:48 -0800 Subject: [Wtr-general] Tab Click Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC203D@bugatti.ems.securicor.com> Did you try the solution that I mentioned. Give the td an id attribute and then you are golden. You shouldn't have any problems. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 12:00 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I stepped through the IRB and getting the following error exception. I used link, button , image etc Watir::Exception::UnknownObjectException: Unable to locate object, using value a nd (?-mix:Contents) When I used "div", its not throwing any message, but no object is returned. Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 2:03 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Some thoughts: Can you give the td that contains the text you want clicked an ID attribute. If so then you could try accessing the td directly and calling the click method on it. This can be done with javascript using the following code. ie_browser.getDocument().getElementById("[table cell id]").click() That should work if you can do something like that. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 10:27 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click HI All Can anyone , give solution, I am struck at this point . Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 9:58 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com > wrote: Hi All My web application contains two tabs in one of the transaction "Detail" and "Contents" After entering the data in the Detail page, using will be saving that record and clicks on "Contents". I am trying to make a script for that Can anyone help me out, how to click on "Contents". I tried with most of the objects, but its not going through. The following is the source code Thanks Meghanath _______________________________________________ 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/20060126/81ef4e56/attachment.html From ChintakrindiMeghana at managementdynamics.com Thu Jan 26 17:14:00 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Thu, 26 Jan 2006 17:14:00 -0500 Subject: [Wtr-general] Tab Click Message-ID: Hi Can you help me, how to get that table cell id Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 4:12 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Did you try the solution that I mentioned. Give the td an id attribute and then you are golden. You shouldn't have any problems. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 12:00 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I stepped through the IRB and getting the following error exception. I used link, button , image etc Watir::Exception::UnknownObjectException: Unable to locate object, using value a nd (?-mix:Contents) When I used "div", its not throwing any message, but no object is returned. Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 2:03 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Some thoughts: Can you give the td that contains the text you want clicked an ID attribute. If so then you could try accessing the td directly and calling the click method on it. This can be done with javascript using the following code. ie_browser.getDocument().getElementById("[table cell id]").click() That should work if you can do something like that. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 10:27 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click HI All Can anyone , give solution, I am struck at this point . Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 9:58 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com> wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto: wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com > wrote: Hi All My web application contains two tabs in one of the transaction "Detail" and "Contents" After entering the data in the Detail page, using will be saving that record and clicks on "Contents". I am trying to make a script for that Can anyone help me out, how to click on "Contents". I tried with most of the objects, but its not going through. The following is the source code Thanks Meghanath _______________________________________________ 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/20060126/effc977e/attachment.html From BPaatsch at activevoice.com Thu Jan 26 17:23:14 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Thu, 26 Jan 2006 16:23:14 -0600 Subject: [Wtr-general] Order of execution / button().click? Message-ID: Hello, I run into following issue: After I click a button on the web page a popup window opens waiting for user action. However the script is waiting indefinitely for the button.click to finish, that itself waits for the popup window to be take care of. Is there a workaround? Code sample ie.button(:name, add.wacTagAdd).click Puts "It never reaches the puts!" Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060126/bf1e86b7/attachment.html From sergio.pinon at us.g4s.com Thu Jan 26 17:34:56 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Thu, 26 Jan 2006 14:34:56 -0800 Subject: [Wtr-general] Tab Click Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC2046@bugatti.ems.securicor.com> If you gave that cell an id here is one way you can do it. Though there is also an Xpath expression you can use though I'm not too good with that. ie_browser.getDocument().getElementById("[table cell id]").click() Try this. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 2:14 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi Can you help me, how to get that table cell id Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 4:12 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Did you try the solution that I mentioned. Give the td an id attribute and then you are golden. You shouldn't have any problems. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 12:00 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I stepped through the IRB and getting the following error exception. I used link, button , image etc Watir::Exception::UnknownObjectException: Unable to locate object, using value a nd (?-mix:Contents) When I used "div", its not throwing any message, but no object is returned. Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 2:03 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Some thoughts: Can you give the td that contains the text you want clicked an ID attribute. If so then you could try accessing the td directly and calling the click method on it. This can be done with javascript using the following code. ie_browser.getDocument().getElementById("[table cell id]").click() That should work if you can do something like that. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 10:27 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click HI All Can anyone , give solution, I am struck at this point . Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 9:58 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com > wrote: Hi All My web application contains two tabs in one of the transaction "Detail" and "Contents" After entering the data in the Detail page, using will be saving that record and clicks on "Contents". I am trying to make a script for that Can anyone help me out, how to click on "Contents". I tried with most of the objects, but its not going through. The following is the source code Thanks Meghanath _______________________________________________ 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/20060126/5f18528e/attachment.html From BPaatsch at activevoice.com Thu Jan 26 17:45:53 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Thu, 26 Jan 2006 16:45:53 -0600 Subject: [Wtr-general] Order of execution / button().click? Message-ID: To clarify. After clicking the button IE tries to load the new web page but then I have a windows popup ontop waiting for an confirmation. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Thursday, January 26, 2006 2:23 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] Order of execution / button().click? Hello, I run into following issue: After I click a button on the web page a popup window opens waiting for user action. However the script is waiting indefinitely for the button.click to finish, that itself waits for the popup window to be take care of. Is there a workaround? Code sample ie.button(:name, add.wacTagAdd).click Puts "It never reaches the puts!" Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060126/1e0ae0fa/attachment.html From ChintakrindiMeghana at managementdynamics.com Thu Jan 26 18:05:47 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Thu, 26 Jan 2006 18:05:47 -0500 Subject: [Wtr-general] Tab Click Message-ID: Hi I asked the Dev. team about the ID, they confirmed there are not generating any id Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 4:12 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Did you try the solution that I mentioned. Give the td an id attribute and then you are golden. You shouldn't have any problems. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 12:00 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I stepped through the IRB and getting the following error exception. I used link, button , image etc Watir::Exception::UnknownObjectException: Unable to locate object, using value a nd (?-mix:Contents) When I used "div", its not throwing any message, but no object is returned. Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 2:03 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Some thoughts: Can you give the td that contains the text you want clicked an ID attribute. If so then you could try accessing the td directly and calling the click method on it. This can be done with javascript using the following code. ie_browser.getDocument().getElementById("[table cell id]").click() That should work if you can do something like that. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 10:27 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click HI All Can anyone , give solution, I am struck at this point . Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 9:58 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com> wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto: wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com > wrote: Hi All My web application contains two tabs in one of the transaction "Detail" and "Contents" After entering the data in the Detail page, using will be saving that record and clicks on "Contents". I am trying to make a script for that Can anyone help me out, how to click on "Contents". I tried with most of the objects, but its not going through. The following is the source code Thanks Meghanath _______________________________________________ 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/20060126/2e343cad/attachment.html From mb at michaelbolton.net Thu Jan 26 18:11:54 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Thu, 26 Jan 2006 18:11:54 -0500 Subject: [Wtr-general] Tab Click In-Reply-To: Message-ID: <00fd01c622cd$e6217430$6801a8c0@Koko> We know that they're not generating an ID; that's clear from the HTML. What Sergio was suggesting is that you ask them to do so. Can we /please/ see some of your Watir/Ruby code? This may be failing for entirely different reasons that our assumptions suggest. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: January 26, 2006 6:06 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I asked the Dev. team about the ID, they confirmed there are not generating any id Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 4:12 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Did you try the solution that I mentioned. Give the td an id attribute and then you are golden. You shouldn't have any problems. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 12:00 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I stepped through the IRB and getting the following error exception. I used link, button , image etc Watir::Exception::UnknownObjectException: Unable to locate object, using value a nd (?-mix:Contents) When I used "div", its not throwing any message, but no object is returned. Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 2:03 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Some thoughts: Can you give the td that contains the text you want clicked an ID attribute. If so then you could try accessing the td directly and calling the click method on it. This can be done with javascript using the following code. ie_browser.getDocument().getElementById("[table cell id]").click() That should work if you can do something like that. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 10:27 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click HI All Can anyone , give solution, I am struck at this point . Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 9:58 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com > wrote: Hi All My web application contains two tabs in one of the transaction "Detail" and "Contents" After entering the data in the Detail page, using will be saving that record and clicks on "Contents". I am trying to make a script for that Can anyone help me out, how to click on "Contents". I tried with most of the objects, but its not going through. The following is the source code Thanks Meghanath _______________________________________________ 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/20060126/cac2029c/attachment.html From BPaatsch at activevoice.com Thu Jan 26 18:31:56 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Thu, 26 Jan 2006 17:31:56 -0600 Subject: [Wtr-general] Order of execution / button().click? Message-ID: The code line I try to execute is: As you can see it clicking the button is executing an onclick event. I replaced my code with ie.button(:name, add.wacTagAdd).fire_event("onclick") w = WinClicker.new() #("#32770", "Microsoft Internet Explorer", handle = w.getWindowHandle("Microsoft Internet Explorer") puts handle w.makeWindowActive(handle) w.clickWindowsButton_hwnd(handle,"OK") and as I can see it is firing the event. However now the popup is not coming up. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Thursday, January 26, 2006 2:46 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Order of execution / button().click? To clarify. After clicking the button IE tries to load the new web page but then I have a windows popup ontop waiting for an confirmation. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Thursday, January 26, 2006 2:23 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] Order of execution / button().click? Hello, I run into following issue: After I click a button on the web page a popup window opens waiting for user action. However the script is waiting indefinitely for the button.click to finish, that itself waits for the popup window to be take care of. Is there a workaround? Code sample ie.button(:name, add.wacTagAdd).click Puts "It never reaches the puts!" Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060126/a5d72fac/attachment.html From sergio.pinon at us.g4s.com Thu Jan 26 18:34:33 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Thu, 26 Jan 2006 15:34:33 -0800 Subject: [Wtr-general] Tab Click Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC204B@bugatti.ems.securicor.com> Agreed. We need something to work from. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Michael Bolton Sent: Thursday, January 26, 2006 3:12 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click We know that they're not generating an ID; that's clear from the HTML. What Sergio was suggesting is that you ask them to do so. Can we /please/ see some of your Watir/Ruby code? This may be failing for entirely different reasons that our assumptions suggest. ---Michael B. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: January 26, 2006 6:06 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I asked the Dev. team about the ID, they confirmed there are not generating any id Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 4:12 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Did you try the solution that I mentioned. Give the td an id attribute and then you are golden. You shouldn't have any problems. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 12:00 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I stepped through the IRB and getting the following error exception. I used link, button , image etc Watir::Exception::UnknownObjectException: Unable to locate object, using value a nd (?-mix:Contents) When I used "div", its not throwing any message, but no object is returned. Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 2:03 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Some thoughts: Can you give the td that contains the text you want clicked an ID attribute. If so then you could try accessing the td directly and calling the click method on it. This can be done with javascript using the following code. ie_browser.getDocument().getElementById("[table cell id]").click() That should work if you can do something like that. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 10:27 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click HI All Can anyone , give solution, I am struck at this point . Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 9:58 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com > wrote: Hi All My web application contains two tabs in one of the transaction "Detail" and "Contents" After entering the data in the Detail page, using will be saving that record and clicks on "Contents". I am trying to make a script for that Can anyone help me out, how to click on "Contents". I tried with most of the objects, but its not going through. The following is the source code Thanks Meghanath _______________________________________________ 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/20060126/7688e2cf/attachment.html From alex at verk.info Thu Jan 26 23:41:03 2006 From: alex at verk.info (Alexey Verkhovsky) Date: Thu, 26 Jan 2006 21:41:03 -0700 Subject: [Wtr-general] Can following if statement be written simpler? In-Reply-To: References: Message-ID: <43D9A45F.3080805@verk.info> Paatsch, Bernd wrote: > Hello, > > I have following code below and wonder if it can be done simpler -- in > one line? > ie2.radio(:name, add.wasTagNewSub).click and $logger.log("...") if add.wacValNewSub But it's bad form, because clicking the button and logging are two different operations, so each should really be on its own line. As a sidenote, abbreviated variable names are VERY bad form. "What the heck is wacValNewSub???", I am thinking when reading this code. You will inevitably think the same a few weeks or months later. Best regards, Alex From angrez at gmail.com Thu Jan 26 23:57:04 2006 From: angrez at gmail.com (Angrez Singh) Date: Fri, 27 Jan 2006 10:27:04 +0530 Subject: [Wtr-general] Tab Click In-Reply-To: <6554B86C58B86F43B66363ED5CF6ED05DC204B@bugatti.ems.securicor.com> References: <6554B86C58B86F43B66363ED5CF6ED05DC204B@bugatti.ems.securicor.com> Message-ID: Hi, How about using XPath for getting the
cell ? ie.td(:xpath, "//td[contains(., 'Contents')/") This will return you the element which has text contents. Now you can click on this Please get the tarball from HEAD to use this option. Also read the document in docs section. Hope this helps. Regards, Angrez From angrez at gmail.com Thu Jan 26 23:58:16 2006 From: angrez at gmail.com (Angrez Singh) Date: Fri, 27 Jan 2006 10:28:16 +0530 Subject: [Wtr-general] Tab Click In-Reply-To: References: <6554B86C58B86F43B66363ED5CF6ED05DC204B@bugatti.ems.securicor.com> Message-ID: Hi, Sorry to mail again, Missed closing square bracket. It should be ie.td(:xpath, "//td[contains(., 'Contents')]/") - Angrez On 1/27/06, Angrez Singh wrote: > Hi, > > How about using XPath for getting the cell ? > > ie.td(:xpath, "//td[contains(., 'Contents')/") > > This will return you the element which has text contents. Now you > can click on this > > Please get the tarball from HEAD to use this option. Also read the > document in docs section. > > Hope this helps. > > Regards, > Angrez > From info at reatlas.com Fri Jan 27 05:21:58 2006 From: info at reatlas.com (Ethan Herdrick) Date: Fri, 27 Jan 2006 02:21:58 -0800 Subject: [Wtr-general] Can get focus on a File Download dialog, but can't click a button Message-ID: <91f48dbf0601270221p71a4055bt24f8035c05c522e@mail.gmail.com> Hi folks - I have a problem, can you help?: I can't successfully click on a button in a File Download dialog window. First I use WinWait like this: autoit.WinWait "File Download" ...and it works fine. It blocks until the file download window appears. So far so good. However, I then want to click on the 'Save' button on that window, which I try to do like this: autoit.ControlClick ("File Download", "", "&Save") ...This has the effect of moving the focus of the 'file download' window to the 'Save' button (though the 'file download' window does not come to the foreground. Perhaps when I say "focus" I am using the wrong terminology, but I think you get the picture.) and the method call returns "1". However, the button is not clicked. I have tried this from irb and confirmed that if I change the parameters of the call to ControlClick to something wrong, like: ("File Download Foo","","&Save") or ("File Download","","&SaveFoo") then the focus is not changed and the method call returns "0". So something is happening when I call ControlClick, but why is there no clicking happening? Also, calling ControlClick like this: autoit.ControlClick ("File Download", "Do you want to open or save this file?", "&Save") ..does exactly the same thing. By the way, this problem occurs on one computer, but does not on a different machine. On that machine, this stuff works fine. I need to deploy this little script to several people's computers. I am trying to automate a process of logging into a web site and downloading some files. Perhaps watir is not the right tool. On a side note, I tried using Mechanize, which is a gem based on a Perl package of the same name, but for some reason it was rejected and redirected by the server at a certain point in the process. I also don't understand why the docs indicate that when calling some autoit functions you can refer to a control or window by title alone, and sometimes the 'text' of the control is necessary (though that can apparently still be left blank) and sometimes the "controlID" is needed. Using AU3Info.exe I can find controlIDs but I don't think I can get them programmatically. Thanks much! -Ethan From Neumann at encoway.de Fri Jan 27 09:44:44 2006 From: Neumann at encoway.de (Neumann, Carsten - ENCOWAY) Date: Fri, 27 Jan 2006 15:44:44 +0100 Subject: [Wtr-general] choose File Dialog Message-ID: <0E46E3619326224CB40CC30C2E36364E362C72@zde008.lenze.com> Is there a possibility to change some settings in Watir, to use file_field with a german Windows? He's looking for "Choose File", can I tell him to look for "Datei ausw?hlen"? Thanks! Carsten Neumann -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060127/6aba319c/attachment.html From Neumann at encoway.de Fri Jan 27 10:38:36 2006 From: Neumann at encoway.de (Neumann, Carsten - ENCOWAY) Date: Fri, 27 Jan 2006 16:38:36 +0100 Subject: [Wtr-general] Choose File Dialog Message-ID: <0E46E3619326224CB40CC30C2E36364E362C73@zde008.lenze.com> I've found it myself, in watir/winclicker.rb you have to replace "Choose File" with "Datei ausw?hlen" (or whatever you're looking for) at two positions in the code. He now finds the "Datei ausw?hlen"-Dialog and fills in the file-field, but how can I get him to click "?ffnen" ("Open"). I've found "&Open" in the code as well and replaced it with "&?ffnen", but it doesn't seem to work. Carsten Neumann -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060127/dd434a72/attachment.html From BPaatsch at activevoice.com Fri Jan 27 11:51:38 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Fri, 27 Jan 2006 10:51:38 -0600 Subject: [Wtr-general] Order of execution / button().click? Message-ID: Okay :) I fiqured it out. Here is my code. ie2.button(:name, add.wacTagAdd).getOLEObject.click w = WinClicker.new() w.clickWindowsButton("Microsoft Internet Explorer", "OK" , maxWaitTime=30 ) w = nil ie2.close _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Thursday, January 26, 2006 3:32 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Order of execution / button().click? The code line I try to execute is: As you can see it clicking the button is executing an onclick event. I replaced my code with ie.button(:name, add.wacTagAdd).fire_event("onclick") w = WinClicker.new() #("#32770", "Microsoft Internet Explorer", handle = w.getWindowHandle("Microsoft Internet Explorer") puts handle w.makeWindowActive(handle) w.clickWindowsButton_hwnd(handle,"OK") and as I can see it is firing the event. However now the popup is not coming up. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Thursday, January 26, 2006 2:46 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Order of execution / button().click? To clarify. After clicking the button IE tries to load the new web page but then I have a windows popup ontop waiting for an confirmation. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Thursday, January 26, 2006 2:23 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] Order of execution / button().click? Hello, I run into following issue: After I click a button on the web page a popup window opens waiting for user action. However the script is waiting indefinitely for the button.click to finish, that itself waits for the popup window to be take care of. Is there a workaround? Code sample ie.button(:name, add.wacTagAdd).click Puts "It never reaches the puts!" Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060127/a8007001/attachment.html From ralickolli at kCura.com Fri Jan 27 16:31:19 2006 From: ralickolli at kCura.com (Rexhina Alickolli) Date: Fri, 27 Jan 2006 15:31:19 -0600 Subject: [Wtr-general] question Message-ID: Hello guys: I have just started to work with ruby and I am wondering if there is a way to write a ruby test script that can call other ruby test scripts? ( so I want to merge and run all the methods which are written in separate ruby test scripts) Thanks--regina -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060127/1a6ef387/attachment.html From mb at michaelbolton.net Fri Jan 27 16:50:00 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Fri, 27 Jan 2006 16:50:00 -0500 Subject: [Wtr-general] Choose File Dialog In-Reply-To: <0E46E3619326224CB40CC30C2E36364E362C73@zde008.lenze.com> Message-ID: <01d401c6238b$a545a8f0$6801a8c0@Koko> Which letter is underlined on the ??ffnen? button? ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Neumann, Carsten - ENCOWAY Sent: January 27, 2006 10:39 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Choose File Dialog I?ve found it myself, in watir/winclicker.rb you have to replace ?Choose File? with ?Datei ausw?hlen? (or whatever you?re looking for) at two positions in the code. He now finds the ?Datei ausw?hlen?-Dialog and fills in the file-field, but how can I get him to click ??ffnen? (?Open?). I?ve found ?&Open? in the code as well and replaced it with ?&?ffnen?, but it doesn?t seem to work. Carsten Neumann -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060127/c2d3538c/attachment.html From BPaatsch at activevoice.com Fri Jan 27 17:21:02 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Fri, 27 Jan 2006 16:21:02 -0600 Subject: [Wtr-general] clickWindowsButton (help :) Message-ID: Alright, until now everything worked just fine. But I run into an situation where I have two popup window open and both have an "OK" button. Window("#32770", "Microsoft Internet Explorer", 1).Window("Button", "OK", 1) " Window("#32770", "Microsoft Internet Explorer", 1).Window("Button", "OK", 1) " As you can see they are identical. The difference lies within what they display. Window("#32770", "Microsoft Internet Explorer", 1).Window("Static", "[5207 - 5307] 11 Subscribers Is this OK?", 2) Window("#32770", "Microsoft Internet Explorer", 1).Window("Static", "{123} DUPLICATE Extension, Personal ID or System ID", 2) IS there a way to specify what OK button to click based on the text in the window? _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Friday, January 27, 2006 8:52 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Order of execution / button().click? Okay :) I fiqured it out. Here is my code. ie2.button(:name, add.wacTagAdd).getOLEObject.click w = WinClicker.new() w.clickWindowsButton("Microsoft Internet Explorer", "OK" , maxWaitTime=30 ) w = nil ie2.close _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Thursday, January 26, 2006 3:32 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Order of execution / button().click? The code line I try to execute is: As you can see it clicking the button is executing an onclick event. I replaced my code with ie.button(:name, add.wacTagAdd).fire_event("onclick") w = WinClicker.new() #("#32770", "Microsoft Internet Explorer", handle = w.getWindowHandle("Microsoft Internet Explorer") puts handle w.makeWindowActive(handle) w.clickWindowsButton_hwnd(handle,"OK") and as I can see it is firing the event. However now the popup is not coming up. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Thursday, January 26, 2006 2:46 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Order of execution / button().click? To clarify. After clicking the button IE tries to load the new web page but then I have a windows popup ontop waiting for an confirmation. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Thursday, January 26, 2006 2:23 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] Order of execution / button().click? Hello, I run into following issue: After I click a button on the web page a popup window opens waiting for user action. However the script is waiting indefinitely for the button.click to finish, that itself waits for the popup window to be take care of. Is there a workaround? Code sample ie.button(:name, add.wacTagAdd).click Puts "It never reaches the puts!" Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060127/bd5001b3/attachment.html From BPaatsch at activevoice.com Fri Jan 27 18:07:50 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Fri, 27 Jan 2006 17:07:50 -0600 Subject: [Wtr-general] clickWindowsButton (help :) Message-ID: Does anybody know why my script gets stuck at "ie2.button(:name, range.wacTagAdd).getOLEObject.click"? puts "before ie2.button \n" ie2.button(:name, range.wacTagAdd).getOLEObject.click #it gets stuck at this point. puts "never reaches this line \n " _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Friday, January 27, 2006 2:21 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] clickWindowsButton (help :) Alright, until now everything worked just fine. But I run into an situation where I have two popup window open and both have an "OK" button. Window("#32770", "Microsoft Internet Explorer", 1).Window("Button", "OK", 1) " Window("#32770", "Microsoft Internet Explorer", 1).Window("Button", "OK", 1) " As you can see they are identical. The difference lies within what they display. Window("#32770", "Microsoft Internet Explorer", 1).Window("Static", "[5207 - 5307] 11 Subscribers Is this OK?", 2) Window("#32770", "Microsoft Internet Explorer", 1).Window("Static", "{123} DUPLICATE Extension, Personal ID or System ID", 2) IS there a way to specify what OK button to click based on the text in the window? _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Friday, January 27, 2006 8:52 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Order of execution / button().click? Okay :) I fiqured it out. Here is my code. ie2.button(:name, add.wacTagAdd).getOLEObject.click w = WinClicker.new() w.clickWindowsButton("Microsoft Internet Explorer", "OK" , maxWaitTime=30 ) w = nil ie2.close _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Thursday, January 26, 2006 3:32 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Order of execution / button().click? The code line I try to execute is: As you can see it clicking the button is executing an onclick event. I replaced my code with ie.button(:name, add.wacTagAdd).fire_event("onclick") w = WinClicker.new() #("#32770", "Microsoft Internet Explorer", handle = w.getWindowHandle("Microsoft Internet Explorer") puts handle w.makeWindowActive(handle) w.clickWindowsButton_hwnd(handle,"OK") and as I can see it is firing the event. However now the popup is not coming up. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Thursday, January 26, 2006 2:46 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Order of execution / button().click? To clarify. After clicking the button IE tries to load the new web page but then I have a windows popup ontop waiting for an confirmation. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Thursday, January 26, 2006 2:23 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] Order of execution / button().click? Hello, I run into following issue: After I click a button on the web page a popup window opens waiting for user action. However the script is waiting indefinitely for the button.click to finish, that itself waits for the popup window to be take care of. Is there a workaround? Code sample ie.button(:name, add.wacTagAdd).click Puts "It never reaches the puts!" Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060127/079a8388/attachment.html From mb at michaelbolton.net Sat Jan 28 01:59:26 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Sat, 28 Jan 2006 01:59:26 -0500 Subject: [Wtr-general] clickWindowsButton (help :) In-Reply-To: Message-ID: <021e01c623d8$60727620$6801a8c0@Koko> Is range.wacTagAdd the name of the button? I see below, NAME='b_Add_' as the name attribute -- should 'b_Add_' be the value instead? Should your name value be in single quotes? If you do all this, could you get rid of the getOLEObject part? Also: someone should whisper to your programmers that NAME= is invalid XHTML; attributes should be lowercase. Uppercase attributes are permitted in HTML 4.01, but lowercase is recommended. It would be interesting to know if it made a difference to your script in any way. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: January 27, 2006 6:08 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] clickWindowsButton (help :) Does anybody know why my script gets stuck at "ie2.button(:name, range.wacTagAdd).getOLEObject.click"? puts "before ie2.button \n" ie2.button(:name, range.wacTagAdd).getOLEObject.click #it gets stuck at this point. puts "never reaches this line \n " _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Friday, January 27, 2006 2:21 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] clickWindowsButton (help :) Alright, until now everything worked just fine. But I run into an situation where I have two popup window open and both have an "OK" button. Window("#32770", "Microsoft Internet Explorer", 1).Window("Button", "OK", 1) " Window("#32770", "Microsoft Internet Explorer", 1).Window("Button", "OK", 1) " As you can see they are identical. The difference lies within what they display. Window("#32770", "Microsoft Internet Explorer", 1).Window("Static", "[5207 - 5307] 11 Subscribers Is this OK?", 2) Window("#32770", "Microsoft Internet Explorer", 1).Window("Static", "{123} DUPLICATE Extension, Personal ID or System ID", 2) IS there a way to specify what OK button to click based on the text in the window? _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Friday, January 27, 2006 8:52 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Order of execution / button().click? Okay :) I fiqured it out. Here is my code. ie2.button(:name, add.wacTagAdd).getOLEObject.click w = WinClicker.new() w.clickWindowsButton("Microsoft Internet Explorer", "OK" , maxWaitTime=30 ) w = nil ie2.close _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Thursday, January 26, 2006 3:32 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Order of execution / button().click? The code line I try to execute is: As you can see it clicking the button is executing an onclick event. I replaced my code with ie.button(:name, add.wacTagAdd).fire_event("onclick") w = WinClicker.new() #("#32770", "Microsoft Internet Explorer", handle = w.getWindowHandle("Microsoft Internet Explorer") puts handle w.makeWindowActive(handle) w.clickWindowsButton_hwnd(handle,"OK") and as I can see it is firing the event. However now the popup is not coming up. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Thursday, January 26, 2006 2:46 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] Order of execution / button().click? To clarify. After clicking the button IE tries to load the new web page but then I have a windows popup ontop waiting for an confirmation. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Thursday, January 26, 2006 2:23 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] Order of execution / button().click? Hello, I run into following issue: After I click a button on the web page a popup window opens waiting for user action. However the script is waiting indefinitely for the button.click to finish, that itself waits for the popup window to be take care of. Is there a workaround? Code sample ie.button(:name, add.wacTagAdd).click Puts "It never reaches the puts!" Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060128/99f2ba34/attachment.html From ati.ozgur at gmail.com Sun Jan 29 06:37:19 2006 From: ati.ozgur at gmail.com (Atilla Ozgur) Date: Sun, 29 Jan 2006 13:37:19 +0200 Subject: [Wtr-general] Question on clicking on link In-Reply-To: <7a754c960601251333q37a085dfyd0d0620924e10ef0@mail.gmail.com> References: <7a754c960601251333q37a085dfyd0d0620924e10ef0@mail.gmail.com> Message-ID: 1.You may try to add this site to your trusted sites 2.You may try to add this site to your .hosts file On 1/25/06, Chris Schmechel wrote: > > Thanks for the reply, it got me thinking. I found the problem: > > ie.link(:url, "download.html").click > > needs to become: > > ie.link(:url, /download.html/).click > > and it works! Now I'm running into another problem. Due to my > browser security settings -- I'm getting the following ActiveX control > upon download: > > "To help protect your security, Internet Explorer blocked this site from > downloading files to your computer. Click here for options..." > > I'd like to be able to detect this and then issue the click on the download > button (ie. start it going ). > > Afterwards, you get another dialog box: File Download - Security Warning. > With the options to Run, Save, or Cancel the file download. How can I > handle > this as well? > > Thanks again! > > Chris Schmechel > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From mb at michaelbolton.net Sun Jan 29 11:58:24 2006 From: mb at michaelbolton.net (mb at michaelbolton.net) Date: Sun, 29 Jan 2006 11:58:24 -0500 Subject: [Wtr-general] Question on clicking on link In-Reply-To: References: <7a754c960601251333q37a085dfyd0d0620924e10ef0@mail.gmail.com> Message-ID: Actually, there's a danger in using /download.html/ in that it will match not only download.html but also downloadxhtml (Now that's not likely to be an issue in this case, but you can see how it might be in other cases. If you were looking for a link like /foo.asp/ would match a link that contained foogasp.html if it appeared on the page before foo.asp To be specific (and mostly to develop good regular expression hygeine habits), you would escape the period, such that your regular expression would be /download\.html/ I AM a pedant, but I've been bitten by that before too, so I hope this helps... ---Michael B. > On 1/25/06, Chris Schmechel wrote: >> >> Thanks for the reply, it got me thinking. I found the problem: >> >> ie.link(:url, "download.html").click >> >> needs to become: >> >> ie.link(:url, /download.html/).click >> >> and it works! Now I'm running into another problem. Due to my >> browser security settings -- I'm getting the following ActiveX control >> upon download: >> >> "To help protect your security, Internet Explorer blocked this site from >> downloading files to your computer. Click here for options..." >> >> I'd like to be able to detect this and then issue the click on the download >> button (ie. start it going ). >> >> Afterwards, you get another dialog box: File Download - Security Warning. >> With the options to Run, Save, or Cancel the file download. How can I >> handle >> this as well? >> >> Thanks again! >> >> Chris Schmechel >> >> >> _______________________________________________ >> 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 DevelopSense: Software Testing in Plain English http://www.developsense.com From ChintakrindiMeghana at managementdynamics.com Fri Jan 27 09:32:00 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Fri, 27 Jan 2006 09:32:00 -0500 Subject: [Wtr-general] Tab Click Message-ID: Hi The following is the ruby cource code equire 'thread' require 'watir' def tc_login ie = Watir::IE.start('http://host10.nextlinx.com:7777/tc/Main.jsp') ie.text_field(:name, "user").set("Megh") ie.text_field(:name, "password").set("Tt1") ie.link(:url, /submit/).click ie.wait() ie.goto(" http://host10.nextlinx.com:7777/tc/Navigator.srv?mode=normal &module=export&menuType=Export") ie.goto(" http://host10.nextlinx.com:7777/tc/Navigator.srv?=/tc/com/generic_list.jsp &pageName=CarrierFedex&mode=normal&resetWhere=Y&urlID=xUrl493&menuID=xMenu02&subMenuID=xMenuSub01") ie.goto(" http://host10.nextlinx.com:7777/tc/tc/Navigator.srv?Page_=/tc/exp/carrier/CarrierList.jsp &boxhdrcarrier=FedEx&mode=normal&module=&usingNLForm=true&ordero.ordno=TC-AG-FedEx-01&gotoPrefix=gotoKey_&gotoKey_ordero.ordno=TC-AG-FedEx-01") ie.goto(" http://host10.nextlinx.com:7777/tc/Navigator.srv?Page_=/tc/exp/carrier/CarrierList.jsp &mode=normal&boxhdrcarrier=FedEx&ordero.ordno=TC-AG-FedEx-01&box_header.shipno=XXXX&tabid=doLineTab()") ie.image(:src, /add.gif/).click ie.wait() ie.text_field(:name, "box_header.sale_term").set("1") ie.select_list(:name , "box_header.service_cd").select("International Economy") ie.text_field(:name, "box_header.no_of_pkgs").set("10") ie.text_field(:name, "box_header.pkg_type").set("25") ie.text_field(:name, "box_header.box_wt").set("06") ie.text_field(:name, "box_header.box_length").set("25") ie.text_field(:name, "box_header.box_width").set("25") ie.text_field(:name, "box_header.box_height").set("25") ie.image(:src, /save.gif/).click ie.wait() # I tried with different options with button,link, image and also with different paramaters like name , value etc. ie.image(:name, /Contents/).click end # run the same test three times concurrently in separate browsers threads = [] 1.times do threads << Thread.new {tc_login} end threads.each {|x| x.join} -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Michael Bolton Sent: Thursday, January 26, 2006 6:12 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click We know that they're not generating an ID; that's clear from the HTML. What Sergio was suggesting is that you ask them to do so. Can we /please/ see some of your Watir/Ruby code? This may be failing for entirely different reasons that our assumptions suggest. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: January 26, 2006 6:06 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I asked the Dev. team about the ID, they confirmed there are not generating any id Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 4:12 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Did you try the solution that I mentioned. Give the td an id attribute and then you are golden. You shouldn't have any problems. Sergio _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 12:00 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I stepped through the IRB and getting the following error exception. I used link, button , image etc Watir::Exception::UnknownObjectException: Unable to locate object, using value a nd (?-mix:Contents) When I used "div", its not throwing any message, but no object is returned. Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Sergio Pinon Sent: Thursday, January 26, 2006 2:03 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Some thoughts: Can you give the td that contains the text you want clicked an ID attribute. If so then you could try accessing the td directly and calling the click method on it. This can be done with javascript using the following code. ie_browser.getDocument().getElementById("[table cell id]").click() That should work if you can do something like that. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 10:27 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click HI All Can anyone , give solution, I am struck at this point . Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chintakrindi Meghanath Sent: Thursday, January 26, 2006 9:58 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click Hi I tried with this options also , but not working. It is not throwing any error, but its not clicking that 'Tab' Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 4:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click How 'bout this: ie.div(:id, 'LineTab').cell(:text, 'Contents').click (If this doesn't work, please describe what it actually does. Error?) Bret On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com> wrote: Hi I aleady tried with that option , but its not working Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto: wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Wednesday, January 25, 2006 2:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click ie.div(:id, 'LineTab').click On 1/25/06, Chintakrindi Meghanath < ChintakrindiMeghana at managementdynamics.com > wrote: Hi All My web application contains two tabs in one of the transaction "Detail" and "Contents" After entering the data in the Detail page, using will be saving that record and clicks on "Contents". I am trying to make a script for that Can anyone help me out, how to click on "Contents". I tried with most of the objects, but its not going through. The following is the source code Thanks Meghanath _______________________________________________ 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/20060127/f999bfa2/attachment.html From David.J.Solis at wellsfargo.com Fri Jan 27 16:47:10 2006 From: David.J.Solis at wellsfargo.com (David.J.Solis at wellsfargo.com) Date: Fri, 27 Jan 2006 15:47:10 -0600 Subject: [Wtr-general] Another JavaScript Question Message-ID: <493148DCF171954FBBF8E8AAB261638C0574F6@msgswbmnmsp35.wellsfargo.com> Mark. Thanks for your response. I tried exactly as you explained below, but could not get it too work. I used the .flash to see where I was on the page, but could not see it except in table nested directly below the table I want to access. Below is the entire contents of the page. I've commented the section the table I need to access with "This is the table I want to access" . Thanks again for you help. Pay Model
    Mercury Admin Framework
    Wagerworks Casino System
Logout
 
 



_____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Thursday, January 26, 2006 8:15 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Another JavaScript Question This is what I would try given the html you sent. $ie.table( :index, 1 )[1][3].click If this table is nested inside other tables you will need to get the index number by counting the tables-starting at the top-most table-by doing a: 1. Right click in the web page and select 'View Source' 2. DO ctrl + f and put tags are the first bracket [the nth inside your table] -- the table[1][4].flash # table[1][6].flash # sleep(3) end end Hope this helps you, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David.J.Solis at wellsfargo.com Sent: Friday, January 27, 2006 1:47 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Another JavaScript Question Mark. Thanks for your response. I tried exactly as you explained below, but could not get it too work. I used the .flash to see where I was on the page, but could not see it except in table nested directly below the table I want to access. Below is the entire contents of the page. I've commented the section the table I need to access with "This is the table I want to access" . Thanks again for you help. Pay Model
tags are the second bracket [the nth inside your table] $ie.table( :index, 1 )[1][3].click You can use the flash method to figure out where you are on the page to debug. $ie.table( :index, 1 )[1][3].flash You could also use the fireEvent method if the click does not work for you. $ie.table( :index, 1 )[1][3].fireEvent("OnClick") Hope this helps, --Mark _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David Solis Sent: Wednesday, January 25, 2006 9:01 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Another JavaScript Question All, I've been trying desperately for over week to figure out how to click on JavaScript button to no avail. I have tried just about everybody's suggestions. Mark Cain's solution posted last week looked very promising, but can't get it to work. Here is the code that contains the buttons (cancel & update) I need to click on:
Thanks ! David -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060127/e2636b31/attachment.html From bret at pettichord.com Sun Jan 29 16:58:51 2006 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 29 Jan 2006 15:58:51 -0600 Subject: [Wtr-general] Can following if statement be written simpler? In-Reply-To: References: Message-ID: Instead of > if nil != add.wacValNewSub Do: if add.wacValNewSub But i think what you are really asking for is to have a logging interface built into Watir. It's a good idea... Bret On 1/26/06, Paatsch, Bernd wrote: > > Hello, > > I have following code below and wonder if it can be done simpler -- in one > line? > > ie2.radio(:name, add.wacTagNewSub).click > $logger.log( " Action: selected radiobutton " + > add.wacTagNewSub + ".") > 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/20060129/bb3a38d0/attachment.html From mb at michaelbolton.net Mon Jan 30 02:50:35 2006 From: mb at michaelbolton.net (mb at michaelbolton.net) Date: Mon, 30 Jan 2006 02:50:35 -0500 Subject: [Wtr-general] Tab Click Message-ID: When I look at this HTML... ...I can see how clicking on Details would cause the 'doCarrierTab()' function to be called. What I don't see is the action associated with Contents. There's a background image, a class name, horizontal and vertical alignment, the word "Contents", an image (evidently) below the word "Contents"... and then what? What happens when you click "Contents" with your mouse, in a browser, outside of anything to do with WATIR? ---Michael B. DevelopSense: Software Testing in Plain English http://www.developsense.com From Neumann at encoway.de Mon Jan 30 03:09:03 2006 From: Neumann at encoway.de (Neumann, Carsten - ENCOWAY) Date: Mon, 30 Jan 2006 09:09:03 +0100 Subject: [Wtr-general] Choose File Dialog Message-ID: <0E46E3619326224CB40CC30C2E36364E362C74@zde008.lenze.com> The first f is underlined: "?ffnen" I now tried "?&ffnen" and it worked, thanks! Carsten Neumann -----Urspr?ngliche Nachricht----- Von: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] Im Auftrag von Michael Bolton Gesendet: Freitag, 27. Januar 2006 22:50 An: wtr-general at rubyforge.org Betreff: Re: [Wtr-general] Choose File Dialog Which letter is underlined on the "?ffnen" button? ---Michael B. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Neumann, Carsten - ENCOWAY Sent: January 27, 2006 10:39 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Choose File Dialog I've found it myself, in watir/winclicker.rb you have to replace "Choose File" with "Datei ausw?hlen" (or whatever you're looking for) at two positions in the code. He now finds the "Datei ausw?hlen"-Dialog and fills in the file-field, but how can I get him to click "?ffnen" ("Open"). I've found "&Open" in the code as well and replaced it with "&?ffnen", but it doesn't seem to work. Carsten Neumann -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060130/11a62515/attachment.html From zeljko.filipin at gmail.com Mon Jan 30 03:48:46 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Mon, 30 Jan 2006 09:48:46 +0100 Subject: [Wtr-general] question In-Reply-To: References: Message-ID: Simple way: put your scripts in the same folder (example: script1.rb, script2.rb...) make script that calls other scripts: require "script1" require "script2" Zeljko 2006/1/27, Rexhina Alickolli : > > > > Hello guys: > > I have just started to work with ruby and I am wondering if there is a way > to write a ruby test script that can call other ruby test scripts? ( so I > want to merge and run all the methods which are written in separate ruby > test scripts) > > > > Thanks--regina > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -- http://iskusivac.blog.hr/ From zeljko.filipin at gmail.com Mon Jan 30 04:07:38 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Mon, 30 Jan 2006 10:07:38 +0100 Subject: [Wtr-general] Tab Click In-Reply-To: References: Message-ID: I guess nothing happens. Zeljko 2006/1/30, mb at michaelbolton.net : > When I look at this HTML... > > > > ...I can see how clicking on Details would cause the 'doCarrierTab()' function > to be called. > > What I don't see is the action associated with Contents. There's a background > image, a class name, horizontal and vertical alignment, the word "Contents", > an image (evidently) below the word "Contents"... and then what? > > What happens when you click "Contents" with your mouse, in a browser, outside > of anything to do with WATIR? > > ---Michael B. > > DevelopSense: Software Testing in Plain English > http://www.developsense.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- http://iskusivac.blog.hr/ From christopher.mcmahon at gmail.com Mon Jan 30 10:05:55 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 30 Jan 2006 09:05:55 -0600 Subject: [Wtr-general] Help with File.join(File.dirname(__FILE__), '..') ? Message-ID: <72799cd70601300705y214df89chf4be872c536a9528@mail.gmail.com> Hi... I have some tests in directories that share common code like suite_foo/ test_1.rb test_2.rb suite_bar/ test_3.rb test_4.rb common/ my_library.rb My test runner script dips into each directory and then back out: ############################################## TOPDIR = File.join(File.dirname(__FILE__), '..') $LOAD_PATH.unshift TOPDIR require 'test/unit' test_dirs = Dir.glob("suite*") test_dirs.each do |dir| Dir.chdir(dir) test_cases = Dir.glob("*rb") test_cases.each {|f| require f } Dir.chdir("..") end #do ########################################################### is this a reasonable approach? It seems kinda thrashy to me, I wonder if there's a better way to go about this. -Chris From chris.schmechel at gmail.com Mon Jan 30 11:34:12 2006 From: chris.schmechel at gmail.com (Chris Schmechel) Date: Mon, 30 Jan 2006 08:34:12 -0800 Subject: [Wtr-general] How do I validate HTML and Javascript? Message-ID: <7a754c960601300834n28e6216arf5dbafd11459bffc@mail.gmail.com> Hi, I'd like to validate the HTML (ie. check for HTTP errors) and the Javascript on a set of pages. My script currently visits the pages via ie.goto(site). I noticed a couple of different methods -- which do I want to call? add_checker() check_for_http_error() How do I catch any errors if they exist? Any examples scripts would be helpful. Thanks again, Chris Schmechel From peppers at gmail.com Mon Jan 30 11:51:58 2006 From: peppers at gmail.com (Terry Peppers) Date: Mon, 30 Jan 2006 10:51:58 -0600 Subject: [Wtr-general] Apache User Authentication Message-ID: <8ca48b420601300851k7356da1cl8f65cfd626cad64a@mail.gmail.com> I was looking through the old Watir mailing lists for some information on how I might be able to bypass the Apache user authentication on our staging machine without using AutoIt. I didn't come up with much aside from use - AutoIt. One of our developers recommended I should try the following URL: http://username:password at stage.somedomain.com This works OK in Firefox (I still get a dialog asking me to click 'OK'), but when you give that input to Internet Explorer it just throws you the stock IE error page. Does anyone know of any workarounds to this or could they point me in the direction of a decent AutoIt example? The example that is mentioned in the docs - 'popups_test.rb' - just isn't clear to me. All I want to do is go to a site, fill out the Apache user authentication dialog, click OK and be on my merry testing way. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060130/e629cfe4/attachment.html From Mark_Cain at rl.gov Mon Jan 30 11:08:40 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Mon, 30 Jan 2006 08:08:40 -0800 Subject: [Wtr-general] Another JavaScript Question Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D536@EX5V.rl.gov> I saved the html you supplied below and named it testpage.html. This is the scripted I wrote and can flash each of the table cells you need to access. Are there event for the images in the table you want to access? What do you want to do with the table once you access it? class TestPage < Test::Unit::TestCase def openPage() file = "c:\\watir_bonus\\working\\testpage.html" $ie.goto(file) end def test_page openPage #your target table is index 7 table = $ie.table(:index, 7) table[1][2].flash #
    Mercury Admin Framework
    Wagerworks Casino System
Logout
 
 



________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Thursday, January 26, 2006 8:15 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Another JavaScript Question This is what I would try given the html you sent. $ie.table( :index, 1 )[1][3].click If this table is nested inside other tables you will need to get the index number by counting the tables-starting at the top-most table-by doing a: 1. Right click in the web page and select 'View Source' 2. DO ctrl + f and put tags are the first bracket [the nth inside your table] -- the
tags are the second bracket [the nth inside your table] $ie.table( :index, 1 )[1][3].click You can use the flash method to figure out where you are on the page to debug. $ie.table( :index, 1 )[1][3].flash You could also use the fireEvent method if the click does not work for you. $ie.table( :index, 1 )[1][3].fireEvent("OnClick") Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David Solis Sent: Wednesday, January 25, 2006 9:01 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Another JavaScript Question All, I've been trying desperately for over week to figure out how to click on JavaScript button to no avail. I have tried just about everybody's suggestions. Mark Cain's solution posted last week looked very promising, but can't get it to work. Here is the code that contains the buttons (cancel & update) I need to click on:
Thanks ! David -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060130/18f27177/attachment.html From bret at pettichord.com Mon Jan 30 14:42:18 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 30 Jan 2006 13:42:18 -0600 Subject: [Wtr-general] Help with File.join(File.dirname(__FILE__), '..') ? In-Reply-To: <72799cd70601300705y214df89chf4be872c536a9528@mail.gmail.com> References: <72799cd70601300705y214df89chf4be872c536a9528@mail.gmail.com> Message-ID: One problem with this is that if you have suite_foo/test_a.rb and suite_bar/test_a.rb, the second test won't be run. A quick fix would be to use "load" instead of "require". But better would be to use more of the pathname with require. Here's how i'd do it: TOPDIR = File.join(File.dirname(__FILE__), '..') $LOAD_PATH.unshift TOPDIR tests = Dir["suite*/*.rb"] tests.each {|t| require t} (I'd put the "require 'test/unit'" in the individual tests instead so that they could also run singly.) Bret On 1/30/06, Chris McMahon wrote: > > Hi... > > I have some tests in directories that share common code like > > suite_foo/ > test_1.rb > test_2.rb > suite_bar/ > test_3.rb > test_4.rb > common/ > my_library.rb > > My test runner script dips into each directory and then back out: > > ############################################## > TOPDIR = File.join(File.dirname(__FILE__), '..') > $LOAD_PATH.unshift TOPDIR > require 'test/unit' > > test_dirs = Dir.glob("suite*") > test_dirs.each do |dir| > Dir.chdir(dir) > > test_cases = Dir.glob("*rb") > > test_cases.each {|f| require f } > > Dir.chdir("..") > > end #do > ########################################################### > > is this a reasonable approach? It seems kinda thrashy to me, I wonder > if there's a better way to go about this. > > -Chris > > _______________________________________________ > 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/20060130/cf02c430/attachment.html From christopher.mcmahon at gmail.com Mon Jan 30 15:10:17 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 30 Jan 2006 14:10:17 -0600 Subject: [Wtr-general] Help with File.join(File.dirname(__FILE__), '..') ? In-Reply-To: References: <72799cd70601300705y214df89chf4be872c536a9528@mail.gmail.com> Message-ID: <72799cd70601301210v2647f336rdb2eb4912202efa0@mail.gmail.com> Interestingly, had a quick conversation with Jonathan Kohl who had run into weirdness with test/unit and with require. Here's what I have now, with require replace by backticks. It seems to be working well so far: TOPDIR = File.join(File.dirname(__FILE__), '..') $LOAD_PATH.unshift TOPDIR require 'test/unit' require 'fileutils' include FileUtils::Verbose test_dirs = Dir.glob("suite**") 0.upto(test_dirs.length - 1) do |dirnum| chdir(test_dirs[dirnum]) puts "" puts "working in #{test_dirs[dirnum]}" test_cases = Dir.glob("*rb") test_cases.each do |casex| puts "running #{casex}" test_result = `ruby #{casex}` puts test_result end chdir("..") end #do On 1/30/06, Bret Pettichord wrote: > One problem with this is that if you have suite_foo/test_a.rb and > suite_bar/test_a.rb, the second test won't be run. A quick fix would be to > use "load" instead of "require". > > But better would be to use more of the pathname with require. Here's how i'd > do it: > > TOPDIR = File.join(File.dirname(__FILE__), '..') > $LOAD_PATH.unshift TOPDIR > tests = Dir["suite*/*.rb"] > tests.each {|t| require t} > > (I'd put the "require 'test/unit'" in the individual tests instead so that > they could also run singly.) > > Bret > > > On 1/30/06, Chris McMahon wrote: > > > > Hi... > > > > I have some tests in directories that share common code like > > > > suite_foo/ > > test_1.rb > > test_2.rb > > suite_bar/ > > test_3.rb > > test_4.rb > > common/ > > my_library.rb > > > > My test runner script dips into each directory and then back out: > > > > ############################################## > > TOPDIR = File.join(File.dirname(__FILE__), '..') > > $LOAD_PATH.unshift TOPDIR > > require 'test/unit' > > > > test_dirs = Dir.glob("suite*") > > test_dirs.each do |dir| > > Dir.chdir(dir) > > > > test_cases = Dir.glob("*rb") > > > > test_cases.each {|f| require f } > > > > Dir.chdir("..") > > > > end #do > > > ########################################################### > > > > is this a reasonable approach? It seems kinda thrashy to me, I wonder > > if there's a better way to go about this. > > > > -Chris > > > > _______________________________________________ > > 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 christopher.mcmahon at gmail.com Mon Jan 30 16:37:30 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 30 Jan 2006 15:37:30 -0600 Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help with File.join(File.dirname(__FILE__), '..') ? Message-ID: <72799cd70601301337y444c7299vcc0f9ee8b5df29f2@mail.gmail.com> Hi again... I'm trying to integrate Test::Unit::Reporter with my little harness script below, and struggling. Ideally, I would pass each "test_cases" array to Reporter and it would Do The Right Thing, but that's not happening. ############################## #ORIGINAL WORKING SCRIPT TOPDIR = File.join(File.dirname(__FILE__), '..') $LOAD_PATH.unshift TOPDIR require 'test/unit' require 'fileutils' include FileUtils::Verbose test_dirs = Dir.glob("suite**") 0.upto(test_dirs.length - 1) do |dirnum| chdir(test_dirs[dirnum]) puts "" puts "working in #{test_dirs[dirnum]}" test_cases = Dir.glob("*rb") test_cases.each do |casex| puts "running #{casex}" test_result = `ruby #{casex}` puts test_result end chdir("..") end #do ######################################### # WHAT I WISH WOULD HAPPEN TOPDIR = File.join(File.dirname(__FILE__), '..') $LOAD_PATH.unshift TOPDIR require 'test/unit' require 'fileutils' include FileUtils::Verbose require 'test/unit/testsuite' require 'test/unit/ui/reporter/reporter' @test_cases = Test::Unit::TestSuite.new FileUtils.mkdir_p 'build/report' test_dirs = Dir.glob("suite*") 0.upto(test_dirs.length - 1) do |dirnum| chdir(test_dirs[dirnum]) puts "" puts "working in #{test_dirs[dirnum]}" @test_cases = Dir.glob("*rb") Test::Unit::UI::Reporter::Reporter.run(@test_cases, 'build/report', :xml) chdir("..") end #do From dara.lillis at kiodex.com Mon Jan 30 17:43:41 2006 From: dara.lillis at kiodex.com (Dara Lillis) Date: Mon, 30 Jan 2006 14:43:41 -0800 Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help withFile.join(File.dirname(__FILE__), '..') ? Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E235D7A@ehost011-27.exch011.intermedia.net> I'm not sure it will solve your problems, but I played around with Test::Unit::Reporter a while back and had to add "require 'stringio'" in reporter.rb to get it to work. To give appropriate credit, it was actually pointed out by another member of this list: http://www.mail-archive.com/wtr-general at rubyforge.org/msg02046.html -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: Monday, January 30, 2006 4:38 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help withFile.join(File.dirname(__FILE__), '..') ? Hi again... I'm trying to integrate Test::Unit::Reporter with my little harness script below, and struggling. Ideally, I would pass each "test_cases" array to Reporter and it would Do The Right Thing, but that's not happening. ############################## #ORIGINAL WORKING SCRIPT TOPDIR = File.join(File.dirname(__FILE__), '..') $LOAD_PATH.unshift TOPDIR require 'test/unit' require 'fileutils' include FileUtils::Verbose test_dirs = Dir.glob("suite**") 0.upto(test_dirs.length - 1) do |dirnum| chdir(test_dirs[dirnum]) puts "" puts "working in #{test_dirs[dirnum]}" test_cases = Dir.glob("*rb") test_cases.each do |casex| puts "running #{casex}" test_result = `ruby #{casex}` puts test_result end chdir("..") end #do ######################################### # WHAT I WISH WOULD HAPPEN TOPDIR = File.join(File.dirname(__FILE__), '..') $LOAD_PATH.unshift TOPDIR require 'test/unit' require 'fileutils' include FileUtils::Verbose require 'test/unit/testsuite' require 'test/unit/ui/reporter/reporter' @test_cases = Test::Unit::TestSuite.new FileUtils.mkdir_p 'build/report' test_dirs = Dir.glob("suite*") 0.upto(test_dirs.length - 1) do |dirnum| chdir(test_dirs[dirnum]) puts "" puts "working in #{test_dirs[dirnum]}" @test_cases = Dir.glob("*rb") Test::Unit::UI::Reporter::Reporter.run(@test_cases, 'build/report', :xml) chdir("..") end #do _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Mon Jan 30 19:14:29 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 30 Jan 2006 18:14:29 -0600 Subject: [Wtr-general] Help with File.join(File.dirname(__FILE__), '..') ? In-Reply-To: <72799cd70601301210v2647f336rdb2eb4912202efa0@mail.gmail.com> References: <72799cd70601300705y214df89chf4be872c536a9528@mail.gmail.com> <72799cd70601301210v2647f336rdb2eb4912202efa0@mail.gmail.com> Message-ID: This runs each test in a separate ruby process. You'll never get this to work right with Test::Unit::Reporter. On 1/30/06, Chris McMahon wrote: > > Interestingly, had a quick conversation with Jonathan Kohl who had run > into weirdness with test/unit and with require. Here's what I have > now, with require replace by backticks. It seems to be working well > so far: > > TOPDIR = File.join(File.dirname(__FILE__), '..') > $LOAD_PATH.unshift TOPDIR > require 'test/unit' > require 'fileutils' > include FileUtils::Verbose > > test_dirs = Dir.glob("suite**") > > 0.upto(test_dirs.length - 1) do |dirnum| > > chdir(test_dirs[dirnum]) > puts "" > puts "working in #{test_dirs[dirnum]}" > > test_cases = Dir.glob("*rb") > > test_cases.each do |casex| > puts "running #{casex}" > > test_result = `ruby #{casex}` > puts test_result > end > > chdir("..") > > end #do > > > On 1/30/06, Bret Pettichord wrote: > > One problem with this is that if you have suite_foo/test_a.rb and > > suite_bar/test_a.rb, the second test won't be run. A quick fix would be > to > > use "load" instead of "require". > > > > But better would be to use more of the pathname with require. Here's how > i'd > > do it: > > > > TOPDIR = File.join(File.dirname(__FILE__), '..') > > $LOAD_PATH.unshift TOPDIR > > tests = Dir["suite*/*.rb"] > > tests.each {|t| require t} > > > > (I'd put the "require 'test/unit'" in the individual tests instead so > that > > they could also run singly.) > > > > Bret > > > > > > On 1/30/06, Chris McMahon wrote: > > > > > > Hi... > > > > > > I have some tests in directories that share common code like > > > > > > suite_foo/ > > > test_1.rb > > > test_2.rb > > > suite_bar/ > > > test_3.rb > > > test_4.rb > > > common/ > > > my_library.rb > > > > > > My test runner script dips into each directory and then back out: > > > > > > ############################################## > > > TOPDIR = File.join(File.dirname(__FILE__), '..') > > > $LOAD_PATH.unshift TOPDIR > > > require 'test/unit' > > > > > > test_dirs = Dir.glob("suite*") > > > test_dirs.each do |dir| > > > Dir.chdir(dir) > > > > > > test_cases = Dir.glob("*rb") > > > > > > test_cases.each {|f| require f } > > > > > > Dir.chdir("..") > > > > > > end #do > > > > > ########################################################### > > > > > > is this a reasonable approach? It seems kinda thrashy to me, I wonder > > > if there's a better way to go about this. > > > > > > -Chris > > > > > > _______________________________________________ > > > 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/20060130/26d1088f/attachment.html From bret at pettichord.com Mon Jan 30 19:37:58 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 30 Jan 2006 18:37:58 -0600 Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help with File.join(File.dirname(__FILE__), '..') ? In-Reply-To: <72799cd70601301337y444c7299vcc0f9ee8b5df29f2@mail.gmail.com> References: <72799cd70601301337y444c7299vcc0f9ee8b5df29f2@mail.gmail.com> Message-ID: By default, test/unit will look for all the testcases you've defined (subclasses of Test::Unit::TestCase), put them in a suite and then execute them. This is convenient when getting started, but causes bafflement when people want to do anything complex. This is all done by Test::Unit::AutoRunner. In your case, you need to take a look at this (in test/unit/autorunner.rb) and call it with some non-default arguments. Your immediate problem is that Test::Unit::Reporter wants a bunch of test cases and instead you are giving it a bunch of files. Test cases are objects (that are created in these files). Here is some additional doc from Test::Unit that explains what is going on. http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html Anyone complaining about wierdness with 'test/unit' and require needs to read this! Bret On 1/30/06, Chris McMahon wrote: > > Hi again... > > I'm trying to integrate Test::Unit::Reporter with my little harness > script below, and struggling. > > Ideally, I would pass each "test_cases" array to Reporter and it would > Do The Right Thing, but that's not happening. > > ############################## > #ORIGINAL WORKING SCRIPT > > TOPDIR = File.join(File.dirname(__FILE__), '..') > $LOAD_PATH.unshift TOPDIR > require 'test/unit' > require 'fileutils' > include FileUtils::Verbose > > test_dirs = Dir.glob("suite**") > > 0.upto(test_dirs.length - 1) do |dirnum| > > chdir(test_dirs[dirnum]) > puts "" > puts "working in #{test_dirs[dirnum]}" > > test_cases = Dir.glob("*rb") > > test_cases.each do |casex| > puts "running #{casex}" > > test_result = `ruby #{casex}` > puts test_result > end > > chdir("..") > > end #do > ######################################### > # WHAT I WISH WOULD HAPPEN > > TOPDIR = File.join(File.dirname(__FILE__), '..') > $LOAD_PATH.unshift TOPDIR > require 'test/unit' > require 'fileutils' > include FileUtils::Verbose > > require 'test/unit/testsuite' > require 'test/unit/ui/reporter/reporter' > @test_cases = Test::Unit::TestSuite.new > FileUtils.mkdir_p 'build/report' > > test_dirs = Dir.glob("suite*") > > 0.upto(test_dirs.length - 1) do |dirnum| > > chdir(test_dirs[dirnum]) > puts "" > puts "working in #{test_dirs[dirnum]}" > > @test_cases = Dir.glob("*rb") > > Test::Unit::UI::Reporter::Reporter.run(@test_cases, 'build/report', > :xml) > > chdir("..") > > end #do > > _______________________________________________ > 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/20060130/a76dc866/attachment.html From christopher.mcmahon at gmail.com Mon Jan 30 19:47:18 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 30 Jan 2006 18:47:18 -0600 Subject: [Wtr-general] Help with File.join(File.dirname(__FILE__), '..') ? In-Reply-To: References: <72799cd70601300705y214df89chf4be872c536a9528@mail.gmail.com> <72799cd70601301210v2647f336rdb2eb4912202efa0@mail.gmail.com> Message-ID: <72799cd70601301647s1ca06c39oce308083cd927786@mail.gmail.com> On 1/30/06, Bret Pettichord wrote: > This runs each test in a separate ruby process. You'll never get this to > work right with Test::Unit::Reporter. Yeah, I know. But backticks capture the output I'm looking for. If I get could get Reporter to do anything useful at all, I was planning to feed the results of each test run through Reporter. Or else I would do something else. :) I think I'm missing some basic concept about how Reporter works, though. It's giving me errors no matter how I address it. I'm sure there's a clue somewhere, I just haven't found it yet. -Chris From bret at pettichord.com Mon Jan 30 19:49:31 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 30 Jan 2006 18:49:31 -0600 Subject: [Wtr-general] IE window popups In-Reply-To: References: Message-ID: Although i can guess what your syntax means, i'm not quite sure where you got it. Did this come from a tool? Take a look at dialog_test.rb for current progress on supporting this. Bret On 1/26/06, Paatsch, Bernd wrote: > > > Hello, > > I am struggeling with IE windows popups. Is there a way (easy) to deal > with following window? > > Sys.Process("IEXPLORE").Window("#32770", "Microsoft Internet Explorer", > 1).Window("Button", "OK", 1).ChildCount > > > > _______________________________________________ > 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/20060130/5bf6d3d4/attachment.html From christopher.mcmahon at gmail.com Mon Jan 30 19:49:34 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 30 Jan 2006 18:49:34 -0600 Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help with File.join(File.dirname(__FILE__), '..') ? In-Reply-To: References: <72799cd70601301337y444c7299vcc0f9ee8b5df29f2@mail.gmail.com> Message-ID: <72799cd70601301649l3bdeaf04lb0bdf3caf06d0938@mail.gmail.com> > Your immediate problem is that Test::Unit::Reporter wants a bunch of test > cases and instead you are giving it a bunch of files. Test cases are objects > (that are created in these files). > > Here is some additional doc from Test::Unit that explains what is going on. > > http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html > > Anyone complaining about wierdness with 'test/unit' and require needs to > read this! Aha. Manana. Sufficient unto the day, and all that... -Chris From mb at michaelbolton.net Mon Jan 30 22:22:03 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Mon, 30 Jan 2006 22:22:03 -0500 Subject: [Wtr-general] Tab Click Message-ID: <006a01c62615$83dbb2e0$1402a8c0@Koko> That's my guess too, but I'd like to hear from Meghanath. ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: January 30, 2006 4:08 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click I guess nothing happens. Zeljko 2006/1/30, mb at michaelbolton.net : > When I look at this HTML... > > > > ...I can see how clicking on Details would cause the 'doCarrierTab()' function > to be called. > > What I don't see is the action associated with Contents. There's a background > image, a class name, horizontal and vertical alignment, the word "Contents", > an image (evidently) below the word "Contents"... and then what? > > What happens when you click "Contents" with your mouse, in a browser, outside > of anything to do with WATIR? > > ---Michael B. > > DevelopSense: Software Testing in Plain English > http://www.developsense.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- http://iskusivac.blog.hr/ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From mb at michaelbolton.net Mon Jan 30 22:22:03 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Mon, 30 Jan 2006 22:22:03 -0500 Subject: [Wtr-general] How do I validate HTML and Javascript? Message-ID: <006b01c62615$846b48b0$1402a8c0@Koko> Validating HTML and checking for HTTP errors are vastly different things. Validating HTML is something that you can do by any number of means. Some Web development tools come with syntax validators and link checkers; there is a checker at validator.w3c.org that will ensure that your HTML is syntactically correct. This doesn't mean that there are no errors on your page; it just means that a browser can read it without getting confused, leaving something out, or barfing. And, by the way, WATIR doesn't do any of this, as far as I know. Checking for an HTTP error (which WATIR does do) essentially involves making sure that no problems have cropped up in the transportation or delivery of the page. The most common instance of an HTTP error is that a browser requests a page, and the server reports that it can find the page that you're asking for--HTTP Error 404. WATIR does this to make sure that it can continue to whatever its next step is. WATIR is Web Application Testing (in Ruby), but that doesn't mean that WATIR does the testing, in the same way that a debugger neither finds nor fixes your bugs. WATIR is a tool that helps you to answer questions that you would like to ask about your application. You would be well-advised to read the WATIR User Guide and the sample tests if you haven't done so already. But the question "how do I catch any errors if they exist?" is the oracle problem. An oracle is a principle or mechanism that will help you to recognize a problem. WATIR is a tool that provides some mechanisms to support your principles. ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris Schmechel Sent: January 30, 2006 11:34 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] How do I validate HTML and Javascript? Hi, I'd like to validate the HTML (ie. check for HTTP errors) and the Javascript on a set of pages. My script currently visits the pages via ie.goto(site). I noticed a couple of different methods -- which do I want to call? add_checker() check_for_http_error() How do I catch any errors if they exist? Any examples scripts would be helpful. Thanks again, Chris Schmechel _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From alex at verk.info Mon Jan 30 22:39:36 2006 From: alex at verk.info (Alexey Verkhovsky) Date: Mon, 30 Jan 2006 20:39:36 -0700 Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help with File.join(File.dirname(__FILE__), '..') ? In-Reply-To: References: <72799cd70601301337y444c7299vcc0f9ee8b5df29f2@mail.gmail.com> Message-ID: <43DEDBF8.1000906@verk.info> Bret Pettichord wrote: > Anyone complaining about wierdness with 'test/unit' and require needs > to read this! In fact, at least when I wrote Test::Unit::Reporter, there was no straightforward way to inject a listener to "discovery of a test case" event. I don't know if it has changed since. By the way, I still hold the admin rights to the corresponding RubyForge project. if you use Test::Unit::Reporter nowadays and want it to suck less, feel free to create yourself a RubyForge account and write me for the commit rights. Best regards, Alexey Verkhovsky From christopher.mcmahon at gmail.com Mon Jan 30 23:02:29 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 30 Jan 2006 22:02:29 -0600 Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help with File.join(File.dirname(__FILE__), '..') ? In-Reply-To: <43DEDBF8.1000906@verk.info> References: <72799cd70601301337y444c7299vcc0f9ee8b5df29f2@mail.gmail.com> <43DEDBF8.1000906@verk.info> Message-ID: <72799cd70601302002l7fa0aec3g11e6d3bb157f1151@mail.gmail.com> > By the way, I still hold the admin rights to the corresponding RubyForge > project. if you use Test::Unit::Reporter nowadays and want it to suck > less, feel free to create yourself a RubyForge account and write me for > the commit rights. Apologies, but is there anything besides Reporter that would help me talk to CCNET that sucks less than Reporter? I've got a rubyforge account, but I'm a lot more interested in talking to CruiseControl than I am in have Reporter not suck. Call it pragmatism :) -Chris From manishs at reconnex.net Tue Jan 31 07:39:49 2006 From: manishs at reconnex.net (Manish Sapariya) Date: Tue, 31 Jan 2006 18:09:49 +0530 Subject: [Wtr-general] watir: windows and unix Message-ID: <43DF5A95.3090903@reconnex.net> Hi List, I need to login to unix box and carry out some task before proceding with my test. I could find rexpect module but it seems that works only on *nix and not on windows. I am not sure whether rexpect can work on windows. Can somebody confirm? If rexpect is not the way, what would be solution for login on to unix box and run some scripts there? I also tried using cygwin on windows, but I am not sure how can I run my watir scripts on cygwin along with rexpect? Is this possible? Any help in this regard will be appreciated. Thanks and Regards, Manish From christopher.mcmahon at gmail.com Tue Jan 31 09:01:12 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 31 Jan 2006 08:01:12 -0600 Subject: [Wtr-general] watir: windows and unix In-Reply-To: <43DF5A95.3090903@reconnex.net> References: <43DF5A95.3090903@reconnex.net> Message-ID: <72799cd70601310601q79f9da53if1d3c6a2ba612d26@mail.gmail.com> > I am not sure whether rexpect can work on windows. Can somebody > confirm? If rexpect is not the way, what would be solution > for login on to unix box and run some scripts there? Use telnet. Net::Telnet, p. 704 in the Pickaxe. -Chris From ChintakrindiMeghana at managementdynamics.com Tue Jan 31 09:09:42 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Tue, 31 Jan 2006 09:09:42 -0500 Subject: [Wtr-general] Tab Click Message-ID: <6CF3AA425295C7479483AC0018EDF98B01DADF6B@MI8NYCMAIL03.Mi8.com> Hi Yes , all of you are right. There is an bug in the code and dev. team is fixing it. Thanks all for your help Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Michael Bolton Sent: Monday, January 30, 2006 10:22 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click That's my guess too, but I'd like to hear from Meghanath. ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: January 30, 2006 4:08 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Tab Click I guess nothing happens. Zeljko 2006/1/30, mb at michaelbolton.net : > When I look at this HTML... > > > > ...I can see how clicking on Details would cause the 'doCarrierTab()' function > to be called. > > What I don't see is the action associated with Contents. There's a background > image, a class name, horizontal and vertical alignment, the word "Contents", > an image (evidently) below the word "Contents"... and then what? > > What happens when you click "Contents" with your mouse, in a browser, outside > of anything to do with WATIR? > > ---Michael B. > > DevelopSense: Software Testing in Plain English > http://www.developsense.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- http://iskusivac.blog.hr/ _______________________________________________ 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 Jan 31 15:04:25 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 31 Jan 2006 14:04:25 -0600 Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help with File.join(File.dirname(__FILE__), '..') ? In-Reply-To: <72799cd70601302002l7fa0aec3g11e6d3bb157f1151@mail.gmail.com> References: <72799cd70601301337y444c7299vcc0f9ee8b5df29f2@mail.gmail.com> <43DEDBF8.1000906@verk.info> <72799cd70601302002l7fa0aec3g11e6d3bb157f1151@mail.gmail.com> Message-ID: Alexey is a modest but awesome ruby programmer. It will be hard to find something that sucks less. His Watir-based test suite for Instiki is the best Watir test suite i've seen published. We need to be stealing ideas from it for Watir's own unit tests. And besides, don't you and Alexey work for the same company? Bret On 1/30/06, Chris McMahon wrote: > > Apologies, but is there anything besides Reporter that would help me > talk to CCNET that sucks less than Reporter? I've got a rubyforge > account, but I'm a lot more interested in talking to CruiseControl > than I am in have Reporter not suck. Call it pragmatism :) > > -Chris > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060131/ee0fef5e/attachment.html From christopher.mcmahon at gmail.com Tue Jan 31 15:17:48 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 31 Jan 2006 14:17:48 -0600 Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help with File.join(File.dirname(__FILE__), '..') ? In-Reply-To: References: <72799cd70601301337y444c7299vcc0f9ee8b5df29f2@mail.gmail.com> <43DEDBF8.1000906@verk.info> <72799cd70601302002l7fa0aec3g11e6d3bb157f1151@mail.gmail.com> Message-ID: <72799cd70601311217h757f0d0bk347dc7ef4c42fca2@mail.gmail.com> On 1/31/06, Bret Pettichord wrote: > Alexey is a modest but awesome ruby programmer. It will be hard to find > something that sucks less. Agreed on the awesomeness. Alex says Reporter is still the best bet for talking to CC. > His Watir-based test suite for Instiki is the best Watir test suite i've > seen published. We need to be stealing ideas from it for Watir's own unit > tests. Definitely. > And besides, don't you and Alexey work for the same company? Indeed. It's convenient that way. :) Seriously, I thought I might have missed some sort of super-brainless CruiseControl integration. I'm definitely going to be studying on Reporter in the very near future. Thanks for the pointer, too, now I know what I'm doing wrong, I think I can probably make it go now. -Chris From sergio.pinon at us.g4s.com Tue Jan 31 15:23:54 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Tue, 31 Jan 2006 12:23:54 -0800 Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help withFile.join(File.dirname(__FILE__), '..') ? Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC2147@bugatti.ems.securicor.com> Chris, I have no idea what Reporter is but a while back I submitted a testing framework that sits on top of WATIR and the results are generated in an xml form which I then have parsed by CCNET. Don't know if this is something that you are looking for but if you would like to check it out I can send it to you. Sergio -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: Monday, January 30, 2006 8:02 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help withFile.join(File.dirname(__FILE__), '..') ? > By the way, I still hold the admin rights to the corresponding RubyForge > project. if you use Test::Unit::Reporter nowadays and want it to suck > less, feel free to create yourself a RubyForge account and write me for > the commit rights. Apologies, but is there anything besides Reporter that would help me talk to CCNET that sucks less than Reporter? I've got a rubyforge account, but I'm a lot more interested in talking to CruiseControl than I am in have Reporter not suck. Call it pragmatism :) -Chris _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Tue Jan 31 15:29:40 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 31 Jan 2006 14:29:40 -0600 Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help withFile.join(File.dirname(__FILE__), '..') ? In-Reply-To: <6554B86C58B86F43B66363ED5CF6ED05DC2147@bugatti.ems.securicor.com> References: <6554B86C58B86F43B66363ED5CF6ED05DC2147@bugatti.ems.securicor.com> Message-ID: <72799cd70601311229q82579fdi243708d226b5de8c@mail.gmail.com> On 1/31/06, Sergio Pinon wrote: > Chris, > I have no idea what Reporter is but a while back I submitted a testing > framework that sits on top of WATIR and the results are generated in an > xml form which I then have parsed by CCNET. Don't know if this is > something that you are looking for but if you would like to check it out > I can send it to you. If you don't mind sending it, i'd really like to see it. -Chris From sergio.pinon at us.g4s.com Tue Jan 31 15:38:30 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Tue, 31 Jan 2006 12:38:30 -0800 Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: HelpwithFile.join(File.dirname(__FILE__), '..') ? Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC2148@bugatti.ems.securicor.com> You know what I looked back at the history of this group and you already saw it when I first posted it to the group. Here are the links to the posts. But I went ahead and attached it again just in case. http://www.mail-archive.com/wtr-general%40rubyforge.org/msg02391.html Sergio -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: Tuesday, January 31, 2006 12:30 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: HelpwithFile.join(File.dirname(__FILE__), '..') ? On 1/31/06, Sergio Pinon wrote: > Chris, > I have no idea what Reporter is but a while back I submitted a testing > framework that sits on top of WATIR and the results are generated in an > xml form which I then have parsed by CCNET. Don't know if this is > something that you are looking for but if you would like to check it out > I can send it to you. If you don't mind sending it, i'd really like to see it. -Chris _______________________________________________ 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: testing framework.zip Type: application/x-zip-compressed Size: 12027 bytes Desc: testing framework.zip Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060131/eb4040b0/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rubysummary.xsl Type: application/octet-stream Size: 7315 bytes Desc: rubysummary.xsl Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060131/eb4040b0/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: rubytests.xsl Type: application/octet-stream Size: 8007 bytes Desc: rubytests.xsl Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060131/eb4040b0/attachment-0001.obj From christopher.mcmahon at gmail.com Tue Jan 31 15:43:49 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 31 Jan 2006 14:43:49 -0600 Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: HelpwithFile.join(File.dirname(__FILE__), '..') ? In-Reply-To: <6554B86C58B86F43B66363ED5CF6ED05DC2148@bugatti.ems.securicor.com> References: <6554B86C58B86F43B66363ED5CF6ED05DC2148@bugatti.ems.securicor.com> Message-ID: <72799cd70601311243o669b0ec2jf75ac330071cbbd2@mail.gmail.com> On 1/31/06, Sergio Pinon wrote: > You know what I looked back at the history of this group and you already > saw it when I first posted it to the group. Here are the links to the > posts. But I went ahead and attached it again just in case. So I did. Thanks again! (I think I need a vacation... :) ) -Chris From sergio.pinon at us.g4s.com Tue Jan 31 15:50:29 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Tue, 31 Jan 2006 12:50:29 -0800 Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd:HelpwithFile.join(File.dirname(__FILE__), '..') ? Message-ID: <6554B86C58B86F43B66363ED5CF6ED05DC214A@bugatti.ems.securicor.com> I think we all do. :P Sergio -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: Tuesday, January 31, 2006 12:44 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd:HelpwithFile.join(File.dirname(__FILE__), '..') ? On 1/31/06, Sergio Pinon wrote: > You know what I looked back at the history of this group and you already > saw it when I first posted it to the group. Here are the links to the > posts. But I went ahead and attached it again just in case. So I did. Thanks again! (I think I need a vacation... :) ) -Chris _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From ralickolli at kCura.com Tue Jan 31 17:07:43 2006 From: ralickolli at kCura.com (Rexhina Alickolli) Date: Tue, 31 Jan 2006 16:07:43 -0600 Subject: [Wtr-general] method Message-ID: How can I verify the presence of an item in an item list (checklist/dropdown list etc)? I am trying to find the method but no being successful. Thanks-- gina From bret at pettichord.com Tue Jan 31 18:58:06 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 31 Jan 2006 17:58:06 -0600 Subject: [Wtr-general] Order of execution / button().click? In-Reply-To: References: Message-ID: Interesting conversation you are having with yourself. I'm surprised that this works. I would expect the click method to still block. In head, there is click_no_wait, which is a non-blocking click. Bret On 1/27/06, Paatsch, Bernd wrote: > > Okay :) I fiqured it out. Here is my code. > > ie2.button(:name, add.wacTagAdd).getOLEObject.click > w = WinClicker.new() > w.clickWindowsButton("Microsoft Internet Explorer", "OK" , maxWaitTime=30 > ) > w = nil > ie2.close > > ------------------------------ > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Paatsch, Bernd > *Sent:* Thursday, January 26, 2006 3:32 PM > *To:* 'wtr-general at rubyforge.org' > *Subject:* Re: [Wtr-general] Order of execution / button().click? > > The code line I try to execute is: > > onClick='return verify();' > > As you can see it clicking the button is executing an onclick event. I > replaced my code with > > ie.button(:name, add.wacTagAdd).fire_event("onclick") > w = WinClicker.new() > > #("#32770", "Microsoft Internet Explorer", > > handle = w.getWindowHandle("Microsoft Internet Explorer") > puts handle > > w.makeWindowActive(handle) > w.clickWindowsButton_hwnd(handle,"OK") > > and as I can see it is firing the event. However now the popup is not > coming up. > > > ------------------------------ > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Paatsch, Bernd > *Sent:* Thursday, January 26, 2006 2:46 PM > *To:* 'wtr-general at rubyforge.org' > *Subject:* Re: [Wtr-general] Order of execution / button().click? > > To clarify. After clicking the button IE tries to load the new web page > but then I have a windows popup ontop waiting for an confirmation. > > ------------------------------ > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Paatsch, Bernd > *Sent:* Thursday, January 26, 2006 2:23 PM > *To:* 'wtr-general at rubyforge.org' > *Subject:* [Wtr-general] Order of execution / button().click? > > Hello, > > I run into following issue: After I click a button on the web page a popup > window opens waiting for user action. However the script is waiting > indefinitely for the button.click to finish, that itself waits for the > popup window to be take care of. > > Is there a workaround? > > Code sample > ie.button(:name, add.wacTagAdd).click > Puts "It never reaches the puts!" > > 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/20060131/8c3694c3/attachment.html From billagee at gmail.com Tue Jan 31 20:06:10 2006 From: billagee at gmail.com (Bill Agee) Date: Tue, 31 Jan 2006 17:06:10 -0800 Subject: [Wtr-general] Apache User Authentication In-Reply-To: <8ca48b420601300851k7356da1cl8f65cfd626cad64a@mail.gmail.com> References: <8ca48b420601300851k7356da1cl8f65cfd626cad64a@mail.gmail.com> Message-ID: <73e7817e0601311706m29450497t41803614e83020c7@mail.gmail.com> On 1/30/06, Terry Peppers wrote: > I was looking through the old Watir mailing lists for some information on > how I might be able to bypass the Apache user authentication on our staging > machine without using AutoIt. I didn't come up with much aside from use - > AutoIt. One of our developers recommended I should try the following URL: > > http://username:password at stage.somedomain.com ... Yeah, the http://user:pass at URL thing used to work in IE too, but support for that was removed at some point after it began to be widely used as part of a technique to spoof URLs in phishing emails. :) Anyway, you might want to look at the 'WindowLogonExample.rb' and 'WindowLogonExtra.rb' files in the Watir unit tests. Those are more the kind of thing you want, I think. And one of the things that helped me understand ways to use autoit was looking over '\ruby\lib\ruby\site_ruby\1.8\watir\WindowHelper.rb'. Up to and including Watir 1.4.1, it seems this type of task is usually accomplished using multiple Ruby threads, in order to get around the fact that IE blocks when you request a URL that spawns a popup or prompt. The code in one of the threads often just runs a second Ruby script (as shown in WindowLogonExample.rb / WindowLogonExtra.rb). I think the development version of Watir has some fancy new stuff that helps in this area, but I haven't looked at it yet. Anyway, here's a distilled example of the thread technique that might work as a standalone script for your case: --------------------------------- require 'watir' require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') # URL that kicks off the basic auth prompt: url = "http://quantico.int.apg.aventail.com/secured/" # The title of the prompt dialog: prompt = "Connect to quantico.int.apg.aventail.com" user = "user1" pass = "user1" a = Thread.new { ie = Watir::IE.start(url) } b = Thread.new { autoit.WinWait prompt, "" autoit.Send(user) autoit.Send("{TAB}") autoit.Send(pass) autoit.Send("{ENTER}") } a.join b.join From gavazn at yahoo.com Tue Jan 31 20:25:51 2006 From: gavazn at yahoo.com (Gavazn Vahshi) Date: Tue, 31 Jan 2006 17:25:51 -0800 (PST) Subject: [Wtr-general] My Tab Click problem Message-ID: <20060201012551.1632.qmail@web42108.mail.yahoo.com> Hi All, I went through the recent email thread for the tab click problem, but unfortunately was unable to solve my problem. I'm knida new to Ruby and Watir and any help is greatly appreciated. It's about a JS pop-up wizard with 4 tabs which opens up when I click on a gif image in main UI. HTML source for the wizard looks like this (... instead of some tags & extras):
title_for_tab1
... title_for_tab2...... ... (total of 4 tabs on page)
For my testing purposes I need to click on each tab and visit each page. There're some text fields that I need to modify. Thanks in advance, gavazn __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From mb at michaelbolton.net Tue Jan 31 23:12:00 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Tue, 31 Jan 2006 23:12:00 -0500 Subject: [Wtr-general] My Tab Click problem In-Reply-To: <20060201012551.1632.qmail@web42108.mail.yahoo.com> Message-ID: <003701c626e5$a62078b0$0902a8c0@Koko> What is the problem that you were unable to solve? ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Gavazn Vahshi Sent: January 31, 2006 8:26 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] My Tab Click problem Hi All, I went through the recent email thread for the tab click problem, but unfortunately was unable to solve my problem. I'm knida new to Ruby and Watir and any help is greatly appreciated. It's about a JS pop-up wizard with 4 tabs which opens up when I click on a gif image in main UI. HTML source for the wizard looks like this (... instead of some tags & extras):
title_for_tab1
... title_for_tab2...... ... (total of 4 tabs on page)
For my testing purposes I need to click on each tab and visit each page. There're some text fields that I need to modify. Thanks in advance, gavazn __________________________________________________ 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 From christopher.mcmahon at gmail.com Tue Jan 31 23:25:46 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 31 Jan 2006 22:25:46 -0600 Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help with File.join(File.dirname(__FILE__), '..') ? In-Reply-To: <43E18229.8000207@verk.info> References: <72799cd70601301337y444c7299vcc0f9ee8b5df29f2@mail.gmail.com> <43DEDBF8.1000906@verk.info> <72799cd70601302002l7fa0aec3g11e6d3bb157f1151@mail.gmail.com> <72799cd70601311217h757f0d0bk347dc7ef4c42fca2@mail.gmail.com> <43E18229.8000207@verk.info> Message-ID: <72799cd70601312025j855b020s6a036ef98c57285c@mail.gmail.com> > It's putting the test suite together that is a little more complicated > than it should be - you need to actually assemble a TestSuite object, > can't just write a list of require statements in a file. > I've also heard that there is a "require 'stringio'" missing, and README > has some wrong (in fact, obsolete) module names. > > All going well, weather permitting, you should be able to figure it all > out in under an hour. > > If you get it working, please at least write some "how-to". Apparently, > I'm going to need the same thing soon :))) Gotcha. Will do. There's a new ruby-fan developer on the project who I'm sure will help me through the tough (read: OO) parts. It might take more than an hour. :) -Chris