From michaelr at ibsglobalweb.com Thu Jun 1 02:43:58 2006 From: michaelr at ibsglobalweb.com (Michael Ruschena) Date: Thu, 1 Jun 2006 16:43:58 +1000 Subject: [Wtr-general] How can I open and attach file using file_field method? Message-ID: <20060601064359.712D4430003@ibsglobalweb.com> I encountered this problem yesterday, and unlike the mail archives, I have an answer. I was getting exactly the behavior described below: 1) I would run a script using file_field.set 2) The script would get to the set method 3a) the choose file window would be invoked 3b) the file setFileDialog.rb would be opened in my ruby editor 3c) the script would sit there waiting for me to take manual action. 4) As soon as I take manual action to close the window, the script would resume Messing around with autoit, and the other suggestions didn't help at all. The problem seems to be caused by associating *.rb files with an IDE. When the set method attempts to start the thread that manipulates the Choose File window, the operating system directs the script to the IDE rather than to Ruby. As soon as I changed the association to the Ruby executable, the file_field set method worked happily. (Well, not quite happily... The method still doesn't like spaces in the path name, but that's an easy problem to solve.) I assume that Watir launching a new thread and telling the thread to execute setFileDialog.rb, while what it needs to do is tell the thread to execute setFileDialog.rb *with Ruby*. Either that or people getting this bug need to change the file associations. Michael Ruschena ________________________________ Cain, Mark Thu, 12 Jan 2006 07:32:28 -0800 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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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" <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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" <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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 <[EMAIL PROTECTED]> 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 From zeljko.filipin at gmail.com Thu Jun 1 03:44:39 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Thu, 1 Jun 2006 09:44:39 +0200 Subject: [Wtr-general] How can I open and attach file using file_field method? In-Reply-To: <20060601064359.712D4430003@ibsglobalweb.com> References: <20060601064359.712D4430003@ibsglobalweb.com> Message-ID: If you want it fixed, enter a new case at Jira ( http://jira.openqa.org/browse/WTR), so it would not be forgotten. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060601/0a1957c5/attachment.html From Adrian.Rutter at tnt.com Thu Jun 1 09:55:13 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Thu, 1 Jun 2006 14:55:13 +0100 Subject: [Wtr-general] Determine HTML property Message-ID: Hi, I have an HTML field that once saved becomes read-only [readonly="true"]. Apart from doing a regex on the source how can I determine this property? Cheers Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From zeljko.filipin at gmail.com Thu Jun 1 10:09:00 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Thu, 1 Jun 2006 16:09:00 +0200 Subject: [Wtr-general] Determine HTML property In-Reply-To: References: Message-ID: ie.radio(:id, "id").readonly? On 6/1/06, Adrian Rutter wrote: > > > Hi, > > I have an HTML field that once saved becomes read-only [readonly="true"]. > Apart from doing a regex on the source how can I determine this property? > > Cheers > > Aidy > > > > > --------------------------------------------------------------------------------------------------------------- > This message and any attachment are confidential and may be privileged or > otherwise protected from disclosure. > If you are not the intended recipient, please telephone or email the > sender and delete this message and any attachment from your system. > If you are not the intended recipient you must not copy this message or > attachment or disclose the contents to any other person. > > --------------------------------------------------------------------------------------------------------------- > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- http://www.testingreflections.com/blog/3071 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060601/74ac64da/attachment.html From bret at pettichord.com Thu Jun 1 10:22:41 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 1 Jun 2006 09:22:41 -0500 Subject: [Wtr-general] How can I open and attach file using file_field method? In-Reply-To: <20060601064359.712D4430003@ibsglobalweb.com> References: <20060601064359.712D4430003@ibsglobalweb.com> Message-ID: Thanks for solving this problem. Now that we have a click_no_wait method, we shouldn't have to resort to external *.rb files in the first place. Bret On 6/1/06, Michael Ruschena wrote: > > I encountered this problem yesterday, and unlike the mail archives, I have > an answer. I was getting exactly the behavior described below: > 1) I would run a script using file_field.set > 2) The script would get to the set method > 3a) the choose file window would be invoked > 3b) the file setFileDialog.rb would be opened in my ruby editor > 3c) the script would sit there waiting for me to take manual action. > 4) As soon as I take manual action to close the window, the script would > resume > Messing around with autoit, and the other suggestions didn't help at all. > > The problem seems to be caused by associating *.rb files with an IDE. When > the set method attempts to start the thread that manipulates the Choose > File > window, the operating system directs the script to the IDE rather than to > Ruby. As soon as I changed the association to the Ruby executable, the > file_field set method worked happily. (Well, not quite happily... The > method > still doesn't like spaces in the path name, but that's an easy problem to > solve.) > > I assume that Watir launching a new thread and telling the thread to > execute > setFileDialog.rb, while what it needs to do is tell the thread to execute > setFileDialog.rb *with Ruby*. Either that or people getting this bug need > to > change the file associations. > > Michael Ruschena > > ________________________________ > > Cain, Mark > Thu, 12 Jan 2006 07:32:28 -0800 > > 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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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" <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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" <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] [mailto:[EMAIL > PROTECTED] 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 <[EMAIL PROTECTED]> 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 > > > > > _______________________________________________ > 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/20060601/0ba4cd04/attachment.html From psyonic at gmail.com Thu Jun 1 11:25:14 2006 From: psyonic at gmail.com (Tyler Prete) Date: Thu, 1 Jun 2006 09:25:14 -0600 Subject: [Wtr-general] Methods that can be used within a frame? In-Reply-To: References: <447DE6B1.90209@tower-mt.com> Message-ID: Well I may not even have to deal with it anymore, but how would I change this manually? I do not have control over the HTML in the page, I am only interacting with it via Watir. On 5/31/06, Bret Pettichord wrote: > > On 5/31/06, Tyler Prete wrote: > > > Thank you for the help David. It looks like for now I will just have to > > try and work-around the frame issue... probably won't be too bad. I would > > post some actual code but I am writing this for use with a company intranet, > > so it wouldn't do much good anyway. > > > > What frame issue? If you want to change the page frames that a main page > loads, the way to do that is to change the main page itself. You do all of > this in HTML. I'm not sure i understand what you are trying to do. Are you > trying to do something that you can do manually? > > 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/20060601/60581c80/attachment.html From dara.lillis at kiodex.com Thu Jun 1 11:43:06 2006 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Thu, 1 Jun 2006 08:43:06 -0700 Subject: [Wtr-general] RPC Server unavailable Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E959F2D@ehost011-27.exch011.intermedia.net> Yesterday I spent a bunch of time getting my watir and ruby versions synchronized on the various machines I use for developing and running tests. I am now using: Ruby 1.8.2-15 Stable Release watir-1.5.1.1017 Is this the right (or at least a "good") Ruby version to use with the latest Watir? I scoured watir.com and the wiki for recommendations on this but couldn't find any. Anway, I am now receiving the "RPC Server unavailable" message intermittently when running tests. I found an old discussion on this (http://rubyforge.org/pipermail/wtr-general/2006-January/004634.html) where Bret recommends: "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." Am I seeing a different problem since I'm using watir-1.5? Or is it the same thing? If it is the same thing, how do I do #3? Dara Lillis * Software Testing * SunGard * Kiodex * 628 Broadway, Suite 501, New York, NY 10012 Tel 646-437-2627 * Fax 646-437-3910 * http://www.sungard.com/Kiodex -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060601/57a2dccc/attachment.html From yawl.12545861 at bloglines.com Thu Jun 1 11:54:15 2006 From: yawl.12545861 at bloglines.com (yawl.12545861 at bloglines.com) Date: 1 Jun 2006 15:54:15 -0000 Subject: [Wtr-general] RPC Server unavailable Message-ID: <1149177255.1940079767.24408.sendItem@bloglines.com> > Anway, I am now receiving the "RPC Server unavailable" message > intermittently when running tests. I found an old discussion on this > (http://rubyforge.org/pipermail/wtr-general/2006-January/004634.html) > where Bret recommends: > I am not sure if this will help, but I have seen several people get "RPC Server unavailable" error because they disabled "DCOM Server Process Launcher" service. Please check out my blog for more information: http://seclib.blogspot.com/2005/10/do-not-disable-dcom-server-process.html From bret at pettichord.com Thu Jun 1 12:09:39 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 1 Jun 2006 11:09:39 -0500 Subject: [Wtr-general] RPC Server unavailable In-Reply-To: <35AF30C7B5EBFA4DBC854B5B9DF66B0E959F2D@ehost011-27.exch011.intermedia.net> References: <35AF30C7B5EBFA4DBC854B5B9DF66B0E959F2D@ehost011-27.exch011.intermedia.net> Message-ID: On 6/1/06, Lillis, Dara wrote: > > Yesterday I spent a bunch of time getting my watir and ruby versions > synchronized on the various machines I use for developing and running tests. > I am now using: > > Ruby 1.8.2-15 Stable Release > watir-1.5.1.1017 > > Is this the right (or at least a "good") Ruby version to use with the > latest Watir? I scoured watir.com and the wiki for recommendations on this > but couldn't find any. > That should be fine. Anway, I am now receiving the "RPC Server unavailable" message intermittently when running tests. I found an old discussion on this (* http://rubyforge.org/pipermail/wtr-general/2006-January/004634.html*) where Bret recommends: "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." > > Am I seeing a different problem since I'm using watir-1.5? Or is it the > same thing? If it is the same thing, how do I do #3? > Good question. Option 3 was causing problems when it was enabled by default, so i turned it off. You can turn it back on with Watir::IE.persist_ole_connection = true This is an as yet undocumented feature. Please let us know whether this helps. Or whether it creates other problems. I wish i remember the exact problems that lead me to turn it off. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060601/c9430b20/attachment.html From EDanilova at NYBOT.com Thu Jun 1 12:33:44 2006 From: EDanilova at NYBOT.com (Danilova, Elza) Date: Thu, 1 Jun 2006 12:33:44 -0400 Subject: [Wtr-general] How to create a script for calendar function? Message-ID: <3111B45C4B9CE54C86294493C8C7E197025DDDDF@mailserver> Hi, Using the following: ie.link(:url,"javascript:show_calendar'resultsearch.gDate')").click ie2=Watir::IE.attach(:title, "Calendar") we were able to open the calendar icon, but could not go any further, because there is no object name on the calendar.html page: -----------Objects in page ------------- name= id= name= id= name= id= name= id= name= id= Calendar html: html> Calendar June 2006
[<<] [<] [Print] [>] [>>]

