From wang.ning at neusoft.com Wed Mar 1 02:19:46 2006 From: wang.ning at neusoft.com (=?gb2312?B?zfXE/g==?=) Date: Wed, 01 Mar 2006 15:19:46 +0800 Subject: [Wtr-general] frame access denied Message-ID: <012101c63d00$85001fb0$8059a8c0@si.neusoft> I have written a ruby program using watir to read some data from IE. It works well on my computer. But on another computer in another city, following exception appears and the program is terminated. I have read some articles on the internet, they said this exception will not influence program running, but my program can not go on running on this point? What should i do? W, [01-Mar-2006 14:50:00#3392] WARN -- : frame error in waitdocument OLE error code:80070005 in ????? HRESULT error code:0x80020009 ????? E:/CQ_bugbase/ruby/lib/ruby/site_ruby/1.8/watir.rb:1405:in `method_missing' E:/CQ_bugbase/ruby/lib/ruby/site_ruby/1.8/watir.rb:1405:in `wait' E:/CQ_bugbase/ruby/lib/ruby/site_ruby/1.8/watir.rb:1404:in `upto' E:/CQ_bugbase/ruby/lib/ruby/site_ruby/1.8/watir.rb:1404:in `wait' E:/CQ_bugbase/ruby/lib/ruby/site_ruby/1.8/watir.rb:2014:in `click' BugbaseCQ.rb:46:in `ReadNowOfOneTest' BugbaseCQ.rb:101:in `ReadNow' BugbaseCQ.rb:101:in `each' BugbaseCQ.rb:101:in `ReadNow' BugbaseCQ.rb:238 E:/CQ_bugbase/ruby/lib/ruby/site_ruby/1.8/watir.rb:1728:in `initialize': Unable to locate a frame with name pagearea (Watir::Exception::UnknownFrameException) from E:/CQ_bugbase/ruby/lib/ruby/site_ruby/1.8/watir.rb:222:in `new' from E:/CQ_bugbase/ruby/lib/ruby/site_ruby/1.8/watir.rb:222:in `frame' from BugbaseCQ.rb:49:in `ReadNowOfOneTest' from BugbaseCQ.rb:101:in `ReadNow' from BugbaseCQ.rb:101:in `each' from BugbaseCQ.rb:101:in `ReadNow' from BugbaseCQ.rb:238 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060301/218ffed0/attachment.html From bret at pettichord.com Wed Mar 1 02:57:43 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 1 Mar 2006 01:57:43 -0600 Subject: [Wtr-general] frame access denied In-Reply-To: <012101c63d00$85001fb0$8059a8c0@si.neusoft> References: <012101c63d00$85001fb0$8059a8c0@si.neusoft> Message-ID: It looks to me like you are running into a cross-site scripting limitation. The frame is being served by a separate server. On 3/1/06, ?? wrote: > > I have written a ruby program using watir to read some data from IE. It > works well on my computer. But on another computer in another city, > following exception appears and the program is terminated. I have read some > articles on the internet, they said this exception will not influence > program running, but my program can not go on running on this point? > > What should i do? > > W, [01-Mar-2006 14:50:00#3392] WARN -- : frame error in waitdocument > OLE error code:80070005 in > ????? > > HRESULT error code:0x80020009 > ????? > E:/CQ_bugbase/ruby/lib/ruby/site_ruby/1.8/watir.rb:1405:in > `method_missing' > E:/CQ_bugbase/ruby/lib/ruby/site_ruby/1.8/watir.rb:1405:in `wait' > E:/CQ_bugbase/ruby/lib/ruby/site_ruby/1.8/watir.rb:1404:in `upto' > E:/CQ_bugbase/ruby/lib/ruby/site_ruby/1.8/watir.rb:1404:in `wait' > E:/CQ_bugbase/ruby/lib/ruby/site_ruby/1.8/watir.rb:2014:in `click' > BugbaseCQ.rb:46:in `ReadNowOfOneTest' > BugbaseCQ.rb:101:in `ReadNow' > BugbaseCQ.rb:101:in `each' > BugbaseCQ.rb:101:in `ReadNow' > BugbaseCQ.rb:238 > E:/CQ_bugbase/ruby/lib/ruby/site_ruby/1.8/watir.rb:1728:in `initialize': > Unable > to locate a frame with name pagearea > (Watir::Exception::UnknownFrameException) > from E:/CQ_bugbase/ruby/lib/ruby/site_ruby/1.8/watir.rb:222:in > `new' > from E:/CQ_bugbase/ruby/lib/ruby/site_ruby/1.8/watir.rb:222:in > `frame' > from BugbaseCQ.rb:49:in `ReadNowOfOneTest' > from BugbaseCQ.rb:101:in `ReadNow' > from BugbaseCQ.rb:101:in `each' > from BugbaseCQ.rb:101:in `ReadNow' > from BugbaseCQ.rb:238 > > > _______________________________________________ > 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/20060301/576a65e2/attachment.html From zeljko.filipin at gmail.com Wed Mar 1 02:59:05 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 1 Mar 2006 08:59:05 +0100 Subject: [Wtr-general] any way to make IE.text_field.set optional? In-Reply-To: <49EE4085F2E38D47AC70EF04AA5582A7085FE4@ITOREX3.interac.local> References: <49EE4085F2E38D47AC70EF04AA5582A7085FE4@ITOREX3.interac.local> Message-ID: This will also work (if you are passing nil or false when you do notwant to set text field). Just a bit shorter. def enter_text(arg1, arg2, arg3) @ie.text_field(:name, 'field1').set(arg1) if arg1 @ie.text_field(:name, 'field2').set(arg2) if arg2 @ie.text_field(:name, 'field3').set(arg3) if arg3end From kiranb4u at yahoo.com Wed Mar 1 23:51:31 2006 From: kiranb4u at yahoo.com (Kiran Kumar..) Date: Wed, 1 Mar 2006 20:51:31 -0800 (PST) Subject: [Wtr-general] How to click a button present on the pop up window.. Message-ID: <20060302045131.27551.qmail@web33206.mail.mud.yahoo.com> Hi All, How to click a button present on the pop up window..please Can any one help me out. regards Kiran.. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From mr.muskrat at gmail.com Thu Mar 2 01:05:16 2006 From: mr.muskrat at gmail.com (Matthew Musgrove) Date: Thu, 02 Mar 2006 00:05:16 -0600 Subject: [Wtr-general] How to click a button present on the pop up window.. In-Reply-To: <20060302045131.27551.qmail@web33206.mail.mud.yahoo.com> References: <20060302045131.27551.qmail@web33206.mail.mud.yahoo.com> Message-ID: <44068B1C.7090307@gmail.com> Hi Kiran, This has been answered before so I'll just link to the one I know of. http://rubyforge.org/pipermail/wtr-general/2005-September/003573.html HTH, Matt Kiran Kumar.. wrote: >Hi All, > >How to click a button present on the pop up window..please Can any one >help me out. > >regards >Kiran.. > >__________________________________________________ >Do You Yahoo!? >Tired of spam? Yahoo! Mail has the best spam protection around >http://mail.yahoo.com >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > From angrez at gmail.com Thu Mar 2 08:07:34 2006 From: angrez at gmail.com (Angrez Singh) Date: Thu, 2 Mar 2006 18:37:34 +0530 Subject: [Wtr-general] xpath support doesn't work for me In-Reply-To: References: Message-ID: Hi Chris, require 'watir' > ie = Watir::IE.start("http://localhost/index.asp") > ie.element_by_xpath("//map[@id='top_menu_map']/area[contains(@href , ' > signup.htm')]/").click > The browser opens to the correct page but I get the following error > > web_pages>ruby trial.rb > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1922:in `elements_by_xpath': > undefined method `elements' for nil:NilClass (NoMethodError) > from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1912:in > `element_by_xpath' > from trial.rb:5 > One thing I noticed is that when you install 'watir' using 'watir_installer.exe' located in 'installer' folder it install wrong version of 'watir.rb' file. Its installs 'Watir 1.4.1' which doesn't contain xpath support. I think you should use either 'install.rb' file for installation or copy the files manually. I tried the same code & its working on my machine. I was able click the image map. Make sure that the following things are in place: 1. You have latest version of 'watir.rb' file. 2. You have copied 'elements.rb' & 'functions.rb' to [ruby installation directory]/lib/ruby/1.8/rexml I don't think you need any thing else than this. Just let me know if problem still persists. Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060302/88cb1319/attachment.html From ChintakrindiMeghana at managementdynamics.com Thu Mar 2 13:04:03 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Thu, 2 Mar 2006 13:04:03 -0500 Subject: [Wtr-general] Volume Testing Message-ID: <6CF3AA425295C7479483AC0018EDF98B01DADFEC@MI8NYCMAIL03.Mi8.com> Hi We have an web application and we are planning for the volume testing.(Processing large volumes of the transactions). Can anyone give explain, how to do proceed with that type of testing using the watir. Thanks Meghanath -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060302/88dd7f0e/attachment.html From Mark_Cain at rl.gov Thu Mar 2 13:53:10 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Thu, 2 Mar 2006 10:53:10 -0800 Subject: [Wtr-general] Older scripts running really slow... Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D591@EX5V.rl.gov> I have some Watir script I wrote about 6 months ago and needed to do some regression testing using these scripts. Well when I began running them they were really slow! Where it used to take 15 to 20 seconds to fill out the page form now is taking 3 to 4 minutes. I have recently upgraded my Watir installation will the latest from SVN and ruby with 1.8.4 Preview 3. Has anyone one else been experiencing slowness? If yes, what did you do to fix it? Thanks, ____________________ Mark L. Cain LMIT - E*STARS(r) ~ Lead Test Engineer 1981 Snyder, MSIN: G3-62, Richland, WA 99354 Mark_Cain at RL.gov 509.376.5458 "640 Kilobytes of computer memory ought to be enough for anybody." - Bill Gates, 1981 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060302/8cc214dd/attachment.html From bret at pettichord.com Thu Mar 2 15:56:52 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 2 Mar 2006 14:56:52 -0600 Subject: [Wtr-general] Older scripts running really slow... In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D591@EX5V.rl.gov> References: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D591@EX5V.rl.gov> Message-ID: Could you please do an apples to apples comparison running your scripts with different versions of Watir against the same version of your application. It's possible an application change triggered the performance problem. Let us know the results. It would also be nice if you could share the Watir scripts that are slow. Bret On 3/2/06, Cain, Mark wrote: > > I have some Watir script I wrote about 6 months ago and needed to do some > regression testing using these scripts. Well when I began running them they > were really slow! Where it used to take 15 to 20 seconds to fill out the > page form now is taking 3 to 4 minutes. I have recently upgraded my Watir > installation will the latest from SVN and ruby with 1.8.4 Preview 3. Has > anyone one else been experiencing slowness? If yes, what did you do to fix > it? > > > > Thanks, > > ____________________ > *Mark L. Cain* > *LMIT - **E*****STARS*(r)* **~ **Lead Test Engineer* > *1981 Snyder, MSIN: G3-62, Richland, WA 99354** > Mark_Cain at RL.gov > 509.376.5458* > *"640 Kilobytes of computer memory ought to be enough for anybody."** - > Bill Gates, 1981 * > > > > _______________________________________________ > 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/20060302/fafed502/attachment.html From tester.paul at gmail.com Thu Mar 2 15:59:44 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Thu, 2 Mar 2006 15:59:44 -0500 Subject: [Wtr-general] Need advice for splitting large scripts into smaller ones Message-ID: <37c405480603021259xfa04d7dy@mail.gmail.com> I have this one script that I'm working on that is just getting bigger as I go along. I would like to break out some of the smaller chunks/tests into separate script files, but I'm not sure of the logistics of this. I tried looking at the unittests but I couldn't answer my questions by looking at them. For example, my one (master) script is set up like the following: ---- #includes #global variables class TC_blahblahblah < Test::Unit::TestCase def cust_method_1 ... end def cust_method_2 ... end test_a_somename yadda yadda yadda end test_b_somename .... end ---- Now, if I break out "test_a_somename" into a separate script, what is the correct format for calling/running it from within the master script? In the new sub-script, do I have to repeat the "class TC_blahblahblah < Test::Unit::TestCase" structure, or just put the "test_a_somename" structure? Do I have to re-include all the require/include lines that were in the master script? (I don't think I should, but I'm not sure.) If I have methods that are defined in the master script, will they be properly called from one of the sub-scripts, or do I have to put them in the sub-scripts too? (I expect it to work if they're only defined in the master script.) Please forgive these basic questions. I searched the message archives but I couldn't find anything helpful other than "you should break up large scripts into smaller ones when they get too long (like ~ 1000 lines)". And I haven't had any success scanning the other Ruby/Watir documentation to give me practical advice on how to do this either. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060302/25152147/attachment.html From Mark_Cain at rl.gov Thu Mar 2 16:16:33 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Thu, 2 Mar 2006 13:16:33 -0800 Subject: [Wtr-general] Older scripts running really slow... Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D595@EX5V.rl.gov> With Watir 1.4.1 (just downloaded and reinstalled) it took: Finished in 31.797 seconds. With Watir from current SVN (did a checkout on the http://svn.openqa.org/svn/watir/trunk/watir) Finished in 179.047 seconds. This is the part that ran: =============================================================== # feature tests for javascript PopUps # revision: $Revision: 1.11 $ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ require 'c:\watir\unittests\setup' require 'watir\dialog' class TC_PER < Test::Unit::TestCase include Watir def gotoPopUpPage() $ie.goto("http://apwtst200.rl.gov/rapidweb/chg/per/per/main.cfm") $ie.set_fast_speed() end #def startClicker( button , waitTime = 3) # w = WinClicker.new # longName = $ie.dir.gsub("/" , "\\" ) # shortName = w.getShortFileName(longName) # c = "start rubyw #{shortName }\\watir\\clickJSDialog.rb #{button } #{ waitTime} " # puts "Starting #{c}" # w.winsystem(c) # w=nil #end def test0_originator $d = Time.now.strftime("%m/%d/%Y") gotoPopUpPage() $ie.text_field(:name, "d_date").set("#{ $d }") $ie.text_field(:name, "d_time").set("1111") $ie.selectBox( :name, "progproj").select(/Other/) $ie.selectBox( :name, "locationID").select(/AW Farm/) $ie.selectBox( :name, "ProblemDiscoveredID").select(/EH\-22/) $ie.text_field( :name, "probdescript").set("Probelm Description Test") $ie.selectBox( :name, "sinID").select(/Cooling Water/) $ie.text_field( :name, "ein").set("eid-001") $ie.checkBox( :name, "reqnsatcheck").set $ie.text_field( :name, "reqnsat").set("Req Not Satisfied") $ie.checkBox( :name, "sourcedoccheck").set $ie.text_field( :name, "SourceDocument").set("Source Doc") $ie.text_field( :name, "actionplan").set("This is a test of the Action Plan text area.") $ie.text_field( :name, "RecommendedCorrectiveActions").set("This is a test of Recommended Actions Taken text area.") $ie.radio( :name, "feedback", 1).set $ie.radio( :name, "feedbacktype", 'other').set $ie.text_field( :name, "feedbackother").set("Feedback Other") #startClicker("OK" , 3) $ie.button("Submit").click_no_wait dialog.button('OK').click $ie.link(:text, /PER-2006-/i).click assert($ie.text_field(:name, "d_date").verify_contains("#{$d}")) assert($ie.text_field(:name, "d_time").verify_contains("11:11")) assert_arrayEquals( ["Other" ] , $ie.select_list(:name, "progproj").getSelectedItems) assert_arrayEquals( ["AW Farm" ] , $ie.select_list(:name, "locationID").getSelectedItems) assert_arrayEquals( ["EH-22" ] , $ie.select_list(:name, "ProblemDiscoveredID").getSelectedItems) assert($ie.text_field(:name, "probdescript").verify_contains("Probelm Description Test")) assert_arrayEquals( ["Cooling Water" ] , $ie.select_list(:name, "sinID").getSelectedItems) assert($ie.text_field(:name, "ein").verify_contains("eid-001")) assert($ie.checkbox(:name, "reqnsatcheck").isSet?) assert($ie.text_field(:name, "reqnsat").verify_contains("Req Not Satisfied")) assert($ie.checkbox(:name, "sourcedoccheck").isSet?) assert($ie.text_field(:name, "SourceDocument").verify_contains("Source Doc")) assert($ie.text_field(:name, "actionplan").verify_contains("This is a test of the Action Plan text area.")) assert($ie.text_field(:name, "RecommendedCorrectiveActions").verify_contains("This is a test of Recommended Actions Taken text area.")) assert($ie.radio(:name, "feedback").isSet?) assert($ie.radio(:name, "feedbacktype", 'other').isSet?) assert($ie.text_field(:name, "feedbackother").verify_contains("Feedback Other")) end end --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Thursday, March 02, 2006 12:57 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Older scripts running really slow... Could you please do an apples to apples comparison running your scripts with different versions of Watir against the same version of your application. It's possible an application change triggered the performance problem. Let us know the results. It would also be nice if you could share the Watir scripts that are slow. Bret On 3/2/06, Cain, Mark < Mark_Cain at rl.gov > wrote: I have some Watir script I wrote about 6 months ago and needed to do some regression testing using these scripts. Well when I began running them they were really slow! Where it used to take 15 to 20 seconds to fill out the page form now is taking 3 to 4 minutes. I have recently upgraded my Watir installation will the latest from SVN and ruby with 1.8.4 Preview 3. Has anyone one else been experiencing slowness? If yes, what did you do to fix it? Thanks, ____________________ Mark L. Cain LMIT - E *STARS (r) ~ Lead Test Engineer 1981 Snyder, MSIN: G3-62, Richland, WA 99354 Mark_Cain at RL.gov 509.376.5458 "640 Kilobytes of computer memory ought to be enough for anybody." - Bill Gates, 1981 _______________________________________________ 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/20060302/ea9b5f0b/attachment.html From christopher_brown at engin.com.au Thu Mar 2 16:10:26 2006 From: christopher_brown at engin.com.au (Brown, Christopher) Date: Fri, 3 Mar 2006 08:10:26 +1100 Subject: [Wtr-general] xpath support doesn't work for me Message-ID: Hi Angrez, Using firefox, I've gone to the URL below http://rubyforge.org/cgi-bin/viewcvs.cgi/*checkout*/watir/watir/rexml/elemen t.rb?root=wtr &rev=1.1 then selected Save Page As ... then browsed to C:\ruby\lib\ruby\1.8\rexml I got prompted to confirm I want to over-write; I selected Yes I did the same for functions.rb. For watir.rb I saved to C:\ruby\lib\ruby\site_ruby\1.8 (I've also tried C:\ruby\lib\ruby\1.8 just in case I got the wrong location). When I ran my test script I still got c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1922:in `elements_by_xpath': undefined method `elements' for nil:NilClass (NoMethodError) from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1912:in `element_by_xpath' from G:/workspace/web_pages/trial.rb:3 With nothing to lose, I've tried running install.rb. Here's the output C:\Temp\watir>install.rb C:\Temp\watir\watir.gif Going to install to C:\watir\ with startMenu=1 and desktop=1 Copying Files watir.rb -> c:\ruby\lib\ruby\site_ruby\1.8/watir.rb cp -r watir c:\ruby\lib\ruby\site_ruby\1.8 cp -r examples C:\watir\ cp -r unitTests C:\watir\ cp -r doc C:\watir\ cp -r rdoc C:\watir\ Rdoc not installed Creating start menu shortcuts Creating desktop shortcuts Installation Completed The revision of watir.rb is 1.282 I still get the same error message when I run my test script. What version of Ruby are you running? Regards Chris -----Original Message----- From: Angrez Singh [mailto:angrez at gmail.com] Sent: Friday, March 03, 2006 12:08 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] xpath support doesn't work for me Hi Chris, require 'watir' ie = Watir::IE.start(" http://localhost/index.asp ") ie.element_by_xpath("//map[@id='top_menu_map']/area[contains(@href , 'signup.htm')]/").click The browser opens to the correct page but I get the following error web_pages>ruby trial.rb C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1922:in `elements_by_xpath': undefined method `elements' for nil:NilClass (NoMethodError) from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1912:in `element_by_xpath' from trial.rb:5 One thing I noticed is that when you install 'watir' using 'watir_installer.exe' located in 'installer' folder it install wrong version of 'watir.rb' file. Its installs 'Watir 1.4.1' which doesn't contain xpath support. I think you should use either 'install.rb' file for installation or copy the files manually. I tried the same code & its working on my machine. I was able click the image map. Make sure that the following things are in place: 1. You have latest version of 'watir.rb' file. 2. You have copied 'elements.rb' & 'functions.rb' to [ruby installation directory]/lib/ruby/1.8/rexml I don't think you need any thing else than this. Just let me know if problem still persists. Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060303/abb497ce/attachment.html From mb at michaelbolton.net Thu Mar 2 16:45:16 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Thu, 2 Mar 2006 16:45:16 -0500 Subject: [Wtr-general] Older scripts running really slow... In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D595@EX5V.rl.gov> Message-ID: <006e01c63e42$97dfad60$6901a8c0@Koko> Obvious possibilities are - response time on the Web pages - typing speed in the forms Are your pages visible? Do they look slower? When they're loading? When they're typing? If you've got one test that takes half a minute and another that takes three minutes (which you do), the places where slowdowns are happening are plausibly visible to the human eye. Apropos of not very much, but you noticed that "Problem" is spelled "Probelm" below, right? ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: March 2, 2006 4:17 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Older scripts running really slow... With Watir 1.4.1 (just downloaded and reinstalled) it took: Finished in 31.797 seconds. With Watir from current SVN (did a checkout on the http://svn.openqa.org/svn/watir/trunk/watir) Finished in 179.047 seconds. This is the part that ran: =============================================================== # feature tests for javascript PopUps # revision: $Revision: 1.11 $ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ require 'c:\watir\unittests\setup' require 'watir\dialog' class TC_PER < Test::Unit::TestCase include Watir def gotoPopUpPage() $ie.goto("http://apwtst200.rl.gov/rapidweb/chg/per/per/main.cfm") $ie.set_fast_speed() end #def startClicker( button , waitTime = 3) # w = WinClicker.new # longName = $ie.dir.gsub("/" , "\\" ) # shortName = w.getShortFileName(longName) # c = "start rubyw #{shortName }\\watir\\clickJSDialog.rb #{button } #{ waitTime} " # puts "Starting #{c}" # w.winsystem(c) # w=nil #end def test0_originator $d = Time.now.strftime("%m/%d/%Y") gotoPopUpPage() $ie.text_field(:name, "d_date").set("#{ $d }") $ie.text_field(:name, "d_time").set("1111") $ie.selectBox( :name, "progproj").select(/Other/) $ie.selectBox( :name, "locationID").select(/AW Farm/) $ie.selectBox( :name, "ProblemDiscoveredID").select(/EH\-22/) $ie.text_field( :name, "probdescript").set("Probelm Description Test") $ie.selectBox( :name, "sinID").select(/Cooling Water/) $ie.text_field( :name, "ein").set("eid-001") $ie.checkBox( :name, "reqnsatcheck").set $ie.text_field( :name, "reqnsat").set("Req Not Satisfied") $ie.checkBox( :name, "sourcedoccheck").set $ie.text_field( :name, "SourceDocument").set("Source Doc") $ie.text_field( :name, "actionplan").set("This is a test of the Action Plan text area.") $ie.text_field( :name, "RecommendedCorrectiveActions").set("This is a test of Recommended Actions Taken text area.") $ie.radio( :name, "feedback", 1).set $ie.radio( :name, "feedbacktype", 'other').set $ie.text_field( :name, "feedbackother").set("Feedback Other") #startClicker("OK" , 3) $ie.button("Submit").click_no_wait dialog.button('OK').click $ie.link(:text, /PER-2006-/i).click assert($ie.text_field(:name, "d_date").verify_contains("#{$d}")) assert($ie.text_field(:name, "d_time").verify_contains("11:11")) assert_arrayEquals( ["Other" ] , $ie.select_list(:name, "progproj").getSelectedItems) assert_arrayEquals( ["AW Farm" ] , $ie.select_list(:name, "locationID").getSelectedItems) assert_arrayEquals( ["EH-22" ] , $ie.select_list(:name, "ProblemDiscoveredID").getSelectedItems) assert($ie.text_field(:name, "probdescript").verify_contains("Probelm Description Test")) assert_arrayEquals( ["Cooling Water" ] , $ie.select_list(:name, "sinID").getSelectedItems) assert($ie.text_field(:name, "ein").verify_contains("eid-001")) assert($ie.checkbox(:name, "reqnsatcheck").isSet?) assert($ie.text_field(:name, "reqnsat").verify_contains("Req Not Satisfied")) assert($ie.checkbox(:name, "sourcedoccheck").isSet?) assert($ie.text_field(:name, "SourceDocument").verify_contains("Source Doc")) assert($ie.text_field(:name, "actionplan").verify_contains("This is a test of the Action Plan text area.")) assert($ie.text_field(:name, "RecommendedCorrectiveActions").verify_contains("This is a test of Recommended Actions Taken text area.")) assert($ie.radio(:name, "feedback").isSet?) assert($ie.radio(:name, "feedbacktype", 'other').isSet?) assert($ie.text_field(:name, "feedbackother").verify_contains("Feedback Other")) end end --Mark _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Thursday, March 02, 2006 12:57 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Older scripts running really slow... Could you please do an apples to apples comparison running your scripts with different versions of Watir against the same version of your application. It's possible an application change triggered the performance problem. Let us know the results. It would also be nice if you could share the Watir scripts that are slow. Bret On 3/2/06, Cain, Mark < Mark_Cain at rl.gov > wrote: I have some Watir script I wrote about 6 months ago and needed to do some regression testing using these scripts. Well when I began running them they were really slow! Where it used to take 15 to 20 seconds to fill out the page form now is taking 3 to 4 minutes. I have recently upgraded my Watir installation will the latest from SVN and ruby with 1.8.4 Preview 3. Has anyone one else been experiencing slowness? If yes, what did you do to fix it? Thanks, ____________________ Mark L. Cain LMIT - E *STARS R ~ Lead Test Engineer 1981 Snyder, MSIN: G3-62, Richland, WA 99354 Mark_Cain at RL.gov 509.376.5458 "640 Kilobytes of computer memory ought to be enough for anybody." - Bill Gates, 1981 _______________________________________________ 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/20060302/c79a3325/attachment.html From Sean.Gallagher at ticketmaster.com Thu Mar 2 18:09:03 2006 From: Sean.Gallagher at ticketmaster.com (Sean Gallagher) Date: Thu, 2 Mar 2006 15:09:03 -0800 Subject: [Wtr-general] Need advice for splitting large scripts into sm aller ones Message-ID: <71D28C8451BFD5119B2B00508BE26E640C64900B@pasmail3.office.tmcs> Paul, Here is how I am doing it. I run my tests using test::unit, the same as you. I have organized my tests into logical groups of test methods, each contained in its own test file. The framework is flexible and supports running tests as 1) a single test method, 2) a test file (all test methods in a single file), or 3) a test suite (set of files). I try to keep my test framework as simple as possible. I find that xUnit assertions combined with some simple log output is sufficient for my needs right now. This approach is quite flexible. I can easily switch between test environments, users and test sites. Each test is discrete and does not depend on any other test. All test files are in a single directory by project (again, to keep it simple). I have the following "core" files: common.rb constants.rb testrunner.rb plus many test files. Here is how they work: 1) common.rb This is a module file and includes setup and teardown methods (called by every test method from all test files; read up on test::unit for details), as well as methods to start IE, clear cache files, log test execution, login to AUT, etc. Common stuff. common.rb is where I reference required libs. The file starts like so: require 'watir' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'watir/testUnitAddons' require 'yaml' require 'constants' # My constants file module Common def setup ... end def teardown ... end ...etc. Check out "Programming Ruby: The Pragmatic Programmer's Guide" for more info on modules. 2) constants.rb As the name implies, just constants. ;-) The file is nothing more than a list of constants used by my tests, such as paths and some test data that rarely changes (and does not change during testing). 3) testrunner.rb My test suite file, modeled after after C:\watir_bonus\unitTests\core_tests.rb (see Watir unit tests) As for the test files, each file starts like so: require 'common' class TC_Example01 < Test::Unit::TestCase include Common def set_test_defaults ... end def test_001 ... end I use a template with the above code for starting new test files. Some notes- As the test methods are logically grouped within a file, I made the decision to put test data in my test files. I tried different ways, but ultimately found this easiest when developing new tests. The method "set_test_defaults" is called from each test method that needs access to the data. As well, each test method calls a "log_test" method (in common.rb) to spit out some useful information as the tests execute. Answers to your questions are inline, below. Hope this helps! Sean -- Sean Gallagher CRM Quality Assurance, Ticketmaster sean.gallagher at ticketmaster.com > Now, if I break out "test_a_somename" into a separate script, > what is the correct format for calling/running it from within > the master script? Use require > > In the new sub-script, do I have to repeat the "class > TC_blahblahblah < Test::Unit::TestCase" structure, or just > put the "test_a_somename" structure? Yes, you must extend Test::Unit::TestCase Do I have to re-include > all the require/include lines that were in the master script? > (I don't think I should, but I'm not sure.) For the approach that I use, yes. > > If I have methods that are defined in the master script, will > they be properly called from one of the sub-scripts, or do I > have to put them in the sub-scripts too? (I expect it to work > if they're only defined in the master script.) No, best to put common methods in a module. > > Please forgive these basic questions. I searched the message > archives but I couldn't find anything helpful other than "you > should break up large scripts into smaller ones when they get > too long (like ~ 1000 lines)". And I haven't had any success > scanning the other Ruby/Watir documentation to give me > practical advice on how to do this either. No problem. Happy to help. > > Paul. > > > From tester.paul at gmail.com Thu Mar 2 19:08:22 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Thu, 2 Mar 2006 19:08:22 -0500 Subject: [Wtr-general] Need advice for splitting large scripts into sm aller ones In-Reply-To: <71D28C8451BFD5119B2B00508BE26E640C64900B@pasmail3.office.tmcs> References: <71D28C8451BFD5119B2B00508BE26E640C64900B@pasmail3.office.tmcs> Message-ID: <37c405480603021608g2abab3b4v@mail.gmail.com> Wow. Thanks very much for the detailed reply. You've given me a lot to work with. When I'm finished writing the scripts I'll try breaking them up in a way similar to how you've described it. Cheers! Paul. On 02/03/06, Sean Gallagher wrote: > > Paul, > Here is how I am doing it. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060302/362de65e/attachment.html From BPaatsch at activevoice.com Thu Mar 2 19:39:32 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Thu, 2 Mar 2006 18:39:32 -0600 Subject: [Wtr-general] Unknown OLE server: `AutoItX3.Control' (WI2OLERuntimeError)! Why? Message-ID: Hello, Strange how Murphy's law always catches you by surprise during demonstrations. My code worked just fine on my machine. However creates an error message when I try to run it on my managers machine with following error message: :/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1311:in `initialize': Unknown OLE server: `AutoItX3.Control' (WI2OLERuntimeError) HRESULT error code:0x800401f3 Invalid class string from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1311:in `new' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1311:in `set_window_state' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1291:in `maximize' Does anybody know why? Thanks, Bernd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060302/175456a0/attachment.html From billagee at gmail.com Thu Mar 2 21:36:25 2006 From: billagee at gmail.com (Bill Agee) Date: Thu, 2 Mar 2006 18:36:25 -0800 Subject: [Wtr-general] Unknown OLE server: `AutoItX3.Control' (WI2OLERuntimeError)! Why? In-Reply-To: References: Message-ID: <73e7817e0603021836q7034ada8od014e43573e5992f@mail.gmail.com> On 3/2/06, Paatsch, Bernd wrote: > > :/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1311:in > `initialize': Unknown OLE server: `AutoItX3.Control' (WI2OLERuntimeError) Maybe AutoItX.dll didn't get registered on his machine during the Watir install? I've never had to register it manually with the most recent Watir version, but I guess it's worth a try. You can try manually registering the dll on that machine, using the path to the file, like so: regsvr32 "C:\ruby\lib\ruby\site_ruby\1.8\watir\AutoItX3.dll" From Mark_Cain at rl.gov Thu Mar 2 17:32:47 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Thu, 2 Mar 2006 14:32:47 -0800 Subject: [Wtr-general] Older scripts running really slow... Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D597@EX5V.rl.gov> I ran the same test on the same web form using two different versions of Watir. The results are listed below. The web pages load as fast as they did before the problem is when the script inputs the data. In 1.4.1 the data is typed and the navigation between input fields is very quickly, but in the current version 1.5.X the data is typed in noticeably slower and navigation between input fields is monumentally slower! My purpose for upgrading was to take advantage of the new popup and modal windows code as well as xpath and other stuff-xpath didn't work at all for me either. As a side not, here are a couple of humorous quotes about spelling: ;-P "It's a damn poor mind that can only think of one way to spell a word." -- Andrew Jackson "I don't give a damn for a man that can only spell a word one way." -- Mark Twain --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Michael Bolton Sent: Thursday, March 02, 2006 1:45 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Older scripts running really slow... Obvious possibilities are - response time on the Web pages - typing speed in the forms Are your pages visible? Do they look slower? When they're loading? When they're typing? If you've got one test that takes half a minute and another that takes three minutes (which you do), the places where slowdowns are happening are plausibly visible to the human eye. Apropos of not very much, but you noticed that "Problem" is spelled "Probelm" below, right? ---Michael B. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: March 2, 2006 4:17 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Older scripts running really slow... With Watir 1.4.1 (just downloaded and reinstalled) it took: Finished in 31.797 seconds. With Watir from current SVN (did a checkout on the http://svn.openqa.org/svn/watir/trunk/watir) Finished in 179.047 seconds. This is the part that ran: =============================================================== # feature tests for javascript PopUps # revision: $Revision: 1.11 $ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ require 'c:\watir\unittests\setup' require 'watir\dialog' class TC_PER < Test::Unit::TestCase include Watir def gotoPopUpPage() $ie.goto("http://apwtst200.rl.gov/rapidweb/chg/per/per/main.cfm") $ie.set_fast_speed() end #def startClicker( button , waitTime = 3) # w = WinClicker.new # longName = $ie.dir.gsub("/" , "\\" ) # shortName = w.getShortFileName(longName) # c = "start rubyw #{shortName }\\watir\\clickJSDialog.rb #{button } #{ waitTime} " # puts "Starting #{c}" # w.winsystem(c) # w=nil #end def test0_originator $d = Time.now.strftime("%m/%d/%Y") gotoPopUpPage() $ie.text_field(:name, "d_date").set("#{ $d }") $ie.text_field(:name, "d_time").set("1111") $ie.selectBox( :name, "progproj").select(/Other/) $ie.selectBox( :name, "locationID").select(/AW Farm/) $ie.selectBox( :name, "ProblemDiscoveredID").select(/EH\-22/) $ie.text_field( :name, "probdescript").set("Probelm Description Test") $ie.selectBox( :name, "sinID").select(/Cooling Water/) $ie.text_field( :name, "ein").set("eid-001") $ie.checkBox( :name, "reqnsatcheck").set $ie.text_field( :name, "reqnsat").set("Req Not Satisfied") $ie.checkBox( :name, "sourcedoccheck").set $ie.text_field( :name, "SourceDocument").set("Source Doc") $ie.text_field( :name, "actionplan").set("This is a test of the Action Plan text area.") $ie.text_field( :name, "RecommendedCorrectiveActions").set("This is a test of Recommended Actions Taken text area.") $ie.radio( :name, "feedback", 1).set $ie.radio( :name, "feedbacktype", 'other').set $ie.text_field( :name, "feedbackother").set("Feedback Other") #startClicker("OK" , 3) $ie.button("Submit").click_no_wait dialog.button('OK').click $ie.link(:text, /PER-2006-/i).click assert($ie.text_field(:name, "d_date").verify_contains("#{$d}")) assert($ie.text_field(:name, "d_time").verify_contains("11:11")) assert_arrayEquals( ["Other" ] , $ie.select_list(:name, "progproj").getSelectedItems) assert_arrayEquals( ["AW Farm" ] , $ie.select_list(:name, "locationID").getSelectedItems) assert_arrayEquals( ["EH-22" ] , $ie.select_list(:name, "ProblemDiscoveredID").getSelectedItems) assert($ie.text_field(:name, "probdescript").verify_contains("Probelm Description Test")) assert_arrayEquals( ["Cooling Water" ] , $ie.select_list(:name, "sinID").getSelectedItems) assert($ie.text_field(:name, "ein").verify_contains("eid-001")) assert($ie.checkbox(:name, "reqnsatcheck").isSet?) assert($ie.text_field(:name, "reqnsat").verify_contains("Req Not Satisfied")) assert($ie.checkbox(:name, "sourcedoccheck").isSet?) assert($ie.text_field(:name, "SourceDocument").verify_contains("Source Doc")) assert($ie.text_field(:name, "actionplan").verify_contains("This is a test of the Action Plan text area.")) assert($ie.text_field(:name, "RecommendedCorrectiveActions").verify_contains("This is a test of Recommended Actions Taken text area.")) assert($ie.radio(:name, "feedback").isSet?) assert($ie.radio(:name, "feedbacktype", 'other').isSet?) assert($ie.text_field(:name, "feedbackother").verify_contains("Feedback Other")) end end --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Thursday, March 02, 2006 12:57 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Older scripts running really slow... Could you please do an apples to apples comparison running your scripts with different versions of Watir against the same version of your application. It's possible an application change triggered the performance problem. Let us know the results. It would also be nice if you could share the Watir scripts that are slow. Bret On 3/2/06, Cain, Mark < Mark_Cain at rl.gov > wrote: I have some Watir script I wrote about 6 months ago and needed to do some regression testing using these scripts. Well when I began running them they were really slow! Where it used to take 15 to 20 seconds to fill out the page form now is taking 3 to 4 minutes. I have recently upgraded my Watir installation will the latest from SVN and ruby with 1.8.4 Preview 3. Has anyone one else been experiencing slowness? If yes, what did you do to fix it? Thanks, ____________________ Mark L. Cain LMIT - E *STARS (r) ~ Lead Test Engineer 1981 Snyder, MSIN: G3-62, Richland, WA 99354 Mark_Cain at RL.gov 509.376.5458 "640 Kilobytes of computer memory ought to be enough for anybody." - Bill Gates, 1981 _______________________________________________ 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/20060302/29f4d68b/attachment.html From bret at pettichord.com Thu Mar 2 22:04:37 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 2 Mar 2006 21:04:37 -0600 Subject: [Wtr-general] Older scripts running really slow... In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D597@EX5V.rl.gov> References: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D597@EX5V.rl.gov> Message-ID: Thanks for the detailed report. The watir code has several delay settings that apply separately between keys on text_field.set and between separate calls. These settings are tweaked by the fast_mode switches as well as other settings. You can probably tweak these settings yourself and get better performance, but it seems like their default settings have somehow changed between 1.4and 1.5. I will look into this further. Bret On 3/2/06, Cain, Mark wrote: > > I ran the same test on the same web form using two different versions of > Watir. The results are listed below. The web pages load as fast as they > did before the problem is when the script inputs the data. In 1.4.1 the > data is typed and the navigation between input fields is very quickly, but > in the current version 1.5.X the data is typed in noticeably slower and > navigation between input fields is monumentally slower! > > > > My purpose for upgrading was to take advantage of the new popup and modal > windows code as well as xpath and other stuff?xpath didn't work at all for > me either. > > > > As a side not, here are a couple of humorous quotes about spelling: ;-P > > "It's a damn poor mind that can only think of one way to spell a word." -- > Andrew Jackson > > "I don't give a damn for a man that can only spell a word one way." -- > Mark Twain > > > > *--Mark* > > > ------------------------------ > > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Michael Bolton > *Sent:* Thursday, March 02, 2006 1:45 PM > > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] Older scripts running really slow... > > > > Obvious possibilities are > > > > - response time on the Web pages > > - typing speed in the forms > > > > Are your pages visible? Do they look slower? When they're loading? When > they're typing? If you've got one test that takes half a minute and another > that takes three minutes (which you do), the places where slowdowns are > happening are plausibly visible to the human eye. > > > > Apropos of not very much, but you noticed that "Problem" is spelled > "Probelm" below, right? > > > > ---Michael B. > > > ------------------------------ > > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Cain, Mark > *Sent:* March 2, 2006 4:17 PM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] Older scripts running really slow... > > With Watir 1.4.1 (just downloaded and reinstalled) it took: > > Finished in 31.797 seconds. > > > > With Watir from current SVN (did a checkout on the > http://svn.openqa.org/svn/watir/trunk/watir) > > Finished in 179.047 seconds. > > > > This is the part that ran: > > =============================================================== > > # feature tests for javascript PopUps > > # revision: $Revision: 1.11 $ > > > > $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == > __FILE__ > > require 'c:\watir\unittests\setup' > > require 'watir\dialog' > > > > class TC_PER < Test::Unit::TestCase > > include Watir > > > > def gotoPopUpPage() > > $ie.goto("http://apwtst200.rl.gov/rapidweb/chg/per/per/main.cfm") > > $ie.set_fast_speed() > > end > > > > #def startClicker( button , waitTime = 3) > > # w = WinClicker.new > > # longName = $ie.dir.gsub("/" , "\\" ) > > # shortName = w.getShortFileName(longName) > > # c = "start rubyw #{shortName }\\watir\\clickJSDialog.rb #{button } > #{ waitTime} " > > # puts "Starting #{c}" > > # w.winsystem(c) > > # w=nil > > #end > > > > def test0_originator > > $d = Time.now.strftime("%m/%d/%Y") > > gotoPopUpPage() > > > > $ie.text_field(:name, "d_date").set("#{ $d }") > > $ie.text_field(:name, "d_time").set("1111") > > > > $ie.selectBox( :name, "progproj").select(/Other/) > > $ie.selectBox( :name, "locationID").select(/AW Farm/) > > $ie.selectBox( :name, "ProblemDiscoveredID").select(/EH\-22/) > > $ie.text_field( :name, "probdescript").set("Probelm Description > Test") > > $ie.selectBox( :name, "sinID").select(/Cooling Water/) > > $ie.text_field( :name, "ein").set("eid-001") > > $ie.checkBox( :name, "reqnsatcheck").set > > $ie.text_field( :name, "reqnsat").set("Req Not Satisfied") > > $ie.checkBox( :name, "sourcedoccheck").set > > $ie.text_field( :name, "SourceDocument").set("Source Doc") > > > > $ie.text_field( :name, "actionplan").set("This is a test of the > Action Plan text area.") > > $ie.text_field( :name, "RecommendedCorrectiveActions").set("This is > a test of Recommended Actions Taken text area.") > > > > $ie.radio( :name, "feedback", 1).set > > $ie.radio( :name, "feedbacktype", 'other').set > > $ie.text_field( :name, "feedbackother").set("Feedback Other") > > > > #startClicker("OK" , 3) > > $ie.button("Submit").click_no_wait > > dialog.button('OK').click > > > > $ie.link(:text, /PER-2006-/i).click > > > > assert($ie.text_field(:name, "d_date").verify_contains("#{$d}")) > > assert($ie.text_field(:name, "d_time").verify_contains("11:11")) > > assert_arrayEquals( ["Other" ] , $ie.select_list(:name, > "progproj").getSelectedItems) > > assert_arrayEquals( ["AW Farm" ] , $ie.select_list(:name, > "locationID").getSelectedItems) > > assert_arrayEquals( ["EH-22" ] , $ie.select_list(:name, > "ProblemDiscoveredID").getSelectedItems) > > assert($ie.text_field(:name, > "probdescript").verify_contains("Probelm Description Test")) > > assert_arrayEquals( ["Cooling Water" ] , $ie.select_list(:name, > "sinID").getSelectedItems) > > assert($ie.text_field(:name, "ein").verify_contains("eid-001")) > > assert($ie.checkbox(:name, "reqnsatcheck").isSet?) > > assert($ie.text_field(:name, "reqnsat").verify_contains("Req Not > Satisfied")) > > assert($ie.checkbox(:name, "sourcedoccheck").isSet?) > > assert($ie.text_field(:name, > "SourceDocument").verify_contains("Source Doc")) > > > > assert($ie.text_field(:name, "actionplan").verify_contains("This > is a test of the Action Plan text area.")) > > assert($ie.text_field(:name, > "RecommendedCorrectiveActions").verify_contains("This is a test of > Recommended Actions Taken text area.")) > > > > assert($ie.radio(:name, "feedback").isSet?) > > assert($ie.radio(:name, "feedbacktype", 'other').isSet?) > > assert($ie.text_field(:name, > "feedbackother").verify_contains("Feedback Other")) > > end > > end > > > > *--Mark* > > > ------------------------------ > > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Bret Pettichord > *Sent:* Thursday, March 02, 2006 12:57 PM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] Older scripts running really slow... > > > > Could you please do an apples to apples comparison running your scripts > with different versions of Watir against the same version of your > application. It's possible an application change triggered the performance > problem. Let us know the results. > > It would also be nice if you could share the Watir scripts that are slow. > > Bret > > On 3/2/06, *Cain, Mark* < Mark_Cain at rl.gov> wrote: > > I have some Watir script I wrote about 6 months ago and needed to do some > regression testing using these scripts. Well when I began running them they > were really slow! Where it used to take 15 to 20 seconds to fill out the > page form now is taking 3 to 4 minutes. I have recently upgraded my Watir > installation will the latest from SVN and ruby with 1.8.4 Preview 3. Has > anyone one else been experiencing slowness? If yes, what did you do to fix > it? > > > > Thanks, > > ____________________ > *Mark L. Cain* > *LMIT - **E** ***STARS* (r)* **~ **Lead Test Engineer* > *1981 Snyder, MSIN: G3-62, Richland, WA 99354** > Mark_Cain at RL.gov > 509.376.5458* > *"640 Kilobytes of computer memory ought to be enough for anybody."** - > Bill Gates, 1981 * > > > > > _______________________________________________ > 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/20060302/aef2e832/attachment.html From bret at pettichord.com Thu Mar 2 23:39:46 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 2 Mar 2006 22:39:46 -0600 Subject: [Wtr-general] Need advice for splitting large scripts into smaller ones In-Reply-To: <37c405480603021259xfa04d7dy@mail.gmail.com> References: <37c405480603021259xfa04d7dy@mail.gmail.com> Message-ID: Very briefly, there are two things you can do to split your code into separate files. 1. Put your test methods in separate files. 2. Put your custom methods in separate files. And then after doing this, you have to be able to put it all together again. You can put test methods in different classes defined in different files. It is best if you put them in classes with different names (but they should all be subclasses of Test::Unit::TestCase). To stitch them back together again, all you have to do is create a master script that require's each of the test scripts. You can put your custom methods in a module that is defined in a separate file. module TestsApplicationFoo def custom_method_1 ... end end Then you can use the methods thus: require 'tests_application_foo' # name of the file with TestApplicationFoo module class MyTests < Test::Unit::TestCase include TestsApplicationFoo def test_1 ... custom_method_1 end end This is brief, but should set you in the right direction as you read the various Ruby references. Bret On 3/2/06, Paul Carvalho wrote: > > I have this one script that I'm working on that is just getting bigger as > I go along. I would like to break out some of the smaller chunks/tests into > separate script files, but I'm not sure of the logistics of this. I tried > looking at the unittests but I couldn't answer my questions by looking at > them. > > For example, my one (master) script is set up like the following: > ---- > #includes > #global variables > > class TC_blahblahblah < Test::Unit::TestCase > def cust_method_1 > ... > end > > def cust_method_2 > ... > end > > test_a_somename > yadda yadda yadda > end > > test_b_somename > .... > end > ---- > > Now, if I break out "test_a_somename" into a separate script, what is the > correct format for calling/running it from within the master script? > > In the new sub-script, do I have to repeat the "class TC_blahblahblah < > Test::Unit::TestCase" structure, or just put the "test_a_somename" > structure? Do I have to re-include all the require/include lines that were > in the master script? (I don't think I should, but I'm not sure.) > > If I have methods that are defined in the master script, will they be > properly called from one of the sub-scripts, or do I have to put them in the > sub-scripts too? (I expect it to work if they're only defined in the master > script.) > > Please forgive these basic questions. I searched the message archives but > I couldn't find anything helpful other than "you should break up large > scripts into smaller ones when they get too long (like ~ 1000 lines)". And > I haven't had any success scanning the other Ruby/Watir documentation to > give me practical advice on how to do this either. > > Paul. > > > _______________________________________________ > 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/20060302/a21ecd31/attachment.html From angrez at gmail.com Fri Mar 3 00:30:07 2006 From: angrez at gmail.com (Angrez Singh) Date: Fri, 3 Mar 2006 11:00:07 +0530 Subject: [Wtr-general] xpath support doesn't work for me In-Reply-To: References: Message-ID: Hi Chris, What version of Ruby are you running? > I am using Ruby 1.8.2 and latest watir tar ball. Also REXML version is " 3.1.2.1". You can check this by using following command: ruby -vrrexml/rexml -e 'p REXML::Version, PLATFORM' But still I have no clue of what is going wrong? Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060303/cfe8bd7b/attachment.html From bret at pettichord.com Fri Mar 3 01:09:58 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 3 Mar 2006 00:09:58 -0600 Subject: [Wtr-general] xpath support doesn't work for me In-Reply-To: References: Message-ID: On 3/2/06, Angrez Singh wrote: > > One thing I noticed is that when you install 'watir' using > 'watir_installer.exe' located in 'installer' folder it install wrong version > of 'watir.rb' file. Its installs 'Watir 1.4.1' which doesn't contain xpath > support. I think you should use either 'install.rb' file for installation > or copy the files manually. > Ouch! We should delete that from trunk. (I'm not on the machine with SVN configuration right now, or else i'd do right now.) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060303/c996dd3f/attachment.html From benjamin.hemken at hmmh.de Fri Mar 3 02:24:06 2006 From: benjamin.hemken at hmmh.de (Benjamin Hemken) Date: Fri, 3 Mar 2006 08:24:06 +0100 Subject: [Wtr-general] How to start more Tests Message-ID: Hello, at the moment we are working on a test framework, which helps us to write tests easily. We have a login and user administration. But we noticed that there are problems, when 2 user want to start a test. The first tests just stops. Both tests where started in a thread, so that we can navigate through the html site, after the test starts. Anybody here who knows how to solve this problem? Another problem is, that our whole application is very very slow. We use SCGI + Apache and to render a site, or a redirect takes about 5 seconds.I know this isn't a watir problem, but maybe someone can help :-) Finally i want to apologise for my bad english, but i tried my best. -Benjamin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060303/538ac114/attachment.html From bret at pettichord.com Fri Mar 3 02:50:39 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 3 Mar 2006 01:50:39 -0600 Subject: [Wtr-general] How to start more Tests In-Reply-To: References: Message-ID: On 3/3/06, Benjamin Hemken wrote: > > Hello, > at the moment we are working on a test framework, which helps us to write > tests easily. > We have a login and user administration. But we noticed that there are > problems, > when 2 user want to start a test. The first tests just stops. Both tests > where started in > a thread, so that we can navigate through the html site, after the test > starts. Anybody here > who knows how to solve this problem? > Show us your test. > Another problem is, that our whole application is very very slow. We use > SCGI + Apache > and to render a site, or a redirect takes about 5 seconds.I know this > isn't a watir problem, > but maybe someone can help :-) > What is your problem? Are you having a problem with your scripts because the application is slow? What problems are you seeing? Please be specific. Your English is fine, but we can't read your mind. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060303/5c94d894/attachment.html From benjamin.hemken at hmmh.de Fri Mar 3 03:58:10 2006 From: benjamin.hemken at hmmh.de (Benjamin Hemken) Date: Fri, 3 Mar 2006 09:58:10 +0100 Subject: [Wtr-general] How to start more Tests Message-ID: Thanks for the fast response. 1. Test def start_test_1 Thread.new { test1 } Thread.pass end def test1 $ie = Watir::IE.new $ie.goto "this is just a test url.com" $ie.text_field(:name, "test").set "Input" $ie.form(:name, "form").submit end 2. Test def start_test_2 Thread.new { test2 } Thread.pass end def test2 $ie = Watir::IE.new $ie.goto "another test url.com" $ie.button(:name, "button").click end The first test stops at a random position after starting the second one. When we start the test alone, of course it works. Because of the automating, the instance variable takes the same name, this is just an example to show, how a test looks like. Showing the whole code would be to complex. But normaly the application works like this: You enter the test code into a textarea. This is written into the database. A method is generated and given to a list. This list is used by the Testrunner to run the test. Speed problem: We have a web application. The time to render a rhtml file, a view, takes about 5 seconds. We are using the normal way of navigating through sites. For example: def show_list render :action => 'list' end or def show_about redirect_to :action => 'list_by_project', :id => params[:id] end The rhtml file consists of a few links and projects. Everything comes from the database. SCGI: http://www.zedshaw.com/projects/scgi_rails/ and the normal apache. -Benjamin -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Friday, March 03, 2006 8:51 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How to start more Tests On 3/3/06, Benjamin Hemken wrote: Hello, at the moment we are working on a test framework, which helps us to write tests easily. We have a login and user administration. But we noticed that there are problems, when 2 user want to start a test. The first tests just stops. Both tests where started in a thread, so that we can navigate through the html site, after the test starts. Anybody here who knows how to solve this problem? Show us your test. Another problem is, that our whole application is very very slow. We use SCGI + Apache and to render a site, or a redirect takes about 5 seconds.I know this isn't a watir problem, but maybe someone can help :-) What is your problem? Are you having a problem with your scripts because the application is slow? What problems are you seeing? Please be specific. Your English is fine, but we can't read your mind. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060303/3d8089a1/attachment.html From Malcolm.Beaton at conchango.com Fri Mar 3 04:44:49 2006 From: Malcolm.Beaton at conchango.com (Beaton, Malcolm) Date: Fri, 3 Mar 2006 09:44:49 -0000 Subject: [Wtr-general] Extracting contents of a list box in a table References: Message-ID: OK Firstly apologies if this has a really obvious answer that I should have known but it has stumped me and I cant find any really good resources for tables handling (surprisingly) I have this on a page (see HTML at the bottom) and this table is table[2]. The top row has a box to enter text into (which I can do) and pressing add adds them to the list box at the bottom. I want to automate this and obviously I need to check the bottom box has the artists I added. But I cant seem to hit the table? I have tried ie.form( :name, "aspnetForm").select_list( :id, "ctl00_pageBody_FavouriteArtistsListBox").getAllContents ie.table(:index, 2).select_list(:id, "ctl00_pageBody_FavouriteArtistsListBox").getAllContents And a few other things but I cant get the content back out of it. All it tells me is this is an undefined method for #
Favourite artists:
Thanks in advance Malcolm _____________________________________________________________________ This e-mail has been scanned for viruses by MessageLabs. The information contained in this message is confidential and is intended for the addressee only. If you have received this message in error, please notify Conchango plc as soon as possible. The unauthorised use, disclosure, copying or alteration of this message is prohibited and may be unlawful. The internet cannot guarantee the integrity of this message and therefore Conchango plc will not be liable for the message if modified. Reg. Heritage House, Church Road, Egham, Surrey, TW20 9QD T 44 (0) 1784 222 222 F 44 (0) 1784 222 200 E talktous at conchango.com No. 2598884 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 7349 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060303/e45fffc1/attachment.bin From marcus.tettmar at gmail.com Fri Mar 3 06:53:36 2006 From: marcus.tettmar at gmail.com (Marcus Tettmar) Date: Fri, 3 Mar 2006 11:53:36 +0000 Subject: [Wtr-general] Problem enumerating forms Message-ID: Hi, Why does this fail: $IE0.goto("http://www.google.com/") $IE0.form( :name, "f").text_field( :name, "q").set("ruby") $IE0.form( :name, "f").button( :name, "btnG").click This fails with: WIN32OLERuntimeError: Failed to get IEnum Interface HRESULT error code:0x80020003 Member not found. If you look at the source of the google search page form "f" *does* exist and the text field and button exist within it. This works: $IE0.goto("http://www.google.com/") $IE0.text_field( :name, "q").set("ruby") $IE0.button( :name, "btnG").click But for a more complicated app that has several forms, which perhaps share names of objects, the first method is necessary. Watir WebRecorder correctly records the form for this very reason, but the first block of code fails, even though the form does exist, with those objects in it. Is this a known problem, or am I missing something? Thanks! -- Marcus Tettmar http://www.mjtnet.com/ Macro Scheduler & WebRecorder for Windows & Web Automation and Testing. WebRecorder for Ruby/Watir now available. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060303/f2fddccc/attachment.html From tester.paul at gmail.com Fri Mar 3 09:50:15 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Fri, 3 Mar 2006 09:50:15 -0500 Subject: [Wtr-general] Extracting contents of a list box in a table In-Reply-To: References: Message-ID: <37c405480603030650i7ad027dfv@mail.gmail.com> Hi Malcom, I don't know if this will work for you or not, but I solved (what I think is) a similar problem yesterday. I had to find a way to click a link in a table that isn't particularly distinguishable from a number of other links on the page. What I did was use relative addressing to solve the problem. That is, I told the script to first figure out what cell in the table it wants and then click the first link it finds within it. The code looks something like: > ie.frame('MainWindow').table(:index, 3)[spec_row][link_column].link(:index, 1).flash > ie.frame('MainWindow').table(:index, 3)[spec_row][link_column].link(:index, 1).click In your case, does the following work for you (i.e. replacing 'spec_row' and 'spec_col' with appropriate values)? > ie.table(:index, 2)[spec_row][spec_col].select_list(:index, 1).getAllContents Paul. On 03/03/06, Beaton, Malcolm wrote: > > OK Firstly apologies if this has a really obvious answer that I should > have known but it has stumped me and I cant find any really good resources > for tables handling (surprisingly) > > I have this on a page (see HTML at the bottom) and this table is table[2]. > The top row has a box to enter text into (which I can do) and pressing add > adds them to the list box at the bottom. I want to automate this and > obviously I need to check the bottom box has the artists I added. But I cant > seem to hit the table? > > I have tried > > ie.form( :name, "aspnetForm").select_list( :id, > "ctl00_pageBody_FavouriteArtistsListBox").getAllContents > > ie.table(:index, > 2).select_list(:id, "ctl00_pageBody_FavouriteArtistsListBox").getAllContents > > [snip] -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060303/181f0bbd/attachment.html From Mark_Cain at rl.gov Fri Mar 3 10:42:46 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Fri, 3 Mar 2006 07:42:46 -0800 Subject: [Wtr-general] Extracting contents of a list box in a table Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D598@EX5V.rl.gov> When adding dynamic content to a table what I have had to do is something like: #Load the contents of the table and its objects into the table variable table = $ie.table(:index, 2) table[3][2].click $ie.text_field(:name, ' ctl00$pageBody$FavouriteArtistsTextBox ').set("Some text you add") $ie.button("ctl00$pageBody$AddArtistButton ").click #This will reload the just entered dynamic content so you can search it. table = $ie.table(:index, 2) sList = table[3][2]. select_list(:id, "ctl00_pageBody_FavouriteArtistsListBox").getAllContents for myList in sList next if myList =~ /Some text you add/ puts "Item found in list" end Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Beaton, Malcolm Sent: Friday, March 03, 2006 1:45 AM To: wtr-general at rubyforge.org Subject: Extracting contents of a list box in a table OK Firstly apologies if this has a really obvious answer that I should have known but it has stumped me and I cant find any really good resources for tables handling (surprisingly) I have this on a page (see HTML at the bottom) and this table is table[2]. The top row has a box to enter text into (which I can do) and pressing add adds them to the list box at the bottom. I want to automate this and obviously I need to check the bottom box has the artists I added. But I cant seem to hit the table? I have tried ie.form( :name, "aspnetForm").select_list( :id, "ctl00_pageBody_FavouriteArtistsListBox").getAllContents ie.table(:index, 2).select_list(:id, "ctl00_pageBody_FavouriteArtistsListBox").getAllContents And a few other things but I cant get the content back out of it. All it tells me is this is an undefined method for #
Favourite artists:
Thanks in advance Malcolm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060303/e863c4b2/attachment.html From tester.paul at gmail.com Fri Mar 3 11:45:12 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Fri, 3 Mar 2006 11:45:12 -0500 Subject: [Wtr-general] How do you skip a disabled checkbox? Message-ID: <37c405480603030845l40bbfd3dk@mail.gmail.com> I want to run through a set of checkboxes on an input page and press the [Submit] button in the shortest amount of lines. Using the API reference, I came up with the following that works for me: > ie.frame('MainWindow').checkboxes.each { |x| x.set } The only problem is that sometimes a checkbox *may* be disabled when you enter this page. In that case, when the loop above gets to the disabled checkbox, it spits out an 'ObjectDisabledException' error (as expected). Is there a quick and easy way that I can get this loop to just skip any disabled checkboxes and continue? I can't think of any way to use an 'if' or 'unless' argument that will capture the exception and continue. Do I have to expand out the loop and insert 'rescue' lines? Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060303/9117bafb/attachment.html From zeljko.filipin at gmail.com Fri Mar 3 11:52:50 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Fri, 3 Mar 2006 17:52:50 +0100 Subject: [Wtr-general] How do you skip a disabled checkbox? In-Reply-To: <37c405480603030845l40bbfd3dk@mail.gmail.com> References: <37c405480603030845l40bbfd3dk@mail.gmail.com> Message-ID: This will do it. ie.frame('MainWindow').checkboxes.each { |x| x.set unless x.disabed } --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/ From hgs at dmu.ac.uk Fri Mar 3 12:06:25 2006 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Fri, 3 Mar 2006 17:06:25 +0000 (WET) Subject: [Wtr-general] How do you skip a disabled checkbox? In-Reply-To: <37c405480603030845l40bbfd3dk@mail.gmail.com> References: <37c405480603030845l40bbfd3dk@mail.gmail.com> Message-ID: On Fri, 3 Mar 2006, Paul Carvalho wrote: [...] > ie.frame('MainWindow').checkboxes.each { |x| x.set } > The only problem is [...]a checkbox *may* be disabled [...]. In that > case, [...] it spits out an 'ObjectDisabledException' [...] > there a quick and easy way that I can get this loop to just skip any > disabled checkboxes and continue? ie.frame('MainWindow').checkboxes.each do |x| begin x.set rescue ObjectDisabledException end end > [...] Do I have to expand out the loop and > insert 'rescue' lines? ie.frame('MainWindow').checkboxes.each { |x| x.set rescue true } http://redhanded.hobix.com/bits/myFavoriteBadPractices.html > Paul. HTH Hugh From BPaatsch at activevoice.com Fri Mar 3 12:19:44 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Fri, 3 Mar 2006 11:19:44 -0600 Subject: [Wtr-general] Taking screen shots Message-ID: Hello, I am using watir for a month now and loving it. Is it possible to take screen shots? The idea is in case a test fails that then a screenshot is taken and stored in a folder for later review. Thanks, Bernd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060303/9f739bfa/attachment.html From mb at michaelbolton.net Fri Mar 3 13:00:08 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Fri, 3 Mar 2006 13:00:08 -0500 Subject: [Wtr-general] Problem enumerating forms In-Reply-To: Message-ID: <01f901c63eec$4eef7e00$6901a8c0@Koko> I'm working out of Head, rather than out of 1.4, but when I try $IE0.form.methods I get this: ArgumentError: wrong number of arguments (0 for 1) from (irb):10:in `form' from (irb):10 from ?:0 which gives me a clue. I try this: $IE0.form('f').methods ...and I get a list of methods back. So it seems as though "form" is either misdocumented as being something that takes two parameters (as SupportsSubElements does), or is buggy such that it should be taking two parameters and is only taking one, and that one is the name. I note in the source code comments that the intention appears to be to support :index , :name, :id, :method, :action, and :xpath. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- bounces at rubyforge.org] On Behalf Of Marcus Tettmar Sent: March 3, 2006 6:54 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Problem enumerating forms Hi, Why does this fail: $IE0.goto("http://www.google.com/") $IE0.form( :name, "f").text_field( :name, "q").set("ruby") $IE0.form( :name, "f").button( :name, "btnG").click This fails with: WIN32OLERuntimeError: Failed to get IEnum Interface HRESULT error code:0x80020003 Member not found. If you look at the source of the google search page form "f" *does* exist and the text field and button exist within it. This works: $IE0.goto("http://www.google.com/") $IE0.text_field( :name, "q").set("ruby") $IE0.button( :name, "btnG").click But for a more complicated app that has several forms, which perhaps share names of objects, the first method is necessary. Watir WebRecorder correctly records the form for this very reason, but the first block of code fails, even though the form does exist, with those objects in it. Is this a known problem, or am I missing something? Thanks! -- Marcus Tettmar http://www.mjtnet.com/ Macro Scheduler & WebRecorder for Windows & Web Automation and Testing. WebRecorder for Ruby/Watir now available. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060303/8234226b/attachment.html From marcus.tettmar at gmail.com Fri Mar 3 13:31:28 2006 From: marcus.tettmar at gmail.com (Marcus Tettmar) Date: Fri, 3 Mar 2006 18:31:28 +0000 Subject: [Wtr-general] Problem enumerating forms In-Reply-To: <01f901c63eec$4eef7e00$6901a8c0@Koko> References: <01f901c63eec$4eef7e00$6901a8c0@Koko> Message-ID: Yes, the (:name, "name") format certainly works in some cases. It is failing unexpectedly in other situations, such as the google example I provided - but according to the documentation, and the source of the google page, there is no reason why it shouldn't work. On 3/3/06, Michael Bolton wrote: > > I'm working out of Head, rather than out of 1.4, but when I try > > $IE0.form.methods > > I get this: > > ArgumentError: wrong number of arguments (0 for 1) > from (irb):10:in `form' > from (irb):10 > from ?:0 > > which gives me a clue. I try this: > > $IE0.form('f').methods > > ...and I get a list of methods back. > > So it seems as though "form" is either misdocumented as being something > that takes two parameters (as SupportsSubElements does), or is buggy such > that it should be taking two parameters and is only taking one, and that one > is the name. I note in the source code comments that the intention appears > to be to support :index , :name, :id, :method, :action, and :xpath. > > ---Michael B. > > > ------------------------------ > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Marcus Tettmar > *Sent:* March 3, 2006 6:54 AM > *To:* wtr-general at rubyforge.org > *Subject:* [Wtr-general] Problem enumerating forms > > Hi, > > Why does this fail: > > $IE0.goto("http://www.google.com/") > $IE0.form( :name, "f").text_field( :name, "q").set("ruby") > $IE0.form( :name, "f").button( :name, "btnG").click > > This fails with: > > WIN32OLERuntimeError: Failed to get IEnum Interface > HRESULT error code:0x80020003 > Member not found. > > If you look at the source of the google search page form "f" *does* exist > and the text field and button exist within it. > > This works: > > $IE0.goto("http://www.google.com/") > $IE0.text_field( :name, "q").set("ruby") > $IE0.button( :name, "btnG").click > > But for a more complicated app that has several forms, which perhaps share > names of objects, the first method is necessary. > > Watir WebRecorder correctly records the form for this very reason, but the > first block of code fails, even though the form does exist, with those > objects in it. Is this a known problem, or am I missing something? > > Thanks! > > -- > Marcus Tettmar > http://www.mjtnet.com/ > Macro Scheduler & WebRecorder for Windows & Web Automation and Testing. > WebRecorder for Ruby/Watir now available. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -- Marcus Tettmar http://www.mjtnet.com/ Macro Scheduler & WebRecorder for Windows & Web Automation and Testing. WebRecorder for Ruby/Watir now available. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060303/ab6dcc71/attachment.html From tester.paul at gmail.com Fri Mar 3 13:35:24 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Fri, 3 Mar 2006 13:35:24 -0500 Subject: [Wtr-general] How do you skip a disabled checkbox? In-Reply-To: References: <37c405480603030845l40bbfd3dk@mail.gmail.com> Message-ID: <37c405480603031035k3a4f8f66s@mail.gmail.com> This worked perfectly - once I spelled "disabled" correctly. ;-) Thanks! Paul. On 03/03/06, Zeljko Filipin wrote: > > This will do it. > ie.frame('MainWindow').checkboxes.each { |x| x.set unless x.disabed } > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060303/275ca103/attachment.html From mb at michaelbolton.net Fri Mar 3 13:00:08 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Fri, 3 Mar 2006 13:00:08 -0500 Subject: [Wtr-general] Older scripts running really slow... In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D597@EX5V.rl.gov> Message-ID: <020001c63eec$5496a2c0$6901a8c0@Koko> People may or may not care about misspellings (I'm in the pedantic former group), but computers are notoriously fussy about it at times. :) ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: March 2, 2006 5:33 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Older scripts running really slow... I ran the same test on the same web form using two different versions of Watir. The results are listed below. The web pages load as fast as they did before the problem is when the script inputs the data. In 1.4.1 the data is typed and the navigation between input fields is very quickly, but in the current version 1.5.X the data is typed in noticeably slower and navigation between input fields is monumentally slower! My purpose for upgrading was to take advantage of the new popup and modal windows code as well as xpath and other stuff-xpath didn't work at all for me either. As a side not, here are a couple of humorous quotes about spelling: ;-P "It's a damn poor mind that can only think of one way to spell a word." -- Andrew Jackson "I don't give a damn for a man that can only spell a word one way." -- Mark Twain --Mark _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Michael Bolton Sent: Thursday, March 02, 2006 1:45 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Older scripts running really slow... Obvious possibilities are - response time on the Web pages - typing speed in the forms Are your pages visible? Do they look slower? When they're loading? When they're typing? If you've got one test that takes half a minute and another that takes three minutes (which you do), the places where slowdowns are happening are plausibly visible to the human eye. Apropos of not very much, but you noticed that "Problem" is spelled "Probelm" below, right? ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: March 2, 2006 4:17 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Older scripts running really slow... With Watir 1.4.1 (just downloaded and reinstalled) it took: Finished in 31.797 seconds. With Watir from current SVN (did a checkout on the http://svn.openqa.org/svn/watir/trunk/watir) Finished in 179.047 seconds. This is the part that ran: =============================================================== # feature tests for javascript PopUps # revision: $Revision: 1.11 $ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ require 'c:\watir\unittests\setup' require 'watir\dialog' class TC_PER < Test::Unit::TestCase include Watir def gotoPopUpPage() $ie.goto("http://apwtst200.rl.gov/rapidweb/chg/per/per/main.cfm") $ie.set_fast_speed() end #def startClicker( button , waitTime = 3) # w = WinClicker.new # longName = $ie.dir.gsub("/" , "\\" ) # shortName = w.getShortFileName(longName) # c = "start rubyw #{shortName }\\watir\\clickJSDialog.rb #{button } #{ waitTime} " # puts "Starting #{c}" # w.winsystem(c) # w=nil #end def test0_originator $d = Time.now.strftime("%m/%d/%Y") gotoPopUpPage() $ie.text_field(:name, "d_date").set("#{ $d }") $ie.text_field(:name, "d_time").set("1111") $ie.selectBox( :name, "progproj").select(/Other/) $ie.selectBox( :name, "locationID").select(/AW Farm/) $ie.selectBox( :name, "ProblemDiscoveredID").select(/EH\-22/) $ie.text_field( :name, "probdescript").set("Probelm Description Test") $ie.selectBox( :name, "sinID").select(/Cooling Water/) $ie.text_field( :name, "ein").set("eid-001") $ie.checkBox( :name, "reqnsatcheck").set $ie.text_field( :name, "reqnsat").set("Req Not Satisfied") $ie.checkBox( :name, "sourcedoccheck").set $ie.text_field( :name, "SourceDocument").set("Source Doc") $ie.text_field( :name, "actionplan").set("This is a test of the Action Plan text area.") $ie.text_field( :name, "RecommendedCorrectiveActions").set("This is a test of Recommended Actions Taken text area.") $ie.radio( :name, "feedback", 1).set $ie.radio( :name, "feedbacktype", 'other').set $ie.text_field( :name, "feedbackother").set("Feedback Other") #startClicker("OK" , 3) $ie.button("Submit").click_no_wait dialog.button('OK').click $ie.link(:text, /PER-2006-/i).click assert($ie.text_field(:name, "d_date").verify_contains("#{$d}")) assert($ie.text_field(:name, "d_time").verify_contains("11:11")) assert_arrayEquals( ["Other" ] , $ie.select_list(:name, "progproj").getSelectedItems) assert_arrayEquals( ["AW Farm" ] , $ie.select_list(:name, "locationID").getSelectedItems) assert_arrayEquals( ["EH-22" ] , $ie.select_list(:name, "ProblemDiscoveredID").getSelectedItems) assert($ie.text_field(:name, "probdescript").verify_contains("Probelm Description Test")) assert_arrayEquals( ["Cooling Water" ] , $ie.select_list(:name, "sinID").getSelectedItems) assert($ie.text_field(:name, "ein").verify_contains("eid-001")) assert($ie.checkbox(:name, "reqnsatcheck").isSet?) assert($ie.text_field(:name, "reqnsat").verify_contains("Req Not Satisfied")) assert($ie.checkbox(:name, "sourcedoccheck").isSet?) assert($ie.text_field(:name, "SourceDocument").verify_contains("Source Doc")) assert($ie.text_field(:name, "actionplan").verify_contains("This is a test of the Action Plan text area.")) assert($ie.text_field(:name, "RecommendedCorrectiveActions").verify_contains("This is a test of Recommended Actions Taken text area.")) assert($ie.radio(:name, "feedback").isSet?) assert($ie.radio(:name, "feedbacktype", 'other').isSet?) assert($ie.text_field(:name, "feedbackother").verify_contains("Feedback Other")) end end --Mark _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Thursday, March 02, 2006 12:57 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Older scripts running really slow... Could you please do an apples to apples comparison running your scripts with different versions of Watir against the same version of your application. It's possible an application change triggered the performance problem. Let us know the results. It would also be nice if you could share the Watir scripts that are slow. Bret On 3/2/06, Cain, Mark < Mark_Cain at rl.gov > wrote: I have some Watir script I wrote about 6 months ago and needed to do some regression testing using these scripts. Well when I began running them they were really slow! Where it used to take 15 to 20 seconds to fill out the page form now is taking 3 to 4 minutes. I have recently upgraded my Watir installation will the latest from SVN and ruby with 1.8.4 Preview 3. Has anyone one else been experiencing slowness? If yes, what did you do to fix it? Thanks, ____________________ Mark L. Cain LMIT - E *STARS R ~ Lead Test Engineer 1981 Snyder, MSIN: G3-62, Richland, WA 99354 Mark_Cain at RL.gov 509.376.5458 "640 Kilobytes of computer memory ought to be enough for anybody." - Bill Gates, 1981 _______________________________________________ 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/20060303/c5b32a37/attachment.html From BPaatsch at activevoice.com Fri Mar 3 16:36:51 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Fri, 3 Mar 2006 15:36:51 -0600 Subject: [Wtr-general] Debug information output Message-ID: Hello, My script works fine but prints debug information (see below) to the stdout (command line). Is there a problem in my script? Is there a way to suppress the messages? DEBUG: IE#getObject error Unknown property or method `name' HRESULT error code:0x80020006 Unknown name. Thx, Bernd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060303/56a6dcbc/attachment.html From zeljko.filipin at gmail.com Sat Mar 4 05:15:38 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Sat, 4 Mar 2006 11:15:38 +0100 Subject: [Wtr-general] How do you skip a disabled checkbox? In-Reply-To: <37c405480603031035k3a4f8f66s@mail.gmail.com> References: <37c405480603030845l40bbfd3dk@mail.gmail.com> <37c405480603031035k3a4f8f66s@mail.gmail.com> Message-ID: Ups. :) On 3/3/06, Paul Carvalho wrote:> This worked perfectly - once I spelled "disabled" correctly. ;-)>> Thanks! Paul. From padhs2k at gmail.com Sat Mar 4 12:48:46 2006 From: padhs2k at gmail.com (Padhma N) Date: Sat, 4 Mar 2006 09:48:46 -0800 Subject: [Wtr-general] How to create a folder having the name of system date and time , at runtime? Message-ID: <38c139080603040948w4180c786n5a174b935ebdf14b@mail.gmail.com> Hi, I am new to Ruby and Watir and have the following doubts. Can someone please help? 1. When I run a particular .rb file, I would like a directory/folder to be created automatically and in that my output result text file should be stored. In other words, a folder should be automatically created at runtime which would hold a .txt file containing the results. That folder should have the Date and Time (when the rb file was run)as it folder name. Is there a way of doing it?? Please let me know. 2. I have grouped around 15 test cases in my test suite. When I run the test suite .rb file, everything runs properly and at the last, the execution time is being displayed like 'Finished in ..... seconds.'. But I would like to know the time taken for each of my test cases to finish. Is there a way of doing it ? Can someone please let me know? 3. I would like to increase the speed of execution. Please let me know how to do it. I would really appreciate it if someone can help me! Thanks a lot! Padhma -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060304/c01e69fd/attachment.html From mb at michaelbolton.net Sat Mar 4 13:20:34 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Sat, 4 Mar 2006 13:20:34 -0500 Subject: [Wtr-general] Debug information output In-Reply-To: Message-ID: <000001c63fb8$59774980$6601a8c0@Koko> There's a terrible problem in your script. Wait--maybe there's no problem in your script. Actually it's kind of hard to tell without seeing the script. If you suspected that this were a problem with the program that you're testing, what would the developer ask you? What would your answer be? Ideally, what we'd like to see is the smallest complete script that makes this happen. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: March 3, 2006 4:37 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] Debug information output Hello, My script works fine but prints debug information (see below) to the stdout (command line). Is there a problem in my script? Is there a way to suppress the messages? DEBUG: IE#getObject error Unknown property or method `name' HRESULT error code:0x80020006 Unknown name. Thx, Bernd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060304/200853bf/attachment.html From mb at michaelbolton.net Sat Mar 4 16:45:19 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Sat, 4 Mar 2006 16:45:19 -0500 Subject: [Wtr-general] How to create a folder having the name of system dateand time , at runtime? In-Reply-To: <38c139080603040948w4180c786n5a174b935ebdf14b@mail.gmail.com> Message-ID: <008f01c63fd4$ef097970$6601a8c0@Koko> 1. When I run a particular .rb file, I would like a directory/folder to be created automatically and in that my output result text file should be stored. In other words, a folder should be automatically created at runtime which would hold a .txt file containing the results. That folder should have the Date and Time (when the rb file was run)as it folder name. Is there a way of doing it?? Please let me know. I was tempted not to answer this question, because I thought you would learn so much more from answering it yourself. But thinking about it turned out to be too much fun. These two methods (put them into a module) work together to make a directory based on the current minute. class Time # when called as a method on a Time object, returns a string in the form # YYYYMMDDhhmm def timestring self.year.to_s + self.month.to_s.rjust(2, "0") + self.day.to_s.rjust(2, "0") \ + self.hour.to_s.rjust(2, "0") + self.min.to_s.rjust(2, "0") end end class Dir def Dir.mkTimeStampDir dirname = Time.now.timestring begin mkdir(dirname) return dirname rescue puts "Unable to create a directory named #{dirname} return nil end end end Now you can put folder = Dir.mkTimeStampDir in your code (checking for folder.nil?) and put a file into the newly-created directory. This illustrates, by the way, how we can add methods to any of the existing Ruby classes, such that (if we add the code above to an IRB session via the require statement), we can do stuff like this: irb(main):014:0> foo = Time.now => Sat Mar 04 16:37:29 Eastern Standard Time 2006 irb(main):015:0> foo.timestring => "200603041637" Gather enough stuff like this together into a single module, and you can extend the language and IRB in whatever you like. I LOVE Ruby. 2. I have grouped around 15 test cases in my test suite. When I run the test suite .rb file, everything runs properly and at the last, the execution time is being displayed like 'Finished in ..... seconds.'. But I would like to know the time taken for each of my test cases to finish. Is there a way of doing it ? Can someone please let me know? At the beginning of whatever you wish to time, put a line starttime = Time.now At then end of whatever you wish to time, put a line endtime = Time.now When you want to determine the elapsed time, elapsed = endtime - starttime where elapsed will be a value in seconds. 3. I would like to increase the speed of execution. Please let me know how to do it. I presume that you mean typing speed. Try callling set_fast_speed at the beginning of the slow bits. ---Michael B. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060304/6a925191/attachment.html From Mark_Cain at rl.gov Mon Mar 6 09:57:47 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Mon, 6 Mar 2006 06:57:47 -0800 Subject: [Wtr-general] Older scripts running really slow... Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D59A@EX5V.rl.gov> Not sure that this mail got delivered so I am sending it again... I ran the same test on the same web form using two different versions of Watir. The results are listed below. The web pages load as fast as they did before the problem is when the script inputs the data. In 1.4.1 the data is typed and the navigation between input fields is very quickly, but in the current version 1.5.X the data is typed in noticeably slower and navigation between input fields is monumentally slower! My purpose for upgrading was to take advantage of the new popup and modal windows code as well as xpath and other stuff-xpath didn't work at all for me either. As a side not, here are a couple of humorous quotes about spelling: ;-P "It's a damn poor mind that can only think of one way to spell a word." -- Andrew Jackson "I don't give a damn for a man that can only spell a word one way." -- Mark Twain --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Michael Bolton Sent: Thursday, March 02, 2006 1:45 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Older scripts running really slow... Obvious possibilities are - response time on the Web pages - typing speed in the forms Are your pages visible? Do they look slower? When they're loading? When they're typing? If you've got one test that takes half a minute and another that takes three minutes (which you do), the places where slowdowns are happening are plausibly visible to the human eye. Apropos of not very much, but you noticed that "Problem" is spelled "Probelm" below, right? ---Michael B. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: March 2, 2006 4:17 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Older scripts running really slow... With Watir 1.4.1 (just downloaded and reinstalled) it took: Finished in 31.797 seconds. With Watir from current SVN (did a checkout on the http://svn.openqa.org/svn/watir/trunk/watir) Finished in 179.047 seconds. This is the part that ran: =============================================================== # feature tests for javascript PopUps # revision: $Revision: 1.11 $ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ require 'c:\watir\unittests\setup' require 'watir\dialog' class TC_PER < Test::Unit::TestCase include Watir def gotoPopUpPage() $ie.goto("http:///rapidweb/chg/per/per/main.cfm") $ie.set_fast_speed() end #def startClicker( button , waitTime = 3) # w = WinClicker.new # longName = $ie.dir.gsub("/" , "\\" ) # shortName = w.getShortFileName(longName) # c = "start rubyw #{shortName }\\watir\\clickJSDialog.rb #{button } #{ waitTime} " # puts "Starting #{c}" # w.winsystem(c) # w=nil #end def test0_originator $d = Time.now.strftime("%m/%d/%Y") gotoPopUpPage() $ie.text_field(:name, "d_date").set("#{ $d }") $ie.text_field(:name, "d_time").set("1111") $ie.selectBox( :name, "progproj").select(/Other/) $ie.selectBox( :name, "locationID").select(/AW Farm/) $ie.selectBox( :name, "ProblemDiscoveredID").select(/EH\-22/) $ie.text_field( :name, "probdescript").set("Probelm Description Test") $ie.selectBox( :name, "sinID").select(/Cooling Water/) $ie.text_field( :name, "ein").set("eid-001") $ie.checkBox( :name, "reqnsatcheck").set $ie.text_field( :name, "reqnsat").set("Req Not Satisfied") $ie.checkBox( :name, "sourcedoccheck").set $ie.text_field( :name, "SourceDocument").set("Source Doc") $ie.text_field( :name, "actionplan").set("This is a test of the Action Plan text area.") $ie.text_field( :name, "RecommendedCorrectiveActions").set("This is a test of Recommended Actions Taken text area.") $ie.radio( :name, "feedback", 1).set $ie.radio( :name, "feedbacktype", 'other').set $ie.text_field( :name, "feedbackother").set("Feedback Other") #startClicker("OK" , 3) $ie.button("Submit").click_no_wait dialog.button('OK').click $ie.link(:text, /PER-2006-/i).click assert($ie.text_field(:name, "d_date").verify_contains("#{$d}")) assert($ie.text_field(:name, "d_time").verify_contains("11:11")) assert_arrayEquals( ["Other" ] , $ie.select_list(:name, "progproj").getSelectedItems) assert_arrayEquals( ["AW Farm" ] , $ie.select_list(:name, "locationID").getSelectedItems) assert_arrayEquals( ["EH-22" ] , $ie.select_list(:name, "ProblemDiscoveredID").getSelectedItems) assert($ie.text_field(:name, "probdescript").verify_contains("Probelm Description Test")) assert_arrayEquals( ["Cooling Water" ] , $ie.select_list(:name, "sinID").getSelectedItems) assert($ie.text_field(:name, "ein").verify_contains("eid-001")) assert($ie.checkbox(:name, "reqnsatcheck").isSet?) assert($ie.text_field(:name, "reqnsat").verify_contains("Req Not Satisfied")) assert($ie.checkbox(:name, "sourcedoccheck").isSet?) assert($ie.text_field(:name, "SourceDocument").verify_contains("Source Doc")) assert($ie.text_field(:name, "actionplan").verify_contains("This is a test of the Action Plan text area.")) assert($ie.text_field(:name, "RecommendedCorrectiveActions").verify_contains("This is a test of Recommended Actions Taken text area.")) assert($ie.radio(:name, "feedback").isSet?) assert($ie.radio(:name, "feedbacktype", 'other').isSet?) assert($ie.text_field(:name, "feedbackother").verify_contains("Feedback Other")) end end --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Thursday, March 02, 2006 12:57 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Older scripts running really slow... Could you please do an apples to apples comparison running your scripts with different versions of Watir against the same version of your application. It's possible an application change triggered the performance problem. Let us know the results. It would also be nice if you could share the Watir scripts that are slow. Bret On 3/2/06, Cain, Mark < Mark_Cain at rl.gov > wrote: I have some Watir script I wrote about 6 months ago and needed to do some regression testing using these scripts. Well when I began running them they were really slow! Where it used to take 15 to 20 seconds to fill out the page form now is taking 3 to 4 minutes. I have recently upgraded my Watir installation will the latest from SVN and ruby with 1.8.4 Preview 3. Has anyone one else been experiencing slowness? If yes, what did you do to fix it? Thanks, ____________________ Mark L. Cain LMIT - E *STARS (r) ~ Lead Test Engineer 1981 Snyder, MSIN: G3-62, Richland, WA 99354 Mark_Cain at RL.gov 509.376.5458 "640 Kilobytes of computer memory ought to be enough for anybody." - Bill Gates, 1981 _______________________________________________ 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/20060306/f185d3a1/attachment.html From Mark_Cain at rl.gov Mon Mar 6 16:49:49 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Mon, 6 Mar 2006 13:49:49 -0800 Subject: [Wtr-general] What happened to 'asseert_arrayEquals' Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D5A0@EX5V.rl.gov> I was noticing in one of my older scripts that one of the asserts (assert_arrayEquals) is failing. Further investigation resulted in not being able to find it in testUnitAddons.rb, where it used to live. Did this assert no longer being used? Is it somewhere else? What else is being deprecated? Is there a running list of these deprecations somewhere? Thanks, ____________________ Mark L. Cain LMIT - E*STARS(r) ~ Lead Test Engineer 1981 Snyder, MSIN: G3-62, Richland, WA 99354 Mark_Cain at RL.gov 509.376.5458 "640 Kilobytes of computer memory ought to be enough for anybody." - Bill Gates, 1981 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060306/f9e5caf4/attachment.html From bret at pettichord.com Mon Mar 6 17:07:19 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 6 Mar 2006 16:07:19 -0600 Subject: [Wtr-general] What happened to 'asseert_arrayEquals' In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D5A0@EX5V.rl.gov> References: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D5A0@EX5V.rl.gov> Message-ID: Most of the assert methods in testUnitAddons.rb reported errors incorrectly. They were also redundant with existing assertions, so it made more sense to remove than that to fix them. I believe that assert_arrayEquals can just be replaced with assert_equals. If you want you can go into the history and see exactly how the unit tests were updated when this was removed. This file was really a part of the Watir unit test suite rather than the Watir library, so this change was not considered a deprecation. There have been ongoing confusions regarding exactly what is and is not part of the supported Watir library. We are trying to make this clearer going forward. We apologize for the confusion. You are free to grab and use an old copy of the file if you want. Bret On 3/6/06, Cain, Mark wrote: > > I was noticing in one of my older scripts that one of the asserts > (assert_arrayEquals) is failing. Further investigation resulted in not > being able to find it in testUnitAddons.rb, where it used to live. Did > this assert no longer being used? Is it somewhere else? What else is being > deprecated? Is there a running list of these deprecations somewhere? > > > > Thanks, > > ____________________ > *Mark L. Cain* > *LMIT - **E*****STARS*(r)* **~ **Lead Test Engineer* > *1981 Snyder, MSIN: G3-62, Richland, WA 99354** > Mark_Cain at RL.gov > 509.376.5458* > *"640 Kilobytes of computer memory ought to be enough for anybody."** - > Bill Gates, 1981 * > > > > _______________________________________________ > 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/20060306/5ae1efeb/attachment.html From pekka.maatta at proventia.fi Tue Mar 7 03:32:46 2006 From: pekka.maatta at proventia.fi (=?ISO-8859-1?Q?Pekka_M=E4=E4tt=E4?=) Date: Tue, 07 Mar 2006 10:32:46 +0200 Subject: [Wtr-general] Finding out the order of input elements? Message-ID: <440D452E.6000805@proventia.fi> Hi, I'm new to Watir (and Ruby), so this may be a stupid question.... tried searching around a bit, but with little success. So here goes: How do I find out if an input element precedes another or not? There does not seem to be a method for accessing all html inputs on page at once, nor does not seem to be an index attribute or such in input objects. So I can get ordered lists of text fields, selects and buttons, but have no way of knowing if, for example, if a certain text field element is defined before a certain button on a page. Or do I? TY in advance, -PM From bret at pettichord.com Tue Mar 7 13:22:15 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 7 Mar 2006 12:22:15 -0600 Subject: [Wtr-general] How to start more Tests In-Reply-To: References: Message-ID: You have two different threads concurrently accessing the same browser ($ie). That will lead to exactly the behavior you describe. You should ask your speed question on the rails mailing list. It doesn't sound like a Watir issue. On 3/3/06, Benjamin Hemken wrote: > > Thanks for the fast response. > > 1. Test > def start_test_1 > Thread.new { test1 } > Thread.pass > end > > def test1 > $ie = Watir::IE.new > $ie.goto "this is just a test url.com" > $ie.text_field(:name, "test").set "Input" > $ie.form(:name, "form").submit > end > > 2. Test > def start_test_2 > Thread.new { test2 } > Thread.pass > end > > def test2 > $ie = Watir::IE.new > $ie.goto "another test url.com" > $ie.button(:name, "button").click > end > > The first test stops at a random position after starting the second one. > When we start the test alone, of course it works. > Because of the automating, the instance variable takes the same name, this > is > just an example to show, how a test looks like. Showing the whole code > would > be to complex. But normaly the application works like this: > You enter the test code into a textarea. This is written into the > database. A method is generated > and given to a list. This list is used by the Testrunner to run the test. > > > Speed problem: > We have a web application. The time to render a rhtml file, a view, takes > about 5 seconds. > We are using the normal way of navigating through sites. > For example: > def show_list > render :action => 'list' > end > > or > def show_about > redirect_to :action => 'list_by_project', :id => params[:id] > end > The rhtml file consists of a few links and projects. Everything comes from > the database. > SCGI: http://www.zedshaw.com/projects/scgi_rails/ and the normal apache. > > -Benjamin > > -----Original Message----- > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Bret Pettichord > *Sent:* Friday, March 03, 2006 8:51 AM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] How to start more Tests > > On 3/3/06, Benjamin Hemken wrote: > > > > Hello, > > at the moment we are working on a test framework, which helps us to > > write tests easily. > > We have a login and user administration. But we noticed that there are > > problems, > > when 2 user want to start a test. The first tests just stops. Both tests > > where started in > > a thread, so that we can navigate through the html site, after the test > > starts. Anybody here > > who knows how to solve this problem? > > > Show us your test. > > > Another problem is, that our whole application is very very slow. We > > use SCGI + Apache > > and to render a site, or a redirect takes about 5 seconds.I know this > > isn't a watir problem, > > but maybe someone can help :-) > > > > What is your problem? Are you having a problem with your scripts because > the application is slow? What problems are you seeing? Please be specific. > > Your English is fine, but we can't read your mind. > > > _______________________________________________ > 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/20060307/5cae4292/attachment.html From padhs2k at gmail.com Tue Mar 7 18:22:48 2006 From: padhs2k at gmail.com (Padhma N) Date: Tue, 7 Mar 2006 15:22:48 -0800 Subject: [Wtr-general] How to create a folder having the name of Message-ID: <38c139080603071522x2671099bra5d29b1840c015b0@mail.gmail.com> Thanks for the fast reply!!! IT was realllllly very helpful! Thanks again! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060307/50455f1e/attachment.html From saudaziz at gmail.com Tue Mar 7 20:43:53 2006 From: saudaziz at gmail.com (saud aziz) Date: Tue, 7 Mar 2006 17:43:53 -0800 Subject: [Wtr-general] Quick help Message-ID: <24d0cb380603071743k135e9083ie993583570082c3d@mail.gmail.com> In the recent emails it was described how ppl are splititng up their code in different files and since i am at the very start of writing down something for proof of concept, i thought it would be wise to begin with such structure and keep adding as i go along... My question is perhaps very simple one and that is, how can i call a variable say RegUserName as mentioned in below code from my test driver? RegUserName exists in Constants.rb file. Here is what i have for both as example: Constants.rb Module Constants RegUserNameLabel = 'first' RegUserName = 'second' RegPassLabel = 'third' RegPassword = 'fourth' end Register.rb #trying to run this as driver for now require 'watir' include Watir require 'test/unit' require 'test/unit/ui/console/testrunner' require 'watir/testUnitAddons' require 'test/unit/assertions' include Test::Unit::Assertions class TC_Tickets < Test::Unit::TestCase require 'Constants' include Constants def test_Registration ie = IE.new ie.goto('http://firstlink') ie.link(:url, 'http://secondlink/register').click #Check for blank submissions and assert that errors were raised #ie.image(:id, 'btn_register').click ie.button(:name, "#{$RegFormButtonName}").click ie.text_field(:id, "#{$RegUserNameLabel}").set("#{$RegUserName}") <-----dies here cause it returns nil. Obviously it's not getting values off Constants.rb ie.text_field(:id, "#{$RegPassLabel}").set("#{$RegPassword}") end end Any help is appreciated. Regards Ruby n00b -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060307/a8415483/attachment.html From bret at pettichord.com Tue Mar 7 22:22:27 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 7 Mar 2006 21:22:27 -0600 Subject: [Wtr-general] Quick help In-Reply-To: <24d0cb380603071743k135e9083ie993583570082c3d@mail.gmail.com> References: <24d0cb380603071743k135e9083ie993583570082c3d@mail.gmail.com> Message-ID: You need to be consistent. Either use RegUserNameLabel in both files or $RegUserNameLabel in both files. You use the first in Constants.rb and the second in Register.rb. On 3/7/06, saud aziz wrote: > > In the recent emails it was described how ppl are splititng up their code > in different files and since i am at the very start of writing down > something for proof of concept, i thought it would be wise to begin with > such structure and keep adding as i go along... > > My question is perhaps very simple one and that is, how can i call a > variable say RegUserName as mentioned in below code from my test driver? > RegUserName exists in Constants.rb file. Here is what i have for both as > example: > > Constants.rb > > Module Constants > > RegUserNameLabel = 'first' > RegUserName = 'second' > RegPassLabel = 'third' > RegPassword = 'fourth' > > end > > > Register.rb > #trying to run this as driver for now > require 'watir' > include Watir > require 'test/unit' > require 'test/unit/ui/console/testrunner' > require 'watir/testUnitAddons' > require 'test/unit/assertions' > include Test::Unit::Assertions > > > class TC_Tickets < Test::Unit::TestCase > > require 'Constants' > include Constants > > def test_Registration > > ie = IE.new > > ie.goto('http://firstlink' ) > ie.link(:url, ' http://secondlink/register').click > > > #Check for blank submissions and assert that errors were raised > #ie.image(:id, 'btn_register').click > ie.button(:name, "#{$RegFormButtonName}").click > > > ie.text_field(:id, > "#{$RegUserNameLabel}").set("#{$RegUserName}") > <-----dies here cause it returns nil. Obviously it's not getting values off > Constants.rb > ie.text_field(:id, "#{$RegPassLabel}").set("#{$RegPassword}") > > end > end > > > Any help is appreciated. > > Regards > Ruby n00b > > -- > Saud Aziz > > "Whenever you find yourself on the side of the majority, it is time to > pause and reflect." - Mark Twain > > > > > _______________________________________________ > 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/20060307/bda96718/attachment.html From ralickolli at kCura.com Wed Mar 8 13:40:30 2006 From: ralickolli at kCura.com (Rexhina Alickolli) Date: Wed, 8 Mar 2006 12:40:30 -0600 Subject: [Wtr-general] how to distinguish among links with the same name Message-ID: I am new in Watir/Ruby and I am trying to figure out how do distinguish links of the same name. Now, if I want to click on that link I just do that by name, but that prevent me from accessing all of them. I can perform the Click action only in the first link. The code behind the link (?Add New Code?) is: ????????..id="_editTemplate__matter__status_hiddenButton" href="javascript:__doPostBack('_editTemplate$_matter$_status$hiddenButton','')" style="visibility:hidden;"> Add New Code
Any suggestion would be appreciated. Thanks-- regina -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 268.2.0/276 - Release Date: 3/7/2006 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060308/96534a72/attachment.html From tester.paul at gmail.com Wed Mar 8 14:07:27 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Wed, 8 Mar 2006 14:07:27 -0500 Subject: [Wtr-general] how to distinguish among links with the same name In-Reply-To: References: Message-ID: <37c405480603081107se31879cq@mail.gmail.com> Hello Regina, at first I wasn't sure I had enough information to help, but then I noticed the "table" tags in your HTML code snip. If I can make a guess, does the HTML page have a table with a bunch of similarly named links in the same column but in different rows? If so, there are different solutions that you might try. One way might be to try and access the link using the table's cell position. For example, using something like: > ie.table(:index, #)[row#][col#].link(:index, 1).click (Replace the '#' with appropriate numbers. This line will click the first link that it finds in that particular table cell.) I had a similar problem accessing the links on one page of my AUT. I wrote a routine that used arrays to look for a particular row that matched certain criteria and then it just clicks the link in whatever column number the link happens to be in. See if that puts you on the right track. If not, please provide some more background information - like the general layout of the html on the page or the code that you've tried that doesn't work. I'd be happy to post my code if you need it, but I'd like to have a better idea that the particular problem that I solved for our app is similar to your situation. Hope that helps. Cheers. Paul. On 08/03/06, Rexhina Alickolli wrote: > > I am new in Watir/Ruby and I am trying to figure out how do distinguish > links of the same name. > > Now, if I want to click on that link I just do that by name, but that > prevent me from accessing all of them. I can perform the Click action only > in the first link. The code behind the link ("Add New Code") is: > > > > ????????..id="_editTemplate__matter__status_hiddenButton" > href="javascript:__doPostBack('_editTemplate$_matter$_status$hiddenButton','')" > style="visibility:hidden;">  id="_editTemplate__matter__status__ctl2_anchor" *class="JavascriptLink" > onclick="AddNewCode_42()">Add New Code
* > > > > Any suggestion would be appreciated. > > *Thanks-- regina* > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060308/d9bf0b16/attachment.html From tester.paul at gmail.com Wed Mar 8 15:15:55 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Wed, 8 Mar 2006 15:15:55 -0500 Subject: [Wtr-general] Random Watir script failures Message-ID: <37c405480603081215n156e60e2r@mail.gmail.com> Hi there, I have noticed that a script of mine seems to be having random failures that I can't explain. I am running Watir 1.4.1 on Ruby 184-16 on Windows XP Pro SP2. The script I'm working with walks through our site map - it enters a page, gets the page size, download time, leaves and then moves onto the next page. The script is correct. However, at random intervals when I run it, a button or link will fail to get recognised and the script just stops. I've been trying to get around the failures by adding a "sleep 1" (or 2 or 3 seconds) whenever it fails. This latest run, it wasn't even a button that the script failed on -- it was a + operator! Okay, I know that I don't know any workaround for that one! Here was the error output: ---- 1) Error: test_d_Reports(TC_LD_site_map_walkthru): NoMethodError: undefined method `+' for nil:NilClass LD_site_map_walkthrough.rb:461:in `test_d_Reports' ---- and line 461 is: row_data[42] = row_data[42] + ',' + $ie.frame('MainWindow').html.length.to_s + ',' + $ie.down_load_time.to_s I know there's nothing wrong with this line because it looks relatively identical to a billion other lines in the script - just the array number changes. And it works when I run it the next time. Other errors I've seen include: ---- 1) Error: test_d_Reports(TC_LD_site_map_walkthru): NoMethodError: undefined method `outerHTML' for nil:NilClass ---- (for the same 'row_data' kind of line as above, just elsewhere in the script.) and err