Could someone please tell me how I would click on one of these links? Thank You Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From zeljko.filipin at gmail.com Wed Jun 7 07:45:39 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 7 Jun 2006 13:45:39 +0200 Subject: [Wtr-general] clicking a link in a javascipt array In-Reply-To: References: Message-ID: This will show you links at your page: ie.show_links index name id href text/src 1 javascript:PC_7_0_G1_selectEmployee('0',%20'amend') Amend 2 javascript:PC_7_0_G1_selectEmployee('1',%20'amend') Amend 3 javascript:PC_7_0_G1_selectEmployee('2',%20'amend') Amend This will click second link: ie.link(:url, "javascript:PC_7_0_G1_selectEmployee('1',%20'amend')").flash It worked for me. ?eljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/26d65fad/attachment.html From zeljko.filipin at gmail.com Wed Jun 7 07:47:13 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 7 Jun 2006 13:47:13 +0200 Subject: [Wtr-general] clicking a link in a javascipt array In-Reply-To: References: Message-ID: That would actually flash the second link. :) This will click the second link: ie.link(:url, "javascript:PC_7_0_G1_selectEmployee('1',%20'amend')").click On 6/7/06, Zeljko Filipin wrote: ie.link(:url, "javascript:PC_7_0_G1_selectEmployee('1',%20'amend')").flash > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/55ebfce7/attachment.html From Adrian.Rutter at tnt.com Wed Jun 7 07:48:04 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Wed, 7 Jun 2006 12:48:04 +0100 Subject: [Wtr-general] clicking a link in a javascipt array - further info In-Reply-To: Message-ID: I can click the fist link quite happily with this: $ie.link(:text, 'Amend').click Thanks Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From DBoyt at anteon.com Wed Jun 7 08:22:44 2006 From: DBoyt at anteon.com (Boyt, Darrel) Date: Wed, 7 Jun 2006 08:22:44 -0400 Subject: [Wtr-general] Proposal for supporting multiple attributes Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC801DA81C6@HQ-EXVS02.anteon.com> I agree with Bret & Paul ... and thanks, Bret, for adding this functionality! Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama ----- Original Message ----- From: Paul Rogers To: wtr-general at rubyforge.org Sent: Tue, 06 Jun 2006 22:13:39 -0600 Subject: Re: [Wtr-general] Proposal for supporting multiple attributes xpath is also very unreadable. As a side note, one of my clients has recognized the value of good html. When something is missing an id , we add an hour, per build, per testcase for manual testing of the application. It something that is now easy for the developers and project managers to see the value, of automation, and writing html that is easily testable Paul ----- Original Message ----- From: Bret Pettichord To: wtr-general at rubyforge.org Sent: Tuesday, June 06, 2006 9:56 PM Subject: Re: [Wtr-general] Proposal for supporting multiple attributes On 6/6/06, Angrez Singh wrote: Can't XPath functionality be used to access elements using multiple attributes? This is already there. > ie.div(:class => "MenuItem", :text => "Pulverize").click This translates to: ie.div(:xpath, "//div[@class = 'MenuItem' and @text = 'Pulverize']).click I think XPath provides much more powerful way to select element in addition to selecting it using multiple attributes. Comments? I've run into this bug when i've tried to use xpath as you describe. http://jira.openqa.org/browse/WTR-19 http://www.germane-software.com/projects/rexml/ticket/61 And i don't think i can wait for the REXML fix. There is also the issue of speed, which i think would make this valuable even after REXML was working correctly. Bret From rodrigo.martin at enratio.com Wed Jun 7 08:44:30 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Wed, 7 Jun 2006 09:44:30 -0300 Subject: [Wtr-general] [question] Setting timeout for a ie.wait method? Message-ID: Hello Bret, ie.down_load_time is a Watir 1.5 feature, right? I'm afraid I still have to use the 1.4.1 release (because of WET compatibility for example). Is there a way I could manage this with 1.4.1? My code is like this: [code] $browser.links.each do |link| all_links[i]=link.href i+=1 end i=0 puts ("Links: #{all_links.length}") gets all_links.each do |test| if $browser.link(:url,"#{test}").exists? == true $browser.link(:url,"#{test}").click $browser.wait else puts("Link #{i}: #{test} --- Not Found!") end i+=1 end [/code] Well, I need a way of check that each link that was clicked have loaded "completely" a page, else I need to report which link fails. So, I first think of setting a timeout to the wait, something like "if after 10 seconds the wait state is still there, let's suppose the page hasn't loaded". 1) Bret, could I manage this with an assert sentence in 1.4.1? 2) Can I catch html messages like "200 OK" after clicking a link? 3) Can I manage html load errors like 404 File Not Found? That's it, I would really appreciate any help... Thanks in Advance! Rodrigo Julian Martin ________________________________ > If all you want to do is verify how long it took to load a page, you can do this: > ie.link(:name, "foo").click > assert( ie.down_load_time < 10) > I have actually been thinking of adding a timeout to the wait method, but i'm not sure your situation really needs it. > Bret > P.S. I have my doubts about McMahon's suggestion. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/28e11521/attachment.html From dara.lillis at kiodex.com Wed Jun 7 10:35:35 2006 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Wed, 7 Jun 2006 07:35:35 -0700 Subject: [Wtr-general] Automation annoyingness Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95A7DD@ehost011-27.exch011.intermedia.net> This is not an unusually complex problem. Testing real web applications, you are likely to run into many similar (and more difficult) issues. Is your wait "hack" a simple wait (i.e. a specified number of seconds) or does it have some logic to it? Below is a simple example of a wait that will wait as long as it takes for the link to appear (polling every half second). If you're looking for something more "elegant" than this, I'm not sure what you want. You could take the logic below and make a method out of it (say "click_wait_for_text"). That is what I would do if I needed to do this a lot. require 'Watir' include Watir $ie=IE.new $ie.methods $ie.goto("http://www.quinert.com/test.html") $ie.link(:text,"First").click while not ($ie.link(:text,"Second").exists?) sleep 0.5 end $ie.link(:text,"Second").click -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Quinert Sent: Wednesday, June 07, 2006 6:14 AM To: wtr-general at rubyforge.org; software-testing at yahoogroups.com Subject: [Wtr-general] Automation annoyingness I have an issue which I suspect can only be solved elegantly by getting our dev team to make some changes to our application. I suspect that the issue I'm having would be a general one with *any* tool attempting to automate a browser (hence my crossposting). The issue is that there is javascript attached to the 'next page' link. This script takes some time to run before advancing to the next page. Watir sensibly waits for IE to not be busy after a control is clicked, however, because the script is running, it looks like IE is not busy. As a result, the script clicks on the link, then immediately checks for the elements on the next page. They're not there, but Watir is tricked into progressing because IE is not loading a page. You can see the issue by running the script below. I naively assumed that my script would click the link to proceed then wait until the next page had loaded. My question is, is this a problem that is encountered frequently? I can imagine a few solutions - - Have the javascript set some visible state indicator on the webpage so that my script can wait for the state indicator to change. - Similarly, just poll until the next page appears to be loaded, or - Have the javascript somehow put IE into a busy/loading state immediately. Does anyone know if this is possible? - Add a wait into my script, or into the click method of links (which is my current hack). Would love to hear suggestions. It seems an interesting problem, and I am sure someone else must have encountered something similar (in Watir or some other automation effort). I also don't think this is something that we might reasonably expect Watir to handle automatically, but am happy to be corrected. Jared require 'Watir' include Watir $ie=IE.new $ie.methods $ie.goto("http://www.quinert.com/test.html") $ie.link(:text,"First").click $ie.link(:text,"Second").click _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Wed Jun 7 10:56:36 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 7 Jun 2006 09:56:36 -0500 Subject: [Wtr-general] Proposal for supporting multiple attributes In-Reply-To: References: Message-ID: On 6/7/06, Zeljko Filipin wrote: > > Are you going to make :index 0 based? I remember there was a discussion > about it. > I think it would be nice to offer the option of 0 or 1 based indexing. The 1 based indexing is particularly awkward when working with tables. But i have no immediate plans to do this. Comments? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/30fbb48f/attachment.html From dara.lillis at kiodex.com Wed Jun 7 11:48:15 2006 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Wed, 7 Jun 2006 08:48:15 -0700 Subject: [Wtr-general] Proposal for supporting multiple attributes Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95A83D@ehost011-27.exch011.intermedia.net> Disclaimer: I am not familiar with the background discussions so please let me know if I'm completely missing the point. but... it would make sense to me to aim to have everything default to 0-based indexing. Ruby has 0-based indexing (for arrays at least). I forget enough things already, so I'd prefer to not have to remember when I need to use which indexing. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Wednesday, June 07, 2006 10:57 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Proposal for supporting multiple attributes On 6/7/06, Zeljko Filipin wrote: Are you going to make :index 0 based? I remember there was a discussion about it. I think it would be nice to offer the option of 0 or 1 based indexing. The 1 based indexing is particularly awkward when working with tables. But i have no immediate plans to do this. Comments? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/a811167d/attachment.html From Adrian.Rutter at tnt.com Wed Jun 7 12:24:23 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Wed, 7 Jun 2006 17:24:23 +0100 Subject: [Wtr-general] Test::Unit Reports? Message-ID: Hi, Is there anything about that sits on top of Test::Unit to produce - for example - html reports, or would it be better to log to XML, then XSLT it? Thank You Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From charley.baker at gmail.com Wed Jun 7 12:29:36 2006 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 7 Jun 2006 10:29:36 -0600 Subject: [Wtr-general] Test::Unit Reports? In-Reply-To: References: Message-ID: Chris and I were just talking about this yesterday: http://rubyforge.org/projects/test-report/ Reports in html or xml. -Charley On 6/7/06, Adrian Rutter wrote: > > > Hi, > > Is there anything about that sits on top of Test::Unit to produce - for > example - html reports, or would it be better to log to XML, then XSLT it? > > Thank You > > Aidy > > > > > --------------------------------------------------------------------------------------------------------------- > This message and any attachment are confidential and may be privileged or > otherwise protected from disclosure. > If you are not the intended recipient, please telephone or email the > sender and delete this message and any attachment from your system. > If you are not the intended recipient you must not copy this message or > attachment or disclose the contents to any other person. > > --------------------------------------------------------------------------------------------------------------- > _______________________________________________ > 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/20060607/a28090a0/attachment.html From dara.lillis at kiodex.com Wed Jun 7 12:29:15 2006 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Wed, 7 Jun 2006 09:29:15 -0700 Subject: [Wtr-general] Test::Unit Reports? Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95A865@ehost011-27.exch011.intermedia.net> Indeed there is. Reporter http://rubyforge.org/projects/test-report/ Gives you junit-like output. I think you need to "require 'stringio'" for it to work, but aside from that it's pretty straightforwad. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Adrian Rutter Sent: Wednesday, June 07, 2006 12:24 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Test::Unit Reports? Hi, Is there anything about that sits on top of Test::Unit to produce - for example - html reports, or would it be better to log to XML, then XSLT it? Thank You Aidy ------------------------------------------------------------------------ --------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. ------------------------------------------------------------------------ --------------------------------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Wed Jun 7 12:40:38 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 7 Jun 2006 09:40:38 -0700 Subject: [Wtr-general] Test::Unit Reports? In-Reply-To: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95A865@ehost011-27.exch011.intermedia.net> References: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95A865@ehost011-27.exch011.intermedia.net> Message-ID: <72799cd70606070940j4321891due4eed0e7eb6f2aff@mail.gmail.com> > I think you need to "require 'stringio'" for it to work, but aside from > that it's pretty straightforwad. Alex fixed this in 'trunk'. -Chris From browne.daniel at gmail.com Wed Jun 7 13:10:08 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Wed, 7 Jun 2006 18:10:08 +0100 Subject: [Wtr-general] clicking a link in a javascipt array - further info In-Reply-To: References: Message-ID: <79518aef0606071010x3de23d18we8e835109a15658@mail.gmail.com> There is always the index option (to click the 3rd "Amend") too: ie.link(:index, 3).click Cheers, Daniel. On 07/06/06, Adrian Rutter wrote: > I can click the fist link quite happily with this: > > $ie.link(:text, 'Amend').click > > Thanks > > Aidy > > > > > --------------------------------------------------------------------------------------------------------------- > This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. > If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. > If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. > --------------------------------------------------------------------------------------------------------------- > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From browne.daniel at gmail.com Wed Jun 7 13:24:10 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Wed, 7 Jun 2006 18:24:10 +0100 Subject: [Wtr-general] [question] Setting timeout for a ie.wait method? In-Reply-To: References: Message-ID: <79518aef0606071024l24a590b8q7d4ee8405e171a00@mail.gmail.com> If you knew of some text that was always present in the html of a loaded page, but not present when one of the error pages is displayed you could use: ie.html.match(/some_text_that_is_always_present/) I imagine there is a better way to do it though. Cheers, Daniel. On 07/06/06, Rodrigo Julian Martin wrote: > > > > > Hello Bret, ie.down_load_time is a Watir 1.5 feature, right? > > > > I'm afraid I still have to use the 1.4.1 release (because of WET > compatibility for example). Is there a way I could manage this with 1.4.1? > > > > > > My code is like this: > > > > [code] > > $browser.links.each do |link| > > all_links[i]=link.href > > i+=1 > > end > > > > i=0 > > puts ("Links: #{all_links.length}") > > gets > > > > all_links.each do |test| > > > > if $browser.link(:url,"#{test}").exists? == true > > $browser.link(:url,"#{test}").click > > $browser.wait > > else > > puts("Link #{i}: #{test} --- Not Found!") > > end > > i+=1 > > end > > [/code] > > > > > > Well, I need a way of check that each link that was clicked have loaded > "completely" a page, else I need to report which link fails. > > So, I first think of setting a timeout to the wait, something like "if after > 10 seconds the wait state is still there, let's suppose the page > > hasn't loaded". > > > > 1) Bret, could I manage this with an assert sentence in 1.4.1? > > 2) Can I catch html messages like "200 OK" after clicking a link? > > 3) Can I manage html load errors like 404 File Not Found? > > > > > > That's it, I would really appreciate any help? > > Thanks in Advance! > > > > Rodrigo Julian Martin > > > > ________________________________ > > > > > > If all you want to do is verify how long it took to load a page, you can > do this: > > > ie.link(:name, "foo").click > > assert( ie.down_load_time < 10) > > > I have actually been thinking of adding a timeout to the wait method, but > i'm not sure your situation really needs it. > > > Bret > > > P.S. I have my doubts about McMahon's suggestion. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From lonny at titanez.net Wed Jun 7 13:27:54 2006 From: lonny at titanez.net (Lonny Eachus) Date: Wed, 07 Jun 2006 10:27:54 -0700 Subject: [Wtr-general] BUG: New IE windows share session state with existingopen windows In-Reply-To: References: Message-ID: <44870C9A.1@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/7c9d1b22/attachment.html From lonny at titanez.net Wed Jun 7 13:37:24 2006 From: lonny at titanez.net (Lonny Eachus) Date: Wed, 07 Jun 2006 10:37:24 -0700 Subject: [Wtr-general] Automation annoyingness In-Reply-To: References: Message-ID: <44870ED4.8060309@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/4c0f90a7/attachment.html From bret at pettichord.com Wed Jun 7 13:53:56 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 7 Jun 2006 12:53:56 -0500 Subject: [Wtr-general] BUG: New IE windows share session state with existingopen windows In-Reply-To: <44870C9A.1@titanez.net> References: <44870C9A.1@titanez.net> Message-ID: On 6/7/06, Lonny Eachus wrote: > > We had a server set up using multiple Mongrels with a lighttpd front end. > A server will wait for an http request to come in, and fire off our Rails > application. The program exits when done (i.e., the controller .rb runs to > completion, no polling loop or anything), but of course the server does not > shut down . . . it waits for more requests. > I thought you were giving advice to Watir users, and that was why i complained. I certainly see know how global variables could get you into the kind of trouble you were talking about using Mongrel and Rails. Your Mongrel server is running continuously and it stores your global variables. Of course. I can also see how this lead you to trouble, but i suggest that one of the Rails or Ruby forums is a better place for you to discuss the problem. I fear it will only lead to confusion mostly amongst people who can't really benefit from your experience (because most people here aren't using Rails). Your problem was really a development problem not a testing problem. When people are using Watir for testing, they are running tests in a separate process and successive runs are in different processes, so globals won't raise these kinds of problems. There are other reasons to avoid globals, but these mostly pertaining to making code more maintainable. I will continue to suggest global variables to new users who are starting to use Watir. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/e77f87f4/attachment.html From mb at michaelbolton.net Wed Jun 7 13:56:56 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Wed, 7 Jun 2006 13:56:56 -0400 Subject: [Wtr-general] BUG: New IE windows share session state with existingopen windows In-Reply-To: <44870C9A.1@titanez.net> Message-ID: <004201c68a5b$c3faac00$6801a8c0@Koko> >I see three ways this could happen, there may be more: (1) The variable "global_foo" is truly "global" on that server from the moment it is instantiated, and remains in memory even when there is no "running code". This is contrary to the way I understood globals to function . . . in which case there was a misunderstanding regarding scope, which in turn is due to lack of adequate documentation. That is to say, it was my understanding that controllers constitute "top level" code, and therefore when a controller exits, all information that is "global" to that controller should be lost. If, however, a "global" functions across controllers, effecting the whole "app", then this makes sense . . . but should be better documented. (2) The variable "global_foo" is supposed to be global only up to the controller context, but something went wrong and it is getting improperly preserved. (3) The POST variables are being improperly preserved (cached) between sessions. >In order of decreasing liklihood, I would rank these (1), (3), (2). When I stated that this could be due to some kind of server caching, I was referring to situation (3) . . . POST variables being improperly cached. That could be tested but I do not think it is very likely. It's always remarkable to me that the people are quickest to suspect that there's a bug in the language--not a bug in their test code, and not a bug in the application under test. Do you think it's more likely that Ruby preserves the value of variables across runs, even when memory is deallocated? Remember that the operating system would have to collaborate by preserving the contents of whatever address the global points to. ---Michael B. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/9510001b/attachment.html From bret at pettichord.com Wed Jun 7 14:01:39 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 7 Jun 2006 13:01:39 -0500 Subject: [Wtr-general] [question] Setting timeout for a ie.wait method? In-Reply-To: References: Message-ID: On 6/7/06, Rodrigo Julian Martin wrote: > > Hello Bret, ie.down_load_time is a Watir 1.5 feature, right? > No. It's been in Watir for a long time. It is in 1.4.1. Well, I need a way of check that each link that was clicked have loaded > "completely" a page, else I need to report which link fails. > > So, I first think of setting a timeout to the wait, something like "if > after 10 seconds the wait state is still there, let's suppose the page > > hasn't loaded". > > > > 1) Bret, could I manage this with an assert sentence in 1.4.1? > No. You would need to write multi-threaded code to do this. > 2) Can I catch html messages like "200 OK" after clicking a link? > 3) Can I manage html load errors like 404 File Not Found? > You might try experimenting with ie.add_checker -- look at Navigation Checker in watir.rb. (Also in 1.4.1) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/9074e62c/attachment.html From lonny at titanez.net Wed Jun 7 14:21:09 2006 From: lonny at titanez.net (Lonny Eachus) Date: Wed, 07 Jun 2006 11:21:09 -0700 Subject: [Wtr-general] Uses for Watir (was: Re: BUG: New IE windows share session state with existingopen windows) In-Reply-To: References: Message-ID: <44871915.3090706@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/6780431c/attachment.html From lonny at titanez.net Wed Jun 7 14:28:56 2006 From: lonny at titanez.net (Lonny Eachus) Date: Wed, 07 Jun 2006 11:28:56 -0700 Subject: [Wtr-general] BUG: New IE windows share session state with existingopen windows In-Reply-To: References: Message-ID: <44871AE8.4040504@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/03f2fcc7/attachment.html From charley.baker at gmail.com Wed Jun 7 15:03:47 2006 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 7 Jun 2006 13:03:47 -0600 Subject: [Wtr-general] Uses for Watir (was: Re: BUG: New IE windows share session state with existingopen windows) In-Reply-To: <44871915.3090706@titanez.net> References: <44871915.3090706@titanez.net> Message-ID: Hey Lonny, Globals in general are best avoided, there are cases where it makes sense, but having been assigned single 40+ page perl scripts and various other projects where just about every variable is a global will pretty much drive that one home. Best to use instance variables when possible, Ruby's oo, use it unless there's some application wide configuration or some other reason to use globals (i.e. post data can be wrapped and stored per request in class). Not to guess out of term, but, you're right, I'd guess there are a fair amount of people using Watir to test Rails. Bret was not implying that, but that this is a Watir list, whereas it sounds like you're having an issue more with your server and the code running there, whether server bug or dev code issue, not sure. This just isn't the forum for random server or dev code problems, sounds like Mongrel, lighthttpd or the code was caching the information. Curious about how your application uses Watir in the application? Sounds rather interesting... -Charley On 6/7/06, Lonny Eachus wrote: > > > I can see that we were coming from different perspectives. But please keep > in mind that not only the functionality but also the "scope" (pardon the > word) of Watir may be expanding . . . I know of several people at least who > use it for things other than testing. Our application DOES use Watir, and I > was just trying to point out a potential pitfall for anyone else in the same > boat. Someone else brought up the subject and I felt a warning might be > appropriate. > > Globals certainly have their place, and it was not my intention to > contradict anything you said . . . just to share some experience. They can > cause problems. What susprises me, though, is the comment that "most" people > here do not use Rails? That seems strange to me . . . I would have thought > it the ideal environment for Watir. > > Lonny Eachus > ========== > > > Subject: > Re: [Wtr-general] BUG: New IE windows share session state with > existingopen windows From: > "Bret Pettichord" Date: > Wed, 7 Jun 2006 12:53:56 -0500 > . . . > I thought you were giving advice to Watir users, and that was why i > complained. I certainly see know how global variables could get you into the > kind of trouble you were talking about using Mongrel and Rails. Your Mongrel > server is running continuously and it stores your global variables. Of > course. I can also see how this lead you to trouble, but i suggest that one > of the Rails or Ruby forums is a better place for you to discuss the > problem. I fear it will only lead to confusion mostly amongst people who > can't really benefit from your experience (because most people here aren't > using Rails). Your problem was really a development problem not a testing > problem. > > When people are using Watir for testing, they are running tests in a > separate process and successive runs are in different processes, so globals > won't raise these kinds of problems. There are other reasons to avoid > globals, but these mostly pertaining to making code more maintainable. I > will continue to suggest global variables to new users who are starting to > use Watir. > > Bret > > > > > > > ------------------------------ > > Subject: > Re: [Wtr-general] BUG: New IE windows share session state with > existingopen windows From: > "Michael Bolton" Date: > Wed, 7 Jun 2006 13:56:56 -0400 To: > To: > > >I see three ways this could happen, there may be more: (1) The variable > "global_foo" is truly "global" on that server from the moment it is > instantiated, and remains in memory *even when there is no "running code"*. > This is contrary to the way I understood globals to function . . . in which > case there was a misunderstanding regarding scope, which in turn is due to > lack of adequate documentation. That is to say, it was my understanding that > controllers constitute "top level" code, and therefore when a controller > exits, all information that is "global" to that controller should be lost. > If, however, a "global" functions across controllers, effecting the whole > "app", then this makes sense . . . but should be better documented. (2) The > variable "global_foo" is supposed to be global only up to the controller > context, but something went wrong and it is getting improperly preserved. > (3) The POST variables are being improperly preserved (cached) between > sessions. > > >In order of decreasing liklihood, I would rank these (1), (3), (2). When > I stated that this could be due to some kind of server caching, I was > referring to situation (3) . . . POST variables being improperly cached. > That could be tested but I do not think it is very likely. > It's always remarkable to me that the people are quickest to suspect that > there's a bug in the language--not a bug in their test code, and not a bug > in the application under test. > > Do you think it's *more* likely that Ruby preserves the value of variables > across runs, even when memory is deallocated? Remember that the operating > system would have to collaborate by preserving the contents of whatever > address the global points to. > > ---Michael B. > > ------------------------------ > > Subject: > Re: [Wtr-general] [question] Setting timeout for a ie.wait method? From: > "Bret Pettichord" Date: > Wed, 7 Jun 2006 13:01:39 -0500 To: > wtr-general at rubyforge.org To: > wtr-general at rubyforge.org > On 6/7/06, Rodrigo Julian Martin wrote: > > > > Hello Bret, ie.down_load_time is a Watir 1.5 feature, right? > > > No. It's been in Watir for a long time. It is in 1.4.1. > > Well, I need a way of check that each link that was clicked have loaded > > "completely" a page, else I need to report which link fails. > > > > So, I first think of setting a timeout to the wait, something like "if > > after 10 seconds the wait state is still there, let's suppose the page > > > > hasn't loaded". > > > > > > > > 1) Bret, could I manage this with an assert sentence in 1.4.1? > > > No. You would need to write multi-threaded code to do this. > > > 2) Can I catch html messages like "200 OK" after clicking a > > link? > > > 3) Can I manage html load errors like 404 File Not Found? > > > You might try experimenting with ie.add_checker -- look at Navigation > Checker in watir.rb. (Also in 1.4.1) > > ------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.orghttp://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/20060607/46617187/attachment.html From bret at pettichord.com Wed Jun 7 15:12:38 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 7 Jun 2006 14:12:38 -0500 Subject: [Wtr-general] Proposal for supporting multiple attributes In-Reply-To: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95A83D@ehost011-27.exch011.intermedia.net> References: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95A83D@ehost011-27.exch011.intermedia.net> Message-ID: On 6/7/06, Lillis, Dara wrote: > > Disclaimer: I am not familiar with the background discussions so please > let me know if I'm completely missing the point. but... > > it would make sense to me to aim to have everything default to 0-based > indexing. Ruby has 0-based indexing (for arrays at least). I forget enough > things already, so I'd prefer to not have to remember when I need to use > which indexing. > In hindsight, we wish we had started with 0-based indexing for just this reason. The problem is what do we do about all the existing tests that use 1-based indexing. This suggests that we have to make it a configurable option -- and maybe change the default to 0-based, but make it easy for the 1-based tests to continue to work. Does this make sense? Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/8c689ef9/attachment.html From bret at pettichord.com Wed Jun 7 15:22:28 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 7 Jun 2006 14:22:28 -0500 Subject: [Wtr-general] clicking a link in a javascipt array In-Reply-To: References: Message-ID: On 6/7/06, Zeljko Filipin wrote: > > ie.link(:url, "javascript:PC_7_0_G1_selectEmployee('1',%20'amend')").flash > Also remember that you can use a regular expression when it's more convenient. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/2a4c9a41/attachment.html From lonny at titanez.net Wed Jun 7 15:36:48 2006 From: lonny at titanez.net (Lonny Eachus) Date: Wed, 07 Jun 2006 12:36:48 -0700 Subject: [Wtr-general] BUG: New IE windows share session state with existingopen windows In-Reply-To: References: Message-ID: <44872AD0.8050605@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/f7270e11/attachment.html From jared at kilmore.info Wed Jun 7 19:31:15 2006 From: jared at kilmore.info (Jared Quinert) Date: Thu, 08 Jun 2006 09:31:15 +1000 Subject: [Wtr-general] Automation annoyingness In-Reply-To: <44870ED4.8060309@titanez.net> References: <44870ED4.8060309@titanez.net> Message-ID: <448761C3.8060409@kilmore.info> In the real-world example the delay is caused by javascript which is doing something necessary, not just pausing (as in my fake example). Watir pauses for 0.2 seconds after a link is clicked, so this probably catches most instances where an application has some javascript that does something computationally intensive before the next page is loaded. I think this means that I have to explicitly handle this. I was hoping to know what approaches others had taken. I figure this would confuse commercial tools as well, but don't have one to compare to, unless they're smart enough to analyse the script invoked to see if it actually submits a form, refreshes, or redirects to another page. Even then, I can imagine issues. Jared > I do not understand the problem. Why not just alter the JavaScript to > reduce or eliminate the delay? You can make it do anything you want it to. > > Lonny Eachus > ========= > > >> >> Subject: >> [Wtr-general] Automation annoyingness >> From: >> Jared Quinert >> Date: >> Wed, 07 Jun 2006 20:14:25 +1000 >> >> >> I have an issue which I suspect can only be solved elegantly by >> getting our dev team to make some changes to our application. I >> suspect that the issue I'm having would be a general one with *any* >> tool attempting to automate a browser (hence my crossposting). >> >> The issue is that there is javascript attached to the 'next page' >> link. This script takes some time to run before advancing to the >> next page. Watir sensibly waits for IE to not be busy after a >> control is clicked, however, because the script is running, it looks >> like IE is not busy. As a result, the script clicks on the link, >> then immediately checks for the elements on the next page. They're >> not there, but Watir is tricked into progressing because IE is not >> loading a page. >> > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20060608/075a057f/attachment.html From bret at pettichord.com Wed Jun 7 20:31:47 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 7 Jun 2006 19:31:47 -0500 Subject: [Wtr-general] Automation annoyingness In-Reply-To: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95A7DD@ehost011-27.exch011.intermedia.net> References: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95A7DD@ehost011-27.exch011.intermedia.net> Message-ID: On 6/7/06, Lillis, Dara wrote: > > while not ($ie.link(:text,"Second").exists?) > sleep 0.5 > end > $ie.link(:text,"Second").click This is what i do as well. I think the remaining question is whether Watir should do this automatically. I've actually coded this directly and tested it and it works. It's only a couple of lines of code. The only complication is that if you do this on every call, you need to make darn sure you put a limit on how long you will poll for the existance of an object. What happens if the page changes and the second page no longer has a link called "Second"? Dara's solution would hang indefinitely, which is a bad thing for a test to do. So that means adding a timeout and then providing a means for users to configure the timeout for their own tests. Should we build this into Watir? The main drawback is that every time there is a failure to find an object, Watir will wait the timeout interval, before actually raising the error. So it could make tests slower, especially when there are lots of errors. On the other hand, you could just set the timeout to 0, and then it would work the way it does today. Comments? Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/61fd435f/attachment.html From jared at kilmore.info Wed Jun 7 20:43:03 2006 From: jared at kilmore.info (Jared Quinert) Date: Thu, 08 Jun 2006 10:43:03 +1000 Subject: [Wtr-general] Automation annoyingness In-Reply-To: References: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95A7DD@ehost011-27.exch011.intermedia.net> Message-ID: <44877297.2040206@kilmore.info> I'm voting to add this...I know I can add it myself, but it seems like a number of people are having to do this already. Jared > I think the remaining question is whether Watir should do this > automatically. I've actually coded this directly and tested it and it > works. It's only a couple of lines of code. > > The only complication is that if you do this on every call, you need > to make darn sure you put a limit on how long you will poll for the > existance of an object. What happens if the page changes and the > second page no longer has a link called "Second"? Dara's solution > would hang indefinitely, which is a bad thing for a test to do. > > So that means adding a timeout and then providing a means for users to > configure the timeout for their own tests. > > Should we build this into Watir? > > The main drawback is that every time there is a failure to find an > object, Watir will wait the timeout interval, before actually raising > the error. So it could make tests slower, especially when there are > lots of errors. On the other hand, you could just set the timeout to > 0, and then it would work the way it does today. > > Comments? > > 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/20060608/42ad1093/attachment.html From lonny at titanez.net Wed Jun 7 20:54:15 2006 From: lonny at titanez.net (Lonny Eachus) Date: Wed, 07 Jun 2006 17:54:15 -0700 Subject: [Wtr-general] Proposal for supporting multiple attributes In-Reply-To: References: Message-ID: <44877537.4000302@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/9bf9ef55/attachment.html From lonny at titanez.net Wed Jun 7 21:09:12 2006 From: lonny at titanez.net (Lonny Eachus) Date: Wed, 07 Jun 2006 18:09:12 -0700 Subject: [Wtr-general] Wtr-general Digest, Vol 31, Issue 16 In-Reply-To: References: Message-ID: <448778B8.1010500@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/fff5dab4/attachment.html From lonny at titanez.net Wed Jun 7 21:13:47 2006 From: lonny at titanez.net (Lonny Eachus) Date: Wed, 07 Jun 2006 18:13:47 -0700 Subject: [Wtr-general] Automation annoyingness In-Reply-To: References: Message-ID: <448779CB.402@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/72df3fb1/attachment.html From lonny at titanez.net Wed Jun 7 21:22:17 2006 From: lonny at titanez.net (Lonny Eachus) Date: Wed, 07 Jun 2006 18:22:17 -0700 Subject: [Wtr-general] Wtr-general Digest, Vol 31, Issue 16 In-Reply-To: References: Message-ID: <44877BC9.4070902@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/17233c0c/attachment.html From bret at pettichord.com Wed Jun 7 21:35:52 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 7 Jun 2006 20:35:52 -0500 Subject: [Wtr-general] Automation annoyingness In-Reply-To: <448779CB.402@titanez.net> References: <448779CB.402@titanez.net> Message-ID: On 6/7/06, Lonny Eachus wrote: > > By automatically, I would hope you mean a kind of "wait_for()" method, > rather than doing it unseen in the background. At first thought it seems the > latter would be terribly inefficient, especially since it is only necessary > in relatively rare cases. > No i meant automatically, all the time. What it would mean is that whenever Watir failed to find an object, it would sleep for a fraction of a second and then try again if the timeout interval hadn't yet been exceeded. If the timeout were set to 0, it should behave exactly as it does today, so you wouldn't need to replace code. In my spike, the core test suite, which normally runs in 120 seconds, ran in 142 with the timeout set to 0. And it represents a worst case, since it includes lots of negative tests -- a lot more than any regular test suite or scaper application would include. And in any case, i can't explain why it took an extra 22 seconds -- so that is a bug i'd have to track down before i would commit the code. > Time and efficiency are definitely a concern in our screen scrapes. I was > already considering overriding existing delays in the code. If this loop > were done every time, we would likely be in the position of having to go > into the Watir code to take it back out, in order to regain what efficiency > we could. > Please let us know where you think Watir is inefficient. Like i said the other day, i'm always tweaking things to make my tests run faster. If you have suggestions, i'm all ears. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/5ee7c473/attachment.html From jared at kilmore.info Wed Jun 7 21:56:41 2006 From: jared at kilmore.info (Jared Quinert) Date: Thu, 08 Jun 2006 11:56:41 +1000 Subject: [Wtr-general] Wtr-general Digest, Vol 31, Issue 16 In-Reply-To: <44877BC9.4070902@titanez.net> References: <44877BC9.4070902@titanez.net> Message-ID: <448783D9.2010008@kilmore.info> I think the point is that any script activity after a click is non-instantaneous. That leaves a window where your test script progresses, checks to see if IE is busy, and is told 'No, IE is not loading a page', but then a fraction of a second later, it may begin loading a page. The process is click, wait for IE, click, wait for IE. If IE doesn't appear to be busy after the click, it will move on. The small sleeps in Watir's wait method might be enough for most circumstances, but probably not all. The actual call in our script is document.form.submit(). I don't know if there's any way to make IE report itself as busy. If there is, that would probably fix things too. Normally, IE is busy once you click a submit button. I don't if it is busy as soon as you call a form's submit method. It seems hard to tell. Jared > > I thought you meant there was an explicit delay. While I do not doubt > what you say, it seems strange that even a mess of JavaScript should > take very long. On the other hand, in recent months I have seen some > JavaScript that was, indeed, a real mess. Can you be more specific > about what it is doing? There may be ways to optimize things on the > JavaScript side. If it is not relevant here, you can send to me > directly at lonny at hotpop.com > > Lonny Eachus > ========== > >> Subject: >> Re: [Wtr-general] Automation annoyingness >> From: >> Jared Quinert >> Date: >> Thu, 08 Jun 2006 09:31:15 +1000 >> >> >> In the real-world example the delay is caused by javascript which is >> doing something necessary, not just pausing (as in my fake example). >> Watir pauses for 0.2 seconds after a link is clicked, so this >> probably catches most instances where an application has some >> javascript that does something computationally intensive before the >> next page is loaded. I think this means that I have to explicitly >> handle this. I was hoping to know what approaches others had taken. >> >> I figure this would confuse commercial tools as well, but don't have >> one to compare to, unless they're smart enough to analyse the script >> invoked to see if it actually submits a form, refreshes, or redirects >> to another page. Even then, I can imagine issues. >> >> Jared > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20060608/cf4bf53e/attachment.html From jared at kilmore.info Wed Jun 7 21:57:45 2006 From: jared at kilmore.info (Jared Quinert) Date: Thu, 08 Jun 2006 11:57:45 +1000 Subject: [Wtr-general] Automation annoyingness In-Reply-To: <448779CB.402@titanez.net> References: <448779CB.402@titanez.net> Message-ID: <44878419.3050804@kilmore.info> Working out what is happening when your script is failing in this instance was time-consuming and non-obvious. I assume that Watir's audience includes people who may not figure out what is going on when their script appears to randomly fail. It makes sense to me to prevent this problem if it can be done without much of an impact on performance. Jared Lonny Eachus wrote: > Apologies for the post with the wrong subject line . . . > > By automatically, I would hope you mean a kind of "wait_for()" method, > rather than doing it unseen in the background. At first thought it > seems the latter would be terribly inefficient, especially since it is > only necessary in relatively rare cases. > > Time and efficiency are definitely a concern in our screen scrapes. I > was already considering overriding existing delays in the code. If > this loop were done every time, we would likely be in the position of > having to go into the Watir code to take it back out, in order to > regain what efficiency we could. > > Lonny Eachus > > >> Subject: >> Re: [Wtr-general] Automation annoyingness >> From: >> "Bret Pettichord" >> Date: >> Wed, 7 Jun 2006 19:31:47 -0500 >> >> >> On 6/7/06, *Lillis, Dara* > > wrote: >> >> while not ($ie.link(:text,"Second").exists?) >> sleep 0.5 >> end >> $ie.link(:text,"Second").click >> >> >> This is what i do as well. >> >> I think the remaining question is whether Watir should do this >> automatically. I've actually coded this directly and tested it and it >> works. It's only a couple of lines of code. >> . . . > > > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20060608/56d9fb2a/attachment.html From bret at pettichord.com Wed Jun 7 22:12:27 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 7 Jun 2006 21:12:27 -0500 Subject: [Wtr-general] Please -- No Digest Headers in your posts! Message-ID: When you reply to a digest message like this: *Re: [Wtr-general] Wtr-general Digest, Vol 31, Issue 16* Please change the header, preferably to match that of the post you are replying to. Including subject lines like this make threads nearly impossible to track. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/2d2a1140/attachment.html From browne.daniel at gmail.com Thu Jun 8 04:14:11 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Thu, 8 Jun 2006 09:14:11 +0100 Subject: [Wtr-general] Automation annoyingness In-Reply-To: <44877297.2040206@kilmore.info> References: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95A7DD@ehost011-27.exch011.intermedia.net> <44877297.2040206@kilmore.info> Message-ID: <79518aef0606080114j4e84c619jbcfac2aa07e75bcb@mail.gmail.com> I think it's a good idea. I used to use WinRunner TSL (I much prefer using Watir by the way!) and it provided similar functionality. What was different was that there was a global timeout setting that was used, and the timeout value added to the operation would be added on to the global timeout value. This was quite handy when testing requirements such as a "All web pages must be loaded within 5 seconds". If desired, this functionality could be easily achieved by Watir users with what is being proposed. Cheers, Daniel. On 08/06/06, Jared Quinert wrote: > > I'm voting to add this...I know I can add it myself, but it seems like a > number of people are having to do this already. > > Jared > > > > > I think the remaining question is whether Watir should do this > automatically. I've actually coded this directly and tested it and it works. > It's only a couple of lines of code. > > The only complication is that if you do this on every call, you need to > make darn sure you put a limit on how long you will poll for the existance > of an object. What happens if the page changes and the second page no longer > has a link called "Second"? Dara's solution would hang indefinitely, which > is a bad thing for a test to do. > > So that means adding a timeout and then providing a means for users to > configure the timeout for their own tests. > > Should we build this into Watir? > > The main drawback is that every time there is a failure to find an object, > Watir will wait the timeout interval, before actually raising the error. So > it could make tests slower, especially when there are lots of errors. On the > other hand, you could just set the timeout to 0, and then it would work the > way it does today. > > Comments? > > Bret > > > ________________________________ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From bret at pettichord.com Thu Jun 8 09:25:41 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 8 Jun 2006 08:25:41 -0500 Subject: [Wtr-general] Automation annoyingness In-Reply-To: <79518aef0606080114j4e84c619jbcfac2aa07e75bcb@mail.gmail.com> References: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95A7DD@ehost011-27.exch011.intermedia.net> <44877297.2040206@kilmore.info> <79518aef0606080114j4e84c619jbcfac2aa07e75bcb@mail.gmail.com> Message-ID: On 6/8/06, Daniel Browne wrote: > > What > was different was that there was a global timeout setting that was > used, and the timeout value added to the operation would be added on > to the global timeout value. This was quite handy when testing > requirements such as a "All web pages must be loaded within 5 > seconds". Can you give an example? I'm not sure i understand. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060608/46803f33/attachment.html From Adrian.Rutter at tnt.com Thu Jun 8 10:33:18 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Thu, 8 Jun 2006 15:33:18 +0100 Subject: [Wtr-general] Test::Unit Reports? Message-ID: Hi, Please forgive my ignorance of unit test suites I have successfully installed Test::Unit::Reporter in my Ruby folder ruby setup.rb config ruby setup.rb install I have created two unit tests that are exactly the same apart from their class and method name class TC_1 def test_tc_1 class TC_2 def test_tc_2 require 'test/unit' class TC_1 < Test::Unit::TestCase def test_tc_1 start_browser('http://gbahevm07l15:9081/wps/portal') assert($ie.contains_text('Welcome')) $ie.close end end This is an attempt to create a unit test suite require 'test/unit' require 'tc_1' require 'tc_2' class TS_MyTests suite = Test::Unit::TestSuite.new suite << tc_1.suite suite << tc_2.suite require 'fileutils' FileUtils.mkdir_p 'build/report' Test::Unit::UI::Reporter.run(suite, 'build/report') end The errors I am receiving are: " undefined local variable or method `tc_1' for TS_MyTests:Class (NameError)" " uninitialized constant Test::Unit::UI::Reporter (NameError)" Can anyone please point me in the right direction? Thank You Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From browne.daniel at gmail.com Thu Jun 8 10:39:39 2006 From: browne.daniel at gmail.com (Daniel Browne) Date: Thu, 8 Jun 2006 15:39:39 +0100 Subject: [Wtr-general] Automation annoyingness In-Reply-To: References: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95A7DD@ehost011-27.exch011.intermedia.net> <44877297.2040206@kilmore.info> <79518aef0606080114j4e84c619jbcfac2aa07e75bcb@mail.gmail.com> Message-ID: <79518aef0606080739i6eda86cck4927f0991fceeaa5@mail.gmail.com> Sure. In WinRunner, there is a global timeout setting that is used for all scripts. This was set via a menu option rather that programmatically. In addition to this, in WinRunner TSL, most operations would take a timeout value as a parameters e.g. link_click(name, timeout) button_click(name, timeout) Don't quote me on any of those functions names. Anyway, let's say I have the global timeout set to 5 seconds, and have the following operation: link_click("my_link", 0) If WinRunner can't find the link within 5 (5 + 0) seconds, it will fail with a timeout error. If it can find the link before the 5 seconds is up then it clicks it as soon as it can. I have seen non-functional requirements before along the lines of "the response time for each operations should be less than 5 seconds". In such circumstances the above is useful. If the requirements then change, the global timeout setting can be changed. If you needed a longer timeout for a specific operation, the following might be used: link_click("my_link", 20) Then it would wait 25 (5 + 20) seconds before timing out. To be honest, when doing our performance testing we mostly used tools like JMeter, working at an HTTP level, however people often like to see how a web sites respond to simulated mouse clicks rather than the HTTP requests behind them. Does that make sense? Cheers, Daniel. On 08/06/06, Bret Pettichord wrote: > On 6/8/06, Daniel Browne wrote: > > > What > > was different was that there was a global timeout setting that was > > used, and the timeout value added to the operation would be added on > > to the global timeout value. This was quite handy when testing > > requirements such as a "All web pages must be loaded within 5 > > seconds". > > > Can you give an example? I'm not sure i understand. > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From dara.lillis at kiodex.com Thu Jun 8 10:50:46 2006 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Thu, 8 Jun 2006 07:50:46 -0700 Subject: [Wtr-general] Test::Unit Reports? Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95AA20@ehost011-27.exch011.intermedia.net> two obvious problems: you need to require reporter: require 'test/unit/ui/reporter' and you should require (and add to the suite) the class TC_1, not the test method tc_1 as an aside, you can create your directory without requiring fileutils using this single line: Dir.mkdir('build/report') -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Adrian Rutter Sent: Thursday, June 08, 2006 10:33 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Test::Unit Reports? Hi, Please forgive my ignorance of unit test suites I have successfully installed Test::Unit::Reporter in my Ruby folder ruby setup.rb config ruby setup.rb install I have created two unit tests that are exactly the same apart from their class and method name class TC_1 def test_tc_1 class TC_2 def test_tc_2 require 'test/unit' class TC_1 < Test::Unit::TestCase def test_tc_1 start_browser('http://gbahevm07l15:9081/wps/portal') assert($ie.contains_text('Welcome')) $ie.close end end This is an attempt to create a unit test suite require 'test/unit' require 'tc_1' require 'tc_2' class TS_MyTests suite = Test::Unit::TestSuite.new suite << tc_1.suite suite << tc_2.suite require 'fileutils' FileUtils.mkdir_p 'build/report' Test::Unit::UI::Reporter.run(suite, 'build/report') end The errors I am receiving are: " undefined local variable or method `tc_1' for TS_MyTests:Class (NameError)" " uninitialized constant Test::Unit::UI::Reporter (NameError)" Can anyone please point me in the right direction? Thank You Aidy ------------------------------------------------------------------------ --------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. ------------------------------------------------------------------------ --------------------------------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Thu Jun 8 10:52:54 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 8 Jun 2006 09:52:54 -0500 Subject: [Wtr-general] Automation annoyingness In-Reply-To: <79518aef0606080739i6eda86cck4927f0991fceeaa5@mail.gmail.com> References: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95A7DD@ehost011-27.exch011.intermedia.net> <44877297.2040206@kilmore.info> <79518aef0606080114j4e84c619jbcfac2aa07e75bcb@mail.gmail.com> <79518aef0606080739i6eda86cck4927f0991fceeaa5@mail.gmail.com> Message-ID: On 6/8/06, Daniel Browne wrote: > > Does that make sense? Yes. Thanks for the explanation. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060608/6f7694bc/attachment.html From dara.lillis at kiodex.com Thu Jun 8 10:53:37 2006 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Thu, 8 Jun 2006 07:53:37 -0700 Subject: [Wtr-general] Test::Unit Reports? Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95AA24@ehost011-27.exch011.intermedia.net> oops, forgot to mention you also need this require: require 'test/unit/ui/console/testrunner' -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lillis, Dara Sent: Thursday, June 08, 2006 10:51 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Test::Unit Reports? two obvious problems: you need to require reporter: require 'test/unit/ui/reporter' and you should require (and add to the suite) the class TC_1, not the test method tc_1 as an aside, you can create your directory without requiring fileutils using this single line: Dir.mkdir('build/report') -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Adrian Rutter Sent: Thursday, June 08, 2006 10:33 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Test::Unit Reports? Hi, Please forgive my ignorance of unit test suites I have successfully installed Test::Unit::Reporter in my Ruby folder ruby setup.rb config ruby setup.rb install I have created two unit tests that are exactly the same apart from their class and method name class TC_1 def test_tc_1 class TC_2 def test_tc_2 require 'test/unit' class TC_1 < Test::Unit::TestCase def test_tc_1 start_browser('http://gbahevm07l15:9081/wps/portal') assert($ie.contains_text('Welcome')) $ie.close end end This is an attempt to create a unit test suite require 'test/unit' require 'tc_1' require 'tc_2' class TS_MyTests suite = Test::Unit::TestSuite.new suite << tc_1.suite suite << tc_2.suite require 'fileutils' FileUtils.mkdir_p 'build/report' Test::Unit::UI::Reporter.run(suite, 'build/report') end The errors I am receiving are: " undefined local variable or method `tc_1' for TS_MyTests:Class (NameError)" " uninitialized constant Test::Unit::UI::Reporter (NameError)" Can anyone please point me in the right direction? Thank You Aidy ------------------------------------------------------------------------ --------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. ------------------------------------------------------------------------ --------------------------------------- _______________________________________________ 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 Adrian.Rutter at tnt.com Thu Jun 8 11:22:39 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Thu, 8 Jun 2006 16:22:39 +0100 Subject: [Wtr-general] Test::Unit Reports? Message-ID: Hi, Thanks for getting back to me. This is where I am with comments #require 'test/unit' #I was under the impression that this would automatically import the two requires below require 'test/unit/ui/reporter' require 'test/unit/ui/console/testrunner' require 'tc_1' require 'tc_2' class TS_MyTests suite = Test::Unit::TestSuite.new suite << TC_1.suite suite << TC_2.suite #Dir.mkdir('build/report') #says file exists require 'fileutils' FileUtils.mkdir_p 'build/report' #I tried this: #Reporter.new.run(suite, 'build/report') #think it's trying to run the below method from this class Test::Unit::UI::Reporter.run(suite, 'build/report') end The problem I have is with this line: Test::Unit::UI::Reporter.run(suite, 'build/report') I am told it is an uninitialized constant Test::Unit::UI::Reporter::StringIO (NameError) Thanks Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From lonny at titanez.net Thu Jun 8 12:39:07 2006 From: lonny at titanez.net (Lonny Eachus) Date: Thu, 08 Jun 2006 09:39:07 -0700 Subject: [Wtr-general] Automation annoyingness In-Reply-To: References: Message-ID: <448852AB.3010103@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060608/13a96e9b/attachment.html From lonny at titanez.net Thu Jun 8 12:57:55 2006 From: lonny at titanez.net (Lonny Eachus) Date: Thu, 08 Jun 2006 09:57:55 -0700 Subject: [Wtr-general] Automation annoyingness In-Reply-To: References: Message-ID: <44885713.6080700@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060608/be6ee5ca/attachment.html From bret at pettichord.com Thu Jun 8 16:12:07 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 8 Jun 2006 15:12:07 -0500 Subject: [Wtr-general] Automation annoyingness In-Reply-To: <44885713.6080700@titanez.net> References: <44885713.6080700@titanez.net> Message-ID: On 6/8/06, Lonny Eachus wrote: > > After considering this carefully, I would argue that this is a good idea, > but it should really be a different method with a different name. > > 1) Adding a non-optional parameter to the "exists?" method call would > break existing code. > > 2) This retry loop is really more of a "wait_for()" method for elements, > without having to instantiate the element first. This is a great idea . . . > but the purpose is different than that of merely testing for existence. > > To me, those two things practically scream "new method". > I'm confused. The proposal isn't to change the exists? method, but rather the other methods. If you want a new name (for whatever method), please suggest one. Specifically, I propose that where you currently do this: while not ($ie.link(:text,"Second").exists?) sleep 0.5 end $ie.link(:text,"Second").click > > You would instead just do this $ie.link(:text,"Second").click > > And you would implicitly get the polling behavior that had been explicit. The proposal is to change all the element methods, except (perhaps) "exists?". It seems to me that "exists?" is a separate case. We should consider it separately. Do we have agreement on the usefulness of the proposal, if no change is made to exists? Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060608/8332bedf/attachment.html From pkrishna25 at yahoo.com Thu Jun 8 20:38:02 2006 From: pkrishna25 at yahoo.com (Prashanth Krishnamurthy) Date: Thu, 8 Jun 2006 17:38:02 -0700 (PDT) Subject: [Wtr-general] WATIT with AJAX. Message-ID: <20060609003802.80248.qmail@web33512.mail.mud.yahoo.com> Hi, I learnt about WATIR just few minutes ago. I am looking at tools which helps me in automating a web based product which uses lot of AJAX. 1.How does WATIR work with AJAX? 2.Has anyone done any comparison amongst products like QTP, SIlktest, WATIR etc. thanks for ur help. --Prashanth __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From jfry at lyris.com Thu Jun 8 21:00:40 2006 From: jfry at lyris.com (Jeff Fry) Date: Thu, 08 Jun 2006 18:00:40 -0700 Subject: [Wtr-general] Automation annoyingness In-Reply-To: References: <44885713.6080700@titanez.net> Message-ID: <4488C838.5060209@lyris.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060608/9d36e2b9/attachment.html From jeff.darklight at gmail.com Fri Jun 9 02:34:53 2006 From: jeff.darklight at gmail.com (Jeff Wood) Date: Thu, 8 Jun 2006 23:34:53 -0700 Subject: [Wtr-general] Automation annoyingness In-Reply-To: <4488C838.5060209@lyris.com> References: <44885713.6080700@titanez.net> <4488C838.5060209@lyris.com> Message-ID: actually, I would code up a "when" functionality just like endfix if or unless ... then you could do ie.link( :text, "Second" ).click when ie.link( :text, "Second" ).exists? ... or something like that. --jw. On 6/8/06, Jeff Fry wrote: > > Bret Pettichord wrote: > > Specifically, I propose that where you currently do this: > > while not ($ie.link(:text,"Second").exists?) > sleep 0.5 > end > $ie.link(:text,"Second").click > > > > > > > > > You would instead just do this > > $ie.link(:text,"Second").click > > > > > > > > > And you would implicitly get the polling behavior that had been explicit. > The proposal is to change all the element methods, except (perhaps) > "exists?". > > It seems to me that "exists?" is a separate case. We should consider it > separately. > > Do we have agreement on the usefulness of the proposal, if no change is > made to exists? > > Bret > My question is: Do we take anything useful away by making $ie.link always > do this? If we have a configurable default timeout that can be set to 0 I > think we're fine. > > Here's what I'd like to see: > 1) Add a global configurable default time to wait for pages to load. I'd > propose leaving this at 0 seconds by default and letting people up it > intentionally. > 2) Add a new optional argument on $ie.link, where I can choose to override > that default: > > $ie.link_wait(:text,"Second").click ## continues to > do what it's always done, unless I have deliberately changed my default page > wait. (Or if I've set my default page wait to (for example) 600 seconds, > it'll wait for up to 10 minutes on each page before giving up.) > > $ie.link(:text,"Second", 30).click ## would wait up to 30 seconds for > the page to load before erroring out, regardless of my default page wait > time. > > ...btw, I don't have a strong opinion on whether the default wait time > would be 0 or non-0. The question for me is which is least surprising > scenario: Someone who expects the script to error when a page doesn't return > quickly, or someone who expects the script to wait patiently while something > happens prior to page load. > > Jeff > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From bret at pettichord.com Fri Jun 9 02:45:24 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 9 Jun 2006 01:45:24 -0500 Subject: [Wtr-general] Automation annoyingness In-Reply-To: References: <44885713.6080700@titanez.net> <4488C838.5060209@lyris.com> Message-ID: On 6/9/06, Jeff Wood wrote: > > actually, I would code up a "when" functionality just like endfix if > or unless ... then you could do > > ie.link( :text, "Second" ).click when ie.link( :text, "Second" ).exists? > > ... or something like that. I don't know how to do this. Can you provide example code? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/e79ec40b/attachment.html From manishs at reconnex.net Fri Jun 9 05:54:55 2006 From: manishs at reconnex.net (Manish Sapariya) Date: Fri, 09 Jun 2006 15:24:55 +0530 Subject: [Wtr-general] running multiple ie session with diff user id for same server Message-ID: <4489456F.503@reconnex.net> Hi, Is there any workaround or trick know to run multiple ie to the same server with different user ids? I need to run same test simultaneously but with different user credentials. But when I tried to do it expires one of the users session. Thanks and Regards, Manish From polleu at xpiece.com Fri Jun 9 06:42:05 2006 From: polleu at xpiece.com (polleu at xpiece.com) Date: Fri, 9 Jun 2006 12:42:05 +0200 (CEST) Subject: [Wtr-general] Test::Unit Reports? Message-ID: <20060609104205.A022B80DA5D@mail.tamergotchya.de> Hi there, I had the same problem. To fix it I import: require 'test/unit/testsuite' require 'test/unit/testsuite' require 'test/unit/ui/reporter' require 'fileutils' require 'test/unit/collector/objectspace' ..... In my setup file ( I have a setup file defined which is called by all test suit files I additionally require the following: require 'watir' require 'test/unit' require 'test/unit/ui/reporter' require 'test/unit/ui/console/testrunner' require 'stringio' require 'fileutils' require 'test/unit/assertions' require 'watir/testUnitAddons' and this seems to have fixed the error. Hope it helps. Ulrike On 08.06.2006 at 17:22, you wrote: > > Hi, > > Thanks for getting back to me. > > This is where I am with comments > > #require 'test/unit' #I was under the impression that this would > automatically import the two requires below > require 'test/unit/ui/reporter' > require 'test/unit/ui/console/testrunner' > require 'tc_1' > require 'tc_2' > > class TS_MyTests > suite = Test::Unit::TestSuite.new > > suite << TC_1.suite > suite << TC_2.suite > > #Dir.mkdir('build/report') #says file exists > require 'fileutils' > FileUtils.mkdir_p 'build/report' > > #I tried this: > #Reporter.new.run(suite, 'build/report') > #think it's trying to run the below method from this class > > Test::Unit::UI::Reporter.run(suite, 'build/report') > end > > > The problem I have is with this line: > > Test::Unit::UI::Reporter.run(suite, 'build/report') > > I am told it is an uninitialized constant > > Test::Unit::UI::Reporter::StringIO (NameError) > > Thanks > > Aidy > > > > --------------------------------------------------------------------------------------------------------------- > This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. > If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. > If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. > --------------------------------------------------------------------------------------------------------------- > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > From Adrian.Rutter at tnt.com Fri Jun 9 06:51:27 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Fri, 9 Jun 2006 11:51:27 +0100 Subject: [Wtr-general] Test::Unit Reports? In-Reply-To: <20060609104205.A022B80DA5D@mail.tamergotchya.de> Message-ID: polleu wrote > I had the same problem. Just this second, I was going to post back. I included this require 'stringio' (as someone did mention), and the code ran. code example: require 'test/unit' require 'test/unit/ui/reporter' require 'test/unit/ui/console/testrunner' require 'stringio' require 'tc_1' require 'tc_2' class TS_MyTests suite = Test::Unit::TestSuite.new suite << TC_1.suite suite << TC_2.suite require 'fileutils' FileUtils.mkdir_p 'build/report' Test::Unit::UI::Reporter.run(suite, '.\build\report') end I certainly like the style of the HTML reports. You can log to xml as well, so if I have some time, I'll write some XSLT so we can have a 'fuller' report. Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From zeljko.filipin at gmail.com Fri Jun 9 07:12:39 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Fri, 9 Jun 2006 13:12:39 +0200 Subject: [Wtr-general] WATIT with AJAX. In-Reply-To: <20060609003802.80248.qmail@web33512.mail.mud.yahoo.com> References: <20060609003802.80248.qmail@web33512.mail.mud.yahoo.com> Message-ID: http://wiki.openqa.org/display/WTR/Comparison+of+Watir+with+Silk+Test On 6/9/06, Prashanth Krishnamurthy wrote: > > > 2.Has anyone done any comparison amongst products like > QTP, SIlktest, WATIR etc. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/67ca5fe8/attachment.html From Lonny at TitanEZ.net Fri Jun 9 10:06:14 2006 From: Lonny at TitanEZ.net (Lonny Eachus) Date: Fri, 09 Jun 2006 07:06:14 -0700 Subject: [Wtr-general] Automation annoyingness In-Reply-To: References: Message-ID: <44898056.5080305@TitanEZ.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/43965d68/attachment.html From bret at pettichord.com Fri Jun 9 11:03:35 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 9 Jun 2006 10:03:35 -0500 Subject: [Wtr-general] Table Row Bug -- How to fix? Message-ID: > > inetdavid (6/8/2006 9:38:31 PM): Just found a problem with row_count with > embedded tables. row_count counts *all* the rows, even rows in sub-tables, > while show_tables shows the correct count because it uses a different > method. I've first added a test to show the problem (using table_test on > table(:index, 3) of table1.html) and I think I have the proper fix to just > show/add rows from within the current table. This is the right way to do > rows, but how do you want to make the change given that some folks may have > coded using the incorrect value? This is http://jira.openqa.org/browse/WTR-26 My view is that we should do the right thing. This has been a common complaint and i don't think there is really much value in trying to retain the old, incorrect behavior. Is anyone depending on it? Comments? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/e01973cc/attachment.html From dara.lillis at kiodex.com Fri Jun 9 11:30:51 2006 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Fri, 9 Jun 2006 08:30:51 -0700 Subject: [Wtr-general] RPC Server unavailable Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95ABD7@ehost011-27.exch011.intermedia.net> Sorry, been meaning to reply on this, I don't think this method exists in my version of watir (1.5.1.1017) attempting to call the method results in "undefined method `persist_ole_connection' for # (NoMethodError)" A search on the contents of all files in my "c:\ruby" directory returned no instances of "persist_ole_connection" I solved my problem by adding "sleep 2" before calling IE.new. I don't open new IE windows so frequently during testing that this is a performance problem for me. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Thursday, June 01, 2006 12:10 PM "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. Good question. Option 3 was causing problems when it was enabled by default, so i turned it off. You can turn it back on with Watir::IE.persist_ole_connection = true This is an as yet undocumented feature. Please let us know whether this helps. Or whether it creates other problems. I wish i remember the exact problems that lead me to turn it off. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/cdafce4b/attachment.html From stuporglue at gmail.com Fri Jun 9 11:55:31 2006 From: stuporglue at gmail.com (Michael Moore) Date: Fri, 9 Jun 2006 09:55:31 -0600 Subject: [Wtr-general] Table Row Bug -- How to fix? In-Reply-To: References: Message-ID: > > inetdavid (6/8/2006 9:38:31 PM): Just found a problem with row_count with > embedded tables. row_count counts *all* the rows, even rows in sub-tables, > while show_tables shows the correct count because it uses a different > method. I've first added a test to show the problem (using table_test on > My view is that we should do the right thing. This has been a common > complaint and i don't think there is really much value in trying to retain > the old, incorrect behavior. Is anyone depending on it? I can't see the value in it either. :-) The real problem I see with the current behavior, is that table.row_count returns a number of rows not accessable via table[row][column]. If it were possible to get at the rows via table[row], I'd chalk it up to an interesting design decision, but as it is, the number returned isn't very usefull in the generic case. It may be possible to work arround/with it in specific cases, but it would be easier if row_count, and table[row] access were at least consistant. Each time I install Watir, I go and make the fix myself. It would be very nice not to have to do that. Currently I'm the only tester using my test scripts, but once others here are using them, I'd rather not have to have them edit watir.rb to get expected behavior. Thanks, -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. From lonny at titanez.net Fri Jun 9 12:27:25 2006 From: lonny at titanez.net (Lonny Eachus) Date: Fri, 09 Jun 2006 09:27:25 -0700 Subject: [Wtr-general] Wtr-general Digest, Vol 31, Issue 20 In-Reply-To: References: Message-ID: <4489A16D.2010304@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/17d8b69a/attachment.html From lonny at titanez.net Fri Jun 9 12:30:52 2006 From: lonny at titanez.net (Lonny Eachus) Date: Fri, 09 Jun 2006 09:30:52 -0700 Subject: [Wtr-general] Subject:, running multiple ie session with diff user id for same server In-Reply-To: References: Message-ID: <4489A23C.5040807@titanez.net> I apologize again. My reply was intended for Manish, with this subject line. Lonny Eachus ========== From bret at pettichord.com Fri Jun 9 13:19:32 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 9 Jun 2006 12:19:32 -0500 Subject: [Wtr-general] Wtr-general Digest, Vol 31, Issue 20 In-Reply-To: <4489A16D.2010304@titanez.net> References: <4489A16D.2010304@titanez.net> Message-ID: Actually this is a common question. The solution is in the FAQ. http://wiki.openqa.org/display/wtr/FAQ#FAQ-concurrentie On 6/9/06, Lonny Eachus wrote: > > There are ways to do this but the specifics depends on what exactly it is > you are trying to do, your local network setup, and on what the server > defines as a "session". Depending on things at the server end, a "session" > might be one user on one IP on one browser (so you could run IE and Firefox > and have two different sessions), or just one user on one IP, or . . . it > varies. > > If you can assign a different IP to each "user", that should take care of > the problem. But you may not have that luxury. Tell me more about what you > are trying to do, and your local setup. > > Lonny Eachus > =========== > > Subject: > [Wtr-general] running multiple ie session with diff user id for same > server From: > Manish Sapariya Date: > Fri, 09 Jun 2006 15:24:55 +0530 > Hi, > Is there any workaround or trick know to run multiple > ie to the same server with different user ids? > > I need to run same test simultaneously but with different > user credentials. But when I tried to do it expires one > of the users session. > > Thanks and Regards, > Manish > > > > _______________________________________________ > 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/20060609/9ff2b7f2/attachment.html From bret at pettichord.com Fri Jun 9 13:30:03 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 9 Jun 2006 12:30:03 -0500 Subject: [Wtr-general] RPC Server unavailable In-Reply-To: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95ABD7@ehost011-27.exch011.intermedia.net> References: <35AF30C7B5EBFA4DBC854B5B9DF66B0E95ABD7@ehost011-27.exch011.intermedia.net> Message-ID: On 6/9/06, Lillis, Dara wrote: > > Sorry, been meaning to reply on this, I don't think this method exists in > my version of watir (1.5.1.1017) > > attempting to call the method results in "undefined method > `persist_ole_connection' for # (NoMethodError)" > > A search on the contents of all files in my "c:\ruby" directory returned > no instances of "persist_ole_connection" > This is a class method, not an instance method. So you DON'T do: ie = IE.new ie.persist_ole_connection = true But rather IE.persist_ole_connection = true If you search for "def self.persist_ole_connection" you should find it in your version of watir. > I solved my problem by adding "sleep 2" before calling IE.new. I don't > open new IE windows so frequently during testing that this is a performance > problem for me. > That works too. On my main development machine, it takes 90 seconds to start a new IE window after all of them have closed, whether i start it with Watir or manually. It's otherwise a fast machine. So i just make sure i never close that last IE window. BTW, i've recently committed an enhanced version of the the close windows code that many of you are using. require 'watir/close_all' IE.close_all # note: this is a class method Because i don't like to close all the windows, i also committed this: ie.close_others # note: this is an instance method Dara, Thanks for the update. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/92fc00a2/attachment.html From lonny at titanez.net Fri Jun 9 13:35:51 2006 From: lonny at titanez.net (Lonny Eachus) Date: Fri, 09 Jun 2006 10:35:51 -0700 Subject: [Wtr-general] running multiple ie session with diff user id for same server In-Reply-To: References: Message-ID: <4489B177.4070204@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/5010b43c/attachment.html From dara.lillis at kiodex.com Fri Jun 9 15:47:00 2006 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Fri, 9 Jun 2006 12:47:00 -0700 Subject: [Wtr-general] RPC Server unavailable Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0EA0D565@ehost011-27.exch011.intermedia.net> I actually had tried IE.persist_ole_connection = true as well. it didn't work either. Slightly different error message, but the same general idea: "undefined method `persist_ole_connection=' for Watir::IE:Class (NoMethodError)" here is the code I ran to generate the above error message: require_gem 'watir', "1.5.1.1017" include Watir IE.persist_ole_connection = true is there another require required? ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord This is a class method, not an instance method. So you DON'T do: ie = IE.new ie.persist_ole_connection = true But rather IE.persist_ole_connection = true If you search for "def self.persist_ole_connection" you should find it in your version of watir. I solved my problem by adding "sleep 2" before calling IE.new. I don't open new IE windows so frequently during testing that this is a performance problem for me. That works too. On my main development machine, it takes 90 seconds to start a new IE window after all of them have closed, whether i start it with Watir or manually. It's otherwise a fast machine. So i just make sure i never close that last IE window. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/87c4e2d1/attachment.html From lonny at titanez.net Fri Jun 9 16:25:56 2006 From: lonny at titanez.net (Lonny Eachus) Date: Fri, 09 Jun 2006 13:25:56 -0700 Subject: [Wtr-general] running multiple ie session with diff user id for same server In-Reply-To: References: Message-ID: <4489D954.3040609@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/3400abcd/attachment.html From lonny at titanez.net Fri Jun 9 16:38:01 2006 From: lonny at titanez.net (Lonny Eachus) Date: Fri, 09 Jun 2006 13:38:01 -0700 Subject: [Wtr-general] running multiple ie session with diff user id for same server In-Reply-To: References: Message-ID: <4489DC29.4090606@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/4a9a2801/attachment.html From jfry at lyris.com Fri Jun 9 16:56:52 2006 From: jfry at lyris.com (Jeff Fry) Date: Fri, 09 Jun 2006 13:56:52 -0700 Subject: [Wtr-general] Automation annoyingness In-Reply-To: References: <44885713.6080700@titanez.net> <4488C838.5060209@lyris.com> Message-ID: <4489E094.3060304@lyris.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/b45d4241/attachment.html From davids at tower-mt.com Fri Jun 9 17:03:27 2006 From: davids at tower-mt.com (David Schmidt) Date: Fri, 09 Jun 2006 14:03:27 -0700 Subject: [Wtr-general] Table Row Bug -- How to fix? In-Reply-To: References: Message-ID: <4489E21F.2050900@tower-mt.com> Bret Pettichord wrote: > > inetdavid (6/8/2006 9:38:31 PM): Just found a problem with > row_count with embedded tables. row_count counts *all* the rows, > even rows in sub-tables, while show_tables shows the correct count > because it uses a different method. I've first added a test to > show the problem (using table_test on table(:index, 3) of > table1.html) and I think I have the proper fix to just show/add > rows from within the current table. This is the right way to do > rows, but how do you want to make the change given that some folks > may have coded using the incorrect value? > > > This is http://jira.openqa.org/browse/WTR-26 > > My view is that we should do the right thing. This has been a common > complaint and i don't think there is really much value in trying to > retain the old, incorrect behavior. Is anyone depending on it? > > Comments? I agree, but wanted to check with you before fixing the problem and possibly breaking some existing script. However, I think it's more likely that Watir users have just learned to not trust row_count rather than depend on it's results where it may be in-accurate. To demonstrate the problem you can load one of the unittest html files that contains a nested table (unittests\html\table1.html). On that page table 4 is a sub-table of table 3, located in row 2, cell 1 of table 3. Table 3 has two rows and table 4 has 1 row, which is properly shown in a show_tables: irb(main):004:0> ie.show_tables Found 6 tables 1 id= rows=2 columns=2 2 id=t1 rows=5 columns=1 3 id=t2 rows=2 columns=2 <== 4 id= rows=1 columns=2 <== 5 id=body_test rows=5 columns=1 6 id=pic_table rows=1 columns=4 => nil The row_count for table 3 is not accurate though as it includes one row which is really inside table 4. (The row_count for all other tables is correct.) irb(main):005:0> ie.table(:index, 3).row_count => 3 irb(main):006:0> ie.table(:index, 4).row_count => 1 The to_a method has the same problem. You see the embedded table's values in multiple places, and the last array element is really an array from the embedded table. irb(main):007:0> ie.table(:index, 3).to_a => [["cell 1", "cell2"], ["nest1nest2", "nest1", "nest2", "Normal"], ["nest1", " nest2"]] irb(main):008:0> ie.table(:index, 4).to_a => [["nest1", "nest2"]] irb(main):009:0> The reason for the different counts became apparent when I looked at the DOM calls available that are being used. Using nested tables as an example, there is a "rows" call for tables, and that "rows" element has only two calls available: irb(main):017:0> ie.table(:index, 3).document.rows.ole_get_methods.sort => [_newEnum, length] This is the method used in show_tables, which is always accurate and gives you a count of how many rows are in the table. However, the method used within Watir to get all rows is getElementsByTagName, which returns *all* objects with a given tag below the current element. If you examine the DHTML Reference document for the TABLE Element (http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/table.asp) you can see that the "rows" method returns a collection of "tr" elements for the current table: irb(main):034:0> ie.table(:index, 3).document.rows.each do |row| irb(main):035:1* print "\nNew row:" irb(main):036:1> puts row.outerHTML irb(main):037:1> end New row: New row: => nil This works as it should. We can now re-code the Table#to_a method to properly iterate only over the proper rows. However, the getElementsByTagName method is called from many different places within Watir, and one of the places is Container#locate_tagged_element, which uses getElementsByTagName for many different tag types. The problem with this is that while the same method is used to get ALL tags of a given type, each DOM element has it's own *specfic* method to return the collection of specific child nodes (like "rows" for table rows, "cells" for table cells, etc). I think we'll have to look at each of those calls to getElementsByTagName to see if the call is appropriate, and re-code each if not. (The "show" methods can still use the getElementsByTagName because they can then show all sub-elements of the desired type, like the ie.show_tables method.) I think the first step will be to create unit tests to show each of the problems and then put in the code to fix each of the count problems till all the unit tests pass. Bret, do you want me to start on this? David From bret at pettichord.com Fri Jun 9 17:07:28 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 9 Jun 2006 16:07:28 -0500 Subject: [Wtr-general] RPC Server unavailable In-Reply-To: <35AF30C7B5EBFA4DBC854B5B9DF66B0EA0D565@ehost011-27.exch011.intermedia.net> References: <35AF30C7B5EBFA4DBC854B5B9DF66B0EA0D565@ehost011-27.exch011.intermedia.net> Message-ID: > > require_gem 'watir', "1.5.1.1017" > include Watir > > IE.persist_ole_connection = true > > is there another require required? > There is a typo in the Watir code. In 1.5.1.1017. it is actually IE.persist_ole_connect = true I will be fixing this momentarily. It really should be IE.persist_ole_connection. This is a good reason to start building the rdocs again! Thanks for your persistence. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/51460f81/attachment.html From jeff.darklight at gmail.com Fri Jun 9 17:13:11 2006 From: jeff.darklight at gmail.com (Jeff Wood) Date: Fri, 9 Jun 2006 14:13:11 -0700 Subject: [Wtr-general] Automation annoyingness In-Reply-To: <4489E094.3060304@lyris.com> References: <44885713.6080700@titanez.net> <4488C838.5060209@lyris.com> <4489E094.3060304@lyris.com> Message-ID: I've seen example code like this on the ruby talk list ... I just sent an email there this morning to see if somebody would dredge it back up for me... The syntax isn't very had to do ... I'll post here once I've got something easily transferrable for ya. Things are still ok here in my world too ... remember you're still always welcome to ask whatever you need of me. ;) --jw. On 6/9/06, Jeff Fry wrote: > > Hey Jeff, nice suggestion - very intuitive syntax (not that I would know > how to code it). > Hope you're enjoying yourself. Life is good here. > Jeff F > > Jeff Wood wrote: > From: wtr-general-bounces at rubyforge.org > Bcc: > Message-ID: > X-OriginalArrivalTime: 09 Jun 2006 06:35:36.0947 (UTC) > FILETIME=[EAEA2C30:01C68B8E] > Date: 8 Jun 2006 23:35:36 -0700 > > actually, I would code up a "when" functionality just like endfix if > or unless ... then you could do > > > ie.link( :text, "Second" ).click when ie.link( :text, "Second" ).exists? ... > or something like that. --jw. On 6/8/06, Jeff Fry wrote: > > Bret Pettichord wrote: > > Specifically, I propose that where you currently do this: > > while not ($ie.link(:text,"Second").exists?) > sleep 0.5 > end > $ie.link(:text,"Second").click > > > > > > You would instead just do this > > $ie.link(:text,"Second").click > > > > > > And you would implicitly get the polling behavior that had been explicit. > The proposal is to change all the element methods, except (perhaps) > "exists?". > > It seems to me that "exists?" is a separate case. We should consider it > separately. > > Do we have agreement on the usefulness of the proposal, if no change is > made to exists? > > Bret > My question is: Do we take anything useful away by making $ie.link always > do this? If we have a configurable default timeout that can be set to 0 I > think we're fine. > > Here's what I'd like to see: > 1) Add a global configurable default time to wait for pages to load. I'd > propose leaving this at 0 seconds by default and letting people up it > intentionally. > 2) Add a new optional argument on $ie.link, where I can choose to override > that default: > > $ie.link_wait(:text,"Second").click ## continues to > do what it's always done, unless I have deliberately changed my default page > wait. (Or if I've set my default page wait to (for example) 600 seconds, > it'll wait for up to 10 minutes on each page before giving up.) > > $ie.link(:text,"Second", 30).click ## would wait up to 30 seconds for > the page to load before erroring out, regardless of my default page wait > time. > > ...btw, I don't have a strong opinion on whether the default wait time > would be 0 or non-0. The question for me is which is least surprising > scenario: Someone who expects the script to error when a page doesn't return > quickly, or someone who expects the script to wait patiently while something > happens prior to page load. > > Jeff > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From bret at pettichord.com Fri Jun 9 17:16:23 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 9 Jun 2006 16:16:23 -0500 Subject: [Wtr-general] Table Row Bug -- How to fix? In-Reply-To: <4489E21F.2050900@tower-mt.com> References: <4489E21F.2050900@tower-mt.com> Message-ID: On 6/9/06, David Schmidt wrote: > > Bret, do you want me to start on this? Yes. I will reply to your design comments on the wtr-development list, which we created specifically to discuss these kinds of details. In addition to making sure that rows actually belong to their tables, we also will want to make sure that cells (TD) belong to their rows. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/1c7b005d/attachment.html From bret at pettichord.com Fri Jun 9 17:23:43 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 9 Jun 2006 16:23:43 -0500 Subject: [Wtr-general] Watir Automator Needed Message-ID: My company may have some contract work for someone with Watir experience. If you might be interested, please send me (off list) a summary of your credentials, including your experience with Watir and other test automation tools. Ideally, you are located in Austin or Houston, but elsewhere (anywhere) is also possible. Bret QA Manager, DataCert, Inc, Houston, Texas, USA -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/80661cf5/attachment.html From nijon at ca.ibm.com Fri Jun 9 17:58:01 2006 From: nijon at ca.ibm.com (Jonathan Ni) Date: Fri, 9 Jun 2006 17:58:01 -0400 Subject: [Wtr-general] Watir 1.5 getOLEObject method problem In-Reply-To: Message-ID: Hi All: I have little problem with release 1.5 getOLEObject method. I found the problem when I using checkboxes[1].getOLEObject. In 1.4 version, for the same code I am able to getting object and can perform some ole methods. But in 1.5 the getOLEObject method return me with nil. I am wondering is this a defect or just the way it works for the future. I am using some ole methods because I need to find parent object. For example, I can get to the checkbox from the frame level, but I need to go back to parent level, until I found the first row parent. Then I can search for the text in to row, which to determin the checkbox is the one I want. Maybe watir has this type of method to find parent object? If not, maybe it's good to have it. Please help. Thanks. Regards, Jonathan Ni -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/35e95215/attachment.html From bret at pettichord.com Fri Jun 9 18:03:04 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 9 Jun 2006 17:03:04 -0500 Subject: [Wtr-general] Watir 1.5 getOLEObject method problem In-Reply-To: References: Message-ID: getOLEObject was renamed to ole_object in 1.5. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060609/8f13dcc0/attachment.html From manishs at reconnex.net Mon Jun 12 03:50:57 2006 From: manishs at reconnex.net (Manish Sapariya) Date: Mon, 12 Jun 2006 13:20:57 +0530 Subject: [Wtr-general] Confused with clicking on elements in div in tables Message-ID: <448D1CE1.1000500@reconnex.net> Hi, Attached is an html with which I faced problem. ---------- $ie.frame("mainFrame").table(:id, /tblMain/i).cells[1].div(:text, "Add New Alias").exists? true $ie.frame("mainFrame").table(:id, /tblMain/i).cells[1].div(:text, "Add New Alias").click --------- exists return true, but when I click on that element it fails to click. However ----------- $ie.frame("mainFrame").table(:id, /tblMain/i).cells[1].div(:id, 'nitemlist').div(:text, "Add New Alias").exists? true $ie.frame("mainFrame").table(:id, /tblMain/i).cells[1].div(:id, 'nitemlist').div(:text, "Add New Alias").click ----------- works just fine. Can somebody please throw some light. Also, what would have been better way to click on the "Add New Alias" link. Thanks, Manish -------------- next part -------------- A non-text attachment was scrubbed... Name: abc.xml Type: text/xml Size: 4235 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060612/4035ee1f/attachment.xml From manishs at reconnex.net Mon Jun 12 04:45:02 2006 From: manishs at reconnex.net (Manish Sapariya) Date: Mon, 12 Jun 2006 14:15:02 +0530 Subject: [Wtr-general] watir and html source does not concur Message-ID: <448D298E.9090605@reconnex.net> Hi, Here is one more html. ---------- $ie.frame("mainFrame").table(:id, /tblMain/i).cells.each { |l| if l.text_field(:name, "hostName").exists? then puts "Flashing input box\n" l.text_field(:name, "hostName").flash end } Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box 0 --------- irb says it found the field five times, but the html source has it listed only once. It however flashesh the same input field. Can somebody explain. Thanks, Manish -------------- next part -------------- A non-text attachment was scrubbed... Name: editalias.xml Type: text/xml Size: 20727 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060612/0af89b43/attachment.xml From manishs at reconnex.net Mon Jun 12 04:55:49 2006 From: manishs at reconnex.net (Manish Sapariya) Date: Mon, 12 Jun 2006 14:25:49 +0530 Subject: [Wtr-general] watir and html source does not concur In-Reply-To: <448D298E.9090605@reconnex.net> References: <448D298E.9090605@reconnex.net> Message-ID: <448D2C15.9040900@reconnex.net> And following give me the same element being flashed 21 times??? ------- $ie.frame("mainFrame").tables.length 14 for i in 1..14 $ie.frame("mainFrame").tables[i].cells.each { |l| if l.select_list(:name, "SELECT_ALIAS_ITEM_TYPE").exists? then puts "Flashing input box\n" l.select_list(:name, "SELECT_ALIAS_ITEM_TYPE").flash end } end Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box Flashing input box 1..14 Regards, Manish From manishs at reconnex.net Mon Jun 12 05:12:31 2006 From: manishs at reconnex.net (Manish Sapariya) Date: Mon, 12 Jun 2006 14:42:31 +0530 Subject: [Wtr-general] watir and html source does not concur In-Reply-To: <448D298E.9090605@reconnex.net> References: <448D298E.9090605@reconnex.net> Message-ID: <448D2FFF.2060207@reconnex.net> Hi, One more question related to this html. How do I distinguish between the two "Add" buttons? Thanks, Manish Manish Sapariya wrote: > Hi, > Here is one more html. > > ---------- > $ie.frame("mainFrame").table(:id, /tblMain/i).cells.each { |l| > if l.text_field(:name, "hostName").exists? then > puts "Flashing input box\n" > l.text_field(:name, "hostName").flash > end > } > Flashing input box > Flashing input box > Flashing input box > Flashing input box > Flashing input box > 0 > --------- > > irb says it found the field five times, but the html source has it listed > only once. It however flashesh the same input field. > > Can somebody explain. > Thanks, > Manish > > ------------------------------------------------------------------------ > > > > > > > > iManager > > > > > > > > > > > > > > > > > > > > > > > > >
>
  Alias Groups
> > > >
>
>
SunMonTueWedThuFriSat
123
4567 wrote: > Using WATIR I am having problem to create a document that includes the > calendar function. > > How can I drive a java script to execute the calendar function, where > the text field can not be populated with the date and it's only allow > you to select a date by clicking on the calendar icon? > > Thank you, > > Elza > > > "This e-mail and any attachments may contain confidential and > privileged information. Any dissemination or use of the information by > a person other than the intended recipient is unauthorized and may be > illegal. If you are not the intended recipient, please notify the > sender immediately by return e-mail, delete this e-mail and destroy > any copies. Although this e-mail and any attachments are believed to > be free of any virus or other defect that might affect any computer > system into which it is received and opened, it is the responsibility > of the recipient to ensure that it is virus free and no responsibility > is accepted by the Board of Trade of the City of New York, Inc. or the > New York Clearing Corporation for any loss or damage arising in any > way from its use. Thank you." > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general __________________________________________________ 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 The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Thu Jun 1 12:39:41 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 1 Jun 2006 11:39:41 -0500 Subject: [Wtr-general] Methods that can be used within a frame? In-Reply-To: References: <447DE6B1.90209@tower-mt.com> Message-ID: On 6/1/06, Tyler Prete wrote: > > Well I may not even have to deal with it anymore, but how would I change > this manually? I do not have control over the HTML in the page, I am only > interacting with it via Watir. > By design, Watir is a tool for automating things that you can do manually. If you don't know how to do it manually, then Watir is probably the wrong tool for you. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060601/1538939a/attachment.html From bret at pettichord.com Thu Jun 1 12:48:10 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 1 Jun 2006 11:48:10 -0500 Subject: [Wtr-general] `method_missing': document (WIN32OLERuntimeError) In-Reply-To: <44740375.1030704@reconnex.net> References: <44740375.1030704@reconnex.net> Message-ID: Please send HTML page and code. On 5/24/06, Manish Sapariya wrote: > > Is this one known? > I searched through the archive and could not find anything similar to > this. > I saw this only first time, and I am not sure whether I will see this > again with the same script. > Please let me know if HTML page or code will help isolate this problem. > > Thanks and Regards, > Manish > > > c:/program > files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.1005/./watir.rb:2447:in > `method_missing': document > (WIN32OLERuntimeError) > OLE error code:80070005 in > Access is denied. > > > HRESULT error code:0x80020009 > Exception occurred. from c:/program > files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.1005/./watir.rb:2447:in > `document' > from c:/program > files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.1005/./watir.rb:1059:in > `check_for_http_error' > from c:/program > files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.1005/./watir.rb:205 > from c:/program > files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.1005/./watir.rb:203:in > `upto' > from c:/program > files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.1005/./watir.rb:203 > from c:/program > files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.1005/./watir.rb:201:in > `call' > from c:/program > files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.1005/./watir.rb:1558:in > `run_error_checks' > from c:/program > files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.1005/./watir.rb:1557:in > `each' > ... 6 levels... > from riGuardSelfTest_2_2_1.rb:374:in `CreateAndScheduleFTPSearch' > from riGuardSelfTest_2_2_1.rb:371:in `each' > from riGuardSelfTest_2_2_1.rb:371:in `CreateAndScheduleFTPSearch' > from riGuardSelfTest_2_2_1.rb:759 > _______________________________________________ > 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/20060601/287b21c3/attachment.html From rodrigo.martin at enratio.com Thu Jun 1 13:41:47 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Thu, 1 Jun 2006 14:41:47 -0300 Subject: [Wtr-general] [question] Setting timeout for a ie.wait method? Message-ID: Hello Everybody! I was wondering if there's a way of setting the timeout parameter for the .wait method... I mean, let's say that a page doesn't load in 10 seconds. Could I trap that the .wait method failed after 10 seconds in order to log that? I'm doing this because I need to test if a page has been loaded correctly after clicking a link, maybe there's a easier form of checking this.. Thanks in Advance! Rodrigo Julian Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060601/31c4204d/attachment.html From christopher.mcmahon at gmail.com Thu Jun 1 13:51:53 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 1 Jun 2006 10:51:53 -0700 Subject: [Wtr-general] [question] Setting timeout for a ie.wait method? In-Reply-To: References: Message-ID: <72799cd70606011051k79c9c2aak6a174bfaedde7a8@mail.gmail.com> > I'm doing this because I need to test if a page has been loaded correctly > after clicking a link, maybe there's a easier form of checking this.. > def wait_for_page(seconds) begin @ie.link(:text,"My Incredibly Important Link").click do_the_next_thing_method rescue sleep 1 seconds = seconds + 1 if seconds == 10 puts "waited over 10 seconds for Incredibly Important Link, tried 10 times, exiting" exit end wait_for_page(seconds) #CALL THE SAME METHOD AGAIN end I haven't tested it but it should be OK. -Chris From bret at pettichord.com Thu Jun 1 14:10:05 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 1 Jun 2006 13:10:05 -0500 Subject: [Wtr-general] [question] Setting timeout for a ie.wait method? In-Reply-To: References: Message-ID: On 6/1/06, Rodrigo Julian Martin wrote: > > I was wondering if there's a way of setting the timeout parameter for the > .wait method? I mean, let's say that a page doesn't load in 10 seconds. > Could I trap that the .wait method failed after 10 seconds in order to log > that? > I'm doing this because I need to test if a page has been loaded correctly > after clicking a link, maybe there's a easier form of checking this.. > If all you want to do is verify how long it took to load a page, you can do this: ie.link(:name, "foo").click assert(ie.down_load_time < 10) I have actually been thinking of adding a timeout to the wait method, but i'm not sure your situation really needs it. Bret P.S. I have my doubts about McMahon's suggestion. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060601/3ca50b9e/attachment.html From christopher.mcmahon at gmail.com Thu Jun 1 14:20:55 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 1 Jun 2006 11:20:55 -0700 Subject: [Wtr-general] [question] Setting timeout for a ie.wait method? In-Reply-To: References: Message-ID: <72799cd70606011120y76857381s9d409db9e6e91459@mail.gmail.com> > P.S. I have my doubts about McMahon's suggestion. :) I'm doing something very similar to this in my current Watir scripts right now, except I haven't put in the max-retries logic yet. -Chris From bret at pettichord.com Thu Jun 1 14:49:44 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 1 Jun 2006 13:49:44 -0500 Subject: [Wtr-general] [question] Setting timeout for a ie.wait method? In-Reply-To: <72799cd70606011120y76857381s9d409db9e6e91459@mail.gmail.com> References: <72799cd70606011120y76857381s9d409db9e6e91459@mail.gmail.com> Message-ID: The problem is that link().click won't return until the page is loaded. Maybe you meant to use link().ole_object.click instead? Bret On 6/1/06, Chris McMahon wrote: > > > P.S. I have my doubts about McMahon's suggestion. > > :) > I'm doing something very similar to this in my current Watir scripts > right now, except I haven't put in the max-retries logic yet. > -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/20060601/26cb9da7/attachment.html From christopher.mcmahon at gmail.com Thu Jun 1 14:55:38 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 1 Jun 2006 11:55:38 -0700 Subject: [Wtr-general] [question] Setting timeout for a ie.wait method? In-Reply-To: References: <72799cd70606011120y76857381s9d409db9e6e91459@mail.gmail.com> Message-ID: <72799cd70606011155x5a277255q2a7ebbca4a711a38@mail.gmail.com> On 6/1/06, Bret Pettichord wrote: > The problem is that link().click won't return until the page is loaded. > Maybe you meant to use link().ole_object.click instead? > Ah, you're right, I misunderstood the original question. Rodrigo, in my case, I have interim pages that show messages to the user before the page I need to manipulate arrives. Also, I have pages that have frames, and the frames take longer to load than the outer page does. So I've written these little looping checkers that don't do the next action until the right part of the page is in place. If that's your issue, then my code will work well for you. If you have simple pages that just don't load, then another approach is in order. -Chris From johnc at testdev.net Thu Jun 1 15:22:51 2006 From: johnc at testdev.net (John Castellucci) Date: Thu, 1 Jun 2006 12:22:51 -0700 Subject: [Wtr-general] [question] Setting timeout for a ie.wait method? In-Reply-To: Message-ID: <129501c685b0$c75e1d50$c802a8c0@lewis> I had a similar requirement and addressed it by adding my methods to the Element class. This may not be the best solution, but it worked for me. module Watir class Element def click_wait(how_long = 30) wait_for(how_long) click end def wait_for(how_long=30) 0.upto(how_long-1) do |n| if exists? if enabled? puts "Waited #{n} sec for #{self.class}(:#{@how}, #{@what})" if n > 0 return end end sleep 1 end raise ("#{self.class}(:#{@how}, #{@what}) not found after #{how_long} sec") if ! exists? raise ("#{self.class}(:#{@how}, #{@what}) not enabled after #{how_long} sec") end end end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060601/eed323e9/attachment.html From rodrigo.martin at enratio.com Thu Jun 1 16:22:41 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Thu, 1 Jun 2006 17:22:41 -0300 Subject: [Wtr-general] [question] Setting timeout for a ie.wait method? Message-ID: Thanks for all your replies... The Chris McMahon answer doesn't fit exactly with what I'm trying to do, but maybe is a good approach... Bret, with the assert sentence, can I say something like... If assert fails, do some code? John, I can't understand your code, I guess I'm too newbie to OO programming...Are you waiting always for 30 seconds? Could this be parametrized too? Thanks again to all of you! ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Jueves, 01 de Junio de 2006 03:50 p.m. To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] [question] Setting timeout for a ie.wait method? The problem is that link().click won't return until the page is loaded. Maybe you meant to use link().ole_object.click instead? Bret On 6/1/06, Chris McMahon wrote: > P.S. I have my doubts about McMahon's suggestion. :) I'm doing something very similar to this in my current Watir scripts right now, except I haven't put in the max-retries logic yet. -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/20060601/9c2bd723/attachment.html From davids at tower-mt.com Thu Jun 1 16:23:04 2006 From: davids at tower-mt.com (David Schmidt) Date: Thu, 01 Jun 2006 13:23:04 -0700 Subject: [Wtr-general] Methods that can be used within a frame? In-Reply-To: References: <447DE6B1.90209@tower-mt.com> Message-ID: <447F4CA8.6090703@tower-mt.com> Tyler, What I've done in the past is to create a new method, Element#html= which allows you to replace the outerHTML for any element: class Watir::Element def html=(new_html) assert_exists @o.outerHTML = new_html end end Unfortunately, when playing with your top level document that contains the frameset there wasn't any Watir::Element I could grab. I tried doing it manually by taking different document elements on that top page and trying to do the change like: ie.document.body.outerhtml = "test" Even though e.document.body.ole_put_methods shows that we should be able to do this (an outerHTML put call exists) when tried I got the following error: irb(main):029:0> ie.document.body.outerhtml = "test" WIN32OLERuntimeError: OLE error code:800A0258 in htmlfile HRESULT error code:0x80020009 Exception occurred. from (irb):29:in `method_missing' from (irb):29 So in Tyler's case, I was unable to find a way to change the frame element in his top HTML. However, I often use this replacement technique to prevent popups by changing the HTML attributes like this: ie.text_field(:id, 'xxx').html = ie.text_field(:id, 'xxx').html.sub(/ onclick=\S+/, '') which clears out the onclick=... from the element. David Bret Pettichord wrote: > On 6/1/06, *Tyler Prete* > wrote: > > Well I may not even have to deal with it anymore, but how would I > change this manually? I do not have control over the HTML in the > page, I am only interacting with it via Watir. > > > By design, Watir is a tool for automating things that you can do > manually. If you don't know how to do it manually, then Watir is > probably the wrong tool for you. > > Bret > > ------------------------------------------------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From davids at tower-mt.com Thu Jun 1 16:23:14 2006 From: davids at tower-mt.com (David Schmidt) Date: Thu, 01 Jun 2006 13:23:14 -0700 Subject: [Wtr-general] Determine HTML property In-Reply-To: References: Message-ID: <447F4CB2.6070902@tower-mt.com> Zeljko Filipin wrote: > ie.radio(:id, "id").readonly? > > On 6/1/06, *Adrian Rutter* > wrote: > > > Hi, > > I have an HTML field that once saved becomes read-only > [readonly="true"]. > Apart from doing a regex on the source how can I determine this > property? > > Cheers > > Aidy > I've just encountered a situation where this doesn't work, and written a fix for it, though I'm not sure where this fix would best be integrated. The problem is that while an input element may NOT be read only, a containing element like a table cell, table row or div may have their visibility turned off, which prevents Watir from setting the focus on the input element and effectively makes the input element read only even though the readonly attribute is false: irb(main):014:0> ie.text_field(:id, 'Detail_Date').readonly? => false irb(main):015:0> ie.text_field(:id, 'Detail_Date').set('01/01/2000') WIN32OLERuntimeError: focus OLE error code:800A083E in htmlfile Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus. HRESULT error code:0x80020009 Exception occurred. from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.1010/./watir.rb:3871:in `method_missing' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.1010/./watir.rb:3871:in `set' from (irb):15 In this case, a TR element a few levels higher has a style of "visibility: hidden; display: none" so the control is invisible and thus read only. I see a few solutions. The first would be to try to update the input element and then rescue the WIN32OLERuntimeError exception. I'm not particularly fond of this, especially since the exception isn't an exception specific to this problem. Another option is to iterate up the DOM elements checking every element to make sure that is is visible. This could be done in Element#readonly?, but then we wouldn't be able to see the value of the actual readonly attribute. I chose to implement another method which I called "writable?" which first checks that the element exists, is enabled and not readonly and then moves up the DOM tree and reports false if any element is not visible (visibility != 'hidden' and display != 'none'). I've tested this and while it can be slow if the input element is deeply embedded it *does* seem to be accurate: irb(main):016:0> ie.text_field(:id, 'Detail_Date').writable? => false irb(main):017:0> ie.text_field(:id, 'Detail_DOB').writable? => true You can try this by adding the following method in your Watir script or by adding just the writable? definition inside class Element in Watir.rb. I can add this to trunk once I get some tests written to test it if we decide this is the way to go. Does anyone have a cleaner or faster way to do this? module Watir class Element # Determine if we can write to a DOM element. # If any parent element isn't visible then we cannot write to the # element. The only realiable way to determine this is to iterate # up the DOM elemint tree checking every element to make sure it's # visible. def writable? assert_exists # First make sure the element itself is writable begin assert_enabled assert_not_readonly rescue Watir::Exception::ObjectDisabledException, Watir::Exception::ObjectReadOnlyException return false end return false if ! document.iscontentEditable # Now iterate up the DOM element tree and return false if any # parent element isn't visible or is disabled. object = document while object begin if object.style.invoke('visibility') =~ /^hidden$/i return false end if object.style.invoke('display') =~ /^none$/i return false end if object.invoke('isDisabled') return false end rescue WIN32OLERuntimeError end object += '.parentElement' end true end end end From psyonic at gmail.com Thu Jun 1 16:33:47 2006 From: psyonic at gmail.com (Tyler Prete) Date: Thu, 1 Jun 2006 14:33:47 -0600 Subject: [Wtr-general] Methods that can be used within a frame? In-Reply-To: References: <447DE6B1.90209@tower-mt.com> Message-ID: Bret, I think we are having some syntactic problems. I CAN do it manually, by interacting with the page myself. I'll try and explain the situation since I can't actually give an example. I am working with a customer service app that has multiple frames, a search bar on the left, a customer frame in the top right, and an invoice frame in the top left. When a search is issued that can result in multiple people, a popup window is opened containing all the names of possible customers. When a name is selected, the customer frame is supposed to change to show that specific customer. When I go through the process myself, it works. However, when using watir, I can click on the link, but it does not load the customer info in the customer frame. I could not get it to work directly, so my idea was to take the link URL and load it manually in the frame, but apparently this is not possible, at least not at this time. Hopefully that helps clear things up. --Tyler On 6/1/06, Bret Pettichord wrote: > > On 6/1/06, Tyler Prete wrote: > > > Well I may not even have to deal with it anymore, but how would I change > > this manually? I do not have control over the HTML in the page, I am only > > interacting with it via Watir. > > > > By design, Watir is a tool for automating things that you can do manually. > If you don't know how to do it manually, then Watir is probably the wrong > tool for you. > > 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/20060601/5e84241a/attachment.html From bret at pettichord.com Thu Jun 1 16:47:32 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 1 Jun 2006 15:47:32 -0500 Subject: [Wtr-general] Methods that can be used within a frame? In-Reply-To: References: <447DE6B1.90209@tower-mt.com> Message-ID: On 6/1/06, Tyler Prete wrote: > > When I go through the process myself, it works. However, when using > watir, I can click on the link, but it does not load the customer info in > the customer frame. > This is the problem we should focus on. Can you provide more information? Are you getting an error message? Can you show us any code or html? -- feel free to sanitize. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060601/b5b64e09/attachment.html From Bill.Attebery at twtelecom.com Thu Jun 1 18:05:38 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Thu, 1 Jun 2006 16:05:38 -0600 Subject: [Wtr-general] How to create a script for calendar function? Message-ID: Try ie2.show_links to see all the links in the page and ie2.show_tables to see all the tables in the page Looking at the code snippet -- ie2.link(:text, '2').click should set the date to '2006-06-02' ie2.link(:id, ).click should set the date to '2006-06-02' Ie2.table(:index, 2)[2][6].click should set the date to '2006-06-02' ie2.table(:index, )[2][6].fireEvent('onclick') should also set the date to '2006-06-02' Also ie2.link(:text, '<<').click should move the year back ie2.link(:text, '>>').click should move the year forward ie2.link(:text, '>').click should move the month forward ie2.link(:text, 'Print').click should print (I assume) etc. Likewise ie2.table(:index, 1)[1][1].click will move the year back ie2.table(:index, 1)[1][1].fireEvent will move the year back etc. I recommend identifying the links by :text (simple to code and read) -- but there are many other ways to do the same thing. Hope this helps. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Danilova, Elza Sent: Thursday, June 01, 2006 10:34 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How to create a script for calendar function? Hi, Using the following: ie.link(:url,"javascript:show_calendar'resultsearch.gDate')").click ie2=Watir::IE.attach(:title, "Calendar") we were able to open the calendar icon, but could not go any further, because there is no object name on the calendar.html page: -----------Objects in page ------------- name= id= name= id= name= id= name= id= name= id= Calendar html: html> Calendar June 2006
[<<] [<] [Print] [>] [>>]

SunMonTueWedThuFriSat
123
4567
-----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Attebery, Bill Sent: Wednesday, May 31, 2006 6:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How to create a script for calendar function? Not sure if all calendar functions are created equal -- the one used at my site pops up another IE window -- I can attach to it and then drive it like always. ie.image(:id, 'my_calendar_icon').click @ie2=IE.attach(:title, /Select Date/) Now @ie2 is another browser instance with select_lists, links, buttons, etc. available to control through regular watir statements. @ie2.select_list(:name, 'cboMonth').select('Jun') @ie2.select_list(:name, 'cboYear').select('2006') @ie2.link(:text, '15').click -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of John Fitisoff Sent: Wednesday, May 31, 2006 3:28 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How to create a script for calendar function? If you aren't trying to do anything complicated - and the calendar control responds to keyboard input - you might want to try using the send_keys method to set the calendar control: ie.image(:id, "my_calendar_icon").click ie.send_keys("{UP}") ie.send_keys("{LEFT}") ie.send_keys("{ENTER}") The drawback is that this approach may not let you exercise all of the calendar control's functionality. But if you're just worried about setting a date it's probably enough to get you past the control without worrying about the Javascript. --- "Danilova, Elza" wrote: > Using WATIR I am having problem to create a document that includes the > calendar function. > > How can I drive a java script to execute the calendar function, where > the text field can not be populated with the date and it's only allow > you to select a date by clicking on the calendar icon? > > Thank you, > > Elza > > > "This e-mail and any attachments may contain confidential and > privileged information. Any dissemination or use of the information by > a person other than the intended recipient is unauthorized and may be > illegal. If you are not the intended recipient, please notify the > sender immediately by return e-mail, delete this e-mail and destroy > any copies. Although this e-mail and any attachments are believed to > be free of any virus or other defect that might affect any computer > system into which it is received and opened, it is the responsibility > of the recipient to ensure that it is virus free and no responsibility > is accepted by the Board of Trade of the City of New York, Inc. or the > New York Clearing Corporation for any loss or damage arising in any > way from its use. Thank you." > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general __________________________________________________ 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 The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. _______________________________________________ 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 content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. From Bill.Attebery at twtelecom.com Thu Jun 1 18:12:32 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Thu, 1 Jun 2006 16:12:32 -0600 Subject: [Wtr-general] How to create a script for calendar function? Message-ID: Oops -- typo 2nd example should be ie2.link(:index, 7).click should set the date to '2006-06-02' -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Attebery, Bill Sent: Thursday, June 01, 2006 4:06 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How to create a script for calendar function? Try ie2.show_links to see all the links in the page and ie2.show_tables to see all the tables in the page Looking at the code snippet -- ie2.link(:text, '2').click should set the date to '2006-06-02' ie2.link(:id, ).click should set the date to '2006-06-02' Ie2.table(:index, 2)[2][6].click should set the date to '2006-06-02' ie2.table(:index, )[2][6].fireEvent('onclick') should also set the date to '2006-06-02' Also ie2.link(:text, '<<').click should move the year back ie2.link(:text, '>>').click should move the year forward ie2.link(:text, '>').click should move the month forward ie2.link(:text, 'Print').click should print (I assume) etc. Likewise ie2.table(:index, 1)[1][1].click will move the year back ie2.table(:index, 1)[1][1].fireEvent will move the year back etc. I recommend identifying the links by :text (simple to code and read) -- but there are many other ways to do the same thing. Hope this helps. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Danilova, Elza Sent: Thursday, June 01, 2006 10:34 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How to create a script for calendar function? Hi, Using the following: ie.link(:url,"javascript:show_calendar'resultsearch.gDate')").click ie2=Watir::IE.attach(:title, "Calendar") we were able to open the calendar icon, but could not go any further, because there is no object name on the calendar.html page: -----------Objects in page ------------- name= id= name= id= name= id= name= id= name= id= Calendar html: html> Calendar June 2006
[<<] [<] [Print] [>] [>>]

SunMonTueWedThuFriSat
123
4567
-----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Attebery, Bill Sent: Wednesday, May 31, 2006 6:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How to create a script for calendar function? Not sure if all calendar functions are created equal -- the one used at my site pops up another IE window -- I can attach to it and then drive it like always. ie.image(:id, 'my_calendar_icon').click @ie2=IE.attach(:title, /Select Date/) Now @ie2 is another browser instance with select_lists, links, buttons, etc. available to control through regular watir statements. @ie2.select_list(:name, 'cboMonth').select('Jun') @ie2.select_list(:name, 'cboYear').select('2006') @ie2.link(:text, '15').click -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of John Fitisoff Sent: Wednesday, May 31, 2006 3:28 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How to create a script for calendar function? If you aren't trying to do anything complicated - and the calendar control responds to keyboard input - you might want to try using the send_keys method to set the calendar control: ie.image(:id, "my_calendar_icon").click ie.send_keys("{UP}") ie.send_keys("{LEFT}") ie.send_keys("{ENTER}") The drawback is that this approach may not let you exercise all of the calendar control's functionality. But if you're just worried about setting a date it's probably enough to get you past the control without worrying about the Javascript. --- "Danilova, Elza" wrote: > Using WATIR I am having problem to create a document that includes the > calendar function. > > How can I drive a java script to execute the calendar function, where > the text field can not be populated with the date and it's only allow > you to select a date by clicking on the calendar icon? > > Thank you, > > Elza > > > "This e-mail and any attachments may contain confidential and > privileged information. Any dissemination or use of the information by > a person other than the intended recipient is unauthorized and may be > illegal. If you are not the intended recipient, please notify the > sender immediately by return e-mail, delete this e-mail and destroy > any copies. Although this e-mail and any attachments are believed to > be free of any virus or other defect that might affect any computer > system into which it is received and opened, it is the responsibility > of the recipient to ensure that it is virus free and no responsibility > is accepted by the Board of Trade of the City of New York, Inc. or the > New York Clearing Corporation for any loss or damage arising in any > way from its use. Thank you." > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general __________________________________________________ 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 The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. _______________________________________________ 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 content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. From psyonic at gmail.com Thu Jun 1 18:35:08 2006 From: psyonic at gmail.com (Tyler Prete) Date: Thu, 1 Jun 2006 16:35:08 -0600 Subject: [Wtr-general] Methods that can be used within a frame? In-Reply-To: References: <447DE6B1.90209@tower-mt.com> Message-ID: I can't provide the full html because I don't have access to it, but here is the link I am trying to click from the popup:
8560113 I imagine part of the problem is related to the onclick javascript event, however I did try calling it seperately with no success. On 6/1/06, Bret Pettichord wrote: > > On 6/1/06, Tyler Prete wrote: > > > When I go through the process myself, it works. However, when using > > watir, I can click on the link, but it does not load the customer info in > > the customer frame. > > > > This is the problem we should focus on. Can you provide more information? > Are you getting an error message? Can you show us any code or html? -- feel > free to sanitize. > > > _______________________________________________ > 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/20060601/47e006bb/attachment.html From lonny at titanez.net Thu Jun 1 19:36:18 2006 From: lonny at titanez.net (Lonny Eachus) Date: Thu, 01 Jun 2006 16:36:18 -0700 Subject: [Wtr-general] How to create a script for calendar function? In-Reply-To: References: Message-ID: <447F79F2.4010508@titanez.net> *IF* (this is a big if, because I am not familiar with the calendar thing) the elements are in a predicable pattern on the page, then here is a possible avenue of approach: You could access the elements by index, and use the "html=" method of David's to give them names or IDs. Then access as usual . . . Lonny Eachus ========= > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Danilova, Elza > Sent: Thursday, June 01, 2006 10:34 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] How to create a script for calendar function? > > Hi, > > Using the following: > ie.link(:url,"javascript:show_calendar'resultsearch.gDate')").click > ie2=Watir::IE.attach(:title, "Calendar") we were able to open the > calendar icon, but could not go any further, because there is no object > name on the calendar.html page: > > -----------Objects in page ------------- > name= id= > name= id= > name= id= > name= id= > name= id= > > > Calendar html: > > > html> > Calendar > > FACE='Verdana' SIZE=2>June 2006
BORDER=1 CELLSPACING=0 CELLPADDING=0 BGCOLOR='#e0e0e0'>
ALIGN=center> [ HREF="javascript:window.opener.Build('resultsearch.gDate', '5', '2005', > 'MONTH DD, YYYY');"><<] [ HREF="javascript:window.opener.Build('resultsearch.gDate', '4', '2006', > 'MONTH DD, YYYY');"><] [ HREF="javascript:window.print();">Print] [ HREF="javascript:window.opener.Build('resultsearch.gDate', '6', '2006', > 'MONTH DD, YYYY');">>] [ HREF="javascript:window.opener.Build('resultsearch.gDate', '5', '2007', > 'MONTH DD, YYYY');">>>]

>
FACE='Verdana' COLOR='darkgreen'>Sun WIDTH='14%'> COLOR='darkgreen'>Mon FACE='Verdana' COLOR='darkgreen'>Tue WIDTH='14%'> COLOR='darkgreen'>Wed FACE='Verdana' COLOR='darkgreen'>Thu WIDTH='14%'> COLOR='darkgreen'>Fri FACE='Verdana' COLOR='darkgreen'>Sat
WIDTH='14%' BGCOLOR="#e0e0e0"> > > > > onClick="self.opener.document.resultsearch.gDate.value='2006-06-01';wind > ow.close();">1 WIDTH='14%'> onClick="self.opener.document.resultsearch.gDate.value='2006-06-02';wind > ow.close();">2 SIZE='2' FACE='Verdana'> onClick="self.opener.document.resultsearch.graDate.value='2006-06-03';wi > ndow.close();">3
BGCOLOR="#e0e0e0"> onClick="self.opener.document.resultsearch.gDate.value='2006-06-04';wind > ow.close();">4 FACE='Verdana'> onClick="self.opener.document.resultsearch.gDate.value='2006-06-05';wind > ow.close();">5 FACE='Verdana'> onClick="self.opener.document.resultsearch.gDate.value='2006-06-06';wind > ow.close();">6 FACE='Verdana'> onClick="self.opener.document.resultsearch.gDate.value='2006-06-07';wind > ow.close();">7
> > > From pkammit at gmail.com Fri Jun 2 12:02:50 2006 From: pkammit at gmail.com (Praveen Kumar Kammitta) Date: Fri, 2 Jun 2006 09:02:50 -0700 Subject: [Wtr-general] [question] Setting timeout for a ie.wait method? Message-ID: If you are looking to gather performance information, you might find the following article useful. Hope this helps. http://www.informit.com/articles/printerfriendly.asp?p=370634&rl=1 On 6/1/06, 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: [question] Setting timeout for a ie.wait method? > (Rodrigo Julian Martin) > 2. Re: Methods that can be used within a frame? (David Schmidt) > 3. Re: Determine HTML property (David Schmidt) > 4. Re: Methods that can be used within a frame? (Tyler Prete) > 5. Re: Methods that can be used within a frame? (Bret Pettichord) > 6. Re: How to create a script for calendar function? (Attebery, Bill) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 1 Jun 2006 17:22:41 -0300 > From: "Rodrigo Julian Martin" > Subject: Re: [Wtr-general] [question] Setting timeout for a ie.wait > method? > To: > Message-ID: > > Content-Type: text/plain; charset="us-ascii" > > Thanks for all your replies... > > > > The Chris McMahon answer doesn't fit exactly with what I'm trying to do, > but maybe is a good approach... > > > > Bret, with the assert sentence, can I say something like... If assert > fails, do some code? > > > > John, I can't understand your code, I guess I'm too newbie to OO > programming...Are you waiting always for 30 seconds? Could this be > parametrized too? > > > > Thanks again to all of you! > > > > > > ________________________________ > > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord > Sent: Jueves, 01 de Junio de 2006 03:50 p.m. > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] [question] Setting timeout for a ie.wait > method? > > > > The problem is that link().click won't return until the page is loaded. > Maybe you meant to use link().ole_object.click instead? > > Bret > > On 6/1/06, Chris McMahon wrote: > > > P.S. I have my doubts about McMahon's suggestion. > > :) > I'm doing something very similar to this in my current Watir scripts > right now, except I haven't put in the max-retries logic yet. > -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/20060601/9c2bd723/attachment-0001.htm > > ------------------------------ > > Message: 2 > Date: Thu, 01 Jun 2006 13:23:04 -0700 > From: David Schmidt > Subject: Re: [Wtr-general] Methods that can be used within a frame? > To: wtr-general at rubyforge.org > Message-ID: <447F4CA8.6090703 at tower-mt.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Tyler, > > What I've done in the past is to create a new method, Element#html= > which allows you to replace the outerHTML for any element: > > class Watir::Element > def html=(new_html) > assert_exists > @o.outerHTML = new_html > end > end > > Unfortunately, when playing with your top level document that contains > the frameset there wasn't any Watir::Element I could grab. I tried > doing it manually by taking different document elements on that top page > and trying to do the change like: > > ie.document.body.outerhtml = "test" > > Even though e.document.body.ole_put_methods shows that we should be able > to do this (an outerHTML put call exists) when tried I got the following > error: > > irb(main):029:0> ie.document.body.outerhtml = "test" > WIN32OLERuntimeError: > OLE error code:800A0258 in htmlfile > > HRESULT error code:0x80020009 > Exception occurred. > from (irb):29:in `method_missing' > from (irb):29 > > So in Tyler's case, I was unable to find a way to change the frame > element in his top HTML. However, I often use this replacement > technique to prevent popups by changing the HTML attributes like this: > > ie.text_field(:id, 'xxx').html = ie.text_field(:id, 'xxx').html.sub(/ > onclick=\S+/, '') > > which clears out the onclick=... from the element. > > David > > Bret Pettichord wrote: > > On 6/1/06, *Tyler Prete* > > wrote: > > > > Well I may not even have to deal with it anymore, but how would I > > change this manually? I do not have control over the HTML in the > > page, I am only interacting with it via Watir. > > > > > > By design, Watir is a tool for automating things that you can do > > manually. If you don't know how to do it manually, then Watir is > > probably the wrong tool for you. > > > > Bret > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > ------------------------------ > > Message: 3 > Date: Thu, 01 Jun 2006 13:23:14 -0700 > From: David Schmidt > Subject: Re: [Wtr-general] Determine HTML property > To: wtr-general at rubyforge.org, wtr-development at rubyforge.org > Message-ID: <447F4CB2.6070902 at tower-mt.com> > Content-Type: text/plain; charset=UTF-8; format=flowed > > Zeljko Filipin wrote: > > ie.radio(:id, "id").readonly? > > > > On 6/1/06, *Adrian Rutter* > > wrote: > > > > > > Hi, > > > > I have an HTML field that once saved becomes read-only > > [readonly="true"]. > > Apart from doing a regex on the source how can I determine this > > property? > > > > Cheers > > > > Aidy > > > I've just encountered a situation where this doesn't work, and written a > fix for it, though I'm not sure where this fix would best be integrated. > > The problem is that while an input element may NOT be read only, a > containing element like a table cell, table row or div may have their > visibility turned off, which prevents Watir from setting the focus on > the input element and effectively makes the input element read only even > though the readonly attribute is false: > > irb(main):014:0> ie.text_field(:id, 'Detail_Date').readonly? > => false > irb(main):015:0> ie.text_field(:id, 'Detail_Date').set('01/01/2000') > WIN32OLERuntimeError: focus > OLE error code:800A083E in htmlfile > Can't move focus to the control because it is invisible, not > enabled, or of a type that does not accept the focus. > HRESULT error code:0x80020009 > Exception occurred. > from > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.1010/./watir.rb:3871:in > `method_missing' > from > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.1010/./watir.rb:3871:in `set' > from (irb):15 > > In this case, a TR element a few levels higher has a style of > "visibility: hidden; display: none" so the control is invisible and thus > read only. > > I see a few solutions. The first would be to try to update the input > element and then rescue the WIN32OLERuntimeError exception. I'm not > particularly fond of this, especially since the exception isn't an > exception specific to this problem. Another option is to iterate up the > DOM elements checking every element to make sure that is is visible. > This could be done in > Element#readonly?, but then we wouldn't be able to see the value of the > actual readonly attribute. I chose to implement another method which I > called "writable?" which first checks that the element exists, is > enabled and not readonly and then moves up the DOM tree and reports > false if any element is not visible (visibility != 'hidden' and display > != 'none'). > > I've tested this and while it can be slow if the input element is deeply > embedded it *does* seem to be accurate: > > irb(main):016:0> ie.text_field(:id, 'Detail_Date').writable? > => false > irb(main):017:0> ie.text_field(:id, 'Detail_DOB').writable? > => true > > You can try this by adding the following method in your Watir script or > by adding just the writable? definition inside class Element in > Watir.rb. I can add this to trunk once I get some tests written to test > it if we decide this is the way to go. Does anyone have a cleaner or > faster way to do this? > > module Watir > class Element > # Determine if we can write to a DOM element. > # If any parent element isn't visible then we cannot write to the > # element. The only realiable way to determine this is to iterate > # up the DOM elemint tree checking every element to make sure it's > # visible. > def writable? > assert_exists > # First make sure the element itself is writable > begin > assert_enabled > assert_not_readonly > rescue Watir::Exception::ObjectDisabledException, > Watir::Exception::ObjectReadOnlyException > return false > end > return false if ! document.iscontentEditable > > # Now iterate up the DOM element tree and return false if any > # parent element isn't visible or is disabled. > object = document > while object > begin > if object.style.invoke('visibility') =~ /^hidden$/i > return false > end > if object.style.invoke('display') =~ /^none$/i > return false > end > if object.invoke('isDisabled') > return false > end > rescue WIN32OLERuntimeError > end > object += '.parentElement' > end > true > end > end > end > > > > > > ------------------------------ > > Message: 4 > Date: Thu, 1 Jun 2006 14:33:47 -0600 > From: "Tyler Prete" > Subject: Re: [Wtr-general] Methods that can be used within a frame? > To: wtr-general at rubyforge.org > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Bret, I think we are having some syntactic problems. I CAN do it manually, > by interacting with the page myself. I'll try and explain the situation > since I can't actually give an example. I am working with a customer > service app that has multiple frames, a search bar on the left, a customer > frame in the top right, and an invoice frame in the top left. When a search > is issued that can result in multiple people, a popup window is opened > containing all the names of possible customers. When a name is selected, > the customer frame is supposed to change to show that specific customer. > When I go through the process myself, it works. However, when using watir, > I can click on the link, but it does not load the customer info in the > customer frame. I could not get it to work directly, so my idea was to take > the link URL and load it manually in the frame, but apparently this is not > possible, at least not at this time. > > Hopefully that helps clear things up. > --Tyler > > On 6/1/06, Bret Pettichord wrote: > > > > On 6/1/06, Tyler Prete wrote: > > > > > Well I may not even have to deal with it anymore, but how would I change > > > this manually? I do not have control over the HTML in the page, I am > only > > > interacting with it via Watir. > > > > > > > By design, Watir is a tool for automating things that you can do manually. > > If you don't know how to do it manually, then Watir is probably the wrong > > tool for you. > > > > 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/20060601/5e84241a/attachment-0001.htm > > ------------------------------ > > Message: 5 > Date: Thu, 1 Jun 2006 15:47:32 -0500 > From: "Bret Pettichord" > Subject: Re: [Wtr-general] Methods that can be used within a frame? > To: wtr-general at rubyforge.org > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > On 6/1/06, Tyler Prete wrote: > > > > When I go through the process myself, it works. However, when using > > watir, I can click on the link, but it does not load the customer info in > > the customer frame. > > > > This is the problem we should focus on. Can you provide more information? > Are you getting an error message? Can you show us any code or html? -- feel > free to sanitize. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://rubyforge.org/pipermail/wtr-general/attachments/20060601/b5b64e09/attachment-0001.htm > > ------------------------------ > > Message: 6 > Date: Thu, 1 Jun 2006 16:05:38 -0600 > From: "Attebery, Bill" > Subject: Re: [Wtr-general] How to create a script for calendar > function? > To: > Message-ID: > > Content-Type: text/plain; charset="us-ascii" > > > Try > > ie2.show_links to see all the links in the page > and ie2.show_tables to see all the tables in the page > > Looking at the code snippet -- > > ie2.link(:text, '2').click should set the date to '2006-06-02' > ie2.link(:id, ).click should set the date to '2006-06-02' > Ie2.table(:index, 2)[2][6].click should set the date to '2006-06-02' > ie2.table(:index, )[2][6].fireEvent('onclick') should also set the date > to '2006-06-02' > > Also ie2.link(:text, '<<').click should move the year back > ie2.link(:text, '>>').click should move the year forward > ie2.link(:text, '>').click should move the month forward > ie2.link(:text, 'Print').click should print (I assume) > etc. > Likewise ie2.table(:index, 1)[1][1].click will move the year back > ie2.table(:index, 1)[1][1].fireEvent will move the year back > etc. > > I recommend identifying the links by :text (simple to code and read) -- > but there are many other ways to do the same thing. > > Hope this helps. > > > > > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Danilova, Elza > Sent: Thursday, June 01, 2006 10:34 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] How to create a script for calendar function? > > Hi, > > Using the following: > ie.link(:url,"javascript:show_calendar'resultsearch.gDate')").click > ie2=Watir::IE.attach(:title, "Calendar") we were able to open the > calendar icon, but could not go any further, because there is no object > name on the calendar.html page: > > -----------Objects in page ------------- > name= id= > name= id= > name= id= > name= id= > name= id= > > Calendar html: > > html> > Calendar > > FACE='Verdana' SIZE=2>June 2006
BORDER=1 CELLSPACING=0 CELLPADDING=0 BGCOLOR='#e0e0e0'>
ALIGN=center> [ HREF="javascript:window.opener.Build('resultsearch.gDate', '5', '2005', > 'MONTH DD, YYYY');"><<] [ HREF="javascript:window.opener.Build('resultsearch.gDate', '4', '2006', > 'MONTH DD, YYYY');"><] [ HREF="javascript:window.print();">Print] [ HREF="javascript:window.opener.Build('resultsearch.gDate', '6', '2006', > 'MONTH DD, YYYY');">>] [ HREF="javascript:window.opener.Build('resultsearch.gDate', '5', '2007', > 'MONTH DD, YYYY');">>>]

>
FACE='Verdana' COLOR='darkgreen'>Sun WIDTH='14%'> COLOR='darkgreen'>Mon FACE='Verdana' COLOR='darkgreen'>Tue WIDTH='14%'> COLOR='darkgreen'>Wed FACE='Verdana' COLOR='darkgreen'>Thu WIDTH='14%'> COLOR='darkgreen'>Fri FACE='Verdana' COLOR='darkgreen'>Sat
WIDTH='14%' BGCOLOR="#e0e0e0"> > > > > onClick="self.opener.document.resultsearch.gDate.value='2006-06-01';wind > ow.close();">1 WIDTH='14%'> onClick="self.opener.document.resultsearch.gDate.value='2006-06-02';wind > ow.close();">2 SIZE='2' FACE='Verdana'> onClick="self.opener.document.resultsearch.graDate.value='2006-06-03';wi > ndow.close();">3
BGCOLOR="#e0e0e0"> onClick="self.opener.document.resultsearch.gDate.value='2006-06-04';wind > ow.close();">4 FACE='Verdana'> onClick="self.opener.document.resultsearch.gDate.value='2006-06-05';wind > ow.close();">5 FACE='Verdana'> onClick="self.opener.document.resultsearch.gDate.value='2006-06-06';wind > ow.close();">6 FACE='Verdana'> onClick="self.opener.document.resultsearch.gDate.value='2006-06-07';wind > ow.close();">7
> > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Attebery, Bill > Sent: Wednesday, May 31, 2006 6:10 PM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] How to create a script for calendar function? > > > > Not sure if all calendar functions are created equal -- the one used at > my site pops up another IE window -- I can attach to it and then drive > it like always. > > ie.image(:id, 'my_calendar_icon').click > @ie2=IE.attach(:title, /Select Date/) > > Now @ie2 is another browser instance with select_lists, links, buttons, > etc. available to control through regular watir statements. > > @ie2.select_list(:name, 'cboMonth').select('Jun') > @ie2.select_list(:name, 'cboYear').select('2006') > @ie2.link(:text, '15').click > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of John Fitisoff > Sent: Wednesday, May 31, 2006 3:28 PM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] How to create a script for calendar function? > > If you aren't trying to do anything complicated - and the calendar > control responds to keyboard input - you might want to try using the > send_keys method to set the calendar control: > > ie.image(:id, "my_calendar_icon").click > ie.send_keys("{UP}") > ie.send_keys("{LEFT}") > ie.send_keys("{ENTER}") > > The drawback is that this approach may not let you exercise all of the > calendar control's functionality. But if you're just worried about > setting a date it's probably enough to get you past the control without > worrying about the Javascript. > > --- "Danilova, Elza" wrote: > > > Using WATIR I am having problem to create a document that includes the > > > calendar function. > > > > How can I drive a java script to execute the calendar function, where > > the text field can not be populated with the date and it's only allow > > you to select a date by clicking on the calendar icon? > > > > Thank you, > > > > Elza > > > > > > "This e-mail and any attachments may contain confidential and > > privileged information. Any dissemination or use of the information by > > > a person other than the intended recipient is unauthorized and may be > > illegal. If you are not the intended recipient, please notify the > > sender immediately by return e-mail, delete this e-mail and destroy > > any copies. Although this e-mail and any attachments are believed to > > be free of any virus or other defect that might affect any computer > > system into which it is received and opened, it is the responsibility > > of the recipient to ensure that it is virus free and no responsibility > > > is accepted by the Board of Trade of the City of New York, Inc. or the > > > New York Clearing Corporation for any loss or damage arising in any > > way from its use. Thank you." > > > > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > __________________________________________________ > 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 > > > > The content contained in this electronic message is not intended to > constitute formation of a contract binding TWTC. TWTC will be > contractually bound only upon execution, by an authorized officer, of a > contract including agreed terms and conditions or by express application > of its tariffs. > > This message is intended only for the use of the individual or entity to > which it is addressed. If the reader of this message is not the intended > recipient, or the employee or agent responsible for delivering the > message to the intended recipient, you are hereby notified that any > dissemination, distribution or copying of this message is strictly > prohibited. If you have received this communication in error, please > notify us immediately by replying to the sender of this E-Mail or by > telephone. _______________________________________________ > 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 content contained in this electronic message is not intended to > constitute formation of a contract binding TWTC. TWTC will be > contractually bound only upon execution, by an authorized officer, of > a contract including agreed terms and conditions or by express > application of its tariffs. > > This message is intended only for the use of the individual or entity > to which it is addressed. If the reader of this message is not the > intended recipient, or the employee or agent responsible for > delivering the message to the intended recipient, you are hereby > notified that any dissemination, distribution or copying of this > message is strictly prohibited. If you have received this > communication in error, please notify us immediately by replying to > the sender of this E-Mail or by telephone. > > > ------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > End of Wtr-general Digest, Vol 31, Issue 5 > ****************************************** > From Adrian.Rutter at tnt.com Fri Jun 2 12:42:46 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Fri, 2 Jun 2006 17:42:46 +0100 Subject: [Wtr-general] organising the app map Message-ID: Hi, Could I have some opinions on whether this is a good way to organise my app map? object_map.rb module Constants URL = "http://portal" USER_NAME = "aidy" #at some time this will be var PASSWORD = "12345" # " " end class LoginWin USER_NAME ='userid' LOG_IN_LINK = 'Log in' PASSWORD = 'password' LOG_IN_BTN= 'Log in' end class MainWin ..... end logob.rb require 'objectMap' def login (username, password) @ie.link(:text, LoginWin::LOG_IN_LINK).click @ie.text_field(:name, LoginWin::USER_NAME).set(username) @ie.text_field(:name, LoginWin::PASSWORD).set(password) @ie.button(:value,LoginWin::LOG_IN_BTN).click end test_1.rb require 'objectMap' require 'browser' require 'logon' start_browser(Constants::URL) login(Constants::USER_NAME, Constants::PASSWORD) Cheers Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From Lonny at TitanEZ.net Sat Jun 3 12:31:31 2006 From: Lonny at TitanEZ.net (Lonny Eachus) Date: Sat, 03 Jun 2006 09:31:31 -0700 Subject: [Wtr-general] Quoting previous messages In-Reply-To: References: Message-ID: <4481B963.6080405@TitanEZ.net> Folks, I have to ask again: PLEASE trim what you include in your replies. Somebody recently echoed an entire digest . . . it was included in the next digest. This makes it tedious to follow what is going on, and hard to separate what is being stated THIS time from what has gone before. Others who subscribe to the list can see the emails that have already been sent. There is no need to quote long chunks of code or prior threads of conversation in your emails. Please take a moment to trim most of the echoed material from your replies before you send. That will make for a more pleasant experience for everybody. Lonny Eachus ========== From noreply at rubyforge.org Sun Jun 4 15:18:41 2006 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 4 Jun 2006 15:18:41 -0400 (EDT) Subject: [Wtr-general] [ wtr-Support Requests-4654 ] Test, test Message-ID: <20060604191841.7D6AB3CC233@rubyforge.org> Support Requests item #4654, was opened at 2006-06-04 19:18 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=488&aid=4654&group_id=104 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Tom Copeland (tom) Assigned to: Nobody (None) Summary: Test, test Initial Comment: Just testing the "tracker to email list" feature... tom ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=488&aid=4654&group_id=104 From zeljko.filipin at gmail.com Mon Jun 5 04:09:12 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Mon, 5 Jun 2006 10:09:12 +0200 Subject: [Wtr-general] Quoting previous messages In-Reply-To: <4481B963.6080405@TitanEZ.net> References: <4481B963.6080405@TitanEZ.net> Message-ID: +1 On 6/3/06, Lonny Eachus wrote: > > Folks, I have to ask again: PLEASE trim what you include in your > replies. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060605/31e9c256/attachment.html From nerimarco at hotmail.com Mon Jun 5 04:50:49 2006 From: nerimarco at hotmail.com (Marco Neri) Date: Mon, 5 Jun 2006 18:50:49 +1000 Subject: [Wtr-general] xpath - which html checker to use? Message-ID: I'm using watir 1.5.1.1017 rexml 3.1.4 ( I have not copied any files out of this distrubution ) I'm trying to use an xpath query in a test and I'm running into a parse error ( here's incomplete trace ). 1) Error: test_rexmltest(TC_rexmltest): REXML::ParseException: #
\n\n" htmlSource = html_source(document.body,htmlSource," ") htmlSource += "\n\n" My problem has 2 parts. 1. why is div="test" written into the output yet when I check the original src in the browser there is no tag div="test". 2. If I modify the watir.rb src and bypass the call to (document.body,htmlSource," ") by using a diff call (ie.ie.parent.document.body OR i use a filestream to read in a saved copy of the html src for the page ) I don't have the div="test' error but I still end up with other parse errors. I know these must be down to malformed html. but.. when I run the original src html through either HTML tidy or Simpletidy it reports warnings but not errors. The parser in rexml must be more strict? Which validator should I use to independently verify the html so that it's inline with what rexml parser expects? thanks Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060605/a9b7efa4/attachment.html From angrez at gmail.com Mon Jun 5 08:39:13 2006 From: angrez at gmail.com (Angrez Singh) Date: Mon, 5 Jun 2006 18:09:13 +0530 Subject: [Wtr-general] xpath - which html checker to use? In-Reply-To: References: Message-ID: Hi Marco, Could you please send the HTML source so that we can have more detalied look into it? Regards, Angrez On 6/5/06, Marco Neri wrote: > > I'm using watir 1.5.1.1017 > rexml 3.1.4 ( I have not copied any files out of this distrubution ) > > I'm trying to use an xpath query in a test and I'm running into a parse > error ( here's incomplete trace ). > > > 1) Error: > test_rexmltest(TC_rexmltest): > REXML::ParseException: # start > Line: > Position: > Last 80 unconsumed characters: >
the output of the call to html_source(document.body,htmlSource," ") in > function create_rexml_document_object in watir.rb > htmlSource =" encoding=\"us-ascii\"?>\n\n" > htmlSource = html_source(document.body,htmlSource," ") > htmlSource += "\n\n" > > My problem has 2 parts. > 1. why is div="test" written into the output yet when I check the original > src in the browser there is no tag div="test". > 2. If I modify the watir.rb src and bypass the call to (document.body,htmlSource," > ") by using a diff call (ie.ie.parent.document.body OR i use a filestream > to read in a saved copy of the html src for the page ) I don't have the > div="test' error but I still end up with other parse errors. I know these > must be down to malformed html. but.. > > when I run the original src html through either HTML tidy or Simpletidy it > reports warnings but not errors. The parser in rexml must be more > strict? Which validator should I use to independently verify the html so > that it's inline with what rexml parser expects? > > thanks > > Marco > > > > > _______________________________________________ > 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/20060605/02395ebb/attachment.html From stuporglue at gmail.com Mon Jun 5 18:27:57 2006 From: stuporglue at gmail.com (Michael Moore) Date: Mon, 5 Jun 2006 16:27:57 -0600 Subject: [Wtr-general] Beep for intervention? Message-ID: I've got a script that can take some time to run, and needs human intervention in a couple parts. Is there a way to have Watir beep or make some sort of audio notification? I guess I could make a page that plays a MIDI file or something which would get opened up at a certain point in the code, but something cleaner would be nice. Thanks, -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. From mtownley at firstlook.biz Mon Jun 5 18:35:32 2006 From: mtownley at firstlook.biz (Mike Townley) Date: Mon, 5 Jun 2006 17:35:32 -0500 Subject: [Wtr-general] Beep for intervention? Message-ID: <91E302EA72562F43AEDC06DD8FAE7D364C2714@ord1mail01.firstlook.biz> You can't do that with Watir, but you can with ruby in general. Remember that you are not limited by Watir to what you can do in your test scripts. Your upper limit is with Ruby. You can program a notification in ruby when it gets to a specific part of your script. Maybe you would like it to open an alert box or play a sound or something like that? You can find code in the libraries on how to do nifty things like this. Best Wishes Mike -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Michael Moore Sent: Monday, June 05, 2006 5:28 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Beep for intervention? I've got a script that can take some time to run, and needs human intervention in a couple parts. Is there a way to have Watir beep or make some sort of audio notification? I guess I could make a page that plays a MIDI file or something which would get opened up at a certain point in the code, but something cleaner would be nice. Thanks, -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Mon Jun 5 18:39:19 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 5 Jun 2006 15:39:19 -0700 Subject: [Wtr-general] Beep for intervention? In-Reply-To: References: Message-ID: <72799cd70606051539icc3dc40h29a97c6d58dc8bd6@mail.gmail.com> On 6/5/06, Michael Moore wrote: > I've got a script that can take some time to run, and needs human > intervention in a couple parts. Is there a way to have Watir beep or > make some sort of audio notification? print "\a" Don't tell anybody I told you. :) -Chris From stuporglue at gmail.com Mon Jun 5 18:50:52 2006 From: stuporglue at gmail.com (Michael Moore) Date: Mon, 5 Jun 2006 16:50:52 -0600 Subject: [Wtr-general] Beep for intervention? In-Reply-To: <91E302EA72562F43AEDC06DD8FAE7D364C2714@ord1mail01.firstlook.biz> References: <91E302EA72562F43AEDC06DD8FAE7D364C2714@ord1mail01.firstlook.biz> Message-ID: > You can't do that with Watir, but you can with ruby in general. Remember > that you are not limited by Watir to what you can do in your test > scripts. Your upper limit is with Ruby. You can program a notification > in ruby when it gets to a specific part of your script. Maybe you would > like it to open an alert box or play a sound or something like that? You > can find code in the libraries on how to do nifty things like this. OK. I figgured I could do something in Ruby, but was just wondering if there were something built in to Watir. There's some parts of our app that don't lend themselves to automated testing (waiting for a status change for an undefined time, etc.) and other parts I just haven't gotten arround to scripting. I'll look at what Ruby's got. Thanks, -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. From stuporglue at gmail.com Mon Jun 5 18:51:14 2006 From: stuporglue at gmail.com (Michael Moore) Date: Mon, 5 Jun 2006 16:51:14 -0600 Subject: [Wtr-general] Beep for intervention? In-Reply-To: <72799cd70606051539icc3dc40h29a97c6d58dc8bd6@mail.gmail.com> References: <72799cd70606051539icc3dc40h29a97c6d58dc8bd6@mail.gmail.com> Message-ID: > > I've got a script that can take some time to run, and needs human > > intervention in a couple parts. Is there a way to have Watir beep or > > make some sort of audio notification? > > print "\a" > > Don't tell anybody I told you. :) I won't mention it. Thanks, -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. From charley.baker at gmail.com Mon Jun 5 18:59:47 2006 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 5 Jun 2006 16:59:47 -0600 Subject: [Wtr-general] Beep for intervention? In-Reply-To: References: <72799cd70606051539icc3dc40h29a97c6d58dc8bd6@mail.gmail.com> Message-ID: I'd say like this seems like a really bad idea, automation code smells. Why do you need human intervention? While it's possible to beep, pause, throw up a dialog, whatever else, while waiting for people to interact with the environment, it doesn't really make for automated tests that can run with a build process. What can't you automate, why the human interaction? -Charley On 6/5/06, Michael Moore wrote: > > > > I've got a script that can take some time to run, and needs human > > > intervention in a couple parts. Is there a way to have Watir beep or > > > make some sort of audio notification? > > > > print "\a" > > > > Don't tell anybody I told you. :) > > I won't mention it. > > Thanks, > -- > Michael Moore > ------------------------------- > www.stuporglue.org -- Donate your used computer to a student that needs > it. > www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. > _______________________________________________ > 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/20060605/ceac08a9/attachment.html From stuporglue at gmail.com Mon Jun 5 23:54:15 2006 From: stuporglue at gmail.com (Michael Moore) Date: Mon, 5 Jun 2006 21:54:15 -0600 Subject: [Wtr-general] Beep for intervention? In-Reply-To: References: <72799cd70606051539icc3dc40h29a97c6d58dc8bd6@mail.gmail.com> Message-ID: > I'd say like this seems like a really bad idea, automation code smells. Why > do you need human intervention? While it's possible to beep, pause, throw up > a dialog, whatever else, while waiting for people to interact with the > environment, it doesn't really make for automated tests that can run with a > build process. What can't you automate, why the human interaction? It's an app that lets an admin manage SSL certs. Depending on the server, the certificate authority used the time for the cert to complete all of it's status codes in our product can range from as little as 15 minutes, to 24 hours. There's also a feature where you can have a user need to approval the installation of the generated cert onto the server (ie. one admin can generate the cert, but some other server admin has final say if the cert gets put on his server.). The specific part I'm working on right now is this approval process. Since the cert can potentially take 24 hours to reach the approval stage, I'd rather not loop. Instead, I'll notify the tester (usually myself) that the script is done, at which point I'll know to keep an eye on the error logs to see if the cert is just being slow, or if it's failing. > environment, it doesn't really make for automated tests that can run with a > build process. Sadly my company is using Visual Studio Team Server, and I haven't found a way to easily kick off Watir test scripts when VSTS finnishes a build, and no easy way to get the results back into VSTS. Supposedly it's possible by integrating it with NUnit or something like that, but I haven't taken the time to work out exactly how that would work. Even without the VSTS integration, Watir was the absolute best testing program I found though. It was the only one I tried that would accurately trigger the javascript events on all the links, checkboxes, drop downs, etc. Hope that makes some sense, -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. From marco.neri at police.vic.gov.au Tue Jun 6 01:23:35 2006 From: marco.neri at police.vic.gov.au (Neri, Marco) Date: Tue, 6 Jun 2006 15:23:35 +1000 Subject: [Wtr-general] xpath - which html checker to use? Message-ID: Hey Angrez I sorted my problem. View src in ie dosen't reveal the true src of what is in the DOM. Using web accesibility toolbar plugin in ie -> source -> view generated source. I found the src of my div=test tag which wasn't showing up in the standard ie view src. had one of the developers change this to div id=test and now it's parsing ok. Marco ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Angrez Singh Sent: Monday, 5 June 2006 22:39 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] xpath - which html checker to use? Hi Marco, Could you please send the HTML source so that we can have more detalied look into it? Regards, Angrez On 6/5/06, Marco Neri < nerimarco at hotmail.com> wrote: I'm using watir 1.5.1.1017 rexml 3.1.4 ( I have not copied any files out of this distrubution ) I'm trying to use an xpath query in a test and I'm running into a parse error ( here's incomplete trace ). 1) Error: test_rexmltest(TC_rexmltest): REXML::ParseException: #
\n\n" htmlSource = html_source(document.body,htmlSource," ") htmlSource += "\n\n" My problem has 2 parts. 1. why is div="test" written into the output yet when I check the original src in the browser there is no tag div="test". 2. If I modify the watir.rb src and bypass the call to (document.body,htmlSource," ") by using a diff call (ie.ie.parent.document.body OR i use a filestream to read in a saved copy of the html src for the page ) I don't have the div="test' error but I still end up with other parse errors. I know these must be down to malformed html. but.. when I run the original src html through either HTML tidy or Simpletidy it reports warnings but not errors. The parser in rexml must be more strict? Which validator should I use to independently verify the html so that it's inline with what rexml parser expects? thanks Marco _______________________________________________ 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. ******************************************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060606/c9206d23/attachment.html From mb at michaelbolton.net Tue Jun 6 04:38:09 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Tue, 6 Jun 2006 04:38:09 -0400 Subject: [Wtr-general] Beep for intervention? In-Reply-To: Message-ID: <054e01c68944$8a27e690$6901a8c0@Koko> Hey, I've got an idea: why have humans even review the test results? I mean, that's just a suggestion that the script can't fix whatever problem is in the code that's under test, right? In fact, why have humans write the test scripts at all? That really smells like we need humans involved in the testing process, doesn't it? Aren't you, like, some total loser if you cant get automation to write the test scripts on its own? - Maybe Michael wants to pause and review a screen with his own eyes before the next step. - Maybe Michael wants to be notified when a bug is found, as one might do with a broken build and a lava lamp. - Maybe Michael wants to vary some aspect of the test at some specific point, based on the result of a previous test. - Maybe Michael wants to be notified immediately upon each step of a test being completed. - Maybe this isn't a test that runs with the build process. I applaud the use of whatever aspects of human cognition want to use in concert with automation. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Charley Baker Sent: June 5, 2006 7:00 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Beep for intervention? I'd say like this seems like a really bad idea, automation code smells. Why do you need human intervention? While it's possible to beep, pause, throw up a dialog, whatever else, while waiting for people to interact with the environment, it doesn't really make for automated tests that can run with a build process. What can't you automate, why the human interaction? -Charley On 6/5/06, Michael Moore wrote: > > I've got a script that can take some time to run, and needs human > > intervention in a couple parts. Is there a way to have Watir beep or > > make some sort of audio notification? > > print "\a" > > Don't tell anybody I told you. :) I won't mention it. Thanks, -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. _______________________________________________ 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/20060606/7af369df/attachment.html From xi.chen at kalido.com Tue Jun 6 05:21:17 2006 From: xi.chen at kalido.com (Xi Chen) Date: Tue, 6 Jun 2006 10:21:17 +0100 Subject: [Wtr-general] BUG: New IE windows share session state with existing open windows Message-ID: <2CCD8390D18C304D9DAC0F92DBA1E275BF091E@kal-uk-s-mail.kalido.local> Hi Scott I tried to run the following ie_array = Array.new(3) ie0 = WIN32OLE.new('Shell.Application') system "c:\\Program Files\\Internet Explorer\\iexplore.exe" ie0 = IE.attach(:title,'Google') #my IE default page is Google ie0.goto("http://localhost:8080/kmdm8/signon.jsp") ie_array[0] = ie0 ie1 = WIN32OLE.new('Shell.Application') system 'c:\\Program Files\\Internet Explorer\\iexplore.exe' ie1 = IE.attach(:title,'Google') ie1.goto("http://localhost:8080/kmdm8/signon.jsp") ie_array[0] = ie1 ie2 = WIN32OLE.new('Shell.Application') system 'c:\\Program Files\\Internet Explorer\\iexplore.exe' ie2 = IE.attach(:title,'Google') ie2.goto("http://localhost:8080/kmdm8/signon.jsp") ie_array[0] = ie2 However the system cannot pick up the IE. Please help. Xi Chen From xi.chen at kalido.com Tue Jun 6 05:27:54 2006 From: xi.chen at kalido.com (Xi Chen) Date: Tue, 6 Jun 2006 10:27:54 +0100 Subject: [Wtr-general] Multi IE session Code Message-ID: <2CCD8390D18C304D9DAC0F92DBA1E275BF0921@kal-uk-s-mail.kalido.local> I tried to run the following ie_array = Array.new(3) ie0 = WIN32OLE.new('Shell.Application') system "c:\\Program Files\\Internet Explorer\\iexplore.exe" ie0 = IE.attach(:title,'Google') #my IE default page is Google ie0.goto("http://localhost:8080/kmdm8/signon.jsp") ie_array[0] = ie0 ie1 = WIN32OLE.new('Shell.Application') system 'c:\\Program Files\\Internet Explorer\\iexplore.exe' ie1 = IE.attach(:title,'Google') ie1.goto("http://localhost:8080/kmdm8/signon.jsp") ie_array[0] = ie1 ie2 = WIN32OLE.new('Shell.Application') system 'c:\\Program Files\\Internet Explorer\\iexplore.exe' ie2 = IE.attach(:title,'Google') ie2.goto("http://localhost:8080/kmdm8/signon.jsp") ie_array[0] = ie2 However the system cannot pick up the IE. Please help. Xi Chen From Adrian.Rutter at tnt.com Tue Jun 6 06:35:44 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Tue, 6 Jun 2006 11:35:44 +0100 Subject: [Wtr-general] override method. Design problem? In-Reply-To: Message-ID: Hi, I have a class for each automated test, and each application window or any other related group of functionality is in a module. Here is an example of a test class: require 'all_libs' class ST_LTD_6 def run begin p "TESTID: #{self.class}", "TEST DESCRIPTION: Change View Type" start_browser('http://gbahevm07l15:9081/wps/portal') login('aidy', '12345') goto_territory_list search_territory("GREENLAND", "NUUK", :view => 'Past' ) click_search p "Do a past and set up an end date at least two days before the test run" verify_result("WHATEVER") rescue => e puts("TEST FAILED:" + e.message + "\n" + e.backtrace.join("\n")) ensure log_out close_window end end end test=ST_LTD_6.new test.run Now the next test I have will we be exactly the same as this on, but on this method invocation search_territory("GREENLAND", "NUUK", :view => 'Past' ) which is contained within a module I include, I need to change the parameters Something like this class ST_LTD_7 < ST_LTD_6 search_territory("GREENLAND", "NUUK", :stream=> 'Sales' ) end Could someone please point me in the right direction? Thank You Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From charley.baker at gmail.com Tue Jun 6 10:57:18 2006 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 6 Jun 2006 08:57:18 -0600 Subject: [Wtr-general] Beep for intervention? In-Reply-To: References: <72799cd70606051539icc3dc40h29a97c6d58dc8bd6@mail.gmail.com> Message-ID: Sorry if I came across a little too harsh, I'm blaming the heat, it's been 90s here for the past week. :) Maybe I'll try to actually be helpful now that I've fallen off my high horse and knocked my head. If your lag time for server cert acceptance is as much as 24 hours and variable within that, you might want to send mail as opposed to beeping, something along the lines of this: require 'net/smtp' myMessage = < To: Michael Moore Subject: Cert Ready Certificate authenticated, ready for review END_OF_MESSAGE Net::SMTP.start('mail.server.whatever', 25, 'server1.foobar.com, 'username', 'password', :login) do |smtp| smtp.send_message myMessage, 'server1.foobar.com', 'mmoore at foobar.com' end For the VSTS builds, it's been a couple of years since I've used VS, and that was Win32 api programming and cgis with C++, some C. There is a wrapper for Watir scripts that I briefly looked at, gives you the ability to run Watir tests through Nant, so you should be able to get more of a continuous integration environment: http://dustin.homestead.com/files/blogs/2006/02/integrating-watir-into-nant-and-nunit.html It looks pretty slick, worth investigating if you're using VSTS. -Charley On 6/5/06, Michael Moore wrote: > > > I'd say like this seems like a really bad idea, automation code smells. > Why > > do you need human intervention? While it's possible to beep, pause, > throw up > > a dialog, whatever else, while waiting for people to interact with the > > environment, it doesn't really make for automated tests that can run > with a > > build process. What can't you automate, why the human interaction? > > It's an app that lets an admin manage SSL certs. Depending on the > server, the certificate authority used the time for the cert to > complete all of it's status codes in our product can range from as > little as 15 minutes, to 24 hours. There's also a feature where you > can have a user need to approval the installation of the generated > cert onto the server (ie. one admin can generate the cert, but some > other server admin has final say if the cert gets put on his server.). > > The specific part I'm working on right now is this approval process. > Since the cert can potentially take 24 hours to reach the approval > stage, I'd rather not loop. Instead, I'll notify the tester (usually > myself) that the script is done, at which point I'll know to keep an > eye on the error logs to see if the cert is just being slow, or if > it's failing. > > > environment, it doesn't really make for automated tests that can run > with a > > build process. > > Sadly my company is using Visual Studio Team Server, and I haven't > found a way to easily kick off Watir test scripts when VSTS finnishes > a build, and no easy way to get the results back into VSTS. > Supposedly it's possible by integrating it with NUnit or something > like that, but I haven't taken the time to work out exactly how that > would work. > > Even without the VSTS integration, Watir was the absolute best testing > program I found though. It was the only one I tried that would > accurately trigger the javascript events on all the links, checkboxes, > drop downs, etc. > > Hope that makes some sense, > -- > Michael Moore > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060606/812d8848/attachment.html From stuporglue at gmail.com Tue Jun 6 11:06:56 2006 From: stuporglue at gmail.com (Michael Moore) Date: Tue, 6 Jun 2006 09:06:56 -0600 Subject: [Wtr-general] Beep for intervention? In-Reply-To: References: <72799cd70606051539icc3dc40h29a97c6d58dc8bd6@mail.gmail.com> Message-ID: > Sorry if I came across a little too harsh, I'm blaming the heat, it's been > 90s here for the past week. :) Maybe I'll try to actually be helpful now > that I've fallen off my high horse and knocked my head. It's alright. I agree that in normal cases, automated testing should be, well, automated. There's always going to be something that needs human verification though. > If your lag time for > server cert acceptance is as much as 24 hours and variable within that, you > might want to send mail as opposed to beeping, something along the lines of > this: > > require 'net/smtp' Cool. That might be better, then it could run on a VMware, and I wouldn't even have to have it on my box. Thanks, -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. From mb at michaelbolton.net Tue Jun 6 11:24:22 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Tue, 6 Jun 2006 11:24:22 -0400 Subject: [Wtr-general] BUG: New IE windows share session state with existingopen windows In-Reply-To: <2CCD8390D18C304D9DAC0F92DBA1E275BF091E@kal-uk-s-mail.kalido.local> Message-ID: <005101c6897d$49813680$6801a8c0@Koko> This isn't a bug in Watir, so the BUG: title for your message isn't appropriate. There are lots of bugs here, but they ain't in Watir. Does your script include 'require watir.rb' and 'include Watir' at any point? When you try to attach using a string literal, it's unlikely to work for attaching to the window by title, unless it includes the entire title string exactly. A regular expression needs only a subset, so when you're trying to attach, do this: foo = IE.attach(:title, /Google/) However, you don't NEED to attach, so in this case, don't bother. There's no need for the call to WIN32OLE; there's no need to call system(). Watir takes care of all this stuff. You've set up an array presumably to hold three browser instances, but you're assigning all three instances to the same element in the array. I gather what you're trying to do is this: require 'watir.rb' include Watir ie_array = Array.new(3) ie_array.each do |element| element = IE.start('http://localhost:8080/kmdm8/signon.jsp') end Right? ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Xi Chen Sent: June 6, 2006 5:21 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] BUG: New IE windows share session state with existingopen windows Hi Scott I tried to run the following ie_array = Array.new(3) ie0 = WIN32OLE.new('Shell.Application') system "c:\\Program Files\\Internet Explorer\\iexplore.exe" ie0 = IE.attach(:title,'Google') #my IE default page is Google ie0.goto("http://localhost:8080/kmdm8/signon.jsp") ie_array[0] = ie0 ie1 = WIN32OLE.new('Shell.Application') system 'c:\\Program Files\\Internet Explorer\\iexplore.exe' ie1 = IE.attach(:title,'Google') ie1.goto("http://localhost:8080/kmdm8/signon.jsp") ie_array[0] = ie1 ie2 = WIN32OLE.new('Shell.Application') system 'c:\\Program Files\\Internet Explorer\\iexplore.exe' ie2 = IE.attach(:title,'Google') ie2.goto("http://localhost:8080/kmdm8/signon.jsp") ie_array[0] = ie2 However the system cannot pick up the IE. Please help. Xi Chen _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Tue Jun 6 11:31:11 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 6 Jun 2006 08:31:11 -0700 Subject: [Wtr-general] Beep for intervention? In-Reply-To: References: <72799cd70606051539icc3dc40h29a97c6d58dc8bd6@mail.gmail.com> Message-ID: <72799cd70606060831l72d69e4bv81f6c102c8825463@mail.gmail.com> here is a wrapper > for Watir scripts that I briefly looked at, gives you the ability to run > Watir tests through Nant, so you should be able to get more of a continuous > integration environment: > http://dustin.homestead.com/files/blogs/2006/02/integrating-watir-into-nant-and-nunit.html > It looks pretty slick, worth investigating if you're using VSTS. That looks very slick indeed. I wish I'd known about that a few months ago. Another way to go about integrating Ruby tests with NUnit/NANT is with Alexey Verkhovsky's Test::Unit::Reporter. http://rubyforge.org/projects/test-report/ I never got it all the way working, but Alex made some changes for me that makes Reporter a lot easier to use than it had been. -Chris From charley.baker at gmail.com Tue Jun 6 11:48:35 2006 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 6 Jun 2006 09:48:35 -0600 Subject: [Wtr-general] Beep for intervention? In-Reply-To: <72799cd70606060831l72d69e4bv81f6c102c8825463@mail.gmail.com> References: <72799cd70606051539icc3dc40h29a97c6d58dc8bd6@mail.gmail.com> <72799cd70606060831l72d69e4bv81f6c102c8825463@mail.gmail.com> Message-ID: I've been using that as well for xUnit style reporting. Highly recommended to make for nice testing reports in Cruise Control or otherwise. Just out of curiousity what changes did he make? It's been a few years since the release. -Charley On 6/6/06, Chris McMahon wrote: > > here is a wrapper > > for Watir scripts that I briefly looked at, gives you the ability to run > > Watir tests through Nant, so you should be able to get more of a > continuous > > integration environment: > > > http://dustin.homestead.com/files/blogs/2006/02/integrating-watir-into-nant-and-nunit.html > > It looks pretty slick, worth investigating if you're using VSTS. > > > That looks very slick indeed. I wish I'd known about that a few months > ago. > > Another way to go about integrating Ruby tests with NUnit/NANT is with > Alexey Verkhovsky's Test::Unit::Reporter. > http://rubyforge.org/projects/test-report/ I never got it all the > way working, but Alex made some changes for me that makes Reporter a > lot easier to use than it had been. > > -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/20060606/fa6733fe/attachment.html From christopher.mcmahon at gmail.com Tue Jun 6 12:00:21 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 6 Jun 2006 09:00:21 -0700 Subject: [Wtr-general] Test::Unit::Reporter Re: Beep for intervention? Message-ID: <72799cd70606060900t145da8bdmd14681d62bbcb414@mail.gmail.com> On 6/6/06, Charley Baker wrote: > I've been using that as well for xUnit style reporting. Highly recommended > to make for nice testing reports in Cruise Control or otherwise. Just out of > curiousity what changes did he make? It's been a few years since the > release. I've lost the original correspondence, so I'm doing this from memory. (Alex reads this list occasionally, maybe he'll chime in.) Repackaged and easier to deploy, for one thing. And it seems like there was a bug or two with String::IO (?) and maybe some other modules or libs that he fixed. The changes are in SVN trunk if you go looking. -Chris From davids at tower-mt.com Tue Jun 6 12:49:58 2006 From: davids at tower-mt.com (David Schmidt) Date: Tue, 06 Jun 2006 09:49:58 -0700 Subject: [Wtr-general] BUG: New IE windows share session state with existingopen windows In-Reply-To: <005101c6897d$49813680$6801a8c0@Koko> References: <005101c6897d$49813680$6801a8c0@Koko> Message-ID: <4485B236.9050308@tower-mt.com> There's another issue which may be affecting your test that is also NOT a Watir bug. Sessions are often set by having a server save a session ID cookie on the IE's PC. For IE, these cookies are saved in a per-user directory. If you run multiple IE's to the same site then the cookies can be overwritten, causing much confusion! IE1 browses to www.somesite.com and a session id is saved. IE2 browses to www.somesite.com and a DIFFERENT session id is saved to the same cookie IE1 browses to another page under www.somesite.com, returning the cookie WHICH IS NOW IE2's COOKIE! We had this problem running some web scrapers simultaneously to the same site from the same computer. We solved the problem by running each scraper under a different user so each scraper got it's own folder for cookies and they then stopped overwriting each other. David Michael Bolton wrote: > This isn't a bug in Watir, so the BUG: title for your message isn't > appropriate. There are lots of bugs here, but they ain't in Watir. > > Does your script include 'require watir.rb' and 'include Watir' at any > point? > > When you try to attach using a string literal, it's unlikely to work for > attaching to the window by title, unless it includes the entire title string > exactly. A regular expression needs only a subset, so when you're trying to > attach, do this: > > foo = IE.attach(:title, /Google/) > > However, you don't NEED to attach, so in this case, don't bother. > > There's no need for the call to WIN32OLE; there's no need to call system(). > Watir takes care of all this stuff. > > You've set up an array presumably to hold three browser instances, but > you're assigning all three instances to the same element in the array. > > I gather what you're trying to do is this: > > require 'watir.rb' > include Watir > > ie_array = Array.new(3) > ie_array.each do |element| > element = IE.start('http://localhost:8080/kmdm8/signon.jsp') > end > > Right? > > ---Michael B. > From mb at michaelbolton.net Tue Jun 6 13:34:27 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Tue, 6 Jun 2006 13:34:27 -0400 Subject: [Wtr-general] BUG: New IE windows share session state with existingopen windows In-Reply-To: <4485B236.9050308@tower-mt.com> Message-ID: <000001c6898f$77ce3850$6801a8c0@Koko> That's a good point if cookies are involved, for sure. Even when they're not involved, there can be some weirdnesses, too. I remember that Firefox's behaviour, in terms of session ID, is different; I don't remember how it's different, though. ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David Schmidt Sent: June 6, 2006 12:50 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] BUG: New IE windows share session state with existingopen windows There's another issue which may be affecting your test that is also NOT a Watir bug. Sessions are often set by having a server save a session ID cookie on the IE's PC. For IE, these cookies are saved in a per-user directory. If you run multiple IE's to the same site then the cookies can be overwritten, causing much confusion! IE1 browses to www.somesite.com and a session id is saved. IE2 browses to www.somesite.com and a DIFFERENT session id is saved to the same cookie IE1 browses to another page under www.somesite.com, returning the cookie WHICH IS NOW IE2's COOKIE! We had this problem running some web scrapers simultaneously to the same site from the same computer. We solved the problem by running each scraper under a different user so each scraper got it's own folder for cookies and they then stopped overwriting each other. David Michael Bolton wrote: > This isn't a bug in Watir, so the BUG: title for your message isn't > appropriate. There are lots of bugs here, but they ain't in Watir. > > Does your script include 'require watir.rb' and 'include Watir' at any > point? > > When you try to attach using a string literal, it's unlikely to work for > attaching to the window by title, unless it includes the entire title string > exactly. A regular expression needs only a subset, so when you're trying to > attach, do this: > > foo = IE.attach(:title, /Google/) > > However, you don't NEED to attach, so in this case, don't bother. > > There's no need for the call to WIN32OLE; there's no need to call system(). > Watir takes care of all this stuff. > > You've set up an array presumably to hold three browser instances, but > you're assigning all three instances to the same element in the array. > > I gather what you're trying to do is this: > > require 'watir.rb' > include Watir > > ie_array = Array.new(3) > ie_array.each do |element| > element = IE.start('http://localhost:8080/kmdm8/signon.jsp') > end > > Right? > > ---Michael B. > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From lonny at titanez.net Tue Jun 6 14:09:39 2006 From: lonny at titanez.net (Lonny Eachus) Date: Tue, 06 Jun 2006 11:09:39 -0700 Subject: [Wtr-general] Watir 1.5.x Performance Issues? In-Reply-To: References: Message-ID: <4485C4E3.4050201@titanez.net> Has anyone else experienced a slowdown of their applications since updating Watir from 1.4.1 to 1.5.0.1026? Is there some kind of background polling going on that is slowing things down? Because my application performance has slowed down by about half. Lonny Eachus ========== From bret at pettichord.com Tue Jun 6 15:34:56 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 6 Jun 2006 14:34:56 -0500 Subject: [Wtr-general] Watir 1.5.x Performance Issues? In-Reply-To: <4485C4E3.4050201@titanez.net> References: <4485C4E3.4050201@titanez.net> Message-ID: On 6/6/06, Lonny Eachus wrote: > > Has anyone else experienced a slowdown of their applications since > updating Watir from 1.4.1 to 1.5.0.1026? > > Is there some kind of background polling going on that is slowing things > down? Because my application performance has slowed down by about half. There have been a lot of changes, but there is no background polling. I just ran the core test suites for the two different versions of Watir. In 1.4.1, it has 160 tests and runs in 99 seconds (with one failure) In trunk (1.5.1.1029), it has 175 tests and runs in 113 seconds That isn't a direct apples to apples comparison, but also isn't consistent with a 50% slowdown. But it really depends on what you tests are doing. I spend a lot of time tuning my test suites to make them run fast, without running so fast that they become unreliable. Typically, this involves tuning timeouts (which are in 1.5, but not in 1.4) and removing sleeps. Of course, i always run Watir in "fast mode". Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060606/22c98171/attachment.html From bret at pettichord.com Tue Jun 6 16:02:24 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 6 Jun 2006 15:02:24 -0500 Subject: [Wtr-general] Methods that can be used within a frame? In-Reply-To: References: <447DE6B1.90209@tower-mt.com> Message-ID: On 6/1/06, Tyler Prete wrote: > > I can't provide the full html because I don't have access to it, but here > is the link I am trying to click from the popup: > > onclick='window.opener.parent.invoice.location.reload("/cgi-bin/cs_mgmt.cgi?page=INVOICE&inv_id=0");'>8560113 > > I imagine part of the problem is related to the onclick javascript event, > however I did try calling it seperately with no success. > And what exactly is the problem? Are you getting an error message? What code are you using? Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060606/7d3935f2/attachment.html From noreply at rubyforge.org Tue Jun 6 16:15:09 2006 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 6 Jun 2006 16:15:09 -0400 (EDT) Subject: [Wtr-general] [ wtr-Support Requests-4681 ] [test] One more test of "noreply" alias Message-ID: <20060606201509.A18EB3CC1E3@rubyforge.org> Support Requests item #4681, was opened at 2006-06-06 20:15 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=488&aid=4681&group_id=104 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Tom Copeland (tom) Assigned to: Nobody (None) Summary: [test] One more test of "noreply" alias Initial Comment: Apologies for the noise... Tom ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=488&aid=4681&group_id=104 From lonny at titanez.net Tue Jun 6 16:51:47 2006 From: lonny at titanez.net (Lonny Eachus) Date: Tue, 06 Jun 2006 13:51:47 -0700 Subject: [Wtr-general] BUG: New IE windows share session state with existingopen windows In-Reply-To: References: Message-ID: <4485EAE3.6010608@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060606/4b2c1f62/attachment.html From lonny at titanez.net Tue Jun 6 16:55:04 2006 From: lonny at titanez.net (Lonny Eachus) Date: Tue, 06 Jun 2006 13:55:04 -0700 Subject: [Wtr-general] Watir 1.5.x Performance Issues? In-Reply-To: References: Message-ID: <4485EBA8.8040907@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060606/77149e13/attachment.html From bret at pettichord.com Tue Jun 6 18:54:07 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 6 Jun 2006 17:54:07 -0500 Subject: [Wtr-general] Proposal for supporting multiple attributes Message-ID: I am planning to add multiple attribute support to Watir. For example: ie.div(:class => "MenuItem", :text => "Pulverize").click The old syntax would continue to be supported. ie.div(:text, "Pulverize").click Moreover, you could now also specify single attributes using this new "hash" syntax. Thus: ie.div(:text => "Pulverize").click These would allow any types of attributes to be mixed. In the case of ":index", the index would apply last. Therefore ie.div(:class => "MenuItem", :index => 3).click Would click the third div on the page whose class=MenuItem. In effect, set of attributes would have an :index of 1 unless something else were specified. Comments? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060606/9547e7f2/attachment.html From welkin_inc at hotmail.com Tue Jun 6 19:04:37 2006 From: welkin_inc at hotmail.com (Andrew McFarlane) Date: Tue, 06 Jun 2006 17:04:37 -0600 Subject: [Wtr-general] Proposal for supporting multiple attributes In-Reply-To: Message-ID: YES!! Up until now, I have been a lurker on this list who could not use Watir--the main application that I support requires that I be able to use multiple attributes to specify a control. Andrew McFarlane >From: "Bret Pettichord" >Reply-To: wtr-general at rubyforge.org >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Proposal for supporting multiple attributes >Date: Tue, 6 Jun 2006 17:54:07 -0500 > >I am planning to add multiple attribute support to Watir. For example: > > ie.div(:class => "MenuItem", :text => "Pulverize").click > >The old syntax would continue to be supported. > > ie.div(:text, "Pulverize").click > >Moreover, you could now also specify single attributes using this new >"hash" syntax. Thus: > > ie.div(:text => "Pulverize").click > >These would allow any types of attributes to be mixed. In the case of >":index", the index would apply last. Therefore > > ie.div(:class => "MenuItem", :index => 3).click > >Would click the third div on the page whose class=MenuItem. In effect, >set of attributes would have an :index of 1 unless something else were >specified. > >Comments? >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general From angrez at gmail.com Tue Jun 6 23:47:26 2006 From: angrez at gmail.com (Angrez Singh) Date: Wed, 7 Jun 2006 09:17:26 +0530 Subject: [Wtr-general] Proposal for supporting multiple attributes In-Reply-To: References: Message-ID: Hi Bret, Can't XPath functionality be used to access elements using multiple attributes? This is already there. > ie.div(:class => "MenuItem", :text => "Pulverize").click This translates to: ie.div(:xpath, "//div[@class = 'MenuItem' and @text = 'Pulverize']).click I think XPath provides much more powerful way to select element in addition to selecting it using multiple attributes. Comments? Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/951ba0ba/attachment.html From bret at pettichord.com Tue Jun 6 23:56:13 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 6 Jun 2006 22:56:13 -0500 Subject: [Wtr-general] Proposal for supporting multiple attributes In-Reply-To: References: Message-ID: On 6/6/06, Angrez Singh wrote: > > Can't XPath functionality be used to access elements using multiple > attributes? This is already there. > > > ie.div(:class => "MenuItem", :text => "Pulverize").click > > > This translates to: > ie.div(:xpath, "//div[@class = 'MenuItem' and @text = 'Pulverize']).click > > I think XPath provides much more powerful way to select element in > addition to selecting it using multiple attributes. Comments? > I've run into this bug when i've tried to use xpath as you describe. http://jira.openqa.org/browse/WTR-19 http://www.germane-software.com/projects/rexml/ticket/61 And i don't think i can wait for the REXML fix. There is also the issue of speed, which i think would make this valuable even after REXML was working correctly. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060606/8fc457e3/attachment.html From bret at pettichord.com Wed Jun 7 00:10:35 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 6 Jun 2006 23:10:35 -0500 Subject: [Wtr-general] BUG: New IE windows share session state with existingopen windows In-Reply-To: <4485EAE3.6010608@titanez.net> References: <4485EAE3.6010608@titanez.net> Message-ID: On 6/6/06, Lonny Eachus wrote: > > Our group has also found that global variables can carry over between > separate runs of the same application, probably due to server caching. If a > global variable was set during one run of the application, and not > explicitly set to something else on the next run, then it would (often? > always?) retain the value from the previous run. Whether this behavior is by > design or not is moot; it exists and it is something to watch out for. > Lonny, I don't mean any disrespect, but i frankly have a hard time believing this explanation. There is no server caching of global variables. If you type "ruby foo.rb" to run your tests and then do "ruby bar.rb" to run more tests (or "ruby foo.rb" again) there is no way the global variables from the first run are going to affect the global variables in a later run. You either are talking about cross-effects between two tests executed in the same ruby session (which is what would be expected to happen) or else some side effects of the first test are persisting (in a cache or something) so that they affect a later run (in which case using globals vs. locals wouldn't make a difference). If globals really were as unreliable as you report, then Ruby would be a shit language and no one would use it. (Or maybe it would be a magic language and everyone would want to use it?) I believe that you had a problem and then got rid of the global variables and the problem went away, but i think there must have been something else involved besides that. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060606/5c0a20e7/attachment.html From paul.rogers at shaw.ca Wed Jun 7 00:13:39 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 06 Jun 2006 22:13:39 -0600 Subject: [Wtr-general] Proposal for supporting multiple attributes References: Message-ID: <009501c689e8$c18ba410$6400a8c0@laptop> xpath is also very unreadable. As a side note, one of my clients has recognized the value of good html. When something is missing an id , we add an hour, per build, per testcase for manual testing of the application. It something that is now easy for the developers and project managers to see the value, of automation, and writing html that is easily testable Paul ----- Original Message ----- From: Bret Pettichord To: wtr-general at rubyforge.org Sent: Tuesday, June 06, 2006 9:56 PM Subject: Re: [Wtr-general] Proposal for supporting multiple attributes On 6/6/06, Angrez Singh wrote: Can't XPath functionality be used to access elements using multiple attributes? This is already there. > ie.div(:class => "MenuItem", :text => "Pulverize").click This translates to: ie.div(:xpath, "//div[@class = 'MenuItem' and @text = 'Pulverize']).click I think XPath provides much more powerful way to select element in addition to selecting it using multiple attributes. Comments? I've run into this bug when i've tried to use xpath as you describe. http://jira.openqa.org/browse/WTR-19 http://www.germane-software.com/projects/rexml/ticket/61 And i don't think i can wait for the REXML fix. There is also the issue of speed, which i think would make this valuable even after REXML was working correctly. 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/20060606/283c36ff/attachment.html From zeljko.filipin at gmail.com Wed Jun 7 03:36:51 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 7 Jun 2006 09:36:51 +0200 Subject: [Wtr-general] Proposal for supporting multiple attributes In-Reply-To: References: Message-ID: On 6/7/06, Bret Pettichord wrote: > > I am planning to add multiple attribute support to Watir. > +1 In effect, > set of attributes would have an :index of 1 unless something else were > specified. > Are you going to make :index 0 based? I remember there was a discussion about it. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/4714f420/attachment.html From jared at kilmore.info Wed Jun 7 06:14:25 2006 From: jared at kilmore.info (Jared Quinert) Date: Wed, 07 Jun 2006 20:14:25 +1000 Subject: [Wtr-general] Automation annoyingness In-Reply-To: References: Message-ID: <4486A701.5060706@kilmore.info> I have an issue which I suspect can only be solved elegantly by getting our dev team to make some changes to our application. I suspect that the issue I'm having would be a general one with *any* tool attempting to automate a browser (hence my crossposting). The issue is that there is javascript attached to the 'next page' link. This script takes some time to run before advancing to the next page. Watir sensibly waits for IE to not be busy after a control is clicked, however, because the script is running, it looks like IE is not busy. As a result, the script clicks on the link, then immediately checks for the elements on the next page. They're not there, but Watir is tricked into progressing because IE is not loading a page. You can see the issue by running the script below. I naively assumed that my script would click the link to proceed then wait until the next page had loaded. My question is, is this a problem that is encountered frequently? I can imagine a few solutions - - Have the javascript set some visible state indicator on the webpage so that my script can wait for the state indicator to change. - Similarly, just poll until the next page appears to be loaded, or - Have the javascript somehow put IE into a busy/loading state immediately. Does anyone know if this is possible? - Add a wait into my script, or into the click method of links (which is my current hack). Would love to hear suggestions. It seems an interesting problem, and I am sure someone else must have encountered something similar (in Watir or some other automation effort). I also don't think this is something that we might reasonably expect Watir to handle automatically, but am happy to be corrected. Jared require 'Watir' include Watir $ie=IE.new $ie.methods $ie.goto("http://www.quinert.com/test.html") $ie.link(:text,"First").click $ie.link(:text,"Second").click From Adrian.Rutter at tnt.com Wed Jun 7 07:18:59 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Wed, 7 Jun 2006 12:18:59 +0100 Subject: [Wtr-general] clicking a link in a javascipt array In-Reply-To: Message-ID: Hi, I have a javascript array in a table. source
Amend Amend Amend
cell 1 cell2
nest1 nest2
Normal
> > > > >
> > >
>
Alias Groups
> >
>
Add New Alias
> > > >
> >
 
> > > > > > >
> > > > > >
Alias Groups 
> > > > > > > >
> > > > > > >
  > > > >
> > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > > > > > > > >
Alias name: > > > >
Items added
> > > >
    >
Description:
  
> > > > > > > > > > > > > > > > > > > > > > > >
Attribute Type:
 
 
Enter or paste values:
 
 
 
> > > > > > > > > > > > > > > > > > > > > > > > > >
^... please choose type
Add >>
 
> > > > > > > > > > > > > > > >
Existing Alias Groups 
Add >>
  
> > > > > > > >
> > > > > > > > > > >
  
   
>
> > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From sikander at marlabs.com Mon Jun 12 09:47:42 2006 From: sikander at marlabs.com (Sikander) Date: Mon, 12 Jun 2006 19:17:42 +0530 Subject: [Wtr-general] Hi - New to Watir, need more document information about Watir Message-ID: <20060612134200.7FA60E9DC@lioness.marlabs.com> Hi All!! I am New to Watir. But very comfortable with this tool. I have basic level of understanding Watir and Ruby. The problem is I have lot of information about Ruby. But less information about Watir. Can anybody help me in getting lot more information about Watir from the basic level to higher level with examples. Looking forward, Regards Sikiander -- Disclaimer: This e-mail, and any files transmitted with it are confidential to Marlabs Inc. and intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060612/f6fe9605/attachment.html From Adrian.Rutter at tnt.com Mon Jun 12 09:43:35 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Mon, 12 Jun 2006 14:43:35 +0100 Subject: [Wtr-general] is not true with assert(ie.contains_text) In-Reply-To: Message-ID: I have a problem with assertions. If I write this: require 'watir' require 'test/unit' class TC_1 < Test::Unit::TestCase def test_1 ie = Watir::IE.new ie.goto('http://wtr.rubyforge.org/') if assert(ie.contains_text("Watir")) p 'pass' else p 'fail' end rescue => e puts(e.message + "\n" + e.backtrace.join("\n")) ensure ie.close end end I get a puts 'fail', even though 'Watir' is contained. If I change the search criteria to: 'ZXV' I get an exception with this "Loaded suite C:/Documents and Settings/g744ahe/workspace/ruby_test/auto_tests/Common_Sales/E2/test Started is not true." And a backtrace. I have tried to do search to find the method #contains_text, but I cannot see it. Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From zeljko.filipin at gmail.com Mon Jun 12 09:47:56 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Mon, 12 Jun 2006 15:47:56 +0200 Subject: [Wtr-general] Hi - New to Watir, need more document information about Watir In-Reply-To: <20060612134200.7FA60E9DC@lioness.marlabs.com> References: <20060612134200.7FA60E9DC@lioness.marlabs.com> Message-ID: Take a look at these: http://openqa.org/watir/ (new home page) http://wtr.rubyforge.org/ (old home page) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060612/8c1c2d4d/attachment.html From stuporglue at gmail.com Mon Jun 12 10:10:23 2006 From: stuporglue at gmail.com (Michael Moore) Date: Mon, 12 Jun 2006 08:10:23 -0600 Subject: [Wtr-general] Hi - New to Watir, need more document information about Watir In-Reply-To: <20060612134200.7FA60E9DC@lioness.marlabs.com> References: <20060612134200.7FA60E9DC@lioness.marlabs.com> Message-ID: > I am New to Watir. But very comfortable with this tool. I have basic level > of understanding Watir and Ruby. > > The problem is I have lot of information about Ruby. But less information > about Watir. Can anybody help me in getting lot more information about Watir > from the basic level to higher level with examples. This page has been the most valuable resource I've found, the Watir API: http://wtr.rubyforge.org/rdoc/index.html -- Michael Moore ------------------------------- www.stuporglue.org -- Donate your used computer to a student that needs it. www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us. From zeljko.filipin at gmail.com Mon Jun 12 10:26:52 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Mon, 12 Jun 2006 16:26:52 +0200 Subject: [Wtr-general] is not true with assert(ie.contains_text) In-Reply-To: References: Message-ID: Try to change if assert(ie.contains_text("Watir")) to if ie.contains_text("Watir") -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060612/a1eb1cee/attachment.html From Adrian.Rutter at tnt.com Mon Jun 12 10:45:32 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Mon, 12 Jun 2006 15:45:32 +0100 Subject: [Wtr-general] is not true with assert(ie.contains_text) Message-ID: Zeljko Filipin wrote >Try to change >if assert(ie.contains_text("Watir")) >to >if ie.contains_text("Watir") That certainly works, but I want to use unit test assertions so I can produce a report summary. It is described in the user-guide as thus: if assert(ie.contains_text("Test verification point."))?? puts("TEST PASSED. Found test string: 'Test verification point.' ") else?? puts("TEST FAILED.") end Cheers Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From bret at pettichord.com Mon Jun 12 10:53:34 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 12 Jun 2006 09:53:34 -0500 Subject: [Wtr-general] is not true with assert(ie.contains_text) In-Reply-To: References: Message-ID: You are referencing a buggy version of our documentation. Please see http://wtr.rubyforge.org/watir_user_guide.html contains_text is in our API documentation. http://wtr.rubyforge.org/rdoc/classes/Watir/IE.html Bret On 6/12/06, Adrian Rutter wrote: > > I have a problem with assertions. > > ie = Watir::IE.new > ie.goto('http://wtr.rubyforge.org/') > if assert(ie.contains_text("Watir")) > p 'pass' > else > p 'fail' > end > rescue => e > puts(e.message + "\n" + e.backtrace.join("\n")) > ensure > ie.close > end > > end > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060612/b9c82838/attachment.html From Adrian.Rutter at tnt.com Mon Jun 12 11:10:05 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Mon, 12 Jun 2006 16:10:05 +0100 Subject: [Wtr-general] is not true with assert(ie.contains_text) Message-ID: Brett wrote > You are referencing a buggy version of our documentation. Please see >http://wtr.rubyforge.org/watir_user_guide.html But if the text is not found, e.g. require 'watir' require 'test/unit' class TC_1 < Test::Unit::TestCase def test_1 ie = Watir::IE.new ie.goto('www.tnt.com') assert(ie.contains_text("ZXVX")) rescue => e puts(e.message + "\n" + e.backtrace.join("\n")) ensure ie.close end end An exception is raised and this non-failure is presented in the console 1 tests, 1 assertions, 0 failures, 0 errors Cheers Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From zeljko.filipin at gmail.com Mon Jun 12 11:11:18 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Mon, 12 Jun 2006 17:11:18 +0200 Subject: [Wtr-general] how to test e-mail applications In-Reply-To: References: Message-ID: Chris, Bret, it took me a few days, but now I can send, receive and parse e-mails. I have tried several solutions and ended with these: - receive e-mail - Net::POP3 ( http://www.ruby-doc.org/stdlib/libdoc/net/pop/rdoc/ index.html ) - send e-mail - Net::SMTP ( http://www.ruby-doc.org/stdlib/libdoc/net/smtp/rdoc/index.html) - create (before sending) and parse e-mail (from file, after receiving) - TMail (http://i.loveruby.net/en/projects/tmail/) Net::POP3 and Net::SMTP are included in Ruby, TMail needs instalation. I had a problem with TMail installation, and I contacted author. He recommended this procedure, and now it works. ruby setup.rb config --without-ext ruby setup.rb setup ruby setup.rb install -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060612/33ff7c7c/attachment.html From charley.baker at gmail.com Mon Jun 12 11:20:48 2006 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 12 Jun 2006 09:20:48 -0600 Subject: [Wtr-general] is not true with assert(ie.contains_text) In-Reply-To: References: Message-ID: That's because you're swallowing the exception in your rescue clause. You want it to be raised and caught by Test::Unit so that it can see it for reporting. You need to either get rid of the rescue and ensure blocks or rethrow the exception (in which case you might want to wrap the original exception). raise Test::Unit::AssertionFailedError, "in my testcase: #{e.message}", e.backtrace -Charley On 6/12/06, Adrian Rutter wrote: > > > Brett wrote > > You are referencing a buggy version of our documentation. Please see > >http://wtr.rubyforge.org/watir_user_guide.html > > But if the text is not found, > > e.g. > require 'watir' > require 'test/unit' > class TC_1 < Test::Unit::TestCase > def test_1 > ie = Watir::IE.new > ie.goto('www.tnt.com') > assert(ie.contains_text ("ZXVX")) > rescue => e > puts(e.message + "\n" + e.backtrace.join("\n")) > ensure > ie.close > end > > end > > > An exception is raised and this non-failure is presented in the console > > 1 tests, 1 assertions, 0 failures, 0 errors > > Cheers > > Aidy > > > > > --------------------------------------------------------------------------------------------------------------- > This message and any attachment are confidential and may be privileged or > otherwise protected from disclosure. > If you are not the intended recipient, please telephone or email the > sender and delete this message and any attachment from your system. > If you are not the intended recipient you must not copy this message or > attachment or disclose the contents to any other person. > > --------------------------------------------------------------------------------------------------------------- > _______________________________________________ > 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/20060612/6440a6fe/attachment.html From christopher.mcmahon at gmail.com Mon Jun 12 11:39:32 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 12 Jun 2006 08:39:32 -0700 Subject: [Wtr-general] how to test e-mail applications In-Reply-To: References: Message-ID: <72799cd70606120839o1acb78ber6868366b01b8cea2@mail.gmail.com> Thanks for the report! I've only spiked a little of this, but I found Net::SMTP to be really easy and intuitive. There are a couple of mildly contradictory docs out on the web, though, so check around-- the easiest-looking way is probably the best way. I'll definitely be giving TMail a look. -Chris On 6/12/06, Zeljko Filipin wrote: > Chris, Bret, > > it took me a few days, but now I can send, receive and parse e-mails. > > I have tried several solutions and ended with these: > > - receive e-mail - Net::POP3 ( > http://www.ruby-doc.org/stdlib/libdoc/net/pop/rdoc/index.html) > - send e-mail - Net::SMTP ( > http://www.ruby-doc.org/stdlib/libdoc/net/smtp/rdoc/index.html) > - create (before sending) and parse e-mail (from file, after receiving) - > TMail ( http://i.loveruby.net/en/projects/tmail/) > > Net::POP3 and Net::SMTP are included in Ruby, TMail needs instalation. I > had a problem with TMail installation, and I contacted author. He > recommended this procedure, and now it works. > > ruby setup.rb config --without-ext > ruby setup.rb setup > ruby setup.rb install > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From Adrian.Rutter at tnt.com Mon Jun 12 11:39:55 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Mon, 12 Jun 2006 16:39:55 +0100 Subject: [Wtr-general] Wtr-general Digest, Vol 31, Issue 25 In-Reply-To: Message-ID: Charley >That's because you're swallowing the exception in your rescue clause. You >want it to be raised and caught by Test::Unit so that it can see it for >reporting. You need to either get rid of the rescue and ensure blocks or >rethrow the exception (in which case you might want to wrap the original > exception). > raise Test::Unit::AssertionFailedError, > "in my testcase: #{e.message}", > e.backtrace Thanks Charley. Could I write an example and submit it to the user guide? Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From Adrian.Rutter at tnt.com Mon Jun 12 11:48:17 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Mon, 12 Jun 2006 16:48:17 +0100 Subject: [Wtr-general] is not true with assert(ie.contains_text) In-Reply-To: Message-ID: sorry about the last header Charley >That's because you're swallowing the exception in your rescue clause. You >want it to be raised and caught by Test::Unit so that it can see it for >reporting. You need to either get rid of the rescue and ensure blocks or >rethrow the exception (in which case you might want to wrap the original > exception). > raise Test::Unit::AssertionFailedError, > "in my testcase: #{e.message}", > e.backtrace Thanks Charley. Could I write an example and submit it to the user guide? Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From Mark_Cain at RL.gov Mon Jun 12 13:53:07 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Mon, 12 Jun 2006 10:53:07 -0700 Subject: [Wtr-general] Watir 1.5.x Performance Issues? In-Reply-To: <4485EBA8.8040907@titanez.net> Message-ID: I have seen significant slowness running my scripts (1.4.1 and 1.5.1) from inside Komodo 3.5 compared to the same scripts inside Eclipse-Eclipse is much faster. Pouncer Note: I only run them inside the IDE when writing and/or debugging and NOT during actual testing. Just in case you were wondering. ;-) --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lonny Eachus Sent: Tuesday, June 06, 2006 1:55 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Watir 1.5.x Performance Issues? Thanks for the input. It could be due to something else, which is why I was asking. Lonny Eachus ========= Subject: Re: [Wtr-general] Watir 1.5.x Performance Issues? From: "Bret Pettichord" Date: Tue, 6 Jun 2006 14:34:56 -0500 . . . There have been a lot of changes, but there is no background polling. I just ran the core test suites for the two different versions of Watir. In 1.4.1, it has 160 tests and runs in 99 seconds (with one failure) In trunk (1.5.1.1029), it has 175 tests and runs in 113 seconds That isn't a direct apples to apples comparison, but also isn't consistent with a 50% slowdown. But it really depends on what you tests are doing. I spend a lot of time tuning my test suites to make them run fast, without running so fast that they become unreliable. Typically, this involves tuning timeouts (which are in 1.5, but not in 1.4) and removing sleeps. Of course, i always run Watir in "fast mode". Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060612/9f5fe513/attachment.html From bret at pettichord.com Tue Jun 13 01:54:16 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 13 Jun 2006 00:54:16 -0500 Subject: [Wtr-general] Wait for control to exist Message-ID: So, i think everyone can at least agree that it would be nice to have a method on Watir elements that would not return until the element appeared on a page. E.g.: ie.button(:value, "OK").dont_return_until_this_element_exists This would be analogous to the existing ie.wait method, except that that waits for the page to load the browser to no longer be busy. The only thing is -- what should it be called? Some ideas... ie.button(:value, "OK").wait_until_exists? ie.button(:value, "OK").wait_til_exist? ie.button(:value, "OK").wait ie.button(:value, "OK").ever_exist? Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060613/59481765/attachment.html From davids at tower-mt.com Tue Jun 13 02:45:42 2006 From: davids at tower-mt.com (David Schmidt) Date: Mon, 12 Jun 2006 23:45:42 -0700 Subject: [Wtr-general] Wait for control to exist In-Reply-To: References: Message-ID: <448E5F16.1040505@tower-mt.com> I called the function I wrote "wait_for", though I like your until_with_timeout method that uses yield better. Then we could do something like: wait_for(10) { ie.button(:value, 'OK') } or just do it as a function like wait_for( ie.button(:value, 'OK'), 10 ) We could just use your until_with_timeout as is, too: until_with_timeout(10) { ie.button(:value, 'OK').exists? } I've been using that already to wait for AJAX events to complete by watching for a "spinner" to appear and then disappear: # wait for "Updating" spinner to appear Watir::until_with_timeout(5) do @ie.div(:id, 'pnlLoading').document.style.invoke('display') != 'none' && @ie.div(:id, 'pnlLoading').document.style.invoke('visibility') != 'hidden' end # wait for "Updating" spinner to hide Watir::until_with_timeout(30) do @ie.div(:id, 'pnlLoading').document.style.invoke('display') == 'none' || @ie.div(:id, 'pnlLoading').document.style.invoke('visibility') == 'hidden' end We may wish to make it a bit more "visible" though, so it can be used without the "Watir::" at the front. David Bret Pettichord wrote: > So, i think everyone can at least agree that it would be nice to have > a method on Watir elements that would not return until the element > appeared on a page. E.g.: > > ie.button(:value, "OK").dont_return_until_this_element_exists > > This would be analogous to the existing ie.wait method, except that > that waits for the page to load the browser to no longer be busy. > > The only thing is -- what should it be called? > > Some ideas... > > ie.button(:value, "OK").wait_until_exists? > ie.button(:value, "OK").wait_til_exist? > ie.button(:value, "OK").wait > ie.button(:value, "OK").ever_exist? > > Bret From andy__s at hotmail.com Tue Jun 13 07:36:43 2006 From: andy__s at hotmail.com (Andy Sipe) Date: Tue, 13 Jun 2006 07:36:43 -0400 Subject: [Wtr-general] Wait for control to exist In-Reply-To: Message-ID: I'm not sure of the syntax, but I'd like to see it support multiple elements being verified. -andy ----Original Message Follows---- From: "Bret Pettichord" Reply-To: wtr-general at rubyforge.org To: wtr-general at rubyforge.org Subject: [Wtr-general] Wait for control to exist Date: Tue, 13 Jun 2006 00:54:16 -0500 So, i think everyone can at least agree that it would be nice to have a method on Watir elements that would not return until the element appeared on a page. E.g.: ie.button(:value, "OK").dont_return_until_this_element_exists This would be analogous to the existing ie.wait method, except that that waits for the page to load the browser to no longer be busy. The only thing is -- what should it be called? Some ideas... ie.button(:value, "OK").wait_until_exists? ie.button(:value, "OK").wait_til_exist? ie.button(:value, "OK").wait ie.button(:value, "OK").ever_exist? Bret _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Tue Jun 13 09:22:42 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 13 Jun 2006 08:22:42 -0500 Subject: [Wtr-general] Wait for control to exist In-Reply-To: References: Message-ID: On 6/13/06, Andy Sipe wrote: > > I'm not sure of the syntax, but I'd like to see it support multiple > elements > being verified. > > -andy How about this ? ie.button(:value, "OK").wait_til_exists ie.button(:value, "Cancel").wait_til_exists Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060613/7f36e5ce/attachment.html From bret at pettichord.com Tue Jun 13 09:38:14 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 13 Jun 2006 08:38:14 -0500 Subject: [Wtr-general] Wait for control to exist In-Reply-To: <448E5F16.1040505@tower-mt.com> References: <448E5F16.1040505@tower-mt.com> Message-ID: On 6/13/06, David Schmidt wrote: > > I called the function I wrote "wait_for", though I like your > until_with_timeout method that uses yield better. > > Then we could do something like: > > wait_for(10) { ie.button(:value, 'OK') } > > or just do it as a function like > > wait_for( ie.button(:value, 'OK'), 10 ) How about this: wait_until(ie.button(:value, "OK").exists?, 10) The advantage of this form is that we could use any boolean expression. So you could wait until a control was disabled or whatever. I'm not 100% sure that i can code this, however. I know i can implement using a block. Thus: wait_until(10) {ie.button(:value, "OK").exists?} This, of course, is the existing until_with_timeout method. Or: ie.button(:value, "OK).wait_until_exists?(10) Which follows the normal Watir practice if putting the methods on the elements. Note that in all these examples the timeout would be optional and would default to a user-configurable value. Probably @@default_timeout. Also, if the timeout were exceeded, it would raise a TimeOutException. Bret We could just use your until_with_timeout as is, too: > > until_with_timeout(10) { ie.button(:value, 'OK').exists? } > > I've been using that already to wait for AJAX events to complete by > watching for a "spinner" to appear and then disappear: > > # wait for "Updating" spinner to appear > Watir::until_with_timeout(5) do > @ie.div(:id, 'pnlLoading').document.style.invoke('display') > != 'none' && > @ie.div(:id, > 'pnlLoading').document.style.invoke('visibility') != 'hidden' > end > # wait for "Updating" spinner to hide > Watir::until_with_timeout(30) do > @ie.div(:id, 'pnlLoading').document.style.invoke('display') > == 'none' || > @ie.div(:id, > 'pnlLoading').document.style.invoke('visibility') == 'hidden' > end > > We may wish to make it a bit more "visible" though, so it can be used > without the "Watir::" at the front. I agree and will make that change regardless. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060613/a386692b/attachment.html From Adrian.Rutter at tnt.com Tue Jun 13 09:52:15 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Tue, 13 Jun 2006 14:52:15 +0100 Subject: [Wtr-general] Wait for control to exist In-Reply-To: Message-ID: Brett wrote > The only thing is -- what should it be called? wait_for_object? Maybe with a default timeout in the initialize method when a parameter is not sent. wait_for_object #default wait_for_object(5000) #milliseconds Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From andy__s at hotmail.com Tue Jun 13 10:23:20 2006 From: andy__s at hotmail.com (Andy Sipe) Date: Tue, 13 Jun 2006 10:23:20 -0400 Subject: [Wtr-general] Wait for control to exist In-Reply-To: Message-ID: That woudl work. What would be nice would be something like this: @ie.wait(10) { button(:id, 'btnOne) span(:id, 'blah') } I'm not sure how that would translate into working code though. Also, is it enough to just check that the item exists? Often I have items that are being updated via AJAX style code and they exist, but they are changing, so I'm looking to see if the value is something specific or something different than last time. If I had the polling on exist it wouldn't be enough. -andy ----Original Message Follows---- From: "Bret Pettichord" Reply-To: wtr-general at rubyforge.org To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Wait for control to exist Date: Tue, 13 Jun 2006 08:22:42 -0500 On 6/13/06, Andy Sipe wrote: > >I'm not sure of the syntax, but I'd like to see it support multiple >elements >being verified. > >-andy How about this ? ie.button(:value, "OK").wait_til_exists ie.button(:value, "Cancel").wait_til_exists Bret _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Adrian.Rutter at tnt.com Tue Jun 13 10:44:32 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Tue, 13 Jun 2006 15:44:32 +0100 Subject: [Wtr-general] Problem finding a link URL with RegEx In-Reply-To: Message-ID: I have got 2 'New' links in one HTML page. The second link has a URL as this: http://gbahevm07l15:9081/wps/myportal/!ut/p/kcxml/04_Sj9SPykssy0xPLMnMz0vM0Y_QjzKLN4i3dAHJgFjGpvqRqCKOcAFfj_zcVKBwpDmQ726kH5abmZeZm1mVmgITdAvDImjoFIBN1MhbPywvvygX6IoQuKGG2AwNRRYMQhgQoO-tH6BfkBsaUW6ca2GcG-BnWubsCADEVrkI/delta/base64xml/L0lDVE83b0pKN3VhQ1NZSkNncFJDZ3BSQS9ZSVVJQUFJSUlJSUlJTU1JSUlNSUlDQ0lHRUVBSktPQk9CS09KRkpGS0pBIS80QjFpY29uUVZ3R3hPVVRvSzc5WVFyTmh6RGNJN0RsRzR4QSEvN18wXzEyUC8xMTQyNS9zcGZfQWN0aW9uTmFtZS9zcGZfQWN0aW9uTGlzdGVuZXIvc3BmX3N0cnV0c0FjdGlvbi8lMG5ld1RlcnJpdG9yeUJJQy5kbw!!#7_0_12P The beginning and end will always be the same whatever environments i.e. http://gbahevm07l15:9081/wps/myportal 7_0_12P This is the regex I have used without success http://gbahevm07l15:9081/wps/myportal\/.*/7_0_12P $ie.link(:url, 'http://gbahevm07l15:9081/wps/myportal\/.*/7_0_12P').click Could anyone help? Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From zeljko.filipin at gmail.com Tue Jun 13 10:56:08 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 13 Jun 2006 16:56:08 +0200 Subject: [Wtr-general] Problem finding a link URL with RegEx In-Reply-To: References: Message-ID: Try this: $ie.link(:url, /http:\/\/gbahevm07l15:9081\/wps\/myportal.*7_0_12P/).click On 6/13/06, Adrian Rutter wrote: > > I have got 2 'New' links in one HTML page. > > The second link has a URL as this: > > > > http://gbahevm07l15:9081/wps/myportal/!ut/p/kcxml/04_Sj9SPykssy0xPLMnMz0vM0Y_QjzKLN4i3dAHJgFjGpvqRqCKOcAFfj_zcVKBwpDmQ726kH5abmZeZm1mVmgITdAvDImjoFIBN1MhbPywvvygX6IoQuKGG2AwNRRYMQhgQoO-tH6BfkBsaUW6ca2GcG-BnWubsCADEVrkI/delta/base64xml/L0lDVE83b0pKN3VhQ1NZSkNncFJDZ3BSQS9ZSVVJQUFJSUlJSUlJTU1JSUlNSUlDQ0lHRUVBSktPQk9CS09KRkpGS0pBIS80QjFpY29uUVZ3R3hPVVRvSzc5WVFyTmh6RGNJN0RsRzR4QSEvN18wXzEyUC8xMTQyNS9zcGZfQWN0aW9uTmFtZS9zcGZfQWN0aW9uTGlzdGVuZXIvc3BmX3N0cnV0c0FjdGlvbi8lMG5ld1RlcnJpdG9yeUJJQy5kbw!!#7_0_12P > > > The beginning and end will always be the same whatever environments > i.e. > > http://gbahevm07l15:9081/wps/myportal 7_0_12P > > > This is the regex I have used without success > > http://gbahevm07l15:9081/wps/myportal\/.*/7_0_12P > > $ie.link(:url, 'http://gbahevm07l15:9081/wps/myportal\/.*/7_0_12P').click > > Could anyone help? > > Aidy > > > > > --------------------------------------------------------------------------------------------------------------- > This message and any attachment are confidential and may be privileged or > otherwise protected from disclosure. > If you are not the intended recipient, please telephone or email the > sender and delete this message and any attachment from your system. > If you are not the intended recipient you must not copy this message or > attachment or disclose the contents to any other person. > > --------------------------------------------------------------------------------------------------------------- > _______________________________________________ > 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/20060613/ee74fc87/attachment.html From lonny at titanez.net Tue Jun 13 11:16:54 2006 From: lonny at titanez.net (Lonny Eachus) Date: Tue, 13 Jun 2006 08:16:54 -0700 Subject: [Wtr-general] how to test e-mail applications In-Reply-To: References: Message-ID: <448ED6E6.80400@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060613/3c36c45e/attachment.html From Adrian.Rutter at tnt.com Tue Jun 13 11:26:23 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Tue, 13 Jun 2006 16:26:23 +0100 Subject: [Wtr-general] Problem finding a link URL with RegEx In-Reply-To: Message-ID: Thanks for the correct RegEx; it finds an object, but not the one I want. The below are the url's of the second 'Filter' and 'New' links. They are hardly different and I am sure they will change in a different environment, so I can't hard-code them http://gbahevm07l15:9081/wps/myportal/!ut/p/kcxml/04_Sj9SPykssy0xPLMnMz0vM0Y_QjzKLN4i3dAHJgFjGpvqRqCKOcAFfj_zcVKBwpDmQ726kH5abmZeZm1mVmgITdAvDImjoFIBN1MhbPywvvygX6IoQuKGG2AwNRRYMQhgQoO-tH6BfkBsaUW6ca2GcG-BnWubsCADEVrkI/delta/base64xml/L0lDVE83b0pKN3VhQ1NZSkNncFJDZ3BSQS9ZSVVJQUFJSUlJSUlJTU1JSUlNSUlDQ0lHRUVBSktPQk9CS09KRkpGS0pBIS80QjFpY29uUVZ3R3hPVVRvSzc5WVFyTmh6RGNJN0RsRzR4QSEvN18wXzEyUC8xMTQyNS9zcGZfQWN0aW9uTmFtZS9zcGZfQWN0aW9uTGlzdGVuZXIvc3BmX3N0cnV0c0FjdGlvbi8lMG5ld1RlcnJpdG9yeUJJQy5kbw!!#7_0_12P http://gbahevm07l15:9081/wps/myportal/!ut/p/kcxml/04_Sj9SPykssy0xPLMnMz0vM0Y_QjzKLN4i3dAHJgFjGpvqRqCKOcAFfj_zcVKBwpDmQ726kH5abmZeZm1mVmgITdAvDImjoFIBN1MhbPywvvygX6IoQuKGG2AwNRRYMQhgQoO-tH6BfkBsaUW6ca2GcG-BnWubsCADEVrkI/delta/base64xml/L0lDVE83b0pKN3VhQ1NZSkNncFJDZ3BSQS9ZSVVJQUFJSUlJSUlJTU1JSUlNSUlDQ0lHRUVBSktPQk9CS09KRkpGS0pBIS80QjFpY29uUVZ3R3hPVVRvSzc5WVFyTmh6RGNJN0RsRzR4QSEvN18wXzEyUC8xMzc3Ni9zcGZfQWN0aW9uTmFtZS9zcGZfQWN0aW9uTGlzdGVuZXIvc3BmX3N0cnV0c0FjdGlvbi8lMHNob3dUZXJyaXRvcnlCSUNTZWFyY2guZG8!#7_0_12P Is it not possible to get the second link on a page? Something like: $ie.link(:text, 'New';:index, 2).click Cheers Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From mb at michaelbolton.net Tue Jun 13 11:49:42 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Tue, 13 Jun 2006 11:49:42 -0400 Subject: [Wtr-general] Problem finding a link URL with RegEx In-Reply-To: Message-ID: <020901c68f00$fc48cfc0$6801a8c0@Koko> >Thanks for the correct RegEx; it finds an object, but not the one I want. >Is it not possible to get the second link on a page? Something like: >$ie.link(:text, 'New';:index, 2).click Possibly--but this might be a good occasion to ask the developers for testability. ---Michael B. From Adrian.Rutter at tnt.com Tue Jun 13 12:05:12 2006 From: Adrian.Rutter at tnt.com (Adrian Rutter) Date: Tue, 13 Jun 2006 17:05:12 +0100 Subject: [Wtr-general] Problem finding a link URL with RegEx Message-ID: MB wrote: > Possibly--but this might be a good occasion to ask the developers for >testability. I think Websphere Portal instantiates each object dynamically and according to the developers, there is nothing they can do. Aidy --------------------------------------------------------------------------------------------------------------- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --------------------------------------------------------------------------------------------------------------- From davids at tower-mt.com Tue Jun 13 13:54:04 2006 From: davids at tower-mt.com (David Schmidt) Date: Tue, 13 Jun 2006 10:54:04 -0700 Subject: [Wtr-general] Wait for control to exist In-Reply-To: References: <448E5F16.1040505@tower-mt.com> Message-ID: <448EFBBC.6070502@tower-mt.com> How about the easy way. Just alias your nice "until_with_timeout" to "wait_until" so both names work and just use that your first format with the block. That way the block can contain any code that returns a boolean, which will allow Andy's request for multiple element support to work like: wait_until(timeout) { ie.button(:id, 'btnOne').exists? and ie.span(:id, 'blah').exists? } with the timeout being optional and using a default_timeout like Bret suggests below. This can then support all *sorts* of things that folks wait for, including thing like the displayed "spinners" that I was waiting to appear and then disappear. David Bret Pettichord wrote: > How about this: > > wait_until(ie.button(:value, "OK").exists?, 10) > > The advantage of this form is that we could use any boolean > expression. So you could wait until a control was disabled or > whatever. I'm not 100% sure that i can code this, however. I know i > can implement using a block. Thus: > > wait_until(10) {ie.button(:value, "OK").exists?} > > This, of course, is the existing until_with_timeout method. Or: > > ie.button(:value, "OK).wait_until_exists?(10) > > Which follows the normal Watir practice if putting the methods on the > elements. > > Note that in all these examples the timeout would be optional and > would default to a user-configurable value. Probably > @@default_timeout. Also, if the timeout were exceeded, it would raise > a TimeOutException. > > Bret From davids at tower-mt.com Tue Jun 13 14:11:33 2006 From: davids at tower-mt.com (David Schmidt) Date: Tue, 13 Jun 2006 11:11:33 -0700 Subject: [Wtr-general] Problem finding a link URL with RegEx In-Reply-To: References: Message-ID: <448EFFD5.7030500@tower-mt.com> Adrian Rutter wrote: > Is it not possible to get the second link on a page? Something like: > > $ie.link(:text, 'New';:index, 2).click > It is currently possible to access the second link on a page, but not with a filter. '$ie.links[2]' will give you the second link on the page, and you can open the page in IRB and do '$ie.show_links' to see which index to use for the link you want. David From bret at pettichord.com Tue Jun 13 14:14:39 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 13 Jun 2006 13:14:39 -0500 Subject: [Wtr-general] Wait for control to exist In-Reply-To: <448EFBBC.6070502@tower-mt.com> References: <448E5F16.1040505@tower-mt.com> <448EFBBC.6070502@tower-mt.com> Message-ID: On 6/13/06, David Schmidt wrote: > > How about the easy way. Just alias your nice "until_with_timeout" to > "wait_until" so both names work and just use that your first format with > the block. That way the block can contain any code that returns a > boolean, which will allow Andy's request for multiple element support to > work like: > > wait_until(timeout) { ie.button(:id, 'btnOne').exists? and ie.span(:id, > 'blah').exists? } > > with the timeout being optional and using a default_timeout like Bret > suggests below. > > This can then support all *sorts* of things that folks wait for, > including thing like the displayed "spinners" that I was waiting to > appear and then disappear. +1 Except that the old until_with_timeout method will be replaced by (rather than aliased to) wait_until BTW, the existing until_with_timeout method had been intended for internal use only and that's why it is kinda ugly. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060613/d26f208c/attachment.html From bret at pettichord.com Tue Jun 13 14:23:40 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 13 Jun 2006 13:23:40 -0500 Subject: [Wtr-general] Wait for control to exist In-Reply-To: References: Message-ID: On 6/13/06, Andy Sipe wrote: > > What would be nice would be something like this: > > @ie.wait(10) { > button(:id, 'btnOne) > span(:id, 'blah') > } This would be: wait_until(10) { @ie.button(:id, 'btnOne').exists? and @ie.span(:id, 'blah').exists? } > Also, is it enough to just check that the item exists? Often I have items > that are being updated via AJAX style code and they exist, but they are > changing, so I'm looking to see if the value is something specific or > something different than last time. If I had the polling on exist it > wouldn't be enough. This approach would allow you to check for whatever you wanted. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060613/d327a80d/attachment.html From bret at pettichord.com Tue Jun 13 15:34:29 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 13 Jun 2006 14:34:29 -0500 Subject: [Wtr-general] Problem finding a link URL with RegEx In-Reply-To: <448EFFD5.7030500@tower-mt.com> References: <448EFFD5.7030500@tower-mt.com> Message-ID: Adrian Rutter wrote: > > Is it not possible to get the second link on a page? Something like: > > > > $ie.link(:text, 'New';:index, 2).click Using 1.5.1.1037 try this: $ie.link(:text => 'New', :index => 2).click I added multiple attribute support last night for links. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060613/d33a0aa8/attachment.html From mail at chriss-baumann.de Tue Jun 13 15:37:41 2006 From: mail at chriss-baumann.de (Christian Baumann) Date: Tue, 13 Jun 2006 21:37:41 +0200 Subject: [Wtr-general] Load site without images? Message-ID: <028e01c68f20$dd9a7310$fe78a8c0@wlm01178> Hello! Is it possible to execute watir-scripts without loading the images in a website? I?m on a dialup and have a real bandwith-problem; and for the execution of my testcases loading of the images isn?t necessary. Thanks in advance, Christian From bret at pettichord.com Tue Jun 13 15:46:51 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 13 Jun 2006 14:46:51 -0500 Subject: [Wtr-general] Load site without images? In-Reply-To: <028e01c68f20$dd9a7310$fe78a8c0@wlm01178> References: <028e01c68f20$dd9a7310$fe78a8c0@wlm01178> Message-ID: On 6/13/06, Christian Baumann wrote: > > Is it possible to execute watir-scripts without loading the images in a > website? > I?m on a dialup and have a real bandwith-problem; and for the execution > of my > testcases loading of the images isn?t necessary. Just turn off this option in IE's Internet Options. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060613/84441217/attachment.html From mtownley at firstlook.biz Tue Jun 13 15:50:00 2006 From: mtownley at firstlook.biz (Mike Townley) Date: Tue, 13 Jun 2006 14:50:00 -0500 Subject: [Wtr-general] Load site without images? Message-ID: <91E302EA72562F43AEDC06DD8FAE7D364C2722@ord1mail01.firstlook.biz> You can tell IE to not load images. You'll need to click Internet Options from the Tools menu. In the new window that opens, click the Advanced tab on the far right. Scroll down the list until you see the Multimedia category and click the checkbox next to Show Pictures to uncheck it, then click Apply and OK. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Christian Baumann Sent: Tuesday, June 13, 2006 2:38 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Load site without images? Hello! Is it possible to execute watir-scripts without loading the images in a website? I?m on a dialup and have a real bandwith-problem; and for the execution of my testcases loading of the images isn?t necessary. Thanks in advance, Christian _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From andy__s at hotmail.com Tue Jun 13 15:58:37 2006 From: andy__s at hotmail.com (Andy Sipe) Date: Tue, 13 Jun 2006 15:58:37 -0400 Subject: [Wtr-general] Wait for control to exist In-Reply-To: Message-ID: I'm not sure just exist is enough for what I'm talking about. If I have a span that already exists in the document and I do something that causes an async request/update to the server then the span always exists so saying: span(:id, ...).wait_for_exists? may blow right through without pausing because the span is there. Maybe something like span(:id, ...).wait_for_change('text', 'blah') where 'text' is the attribute i'm waiting to change and 'blah' is the value I'm waiting for it to change to. So you could also do span(:id, ...).wait_for_change('exists?', true) -andy ----Original Message Follows---- From: "Bret Pettichord" Reply-To: wtr-general at rubyforge.org To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Wait for control to exist Date: Tue, 13 Jun 2006 13:23:40 -0500 On 6/13/06, Andy Sipe wrote: > >What would be nice would be something like this: > >@ie.wait(10) { > button(:id, 'btnOne) > span(:id, 'blah') >} This would be: wait_until(10) { @ie.button(:id, 'btnOne').exists? and @ie.span(:id, 'blah').exists? } >Also, is it enough to just check that the item exists? Often I have items >that are being updated via AJAX style code and they exist, but they are >changing, so I'm looking to see if the value is something specific or >something different than last time. If I had the polling on exist it >wouldn't be enough. This approach would allow you to check for whatever you wanted. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From speedsticko at hotmail.com Tue Jun 13 17:26:40 2006 From: speedsticko at hotmail.com (kwan l) Date: Tue, 13 Jun 2006 23:26:40 +0200 Subject: [Wtr-general] Trouble with links in a div Message-ID: Hi, I've just started using Watir and have run into a problem with links inside of divs. example page: when i try the script: require 'Watir' ie = Watir::IE.start("C:\\testwatir.html") # Test initial displaywpdiv = ie.div(:id, "div1")wpdiv.link(:index, 1).clickie.close I get an error saying that, "document" is undefined. This happens in the "getLink" method. Can anybody explain what I am doing incorrectly? Thanks Kwan _________________________________________________________________ Soyez parmi les premiers ? essayer la future messagerie : Windows Live Messenger Beta http://ideas.live.com/programpage.aspx?versionId=0eccd94b-eb48-497c-8e60-c6313f7ebb73 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060613/86b9b6f3/attachment.html From davids at tower-mt.com Tue Jun 13 17:28:41 2006 From: davids at tower-mt.com (David Schmidt) Date: Tue, 13 Jun 2006 14:28:41 -0700 Subject: [Wtr-general] Wait for control to exist In-Reply-To: References: Message-ID: <448F2E09.90108@tower-mt.com> Our solution is better than that. Bret already has a method that I've been using and it's generic enough that you can wait for just about anything. He's stated that he'll just be renaming it to "wait_for". On a web scraper I have there is an AJAX request that fires when one of the fields is changed. When this happens, a graphical "spinner" image appears to let you know it's making a request. The spinner is always there, but the DIV containing it gets changed from hidden to visible and back again. I'm able to wait for the style to change to visible and then wait for the style to change to hidden (even though the DIV *always* exists) like this (using the new wait_for() method name): # wait for "Updating" spinner to appear wait_for(5) do @ie.div(:id, 'pnlLoading').document.style.invoke('display') != 'none' && @ie.div(:id, 'pnlLoading').document.style.invoke('visibility') != 'hidden' end # wait for "Updating" spinner to hide wait_for(30) do @ie.div(:id, 'pnlLoading').document.style.invoke('display') == 'none' || @ie.div(:id, 'pnlLoading').document.style.invoke('visibility') == 'hidden' end The wait_for method will just keep trying the supplied block until the block returns "true" or the timeout has passed (where it will throw an exception). David Andy Sipe wrote: > I'm not sure just exist is enough for what I'm talking about. > > If I have a span that already exists in the document and I do something that > causes an async request/update to the server then the span always exists so > saying: > > span(:id, ...).wait_for_exists? > > may blow right through without pausing because the span is there. > > Maybe something like > > span(:id, ...).wait_for_change('text', 'blah') > > where 'text' is the attribute i'm waiting to change and 'blah' is the value > I'm waiting for it to change to. > > So you could also do > > span(:id, ...).wait_for_change('exists?', true) > > -andy > From bret at pettichord.com Tue Jun 13 18:47:01 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 13 Jun 2006 17:47:01 -0500 Subject: [Wtr-general] Wait for control to exist In-Reply-To: <448F2E09.90108@tower-mt.com> References: <448F2E09.90108@tower-mt.com> Message-ID: On 6/13/06, David Schmidt wrote: > > The wait_for method will just keep trying the supplied block until the > block > returns "true" or the timeout has passed (where it will throw an > exception). We want it to be called "wait_until" -- correct? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060613/66c2e9e5/attachment.html From davids at tower-mt.com Tue Jun 13 18:50:38 2006 From: davids at tower-mt.com (David Schmidt) Date: Tue, 13 Jun 2006 15:50:38 -0700 Subject: [Wtr-general] Wait for control to exist In-Reply-To: References: <448F2E09.90108@tower-mt.com> Message-ID: <448F413E.4010700@tower-mt.com> Yup, my bad. I just typed the wrong name out of habit. New name will be "wait_until". *SLAP* Ouch! OK, I've been punished. David Bret Pettichord wrote: > On 6/13/06, *David Schmidt* > wrote: > > The wait_for method will just keep trying the supplied block until > the block > returns "true" or the timeout has passed (where it will throw an > exception). > > > We want it to be called "wait_until" -- correct? From bret at pettichord.com Tue Jun 13 18:51:46 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 13 Jun 2006 17:51:46 -0500 Subject: [Wtr-general] Trouble with links in a div In-Reply-To: References: Message-ID: On 6/13/06, kwan l wrote: > > ie = Watir::IE.start("C:\\testwatir.html") > Try this instead: Watir::IE.start("file:///C:/testwatir.html") Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060613/3c9ded34/attachment.html From bret at pettichord.com Tue Jun 13 18:55:31 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 13 Jun 2006 17:55:31 -0500 Subject: [Wtr-general] Wait for control to exist In-Reply-To: <448F413E.4010700@tower-mt.com> References: <448F2E09.90108@tower-mt.com> <448F413E.4010700@tower-mt.com> Message-ID: I've written this up as http://jira.openqa.org/browse/WTR-75 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060613/b9d659e0/attachment.html From andy__s at hotmail.com Tue Jun 13 18:56:39 2006 From: andy__s at hotmail.com (Andy Sipe) Date: Tue, 13 Jun 2006 18:56:39 -0400 Subject: [Wtr-general] Wait for control to exist In-Reply-To: <448F2E09.90108@tower-mt.com> Message-ID: That sounds great. I didn't realize that was what you were talking about. Thanks -andy ----Original Message Follows---- From: David Schmidt Reply-To: wtr-general at rubyforge.org To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Wait for control to exist Date: Tue, 13 Jun 2006 14:28:41 -0700 Our solution is better than that. Bret already has a method that I've been using and it's generic enough that you can wait for just about anything. He's stated that he'll just be renaming it to "wait_for". On a web scraper I have there is an AJAX request that fires when one of the fields is changed. When this happens, a graphical "spinner" image appears to let you know it's making a request. The spinner is always there, but the DIV containing it gets changed from hidden to visible and back again. I'm able to wait for the style to change to visible and then wait for the style to change to hidden (even though the DIV *always* exists) like this (using the new wait_for() method name): # wait for "Updating" spinner to appear wait_for(5) do @ie.div(:id, 'pnlLoading').document.style.invoke('display') != 'none' && @ie.div(:id, 'pnlLoading').document.style.invoke('visibility') != 'hidden' end # wait for "Updating" spinner to hide wait_for(30) do @ie.div(:id, 'pnlLoading').document.style.invoke('display') == 'none' || @ie.div(:id, 'pnlLoading').document.style.invoke('visibility') == 'hidden' end The wait_for method will just keep trying the supplied block until the block returns "true" or the timeout has passed (where it will throw an exception). David Andy Sipe wrote: > I'm not sure just exist is enough for what I'm talking about. > > If I have a span that already exists in the document and I do something that > causes an async request/update to the server then the span always exists so > saying: > > span(:id, ...).wait_for_exists? > > may blow right through without pausing because the span is there. > > Maybe something like > > span(:id, ...).wait_for_change('text', 'blah') > > where 'text' is the attribute i'm waiting to change and 'blah' is the value > I'm waiting for it to change to. > > So you could also do > > span(:id, ...).wait_for_change('exists?', true) > > -andy > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From speedsticko at hotmail.com Tue Jun 13 22:10:14 2006 From: speedsticko at hotmail.com (kwan l) Date: Wed, 14 Jun 2006 04:10:14 +0200 Subject: [Wtr-general] Trouble with links in a div Message-ID: Thanks Bret, but i still get the same error. Creating the "ie" instance works fine. It fails when I try to reference the link inside the div tag. I peeked in the code for "getLink" and it fails at the lines : def getLink( how, what ) links = document.all.tags("A") Apparently, the document object is nil. Accessing the link from the "ie" instance also calls "getLink" but in that case the document object isn't nil. It's only nil when I access the "link" collection of the div object. I'm not quite sure what's going on here ... Kwan Date: Tue, 13 Jun 2006 17:51:46 -0500From: bret at pettichord.comTo: wtr-general at rubyforge.orgSubject: Re: [Wtr-general] Trouble with links in a divOn 6/13/06, kwan l wrote: ie = Watir::IE.start("C:\\testwatir.html") Try this instead:Watir::IE.start("file:///C:/testwatir.html")Bret _________________________________________________________________ Plus d'affichage et plus de partage. Essayez gratuitement Windows Live Messenger Beta http://ideas.live.com/programpage.aspx?versionId=0eccd94b-eb48-497c-8e60-c6313f7ebb73 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060614/f7eab511/attachment.html From Andy.Case at qsa.qld.edu.au Tue Jun 13 22:20:42 2006 From: Andy.Case at qsa.qld.edu.au (Andy Case) Date: Wed, 14 Jun 2006 12:20:42 +1000 Subject: [Wtr-general] Drop Down Lists (li) Message-ID: <86EED55AE819274B8308B62A225457D80367BD88@exch1.qsa.local> I am new to WATIR/RUBY and have run into difficulty with a drop down list, example HTML below. The example documentation doesn't seem to cover this. Can anyone suggest how I would use WATIR to select the drop down options?

Manage Staff Accounts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This email (including any attached files) is for the intended recipient(s) only. If you received this email by mistake, please, as a courtesy, tell the sender, then delete this email. The views and opinions are the originator's and do not necessarily reflect those of the Queensland Studies Authority. All reasonable precautions have been taken to ensure that this email contained no viruses at the time it was sent. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060629/aae172ac/attachment.html From Andy.Case at qsa.qld.edu.au Thu Jun 29 01:30:46 2006 From: Andy.Case at qsa.qld.edu.au (Andy Case) Date: Thu, 29 Jun 2006 15:30:46 +1000 Subject: [Wtr-general] File Download Pop-Ups Message-ID: <86EED55AE819274B8308B62A225457D80367BFE9@exch1.qsa.local> Hi, I get the following Pop-up from my application. Is there a WATIR command that allows me to select the buttons below. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This email (including any attached files) is for the intended recipient(s) only. If you received this email by mistake, please, as a courtesy, tell the sender, then delete this email. The views and opinions are the originator's and do not necessarily reflect those of the Queensland Studies Authority. All reasonable precautions have been taken to ensure that this email contained no viruses at the time it was sent. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060629/fa7115d9/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 23355 bytes Desc: Outlook.jpg Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060629/fa7115d9/attachment.jpe From zeljko.filipin at gmail.com Thu Jun 29 06:52:32 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Thu, 29 Jun 2006 12:52:32 +0200 Subject: [Wtr-general] checkbox list created by javascript In-Reply-To: <86EED55AE819274B8308B62A225457D80367BFE2@exch1.qsa.local> References: <86EED55AE819274B8308B62A225457D80367BFE2@exch1.qsa.local> Message-ID: I do not see a checkbox at your html. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060629/51ca6175/attachment.html From FLegarreta at NYBOT.com Thu Jun 29 09:51:58 2006 From: FLegarreta at NYBOT.com (Legarreta, Frank) Date: Thu, 29 Jun 2006 09:51:58 -0400 Subject: [Wtr-general] Need help populating a field array using variables Message-ID: <3111B45C4B9CE54C86294493C8C7E197041E4FD6@mailserver.nybot.com> Thank you all so much! ie.text_field(:name,"grade_result_list[#{x}].beanCount").set("800") Worked like a charm. Regards, Frank "This e-mail and any attachments may contain confidential and privileged information. Any dissemination or use of the information by a person other than the intended recipient is unauthorized and may be illegal. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this e-mail and destroy any copies. Although this e-mail and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by the Board of Trade of the City of New York, Inc. or the New York Clearing Corporation for any loss or damage arising in any way from its use. Thank you." -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060629/91e4e448/attachment.html From rodrigo.martin at enratio.com Thu Jun 29 10:42:53 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Thu, 29 Jun 2006 11:42:53 -0300 Subject: [Wtr-general] Help with finding a link using regular expression and url propertie Message-ID: Hello! I need to find and click a link with an specific url, which depends of an item id number: itemId="22053541" $browser.link(:url, /sell?act=categ&subAct=similarItem&siteID=MLA&itemID=#{itemId}/).click When i run this, watir shows me: c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1939:in `assert_exists': Unable to locate object, using url and (?-mix:sell?act=categ&subAct=similarItem&siteID=MLA&itemID=22053541) Am i doing something wrong with that regular expression? Thanks in advance Cheers! Rodrigo Julian Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060629/b9f0c1d9/attachment.html From charley.baker at gmail.com Thu Jun 29 11:02:59 2006 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 29 Jun 2006 09:02:59 -0600 Subject: [Wtr-general] File Download Pop-Ups In-Reply-To: <86EED55AE819274B8308B62A225457D80367BFE9@exch1.qsa.local> References: <86EED55AE819274B8308B62A225457D80367BFE9@exch1.qsa.local> Message-ID: Take a look at winClicker.rb, clickWindowsButton should work, something like this: require 'watir/winClicker' clicker = WinClicker.new clicker.clickWindowsButton('File Download', 'Save') -Charley On 6/28/06, Andy Case wrote: > > Hi, > > I get the following Pop-up from my application. > > Is there a WATIR command that allows me to select the buttons below. > > _______________________________________________ > 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/20060629/4a1f8ed2/attachment.html From ravishan at BIWORLDWIDE.com Thu Jun 29 12:30:34 2006 From: ravishan at BIWORLDWIDE.com (Ravishankar, MG) Date: Thu, 29 Jun 2006 11:30:34 -0500 Subject: [Wtr-general] Help with finding a link using regular expression andurl propertie Message-ID: <03CAD54D1DFAE5488B6C53178EF9EA3C07040F63@EXCHANGE1.biperf.com> Add a back slash before the question mark - like this: $browser.link(:url, /sell\?act=categ&subAct=similarItem&siteID=MLA&itemID=#{itemId}/).click ________________________________ itemId="22053541" $browser.link(:url, /sell?act=categ&subAct=similarItem&siteID=MLA&itemID=#{itemId}/).click When i run this, watir shows me: c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1939:in `assert_exists': Unable to locate object, using url and (?-mix:sell?act=categ&subAct=similarItem&siteID=MLA&itemID=22053541) This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060629/56bc8ef1/attachment.html From NSandhu at raleys.com Thu Jun 29 12:22:25 2006 From: NSandhu at raleys.com (NIcky Sandhu) Date: Thu, 29 Jun 2006 09:22:25 -0700 Subject: [Wtr-general] xpath error Message-ID: <882C8B6492C05E48AEA0C7B2D7D4254E03C148A2@EMAIL.RALEYSNT.SECNET.RALEYS.COM> I got an error using the xpath feature with watir 1.5.1.1045. >> ie.link(:xpath,'//a[contains(string(.),"Search Now")]').click I have attached the error document and the stack trace below. The document seems to be valid xml and other xpath tools work fine REXML::ParseException: #> .... c:/ruby/lib/ruby/site_ruby/1.8/rexml/encodings/ICONV.rb:7:in `conv' c:/ruby/lib/ruby/site_ruby/1.8/rexml/encodings/ICONV.rb:7:in `decode' c:/ruby/lib/ruby/site_ruby/1.8/rexml/source.rb:50:in `encoding=' c:/ruby/lib/ruby/site_ruby/1.8/rexml/parsers/baseparser.rb:203:in `pull' c:/ruby/lib/ruby/site_ruby/1.8/rexml/parsers/treeparser.rb:21:in `parse' c:/ruby/lib/ruby/site_ruby/1.8/rexml/document.rb:190:in `build' c:/ruby/lib/ruby/site_ruby/1.8/rexml/document.rb:45:in `initialize' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:1887:in `create_rexml_document_object' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:1869:in `rexml_document_object' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:2071:in `elements_by_xpath' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:2064:in `element_by_xpath' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:3466:in `locate' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:2256:in `assert_exists' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:2396:in `click' (irb):11:in `irb_binding' c:/ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' c:/ruby/lib/ruby/1.8/irb/workspace.rb:52 ... "\240 > Warning: this e-mail may contain information proprietary to Raley's and is intended only for the use of the intended recipients. If the reader of this message is not an 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 message in error, please notify the sender immediately. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060629/fbb5dd5d/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: error.xml Type: text/xml Size: 28860 bytes Desc: error.xml Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060629/fbb5dd5d/attachment.xml From rodrigo.martin at enratio.com Thu Jun 29 12:39:27 2006 From: rodrigo.martin at enratio.com (Rodrigo Julian Martin) Date: Thu, 29 Jun 2006 13:39:27 -0300 Subject: [Wtr-general] Help with finding a link using regular expressionandurl propertie References: <03CAD54D1DFAE5488B6C53178EF9EA3C07040F63@EXCHANGE1.biperf.com> Message-ID: Thank you so much Ravishankar! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 2928 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060629/cd37bb39/attachment.bin From Mark_Cain at RL.gov Thu Jun 29 14:16:25 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Thu, 29 Jun 2006 11:16:25 -0700 Subject: [Wtr-general] File Download Pop-Ups In-Reply-To: Message-ID: I ended up having to put a sleep 2 in winClicker to get this to click the button. At approximately line 299 in WinClicker.rb-this section: if d != -1 makeWindowActive(hwnd) ==> sleep 2 clickButtonWithHandle(d) else After I added this then it would click the specified button. Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Charley Baker Sent: Thursday, June 29, 2006 8:03 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] File Download Pop-Ups Take a look at winClicker.rb, clickWindowsButton should work, something like this: require 'watir/winClicker' clicker = WinClicker.new clicker.clickWindowsButton('File Download', 'Save') -Charley On 6/28/06, Andy Case wrote: Hi, I get the following Pop-up from my application. Is there a WATIR command that allows me to select the buttons below. _______________________________________________ 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/20060629/d3863cca/attachment.html From dsolis at yahoo.com Thu Jun 29 20:45:00 2006 From: dsolis at yahoo.com (David Solis) Date: Thu, 29 Jun 2006 17:45:00 -0700 (PDT) Subject: [Wtr-general] How to detect open browsers Message-ID: <20060630004500.91967.qmail@web82805.mail.mud.yahoo.com> I want to be able to detect any open browsers before my tests starts running. Does anybody have an idea on how to detect open browsers? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060629/5b0caac8/attachment.html From angrez at gmail.com Thu Jun 29 23:08:06 2006 From: angrez at gmail.com (Angrez Singh) Date: Fri, 30 Jun 2006 08:38:06 +0530 Subject: [Wtr-general] xpath error In-Reply-To: <882C8B6492C05E48AEA0C7B2D7D4254E03C148A2@EMAIL.RALEYSNT.SECNET.RALEYS.COM> References: <882C8B6492C05E48AEA0C7B2D7D4254E03C148A2@EMAIL.RALEYSNT.SECNET.RALEYS.COM> Message-ID: Hi, Are you using latest version of REXML i.e. 3.1.4 ? If not install latest version of REXML and try XPath again. Regards, Angrez On 6/29/06, NIcky Sandhu wrote: > > I got an error using the xpath feature with watir 1.5.1.1045. > >> ie.link(:xpath,'//a[contains(string(.),"Search Now")]').click > > I have attached the error document and the stack trace below. > The document seems to be valid xml and other xpath tools work fine > REXML::ParseException: # error.xml >> > .... > c:/ruby/lib/ruby/site_ruby/1.8/rexml/encodings/ICONV.rb:7:in `conv' > c:/ruby/lib/ruby/site_ruby/1.8/rexml/encodings/ICONV.rb:7:in `decode' > c:/ruby/lib/ruby/site_ruby/1.8/rexml/source.rb:50:in `encoding=' > c:/ruby/lib/ruby/site_ruby/1.8/rexml/parsers/baseparser.rb:203:in `pull' > c:/ruby/lib/ruby/site_ruby/1.8/rexml/parsers/treeparser.rb:21:in `parse' > c:/ruby/lib/ruby/site_ruby/1.8/rexml/document.rb:190:in `build' > c:/ruby/lib/ruby/site_ruby/1.8/rexml/document.rb:45:in `initialize' > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:1887:in > `create_rexml_document_object' > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:1869:in > `rexml_document_object' > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:2071:in > `elements_by_xpath' > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:2064:in > `element_by_xpath' > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:3466:in > `locate' > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:2256:in > `assert_exists' > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:2396:in `click' > (irb):11:in `irb_binding' > c:/ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' > c:/ruby/lib/ruby/1.8/irb/workspace.rb:52 > ... > "\240 Line: > Position: > Last 80 unconsumed characters: > bgColor="#ffffff" le > from c:/ruby/lib/ruby/site_ruby/1.8/rexml/parsers/treeparser.rb:89:in > `parse' > from c:/ruby/lib/ruby/site_ruby/1.8/rexml/document.rb:190:in `build' > from c:/ruby/lib/ruby/site_ruby/1.8/rexml/document.rb:45:in `initialize' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:1887:in > `create_rexml_document_object' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:1869:in > `rexml_document_object' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:2071:in > `elements_by_xpath' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:2064:in > `element_by_xpath' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:3466:in > `locate' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:2256:in > `assert_exists' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1045/./watir.rb:2396:in > `click' > from (irb):11 > >> > > *Warning: this e-mail may contain information proprietary to Raley's and > is intended only for the use of the intended recipients. If the reader of > this message is not an 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 message in error, please notify the sender immediately.* > > > _______________________________________________ > 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/20060630/74884200/attachment.html From bret at pettichord.com Fri Jun 30 01:32:25 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 30 Jun 2006 00:32:25 -0500 Subject: [Wtr-general] How to detect open browsers In-Reply-To: <20060630004500.91967.qmail@web82805.mail.mud.yahoo.com> References: <20060630004500.91967.qmail@web82805.mail.mud.yahoo.com> Message-ID: On 6/29/06, David Solis wrote: > > I want to be able to detect any open browsers before my tests starts > running. Does anybody have an idea on how to detect open browsers? > Look at Watir::IE.close_all in watir/close_all.rb in trunk or a recent build. It finds browsers and then closes them. It is still probably a little buggy and i haven't released any unit tests for it. (I do have some tests for it that test in the context of a particular application.) Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060630/f8e2dccb/attachment.html From NSandhu at raleys.com Fri Jun 30 11:38:53 2006 From: NSandhu at raleys.com (NIcky Sandhu) Date: Fri, 30 Jun 2006 08:38:53 -0700 Subject: [Wtr-general] xpath error Message-ID: <882C8B6492C05E48AEA0C7B2D7D4254E03C14983@EMAIL.RALEYSNT.SECNET.RALEYS.COM> >> require 'rexml/rexml' require 'rexml/rexml' => true >> print REXML::Version print REXML::Version 3.1.4=> nil >> Warning: this e-mail may contain information proprietary to Raley's and is intended only for the use of the intended recipients. If the reader of this message is not an 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 message in error, please notify the sender immediately. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Angrez Singh Sent: Thursday, June 29, 2006 8:08 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] xpath error Hi, Are you using latest version of REXML i.e. 3.1.4 ? If not install latest version of REXML and try XPath again. Regards, Angrez On 6/29/06, NIcky Sandhu wrote: I got an error using the xpath feature with watir 1.5.1.1045. >> ie.link(:xpath,'//a[contains(string(.),"Search Now")]').click I have attached the error document and the stack trace below. The document seems to be valid xml and other xpath tools work fine REXML::ParseException: #> .... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060630/ec503f75/attachment.html