From forum-watir-users at openqa.org Fri Jun 1 02:03:32 2007 From: forum-watir-users at openqa.org (Harmeet) Date: Fri, 01 Jun 2007 01:03:32 CDT Subject: [Wtr-general] Clicking link in Ajax table Message-ID: <32889383.18471180677842971.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> *How to click a dynamic link in AJAX table that changes its state from 'Save PDS' to 'Saved' and also sends a request to the server to save a fund with APIR code. I am using Watir. Here is the code* From zeljko.filipin at gmail.com Fri Jun 1 04:49:19 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 1 Jun 2007 10:49:19 +0200 Subject: [Wtr-general] how to count the no of link in a datatable In-Reply-To: <41096639.11311180616457596.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <7523f5800705310110n7988a1a7radccf17bcbbede01@mail.gmail.com> <41096639.11311180616457596.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 5/31/07, Ravi wrote: > > ie.table(:index,1).links.length I knew that there must be a simpler solution. :) Thanks Ravi. Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070601/454ded97/attachment.html From zeljko.filipin at gmail.com Fri Jun 1 05:38:20 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 1 Jun 2007 11:38:20 +0200 Subject: [Wtr-general] Clicking link in Ajax table In-Reply-To: <32889383.18471180677842971.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32889383.18471180677842971.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: This does not work? ie.link(:text, "Save PDS").click Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070601/a2a33067/attachment.html From watir_user at yahoo.co.in Fri Jun 1 10:04:31 2007 From: watir_user at yahoo.co.in (watir-user watir-user) Date: Fri, 1 Jun 2007 15:04:31 +0100 (BST) Subject: [Wtr-general] How do i check the sorting of Date? Message-ID: <206419.20231.qm@web94313.mail.in2.yahoo.com> Hi All, I need help for checking the sorting date. I have a link called Job Date below of this link displays list of Date, clicking on this link it sorts the date field, like follow 05/31/2007 09:36 AM 05/31/2007 09:36 AM 05/31/2007 09:13 AM 05/30/2007 03:20 PM 05/30/2007 11:16 AM 05/30/2007 09:52 AM 05/30/2007 09:49 AM 05/29/2007 12:59 PM 05/29/2007 10:45 AM How do i confirm that clicking on Job Date link, it displays all the dates in proper sorting order? Looking forward, --------------------------------- Looking for people who are YOUR TYPE? Find them here! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070601/a78be254/attachment.html From paul.rogers at shaw.ca Fri Jun 1 10:55:30 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 01 Jun 2007 08:55:30 -0600 Subject: [Wtr-general] How do i check the sorting of Date? References: <206419.20231.qm@web94313.mail.in2.yahoo.com> Message-ID: <011401c7a45c$e5d7f370$6400a8c0@laptop> there is a parse method on the Date class which allows you to create a ruby date object from a string http://www.ruby-doc.org/core/classes/Date.html#M000656 you could do this for each of the dates listed below, and then have ruby sort them, and format in the same style as they are shown in below, then you can do a string compare. Paul ----- Original Message ----- From: watir-user watir-user To: wtr-general at rubyforge.org Sent: Friday, June 01, 2007 8:04 AM Subject: [Wtr-general] How do i check the sorting of Date? Hi All, I need help for checking the sorting date. I have a link called Job Date below of this link displays list of Date, clicking on this link it sorts the date field, like follow 05/31/2007 09:36 AM 05/31/2007 09:36 AM 05/31/2007 09:13 AM 05/30/2007 03:20 PM 05/30/2007 11:16 AM 05/30/2007 09:52 AM 05/30/2007 09:49 AM 05/29/2007 12:59 PM 05/29/2007 10:45 AM How do i confirm that clicking on Job Date link, it displays all the dates in proper sorting order? Looking forward, ------------------------------------------------------------------------------ Looking for people who are YOUR TYPE? Find them here! ------------------------------------------------------------------------------ _______________________________________________ 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/20070601/29bb5ac3/attachment.html From bret at pettichord.com Fri Jun 1 11:18:01 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 01 Jun 2007 10:18:01 -0500 Subject: [Wtr-general] Microsoft Support for Ruby In-Reply-To: <465E408E.3030304@pettichord.com> References: <465E408E.3030304@pettichord.com> Message-ID: <466038A9.5010401@pettichord.com> Bret Pettichord wrote: > Some of you may have seen some of the recent announcements from > Microsoft regarding their plans to support Ruby in the .Net environment. > This is an excellent post that analyzes the impact that this may have: > http://martinfowler.com/bliki/RubyMicrosoft.html > Here is a response from Microsoft's lead Ruby developer. http://www.iunknown.com/2007/05/microsoft_and_i.html From bret at pettichord.com Fri Jun 1 14:55:37 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 01 Jun 2007 13:55:37 -0500 Subject: [Wtr-general] Fox Test Runner Message-ID: <46606BA9.9020900@pettichord.com> Have any of you gotten the Fox Test Runner to work? This is used if you run your Test::Unit based tests using the "-rf" command line switch. I have installed fxruby-1.6.11.gem and RXRuby-1.6.11-ruby186.exe, but still get this error: no such file to load -- fox (LoadError) I'm guessing that this is a version problem with Fox. Wdyt? Bret From phlip2005 at gmail.com Fri Jun 1 15:19:22 2007 From: phlip2005 at gmail.com (Phlip) Date: Fri, 1 Jun 2007 12:19:22 -0700 Subject: [Wtr-general] Microsoft Support for Ruby In-Reply-To: <466038A9.5010401@pettichord.com> References: <465E408E.3030304@pettichord.com> <466038A9.5010401@pettichord.com> Message-ID: <860c114f0706011219l31d14ca0tac8d781de4243c7@mail.gmail.com> Bret Pettichord wrote: > Some of you may have seen some of the recent announcements from > Microsoft regarding their plans to support Ruby in the .Net environment. > This is an excellent post that analyzes the impact that this may have: > http://martinfowler.com/bliki/RubyMicrosoft.html > > Here is a response from Microsoft's lead Ruby developer. > > http://www.iunknown.com/2007/05/microsoft_and_i.html MS wants to play with the Big Boys now. -- Phlip http://www.oreilly.com/catalog/9780596510657/ "Test Driven Ajax (on Rails)" assert_xpath, assert_javascript, & assert_ajax From manish at gslab.com Sat Jun 2 00:09:10 2007 From: manish at gslab.com (Manish Sapariya) Date: Sat, 02 Jun 2007 09:39:10 +0530 Subject: [Wtr-general] Gmail Automation: Repeated execution fails to send mails, set values fails In-Reply-To: <39762399.12751180620078781.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <39762399.12751180620078781.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4660ED66.4010003@gslab.com> devya wrote: > But this case > fails after few iteration with following exception > > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1819:in `method_missing': unknown property or method `readyState' (WIN32OLERuntimeError) > HRESULT error code:0x80070005 > Access is denied. from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1819:in `wait' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:224:in `wait' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:2575:in `click' > from try.rb:53:in `SendMailGmail' > from try.rb:70 > from try.rb:69:in `each' > from try.rb:69 > Updating the to the latest gem, watir-1.5.1.1192, fixes this problem. Regards, Manish From manish at gslab.com Sat Jun 2 01:54:11 2007 From: manish at gslab.com (Manish Sapariya) Date: Sat, 02 Jun 2007 11:24:11 +0530 Subject: [Wtr-general] Gmail Automation: Repeated execution fails to send mails, set values fails In-Reply-To: <39762399.12751180620078781.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <39762399.12751180620078781.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <46610603.5080502@gslab.com> devya wrote: > Case 2: Fails to set value for the to,subject and mailbody fields after few iteration. > > login > for 1 to 50 > sendmail > logout > > In this case after sending the first, few mails, it shows the to,subject,mailbody fields. The exists? test passes for these controls. > > However setting the values on these controls does not reflect the > value in ie. Also, flash method does not flash it. When I read the > value from these controls, I can read them. > > One interesting thing that I noted is, if I set > the value in ie directly and then read the control, I dont get > the new value, but what I get is the old value. > > Have I found a bug? Isn't watir refreshing the new DOM tree after > sending the mail? > No, there isn't any bug in watir. However, its typical behavior of gmail. I am not sure why, but this is what I observed after playing with gmail. Every time you compose a mail, gmail puts mail compose control in either of the v1,v2,v3 or v4 frame. I have not been able to figure out exactly when it uses a given frame though. One thing I noticed is that sometimes two frames contain the same controls for compose mail and hence the above mentioned behavior. I modified the SendMailGmail() as follows and it worked for 50 iterations. There are chances that the following code may not work in the case, when exists? check is done on elements which are not displayed. I did not face this problem in first run. However, the question is, is there any way to figure out if the controls are the one which are visible in the ie? Can I use Z-Index attribute? Regards, Manish def SendMailGmail(mailTo, mailSubject, mailBody) puts "In SendMailGmail function" @ie.send_keys("c") while((!@ie.frame(:name, "main").frame(:id, "v1").text_field(:id, "to_compose").exists?) && (!@ie.frame(:name, "main").frame(:id, "v2").text_field(:id, "to_compose").exists?) && (!@ie.frame(:name, "main").frame(:id, "v3").text_field(:id, "to_compose").exists?) && (!@ie.frame(:name, "main").frame(:id, "v4").text_field(:id, "to_compose").exists?) ) p "waiting for compose window to appear" sleep(2) end if ( @ie.frame(:name, "main").frame(:id, "v1").text_field(:id, "to_compose").exists? ) frame="v1" elsif ( @ie.frame(:name, "main").frame(:id, "v2").text_field(:id, "to_compose").exists? ) frame="v2" elsif ( @ie.frame(:name, "main").frame(:id, "v3").text_field(:id, "to_compose").exists? ) frame="v3" else frame = "v4" end puts "chosen frame is #{frame}\n" # sleep(2) #if (@ie.frame(:name, "main").frame(:id, "v2").text_field(:id, "to_compose").exists?()) puts "Mail To Address - #{mailTo}" @ie.frame(:name, "main").frame(:id, frame).text_field(:id, "to_compose").set(mailTo) #end #if (@ie.frame(:name, "main").frame(:id, "v2").text_field(:name, "subject").exists?()) puts "Mail Subject - #{mailSubject}" @ie.frame(:name, "main").frame(:id, frame).text_field(:name, "subject").set(mailSubject) #end #if (@ie.frame(:name, "main").frame(:id, "v2").div(:id, "hc_compose").exists?()) puts "Mail Body - #{mailBody}" @ie.frame(:name, "main").frame(:id, frame).div(:id, "hc_compose").document.innerHTML=mailBody #end @ie.frame(:name, "main").frame(:id, frame).button(:id, "snd").click c @ie.frame(:name, "main").wait() sleep(3) end # end function SendMail From jim_matt at swbell.net Sat Jun 2 18:06:58 2007 From: jim_matt at swbell.net (jim_matt) Date: Sat, 2 Jun 2007 17:06:58 -0500 Subject: [Wtr-general] gem error installing 'builder' References: <0b2e01c799c7$46397220$6401a8c0@Jimsxp> Message-ID: <01f001c7a562$570630b0$6401a8c0@Jimsxp> Since no one seemed to have any ideas on how to fix this for Windows (searching, I did find some suggestions for Unix type systems), I decided I would have to bite the bullit and try different versions of Ruby and Watir. I blindly installed a new version of Ruby and a new version of Watir. I do not like to do this because past experience has taught me that I would be trading one set of problems for another. I am happy to report that does not seem to be the case this time. So far, all my scripts are working without a problem. I installed: Ruby 1.8.6-25 Watir 1.5.1.1192 Note that I did not install or update rubygems. I then installed other gems I needed including "ci_reporter" and "builder". Jim Matthews ----- Original Message ----- From: jim_matt To: wtr-general at rubyforge.org Sent: Friday, May 18, 2007 10:39 PM Subject: [Wtr-general] gem error installing 'builder' I am resending this because I have not seen it show up in email distribution. I sent it earlier in the day than the one titled "ie.maximize does not always work". I did more research after I sent the following message. Most of the solutions seemed to be for unix based systems. The best one I found for windows appeared to involve completely uninstalling gem 0.9.3 and installing gem 0.9.2. The original message I sent follows below. ------------------------------------------------------------------------------------------------------------------------------- I am getting the following error when I try to install 'builder'. Any suggestions? D:\InstalledFiles\builder_2_1_1>gem install builder -l -y D:\InstalledFiles\builder_2_1_1>"D:\ruby\bin\ruby.exe" "D:\ruby\bin\gem" install builder - l -y ERROR: Error installing gem builder[.gem]: install directory # not absolute Obviously the error about the pathname not being absolute is incorrect. I am running Ruby 1.8.2-15 Watir 1.5-1145 as a gem gem 0.9.3 I am trying to set things up so I can get reports with ci_reporter and running specific versions of Ruby and Watir to avoid certain bugs. Jim Matthews ------------------------------------------------------------------------------ _______________________________________________ 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/20070602/a7674e83/attachment-0001.html From jim_matt at swbell.net Sat Jun 2 18:26:48 2007 From: jim_matt at swbell.net (jim_matt) Date: Sat, 2 Jun 2007 17:26:48 -0500 Subject: [Wtr-general] Cannot identify a table "cell" by "class" in FireWatir Message-ID: <01f701c7a565$1c757c50$6401a8c0@Jimsxp> I know this is mainly for Watir, but I thought some of you might be interested in what I found with FireWatir. One of my goals at the place I am currently working is to have a set of scripts that I can run on IE, Firefox, and Safari. I already have a number of scripts working for Watir. I finally was able to get FireWatir working on my system (for those interested, you might want to check out the Google FireWater Group discussion at http://groups.google.com/group/firewatir ). I modified the first script by changing references from Watir to FireWatir. I had anticipated doing this so I changed the $br = Watir::IE.new to $br = FireWatir::Firefox.new and ran the script. After correcting a couple editing errors, the script ran all the way through. I was very happy since the script did a number of operations that were common to other scripts. I decided to try this with a second script. I made the edits and ran the script. This time the script failed because it could not locate a table cell that was identified by class. $br.cell(:class, "x") This works fine in Watir. I went back and looked at the cell and the class is the only thing that uniqely identifies it. I 'll have to figure something else to do. Jim Matthews -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070602/58148b33/attachment.html From aidy.lewis at googlemail.com Sun Jun 3 03:27:32 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Sun, 3 Jun 2007 08:27:32 +0100 Subject: [Wtr-general] instantiate a class that inherits from Test::Unit In-Reply-To: <465F2BF3.6030204@pettichord.com> References: <7ac2300c0705300738g660a9241u5be5b618507c351e@mail.gmail.com> <465DCFD1.7070204@pettichord.com> <7ac2300c0705310020m4c450855ubcb1476ce1994e4e@mail.gmail.com> <465F2BF3.6030204@pettichord.com> Message-ID: <7ac2300c0706030027k39ab8bccpcdeca195bf114762@mail.gmail.com> On 31/05/07, Bret Pettichord wrote: > However, i still have no idea what you are trying to do. Why do you want > to instantiate a test case? > Hi Bret, Each page has its own class. So for example the Login Class will hold its own object map and methods relating to that page class Login def initialize(params) self.username.set(params[:username]) self.password.set(params[:password]) end def username;$ie.text_field(:name, 'username');end def password;$ie.text_field(:name, 'password');end def sign_in;$ie.button(:alt, /Log in/);end end Now, I was thinking of having a method that would assert all the page objects. So I was planing to inherit Test::Unit and instantiate the sub-class: login = Login.new login.check_all_page_objects. aidy From paul.rogers at shaw.ca Sun Jun 3 09:12:35 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 03 Jun 2007 07:12:35 -0600 Subject: [Wtr-general] instantiate a class that inherits from Test::Unit References: <7ac2300c0705300738g660a9241u5be5b618507c351e@mail.gmail.com> <465DCFD1.7070204@pettichord.com> <7ac2300c0705310020m4c450855ubcb1476ce1994e4e@mail.gmail.com> <465F2BF3.6030204@pettichord.com> <7ac2300c0706030027k39ab8bccpcdeca195bf114762@mail.gmail.com> Message-ID: <023c01c7a5e0$da559e50$6400a8c0@laptop> why not put your login code into a login class, and have th test class instantiate that class Login def initialize(params) self.username.set(params[:username]) self.password.set(params[:password]) end def username;$ie.text_field(:name, 'username');end def password;$ie.text_field(:name, 'password');end def sign_in;$ie.button(:alt, /Log in/);end end class TestLogin < Test::Unit::Testcase def test_login asert_nothig_raised( 'Login Problem') do l = Login.new( :password=>'secret' , username = 'paul' ) end end end ----- Original Message ----- From: "aidy lewis" To: Sent: Sunday, June 03, 2007 1:27 AM Subject: Re: [Wtr-general] instantiate a class that inherits from Test::Unit > On 31/05/07, Bret Pettichord wrote: >> However, i still have no idea what you are trying to do. Why do you want >> to instantiate a test case? >> > > Hi Bret, > > Each page has its own class. So for example the Login Class will hold > its own object map and methods relating to that page > > > > class Login > > def initialize(params) > self.username.set(params[:username]) > self.password.set(params[:password]) > end > > def username;$ie.text_field(:name, 'username');end > def password;$ie.text_field(:name, 'password');end > def sign_in;$ie.button(:alt, /Log in/);end > > end > > > > Now, I was thinking of having a method that would assert all the page > objects. So I was planing to inherit Test::Unit and instantiate the > sub-class: > > login = Login.new > login.check_all_page_objects. > > aidy > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Sun Jun 3 14:24:19 2007 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 03 Jun 2007 13:24:19 -0500 Subject: [Wtr-general] instantiate a class that inherits from Test::Unit In-Reply-To: <023c01c7a5e0$da559e50$6400a8c0@laptop> References: <7ac2300c0705300738g660a9241u5be5b618507c351e@mail.gmail.com> <465DCFD1.7070204@pettichord.com> <7ac2300c0705310020m4c450855ubcb1476ce1994e4e@mail.gmail.com> <465F2BF3.6030204@pettichord.com> <7ac2300c0706030027k39ab8bccpcdeca195bf114762@mail.gmail.com> <023c01c7a5e0$da559e50$6400a8c0@laptop> Message-ID: <46630753.9070102@pettichord.com> Paul Rogers wrote: > why not put your login code into a login class, and have th test class > instantiate that > + 1 From forum-watir-users at openqa.org Mon Jun 4 00:45:31 2007 From: forum-watir-users at openqa.org (Harmeet) Date: Sun, 03 Jun 2007 23:45:31 CDT Subject: [Wtr-general] Clicking link in Ajax table In-Reply-To: Message-ID: <28416284.131180932361207.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Please check the attached txt file for code. Actually this link is in table that is in DIV tags. I want to click the "Save PDS" link in table index 2 of the attached code. But it is not clicking with simple ie.link(:text, "Save PDS").click I don't know how to put the code here. I have tried it but couldn't From forum-watir-users at openqa.org Mon Jun 4 03:37:56 2007 From: forum-watir-users at openqa.org (devya) Date: Mon, 04 Jun 2007 02:37:56 CDT Subject: [Wtr-general] Clicking link in Ajax table In-Reply-To: <28416284.131180932361207.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <24398142.61180942707805.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Try ie.table(:name, "xyz")[row][column].link(:text, "Save PDS").click Please replace table identifier and row, coulmn numbers in above code line. I could not find the code attachment to your reply, so used some arbitary values ("abc") for table identifier. Regards -Devyani From zeljko.filipin at gmail.com Mon Jun 4 04:36:07 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 4 Jun 2007 10:36:07 +0200 Subject: [Wtr-general] Clicking link in Ajax table In-Reply-To: <28416284.131180932361207.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28416284.131180932361207.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Harmeet, Does this work? ie.table(:index, 2).link(:text, "Save PDS").click Do you get an error message after this? ie.link(:text, "Save PDS").click Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070604/fbc65a64/attachment.html From forum-watir-users at openqa.org Mon Jun 4 05:18:13 2007 From: forum-watir-users at openqa.org (sapna) Date: Mon, 04 Jun 2007 04:18:13 CDT Subject: [Wtr-general] To view the message send based on ID created. Message-ID: <34778098.681180948723128.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, Need your kind help for the below problem. In the application there's option to send query. After the query is made the same is displayed in different web page as n rows 2 columns in Date and subject fromate. Now I need to select the message under subject column the one I had sent. I saw in the view source there is ID been created for it can I select it based on the id created or is there any othe way of doing this. Give me an idea how to implement in the WATIR script. Regards Sapna From zeljko.filipin at gmail.com Mon Jun 4 05:25:50 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 4 Jun 2007 11:25:50 +0200 Subject: [Wtr-general] To view the message send based on ID created. In-Reply-To: <34778098.681180948723128.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <34778098.681180948723128.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Sapna, Can you post relevant html snippet? Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070604/64d3c0c6/attachment.html From forum-watir-users at openqa.org Mon Jun 4 06:27:11 2007 From: forum-watir-users at openqa.org (Fletch) Date: Mon, 04 Jun 2007 05:27:11 CDT Subject: [Wtr-general] select_list Message-ID: <32139870.1131180952861833.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi All, Is it possible to select an item in a select list by index? I have a situation whereby either the test does not know, or does not care what it selects from a multiple select list, so each time I run this script I want to just select the first item in the select list. @mainFrame.select_list(:name, 'availableItems').select(:index, 1) does not seem to do the trick. I would use the get all content method, but there is the added complexity that we can select as many items as we want in the list, but the validation will only allow a maximum of three to ever be saved. Any help with this one would be appreciated. Thanks, PMF. From forum-watir-users at openqa.org Mon Jun 4 06:29:14 2007 From: forum-watir-users at openqa.org (sapna) Date: Mon, 04 Jun 2007 05:29:14 CDT Subject: [Wtr-general] To view the message send based on ID created. In-Reply-To: Message-ID: <33940683.1201180952984187.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I don't know if this would help you out in figuring out the my problem. Please let me know. Bill Payment Inquiry From forum-watir-users at openqa.org Mon Jun 4 06:36:31 2007 From: forum-watir-users at openqa.org (Vipul) Date: Mon, 04 Jun 2007 05:36:31 CDT Subject: [Wtr-general] Unable to loc. obj excep. for obj visible through show_all_objects cmd Message-ID: <33738756.1271180953421486.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> hi, on executing following command $ie.frame(:index,2).show_all_objects i get the object image name=WorkOrderSummary1$roundedGroupBox$ibtnNewWorkOrder id=WorkOrderSummary1_roundedGroupBox_ibtnNewWorkOrder value= alt=New WorkOrder src=http://10.2.56.17/MCCLdap/_imgs/newRecord.gif but when i try to click the image $ie.frame(:index,2).image(:alt,/New WorkOrder/i).click i get the exception 'Unable to locate object, using alt and (?i-mx:New WorkOrder)' i have tried using sleep before image click but still getting the same exception. From zeljko.filipin at gmail.com Mon Jun 4 07:02:46 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 4 Jun 2007 13:02:46 +0200 Subject: [Wtr-general] To view the message send based on ID created. In-Reply-To: <33940683.1201180952984187.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <33940683.1201180952984187.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 6/4/07, sapna wrote: > > href="/AppsUIWeb/SelfService/MessageDetail.aspx?id=1274&messageToUser=False">Bill > Payment Inquiry Sapna, What do you need to do? Click this link? This does not do it? ie.link(:text, "Bill Payment Inquiry").click ie.link(:href, /id=1274/).click Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070604/77e55381/attachment.html From chitta.ranjan at globallogic.com Mon Jun 4 08:28:15 2007 From: chitta.ranjan at globallogic.com (chitta) Date: Mon, 4 Jun 2007 17:58:15 +0530 Subject: [Wtr-general] Read a picture number Message-ID: <000c01c7a6a3$d31187d0$fa64a8c0@synapse.com> Hi,, Is this possible to read a picture number from a page and write it in the text field. Regards Chitta Ranjan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070604/39ced42f/attachment.html From prema.arya at gmail.com Mon Jun 4 10:17:56 2007 From: prema.arya at gmail.com (Prema Arya) Date: Mon, 4 Jun 2007 19:47:56 +0530 Subject: [Wtr-general] Read a picture number In-Reply-To: <000c01c7a6a3$d31187d0$fa64a8c0@synapse.com> References: <000c01c7a6a3$d31187d0$fa64a8c0@synapse.com> Message-ID: <27915010706040717u1dac700en3ca0af93a52c59f0@mail.gmail.com> Hi, You want to read the number from an image or text in the html code? give us a clear picture. Regards, Perma On 6/4/07, chitta wrote: > > Hi,, > > > Is this possible to read a picture number from a page and write it in the > text field. > > > > Regards > > Chitta Ranjan > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- Prema Arya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070604/d516d402/attachment.html From forum-watir-users at openqa.org Mon Jun 4 10:36:23 2007 From: forum-watir-users at openqa.org (reinier) Date: Mon, 04 Jun 2007 09:36:23 CDT Subject: [Wtr-general] length not recognized for array within a class In-Reply-To: <35533066.6411179134550280.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <33960027.2791180967813802.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> thanks, that was the solution From forum-watir-users at openqa.org Mon Jun 4 10:38:14 2007 From: forum-watir-users at openqa.org (Ravi) Date: Mon, 04 Jun 2007 09:38:14 CDT Subject: [Wtr-general] select_list In-Reply-To: <32139870.1131180952861833.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <30044114.2861180967924914.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> > @mainFrame.select_list(:name, 'availableItems').select(:index, 1) does not seem to do the trick. This should work: @mainFrame.select_list(:name, 'availableItems').getAllContents[0] From bret at pettichord.com Mon Jun 4 15:08:24 2007 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 04 Jun 2007 14:08:24 -0500 Subject: [Wtr-general] Wait issue with file_field.set, solution In-Reply-To: <68f4a0e80703070731j50b7b65dy4f2807b8679d7b78@mail.gmail.com> References: <68f4a0e80703070731j50b7b65dy4f2807b8679d7b78@mail.gmail.com> Message-ID: <46646328.50004@pettichord.com> I'm responding to an old thread -- catching up on my email. In this proposal (from March), Ethan provided a Jira ticket and code patches. http://jira.openqa.org/browse/WTR-146 My understanding is that this proposal can be summarized in two points. 1. Provide the same options to Filefield#set as currently exist for Element#click. 2. Change the API. If this is correct, then i would like to consider the two parts of proposal separately. If not, i would like to know what else is being proposed. Bret Ethan Jewett wrote: > I think that the addition of the "click" to file_field.set in this > change (see thread below) is causing one of my tests to hang during > the @container.wait in the "click" method. However, this problem > didn't show up until after the changes to the wait functionality in > mid-February. Or so my theory goes . . . > > The fix, in my case, is to change the "click" to a "click!" in > file_field.set, by-passing the @container.wait in the click method. I > suppose I could use a time-out technique instead. > > I can't provide a test case, unfortunately, because I don't have a > handle on all the javascript eventing and fancy ajax-y reload in > various frames that's going on in a generated SAP business server > pages app. I think this is a relatively well-known issue with > ajax-like apps. Please correct me if I'm wrong. > > Attached is a patch to the 1.5.1163 revision that illustrates the way > I've modified watir.rb to allow me to specify wait behavior in the > file_field.set method. The "watir 1.5.1163 - no_wait option in > file_field.set.patch" basically throws any extra arguments on > file_field.set into an args_hash Hash. The "set" method then checks > for the :no_wait key and either "click"s or "click!"s based on that > key. > > So, > > file_field.set(path) results in a "click" > file_field.set(path, :no_wait => false) results in a "click" > file_field.set(path, :no_wait => true) results in a "click!" > > The upside here is that this doesn't change existing behavior. The > downside is that it is kind of a hack as it stands. > > I think that implementing this sort of functionality in a more general > (and perhaps better thought-out) way would give a lot of flexibility > to those of us dealing with ajax goodness to manually override wait > functionality when necessary. It might also be a reasonably standard > way to allow granular control of other functionality on a method-call > by method-call basis. > > Is this reasonable? Has something like this been decided against in > the past? Is it too big a change for 1.5? Thoughts on problems? > Improvements? Maybe using :wait => false instead of :no_wait => true > would be more intuitive? > > I don't think this patch is ready to go into the code-base as it > stands, even if people think it is a reasonable approach, but I'll > submit a Jira ticket once I have something that I think will work. > > Thanks, > Ethan > > On 1/10/07, Bret Pettichord wrote: >> John Lolis wrote: >> > I registered AutoItX3.dll using regsvr32 and it got rid of the >> error message, the problem now is it doesn't fill in the field with >> any text. I can flash it, so i know I have the right field - I just >> can't put anything in there. >> > >> > any more ideas? >> > >> >> Today I checked in fixes for both this and the other problem (autoit >> registration). These are NOT in today's dev gem, but will be in the next >> one. You can pull them from trunk if you like. >> >> A workaround for this problem for earlier versions of 1.5 is this: >> >> 1. Manually register autoit: >> >> >regsvr32 AutoItX3.dll >> >> 2. Add a call to click: >> >> ie.file_field(:id, >> 'DriverFileUpload_DriverFileUpload').set(filename) >> ie.file_field(:id, 'DriverFileUpload_DriverFileUpload').click >> >> Please let us know if either of these solutions does not fix this >> problem for anyone. >> >> Bret >> _______________________________________________ >> Wtr-general mailing list >> Wtr-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-general >> > ------------------------------------------------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From forum-watir-users at openqa.org Mon Jun 4 19:04:45 2007 From: forum-watir-users at openqa.org (Harmeet) Date: Mon, 04 Jun 2007 18:04:45 CDT Subject: [Wtr-general] Clicking link in Ajax table In-Reply-To: <24398142.61180942707805.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <29835985.6831180998315366.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> How can I post the HTML code here in this message From chitta.ranjan at globallogic.com Mon Jun 4 23:42:49 2007 From: chitta.ranjan at globallogic.com (chitta) Date: Tue, 5 Jun 2007 09:12:49 +0530 Subject: [Wtr-general] Read a picture number Message-ID: <002001c7a723$96cc3dd0$fa64a8c0@synapse.com> Yap, that's an image,, I am in a process to write a script which automate the total process of email creation in gmail, But during registration you can mark an image always populated which contain some random alphabets, later which user needs to type it by looking at the image,,, & I Baffled their. Thanks in Advance Chitta Ranjan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070605/30136a12/attachment.html From jeff.fry at gmail.com Tue Jun 5 00:41:27 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Mon, 04 Jun 2007 21:41:27 -0700 Subject: [Wtr-general] Read a picture number In-Reply-To: <002001c7a723$96cc3dd0$fa64a8c0@synapse.com> References: <002001c7a723$96cc3dd0$fa64a8c0@synapse.com> Message-ID: <4664E977.3090502@gmail.com> chitta wrote: > Yap, that's an image,, > > I am in a process to write a script which automate the total process > of email creation in gmail, But during registration you can mark an > image always populated which contain some random alphabets, later > which user needs to type it by looking at the image,,, & I Baffled their. > Hi Chitta, It sounds like you want to automate creating many gmail accounts, and are being prevented by CAPTCHAs ...which they use specifically to prevent folks from automating creating many gmail accounts. Am I understanding you correctly? If I am - No, Watir definitely doesn't have any functionality to get around this...and I think we'd probably resist adding it, unless we understood what good purpose you'd be using it for. (I have no reason to make assumptions about how you would use this, but most people who are interested in cracking CAPTCHAs are spammers.) Jeff ---- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070604/b3347d33/attachment-0001.html From chitta.ranjan at globallogic.com Tue Jun 5 01:00:08 2007 From: chitta.ranjan at globallogic.com (chitta) Date: Tue, 5 Jun 2007 10:30:08 +0530 Subject: [Wtr-general] Read a picture number Message-ID: <000301c7a72e$63a65d90$091b10ac@synapse.com> Hi, That was not my intention, I really need more then 50 active email addresses for my testing purpose ,,, ok that's not an issue,, I will make it manually, unless I will try to make some alias mail id. Regards Chitta Ranjan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070605/f5f4ef35/attachment.html From jeff.fry at gmail.com Tue Jun 5 01:12:38 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Mon, 04 Jun 2007 22:12:38 -0700 Subject: [Wtr-general] Read a picture number In-Reply-To: <000301c7a72e$63a65d90$091b10ac@synapse.com> References: <000301c7a72e$63a65d90$091b10ac@synapse.com> Message-ID: <4664F0C6.2000401@gmail.com> chitta wrote: > > Hi, > > > > That was not my intention, I really need more then 50 active email > addresses for my testing purpose ,,, ok that's not an issue,, I will > make it manually, unless I will try to make some alias mail id. > > > Cool - thanks for the explanation. I would say for 50 addresses you are probably best off doing it manually...or perhaps experimenting with having a few scripts running that get you to the point of the captcha and then pause, waiting for you to take the next step. Cheers, Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070604/7924b418/attachment.html From chitta.ranjan at globallogic.com Tue Jun 5 01:44:55 2007 From: chitta.ranjan at globallogic.com (chitta) Date: Tue, 5 Jun 2007 11:14:55 +0530 Subject: [Wtr-general] Read a picture number Message-ID: <000801c7a734$a57e6310$091b10ac@synapse.com> Well ,, Thanks for the advice, I preferred to go manually. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070605/ba4b109a/attachment.html From forum-watir-users at openqa.org Tue Jun 5 02:37:43 2007 From: forum-watir-users at openqa.org (kumari) Date: Tue, 05 Jun 2007 01:37:43 CDT Subject: [Wtr-general] return data from tablecells? In-Reply-To: <7ac2300c0705310752j22de977bqf43e5c3ec38edb86@mail.gmail.com> Message-ID: <34567470.8731181025493511.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> variable = ie.table(index,1).row_values(1) puts variable the above syntax returns the values in the row number '1' similarly we can also get the values of column. To get the particular value in a cell table = ie.table(:index,1) variable = table[1][1].to_s The above variable gives the cell value of rownumber 1 and columnnumber 1 From forum-watir-users at openqa.org Tue Jun 5 02:50:15 2007 From: forum-watir-users at openqa.org (kumari) Date: Tue, 05 Jun 2007 01:50:15 CDT Subject: [Wtr-general] HELP!!!!!!!!! Stuck with a potential bug. In-Reply-To: <33738756.1271180953421486.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <31549171.9101181026245933.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi i think this will work $ie.frame(:index,2).image(:src,/newRecord.gif/).click try this with button also as image.sometimes may not work where button will work $ie.frame(:index,2).button(:alt,/New WorkOrder/).click bye From zeljko.filipin at gmail.com Tue Jun 5 05:41:14 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 5 Jun 2007 11:41:14 +0200 Subject: [Wtr-general] Clicking link in Ajax table In-Reply-To: <29835985.6831180998315366.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <24398142.61180942707805.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <29835985.6831180998315366.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 6/5/07, Harmeet wrote: > > How can I post the HTML code here in this message Just paste it, it usually works. Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070605/1e265168/attachment.html From forum-watir-users at openqa.org Tue Jun 5 05:56:51 2007 From: forum-watir-users at openqa.org (sapna) Date: Tue, 05 Jun 2007 04:56:51 CDT Subject: [Wtr-general] To view the message send based on ID created. In-Reply-To: Message-ID: <26705696.10481181037441482.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I think this [ie.link(:href, /id=1274/).click] will help me out but I have another question for this as the id created is dynamic it keep changing for every new transaction. So I need to make transaction and navigate to message page click on the Bill Payment Inquiry link based on the current ID created. So how do I fetch the ID. Regards Sapna From zeljko.filipin at gmail.com Tue Jun 5 06:01:36 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 5 Jun 2007 12:01:36 +0200 Subject: [Wtr-general] Read a picture number In-Reply-To: <000301c7a72e$63a65d90$091b10ac@synapse.com> References: <000301c7a72e$63a65d90$091b10ac@synapse.com> Message-ID: On 6/5/07, chitta wrote: > > I really need more then 50 active email addresses for my testing purpose > I use my gmail account for testing also. You do not need 50 accounts. Gmail allows you to add "+some_text" after you user name and before "@gmail.com". Like this. username+account1 at gmail.com username+account2 at gmail.com Anything sent to username+account1 at gmail.com and username+account2 at gmail.comwill be delivered to inbox of username at gmail.com. Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070605/64c79697/attachment.html From chitta.ranjan at globallogic.com Tue Jun 5 06:58:29 2007 From: chitta.ranjan at globallogic.com (chitta) Date: Tue, 5 Jun 2007 16:28:29 +0530 Subject: [Wtr-general] Read a picture number Message-ID: <000601c7a760$73304230$091b10ac@synapse.com> I use my gmail account for testing also. You do not need 50 accounts. Gmail allows you to add "+some_text" after you user name and before "@gmail.com". Like this. username+account1 at gmail.com username+account2 at gmail.com Anything sent to username+account1 at gmail.com and username+account2 at gmail.comwill be delivered to inbox of username at gmail.com. ---------------------------------------------------------------------------- --------------------------------------------------------------------------- hi, Great idea, It's working. Thank you very much -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070605/c3fcae91/attachment.html From forum-watir-users at openqa.org Tue Jun 5 08:52:51 2007 From: forum-watir-users at openqa.org (Vipul) Date: Tue, 05 Jun 2007 07:52:51 CDT Subject: [Wtr-general] HELP!!!!!!!!! Stuck with a potential bug. In-Reply-To: <31549171.9101181026245933.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <31835173.1231181048001077.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> yes it worked as a button. Although i am surprised why image worked as button. thanks for the help!!!!!!!!!!!!! From forum-watir-users at openqa.org Tue Jun 5 12:36:10 2007 From: forum-watir-users at openqa.org (imran) Date: Tue, 05 Jun 2007 11:36:10 CDT Subject: [Wtr-general] Upgrading the gem for watir 1.5.1.1192 Message-ID: <27641726.3091181061400088.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> A new gem is ready for download, this is the latest pull from Subversion source, tagged at 1.5.1.1192. This gem has a new install process, due to a new dependency on other gems. After download the gem, execute the following commands in the same directory as the gem: > gem install win32-process --include-dependencies > gem install watir I have applied above .. operations as i execute first command where i have extracted the gem. At the command propmt it asks for the selection .. 2 for ruby and 3 for watir. I apply first one. and then second command is executed. But still the code asking me to upgrade to 1.5.1.1100. Current version of Ruby = Ruby184-18 Current Version of Watir = 1.4.1 What should i do now to upgrade my watir to 1.5.1.1192. Thanks. From bret at pettichord.com Tue Jun 5 14:28:26 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 05 Jun 2007 13:28:26 -0500 Subject: [Wtr-general] Upgrading the gem for watir 1.5.1.1192 In-Reply-To: <27641726.3091181061400088.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <27641726.3091181061400088.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4665AB4A.7030404@pettichord.com> imran wrote: > But still the code asking me to upgrade to 1.5.1.1100. > What message are you seeing? What is the exact language? From bret at pettichord.com Tue Jun 5 14:30:25 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 05 Jun 2007 13:30:25 -0500 Subject: [Wtr-general] gem error installing 'builder' In-Reply-To: <01f001c7a562$570630b0$6401a8c0@Jimsxp> References: <0b2e01c799c7$46397220$6401a8c0@Jimsxp> <01f001c7a562$570630b0$6401a8c0@Jimsxp> Message-ID: <4665ABC1.3050408@pettichord.com> jim_matt wrote: > So far, all my scripts are working without a problem. > Thanks for the report. From forum-watir-users at openqa.org Tue Jun 5 18:39:08 2007 From: forum-watir-users at openqa.org (Lana) Date: Tue, 05 Jun 2007 17:39:08 CDT Subject: [Wtr-general] How would you approach verification of data in *xml* format with Watir? Message-ID: <39432965.5161181083178921.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> How would you approach verification of data in *xml* format with Watir through the browser? data example: _http://www.live365.com/stations/easytempo?site=xml_ is there some XMLParser available? From christopher.mcmahon at gmail.com Tue Jun 5 18:53:02 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 5 Jun 2007 16:53:02 -0600 Subject: [Wtr-general] How would you approach verification of data in *xml* format with Watir? In-Reply-To: <39432965.5161181083178921.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <39432965.5161181083178921.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70706051553h68b383dei6695a47b5b06bae6@mail.gmail.com> On 6/5/07, Lana wrote: > How would you approach verification of data in *xml* format with Watir through the browser? > data example: _http://www.live365.com/stations/easytempo?site=xml_ > is there some XMLParser available? My understanding is that REXML is pretty much the standard. http://www.germane-software.com/software/rexml/ From forum-watir-users at openqa.org Tue Jun 5 21:13:52 2007 From: forum-watir-users at openqa.org (Lana) Date: Tue, 05 Jun 2007 20:13:52 CDT Subject: [Wtr-general] How would you approach verification of data in *xml* format with Watir? In-Reply-To: <72799cd70706051553h68b383dei6695a47b5b06bae6@mail.gmail.com> Message-ID: <33068267.5301181092462054.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you for right direction, this helped me to get started: ----------------------------------------------------------------------------------------- #includes require 'watir' require "rexml/document" include Watir include REXML doc = Document.new File.new("station.xml") root = doc.root puts root.elements["STATION_BROADCASTER"] ===== result: username ========================================= But I seems can't find how to get actual value of element 'STATION_BROADCASTER', as there is no attribute, any suggestions? this is my xml: username Thank You, Lana From paul.rogers at shaw.ca Tue Jun 5 21:56:31 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 05 Jun 2007 19:56:31 -0600 Subject: [Wtr-general] How would you approach verification of data in *xml* format with Watir? References: <33068267.5301181092462054.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <000b01c7a7dd$e78eb990$6400a8c0@laptop> you may want to look at xml unit - http://xmlunit.sourceforge.net/ ----- Original Message ----- From: "Lana" To: Sent: Tuesday, June 05, 2007 7:13 PM Subject: Re: [Wtr-general] How would you approach verification of data in *xml* format with Watir? > Thank you for right direction, this helped me to get started: > ----------------------------------------------------------------------------------------- > #includes > require 'watir' > require "rexml/document" > include Watir > include REXML > > > doc = Document.new File.new("station.xml") > root = doc.root > puts root.elements["STATION_BROADCASTER"] > ===== > result: > username > ========================================= > But I seems can't find how to get actual value of element > 'STATION_BROADCASTER', as there is no attribute, any suggestions? > > this is my xml: > > username > > Thank You, > Lana > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From christopher.mcmahon at gmail.com Tue Jun 5 23:09:29 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 5 Jun 2007 21:09:29 -0600 Subject: [Wtr-general] How would you approach verification of data in *xml* format with Watir? In-Reply-To: <33068267.5301181092462054.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <72799cd70706051553h68b383dei6695a47b5b06bae6@mail.gmail.com> <33068267.5301181092462054.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70706052009j4ce1c74fr680e85c165a6c124@mail.gmail.com> It's been a while since I've mucked around with REXML, but this works: ##################### require "rexml/document" include REXML xml = REXML::Document.new(" username ") xml.elements.each("*/STATION_BROADCASTER") {|e| puts e.text} ################################## I'll recommend that you read the tutorial over and over. If I'm not mistaken, there's a REXML mail list, or comp.lang.ruby is always a good place to find information from people much more experienced than me. http://www.germane-software.com/software/rexml/docs/tutorial.html On 6/5/07, Lana wrote: > Thank you for right direction, this helped me to get started: > ----------------------------------------------------------------------------------------- > #includes > require 'watir' > require "rexml/document" > include Watir > include REXML > > > doc = Document.new File.new("station.xml") > root = doc.root > puts root.elements["STATION_BROADCASTER"] > ===== > result: > username > ========================================= > But I seems can't find how to get actual value of element 'STATION_BROADCASTER', as there is no attribute, any suggestions? > > this is my xml: > > username > > Thank You, > Lana > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Wed Jun 6 01:38:17 2007 From: forum-watir-users at openqa.org (san) Date: Wed, 06 Jun 2007 00:38:17 CDT Subject: [Wtr-general] How To Check If A Row Inside A Table Exists Or Not & Count Of Rows.... Message-ID: <38583722.6431181108327320.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Everybody... I Just Tried ie.table(:index, 1).row(:index, 7).exists? or ie.table(:index, 1)[7].exists? But Nothing Works... here's The html 12345
Or Suppose I Have Nested Tables...
Rating History
 
:: Series 1 Graph
 Date  Rating  Action
 10 OCT 2006  Aaa  Change to definitive
 5 SEP 2006  (P)Aaa  New
:: Series 3 Graph
 Date  Rating  Action
 18 MAY 2007  Aaa  Change to definitive
 18 MAY 2007  Aaa  No Rating
 7 MAY 2007  (P)Aaa  New
Now If I Want The Nos Of Rows Of Table with ID Table5 Only What Should I Do, Coz I Just Tried [b]ie.table(:id, "Table5").row_count()[/b] Gives 21 no of Rows, The Total No Of Rows Including The Nested Ones. As Table5 Contains Only 14 Rows Of Itself....Which You Can See By IE Developer Toolbar... Sorry For The Long Html... :) Thanks Everybody... :) From forum-watir-users at openqa.org Wed Jun 6 02:14:21 2007 From: forum-watir-users at openqa.org (kumari) Date: Wed, 06 Jun 2007 01:14:21 CDT Subject: [Wtr-general] How To Check If A Row Inside A Table Exists Or Not & Count Of Rows.... In-Reply-To: <38583722.6431181108327320.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <40363587.6821181110491884.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi If u want only the row count of partiular table without nested ones just use the below function at the starting of script and then use the normal syntax "ie.table(:id, "Table5").row_count()".u will get the row count of particular table ************************************************************************ module Watir include Watir::Exception class Table < Element include Container def row_count assert_exists raise UnknownTableException , "Unable to locate a table using #{@how} and #{@what} " if @o == nil return @o.rows.length end end end ********************************************************************************** now use "ie.table(:id, "Table5").row_count()".If i am write u have to get the exact row count of table without nested rows. bye Kumari From forum-watir-users at openqa.org Wed Jun 6 02:33:03 2007 From: forum-watir-users at openqa.org (eisdrache) Date: Wed, 06 Jun 2007 01:33:03 CDT Subject: [Wtr-general] Concurrent tests, different regions... Message-ID: <36841192.6891181111613275.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Here is the basic idea of what I am trying to do... I have one site, lets call it www.example.com. On that site, there is a login page which directs to four different regions, say region1.example.com, region2.example.com, etc. Now, on the other side of the equation, watir is being run from a remote webserver. And on that webserver I have a php page which controls the execution of the watir script and then posts the results in a table to the user. So, at the moment, the user goes to the php page. Clicks "start test" and watir then goes to www.example.com and one by one tests each region. However, what I would like is when the user clicks the test button, four separate tests will begin and test each region concurrently. I have tried setting up something like this: php page: $regions = array('region1','region2','region3','region4'); foreach ($regions as $region) { $cmd = "start example.rbw $region"; exec($cmd); sleep(3); } ruby page: region = $ARGV[0] $ie = Watir::IE.start("www.example.com") $ie.text_field(:name, "user").set(username) $ie.text_field(:name, "password").set(password) $ie.select_list(:name, "region").select(region) proceed with testing... This, however, does not seem to work. Seems as if two or three instances will start but only one will actually finish. So, hopefully this makes sense and hopefully someone can help me figure this one out. Thanks in advance. From forum-watir-users at openqa.org Wed Jun 6 03:06:07 2007 From: forum-watir-users at openqa.org (san) Date: Wed, 06 Jun 2007 02:06:07 CDT Subject: [Wtr-general] How To Check If A Row Inside A Table Exists Or Not & Count Of Rows.... In-Reply-To: <40363587.6821181110491884.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <25907479.6961181113597278.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks kumari... It Really Helped Me Out... But I just Copied It.. :P Can You Pls Explain The Function A little Bit More... Thanks A Lot... :) And By The Way Is There Any Way To Check If A Row Inside A Table Exists Or Not... ? From tester.paul at gmail.com Wed Jun 6 09:45:10 2007 From: tester.paul at gmail.com (Paul Carvalho) Date: Wed, 6 Jun 2007 09:45:10 -0400 Subject: [Wtr-general] Concurrent tests, different regions... In-Reply-To: <36841192.6891181111613275.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36841192.6891181111613275.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <37c405480706060645k6843692fxa365c40cab3bc8ea@mail.gmail.com> Without seeing more of the code, I'm pretty sure you need to start by moving away from using Global variables. On 06/06/07, eisdrache wrote: > > Here is the basic idea of what I am trying to do... > > I have one site, lets call it www.example.com. On that site, there is a > login page which directs to four different regions, say > region1.example.com, region2.example.com, etc. [snip] > I have tried setting up something like this: > > php page: > > $regions = array('region1','region2','region3','region4'); > > foreach ($regions as $region) { > $cmd = "start example.rbw $region"; > exec($cmd); > sleep(3); > } > > ruby page: > > region = $ARGV[0] > > $ie = Watir::IE.start("www.example.com") > > $ie.text_field(:name, "user").set(username) > $ie.text_field(:name, "password").set(password) > $ie.select_list(:name, "region").select(region) > > proceed with testing... > > This, however, does not seem to work. Seems as if two or three instances > will start but only one will actually finish. So, hopefully this makes sense > and hopefully someone can help me figure this one out. > > Thanks in advance. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070606/22607ec0/attachment.html From forum-watir-users at openqa.org Wed Jun 6 10:38:24 2007 From: forum-watir-users at openqa.org (mihai) Date: Wed, 06 Jun 2007 09:38:24 CDT Subject: [Wtr-general] run a javascript in html? Message-ID: <34553573.12721181140734110.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> i have a scientific calculator made in java in a html; how do i test the buttons? when i want to press "5" it runs a javascript function digit(5) how do i call that function in watir? From zeljko.filipin at gmail.com Wed Jun 6 10:42:03 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 6 Jun 2007 16:42:03 +0200 Subject: [Wtr-general] run a javascript in html? In-Reply-To: <34553573.12721181140734110.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <34553573.12721181140734110.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Some html would help. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070606/ef16089f/attachment.html From forum-watir-users at openqa.org Wed Jun 6 10:48:20 2007 From: forum-watir-users at openqa.org (mihai) Date: Wed, 06 Jun 2007 09:48:20 CDT Subject: [Wtr-general] run a javascript in html? In-Reply-To: <34553573.12721181140734110.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <28085220.12851181141330775.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> this is the page i want to test: [http://www.squarebox.co.uk/scalc.html|http://www.squarebox.co.uk/scalc.html] From forum-watir-users at openqa.org Wed Jun 6 10:52:05 2007 From: forum-watir-users at openqa.org (Titani) Date: Wed, 06 Jun 2007 09:52:05 CDT Subject: [Wtr-general] Watir::Exception::NavigationException not being thrown Message-ID: <29350813.12921181141555133.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I am fairly new to Watir. I had been working with Watir 1.4.1 and I just installed the latest Watir 1.5 gem. When I had Watir 1.4.1 installed, I was able to catch the Watir::Exception::NavigationException when I tried to goto a webpage that did not exist. It seems that 1.5 is not throwing this exception. Does anyone have any suggestions on how I can detect a http error with 1.5. Thanks From paul.rogers at shaw.ca Wed Jun 6 11:33:22 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 06 Jun 2007 09:33:22 -0600 Subject: [Wtr-general] Watir::Exception::NavigationException not being thrown References: <29350813.12921181141555133.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <010001c7a850$04a39d30$6400a8c0@laptop> this was removed from 1.5 because for a few people it was annoying. doing this may fix it require 'watir/contrib/page_checker' ie = Watir::IE.start( 'www.page.com') ie.add_checker(PageCheckers::NAVIGATION_CHECKER) Paul ----- Original Message ----- From: "Titani" To: Sent: Wednesday, June 06, 2007 8:52 AM Subject: [Wtr-general] Watir::Exception::NavigationException not being thrown > Hi, > > I am fairly new to Watir. I had been working with Watir 1.4.1 and I just > installed the latest Watir 1.5 gem. > > When I had Watir 1.4.1 installed, I was able to catch the > Watir::Exception::NavigationException > when I tried to goto a webpage that did not exist. It seems that 1.5 is > not throwing this exception. > > Does anyone have any suggestions on how I can detect a http error with > 1.5. > > Thanks > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Wed Jun 6 13:14:45 2007 From: forum-watir-users at openqa.org (vijay) Date: Wed, 06 Jun 2007 12:14:45 CDT Subject: [Wtr-general] Can an 'excel' file be renamed with a Watir command? Message-ID: <31851105.14701181150115171.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello people, I have got a script that creates an 'excel_file' while running. After running, I want to rename it so that next time, when the script is run, it will create the excel file anew. Can I do that? I tried a few DOS commands but I could find only two DOS commands working in Watir. They are 'Dir.mkdir(directory)' and 'rmdir(directory)' Thanks, in Advance, Vijay From areed at relocationcentral.com Wed Jun 6 13:22:16 2007 From: areed at relocationcentral.com (Adam Reed) Date: Wed, 6 Jun 2007 12:22:16 -0500 Subject: [Wtr-general] Can an 'excel' file be renamed with a Watir command? In-Reply-To: <31851105.14701181150115171.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <31851105.14701181150115171.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36B5DBA88E027F47812ED877C6A978D801372E17@rc-mail.relocationcentral.com> You should be able to use: File.rename("afile", "afile.bak") This is listed in the Pragmatic Programmer's (free) Guide to Ruby: http://www.rubycentral.com/book/ref_c_file.html So you'd just do a little: if File.exists?("test.xls") File.rename("test.xls", "old_test.xls") else... end... Thanks, Adam -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of vijay Sent: Wednesday, June 06, 2007 12:15 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Can an 'excel' file be renamed with a Watir command? Hello people, I have got a script that creates an 'excel_file' while running. After running, I want to rename it so that next time, when the script is run, it will create the excel file anew. Can I do that? I tried a few DOS commands but I could find only two DOS commands working in Watir. They are 'Dir.mkdir(directory)' and 'rmdir(directory)' Thanks, in Advance, Vijay _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Wed Jun 6 14:24:26 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 6 Jun 2007 12:24:26 -0600 Subject: [Wtr-general] Can an 'excel' file be renamed with a Watir command? In-Reply-To: <31851105.14701181150115171.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <31851105.14701181150115171.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70706061124q607144e4x60fca2a9ead45d1b@mail.gmail.com> > I have got a script that creates an 'excel_file' while running. After running, I want to rename it so that next time, when the script is run, it will create the excel file anew. Can I do that? I tried a few DOS commands but I could find only two DOS commands working in Watir. They are 'Dir.mkdir(directory)' and 'rmdir(directory)' That's not DOS and that's not Watir. That's Ruby. You should definitely read up on the Ruby language itself. The only thing Watir knows about is the browser. From forum-watir-users at openqa.org Wed Jun 6 15:10:25 2007 From: forum-watir-users at openqa.org (Lana) Date: Wed, 06 Jun 2007 14:10:25 CDT Subject: [Wtr-general] How would you approach verification of data in *xml* format with Watir? In-Reply-To: <72799cd70706052009j4ce1c74fr680e85c165a6c124@mail.gmail.com> Message-ID: <29362298.15991181157055397.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank You, here is my final basic piece working with your help: ************************************************************** require 'watir' require "rexml/document" include Watir include REXML test_site = 'http://...........site=xml' ie = IE.new ie.goto(test_site) xml_data = Document.new(ie.text) xml_data.elements.each("*/STATION_BROADCASTER") {|e| puts e.text} From christopher.mcmahon at gmail.com Wed Jun 6 15:20:41 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 6 Jun 2007 13:20:41 -0600 Subject: [Wtr-general] How would you approach verification of data in *xml* format with Watir? In-Reply-To: <29362298.15991181157055397.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <72799cd70706052009j4ce1c74fr680e85c165a6c124@mail.gmail.com> <29362298.15991181157055397.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70706061220p6bf557afmce1f26311276c3a4@mail.gmail.com> On 6/6/07, Lana wrote: > Thank You, > here is my final basic piece working with your help: You're welcome, I'm glad you got it to go! From forum-watir-users at openqa.org Wed Jun 6 16:10:35 2007 From: forum-watir-users at openqa.org (vijay) Date: Wed, 06 Jun 2007 15:10:35 CDT Subject: [Wtr-general] Can an 'excel' file be renamed with a Watir command? In-Reply-To: <31851105.14701181150115171.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <39345009.16911181160665970.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you areed for your answer. That was what I needed. It is working perfectly. Also, cmcmahon, I would definitely try to read the 'Ruby Language Help' file. Thanks, Vijay. From forum-watir-users at openqa.org Wed Jun 6 23:10:18 2007 From: forum-watir-users at openqa.org (Hayato) Date: Wed, 06 Jun 2007 22:10:18 CDT Subject: [Wtr-general] Modal dialog Message-ID: <41417239.19211181185848527.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello, I'm trying to manipulate modal_dialog and I have an issue. In Watir (Ruby) code, I create two threads. One is to load the target page and click on a button. The button in the target page has onclick event handler that executes JavaScript to show modal popup. The other thread in Ruby watches for modal_dialog. The main thread before branching looks like the following. def test $ie = IE.new m = ModalWindowHandler.new modalWindowHandlerThread = Thread.new { m.handleWindow() } l = Thread.new{loadPage()} modalWindowHandlerThread.join l.join end Here is the first thread code. def loadPage() $ie.goto('http://localhost/Default.htm') loadButton = $ie.button(:name, 'btnLoad') loadButton.click end So the first thread loads the modal window, and the other thread watches for it and when it finds it, it clicks on the close button. However, when the first Ruby thread clicks on the button that invokes JavaScript to show modal window, the other thread (modalWindowHandlerThread) also stops. This causes the entire Watir script to halt. But when I manually close the popup window and manually click on the button to show the modal popup window, the other thread restarts and successfully finds the modal window. Does anyone know how to resolve this issue? Please let me know. TIA From manish at gslab.com Thu Jun 7 01:53:36 2007 From: manish at gslab.com (Manish Sapariya) Date: Thu, 07 Jun 2007 11:23:36 +0530 Subject: [Wtr-general] run a javascript in html? In-Reply-To: <28085220.12851181141330775.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28085220.12851181141330775.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <46679D60.6070008@gslab.com> mihai wrote: > this is the page i want to test: [http://www.squarebox.co.uk/scalc.html|http://www.squarebox.co.uk/scalc.html] > This should work. ie.area(:href, /digit\(4\)/).click For accessing the operators you will have to change the regexp and you are done. Question to the list: On given page, when I do ie.show_links, it shows all the javascript hrefs. However when I do ie.links() or check the existence of these links using ie.link(:href,/digit/) it returns false? Are there any known limitations on accessibility of map and area elements? Thanks and Regards, Manish From forum-watir-users at openqa.org Thu Jun 7 02:17:47 2007 From: forum-watir-users at openqa.org (mihai) Date: Thu, 07 Jun 2007 01:17:47 CDT Subject: [Wtr-general] run a javascript in html? In-Reply-To: <34553573.12721181140734110.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <28334332.20781181197097638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> nobody can help me? From forum-watir-users at openqa.org Thu Jun 7 02:54:03 2007 From: forum-watir-users at openqa.org (mihai) Date: Thu, 07 Jun 2007 01:54:03 CDT Subject: [Wtr-general] click link in iframe? Message-ID: <30923741.21081181199273196.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> i have this html code: table border="0" cellpadding="0" cellspacing="0" width="100%" > this is a meniu with submenius links: Standard Analytics, Custom Analytics, My Workspace... and can i click Standard Analytics for example in watir? From manish at gslab.com Thu Jun 7 03:10:49 2007 From: manish at gslab.com (Manish Sapariya) Date: Thu, 07 Jun 2007 12:40:49 +0530 Subject: [Wtr-general] run a javascript in html? In-Reply-To: <28334332.20781181197097638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28334332.20781181197097638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4667AF79.8090103@gslab.com> mihai wrote: > nobody can help me? > Did you try solution posted by me? ----reproduced here--- This should work. ie.area(:href, /digit\(4\)/).click For accessing the operators you will have to change the regexp and you are done. ----------- -Manish From forum-watir-users at openqa.org Thu Jun 7 04:12:26 2007 From: forum-watir-users at openqa.org (jhun) Date: Thu, 07 Jun 2007 03:12:26 CDT Subject: [Wtr-general] [firewatir] Fire_event not working in Firefox Message-ID: <22789869.51181203976545.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have this in my code: lis = $browser.elements_by_xpath("//li"); lis.each do |li| $logger.log("value: " + li.id); if (li.id == d.id[4..10]) $logger.log("FOUND!!!"); * li.fire_event("ondblclick");* break; end end In bold text, doesnt seem to work. Can you please help me or i hope there's alternative to activate the ondblclick event. Thanks for the help! From forum-watir-users at openqa.org Thu Jun 7 04:56:15 2007 From: forum-watir-users at openqa.org (Manish Sapariya) Date: Thu, 07 Jun 2007 03:56:15 CDT Subject: [Wtr-general] run a javascript in html? In-Reply-To: <28334332.20781181197097638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <27410012.601181206605767.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> This should work. ie.area(:href, /digit\(4\)/).click For accessing the operators you will have to change the regexp and you are done. From manish at gslab.com Thu Jun 7 04:59:21 2007 From: manish at gslab.com (Manish Sapariya) Date: Thu, 07 Jun 2007 14:29:21 +0530 Subject: [Wtr-general] forum do not get the postings made using the mailing list Message-ID: <4667C8E9.7050003@gslab.com> Hi All, This particular mail is targeted to the admin of watir-general forum on openqa.org. This may be known issue, but I observed that the postings done using mailing list mail id, does not get reflected in the forum and many user's are using just forum for discussing the queries. Is there any way to make sure that the postings do get copied to forum? Thanks and Regards, Manish From forum-watir-users at openqa.org Thu Jun 7 05:00:34 2007 From: forum-watir-users at openqa.org (John) Date: Thu, 07 Jun 2007 04:00:34 CDT Subject: [Wtr-general] Link description from file Message-ID: <26550969.661181206864161.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I have stored the link descriptions in a file to limit the maintenance efforts. I read the description from the file, store it in a variable and then click the link. When I use the whole link description, everything works fine: [code] link = "www.example.com/contact.php" ie.link(:url, link).click [/code] But when I use a regular expression, then it doesn't work, because I think it is stored as a string: [code] link = "/contact/" ie.link(:url, link).click [/code] How can I use regular expressions this way? Is there some string to regular expression conversion possibility? Regards, John Message was edited by: jarkelen1 From xingyuhui at gmail.com Thu Jun 7 05:23:07 2007 From: xingyuhui at gmail.com (=?GB2312?B?u9Q=?=) Date: Thu, 7 Jun 2007 17:23:07 +0800 Subject: [Wtr-general] Link description from file In-Reply-To: <26550969.661181206864161.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <26550969.661181206864161.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <59e2d0a70706070223n6b9a19cfk3c4d9595ca4f6983@mail.gmail.com> hi try this : link = "contact" ie.link(:url, /#{link}/).click 2007/6/7, John : > > Hi, > > I have stored the link descriptions in a file to limit the maintenance > efforts. I read the description from the file, store it in a variable and > then click the link. When I use the whole link description, everything works > fine: > > [code] > link = "www.example.com/contact.php" > ie.link(:url, link).click > [/code] > > But when I use a regular expression, then it doesn't work, because I think > it is stored as a string: > > [code] > link = "/contact/" > ie.link(:url, link).click > [/code] > > How can I use regular expressions this way? Is there some string to > regular expression conversion possibility? > > Regards, > John > > Message was edited by: jarkelen1 > _______________________________________________ > 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/20070607/b2480d48/attachment.html From forum-watir-users at openqa.org Thu Jun 7 05:42:59 2007 From: forum-watir-users at openqa.org (mihai) Date: Thu, 07 Jun 2007 04:42:59 CDT Subject: [Wtr-general] run a javascript in html? In-Reply-To: <34553573.12721181140734110.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <27103407.901181209409922.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> that doesn't work Error: undefined method `area' for # (NoMethodError) watir code: require 'watir' #includes include Watir ie = IE.new ie.goto( 'http://www.squarebox.co.uk/scalc.html' ) sleep(5) ie.area(:href, /digit\(4\)/).click From forum-watir-users at openqa.org Thu Jun 7 05:50:17 2007 From: forum-watir-users at openqa.org (Manish Sapariya) Date: Thu, 07 Jun 2007 04:50:17 CDT Subject: [Wtr-general] run a javascript in html? In-Reply-To: <27103407.901181209409922.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <24949378.961181209847109.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I think watir 1.4 does not support map and area element. Try watir 1.5. From prema.arya at gmail.com Thu Jun 7 05:54:17 2007 From: prema.arya at gmail.com (Prema Arya) Date: Thu, 7 Jun 2007 15:24:17 +0530 Subject: [Wtr-general] [firewatir] Fire_event not working in Firefox In-Reply-To: <22789869.51181203976545.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <22789869.51181203976545.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <27915010706070254k4a7a9dd8j379a678c0c1963b@mail.gmail.com> Hi Jhun, Thanks for reporting this. You can use the latest code form svn/trunk at http://firewatir.googlecode.com/svn/trunk/FireWatir/ We have already fixed this issue. In case you face any problem let me know. Regards, Prema On 6/7/07, jhun wrote: > > I have this in my code: > > lis = > $browser.elements_by_xpath("//li"); > lis.each do |li| > $logger.log("value: " + > li.id); > if (li.id == d.id[4..10]) > $logger.log("FOUND!!!"); > > * li.fire_event > ("ondblclick");* > break; > end > end > > In bold text, doesnt seem to work. Can you please help me or i hope > there's alternative to activate the ondblclick event. Thanks for the help! > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- Prema Arya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070607/3d0763c0/attachment-0001.html From forum-watir-users at openqa.org Thu Jun 7 06:57:25 2007 From: forum-watir-users at openqa.org (jhun) Date: Thu, 07 Jun 2007 05:57:25 CDT Subject: [Wtr-general] [firewatir] Fire_event not working in Firefox In-Reply-To: <22789869.51181203976545.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <24985303.1851181213876217.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> i hope u could help me. Im in a rush. Thanks!!! From forum-watir-users at openqa.org Thu Jun 7 08:04:51 2007 From: forum-watir-users at openqa.org (reinier) Date: Thu, 07 Jun 2007 07:04:51 CDT Subject: [Wtr-general] odd thing on comparing strings Message-ID: <25468925.2911181217921936.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Something odd here, or something foolish I simply miss;) [CODE] strTemp=browser.getEditbox(guiMap.getWindow('login').getObject('Login Editbox','','').getFysicalDescription()) strTemp2='email at address.com' if (strTemp.eql?(strTemp2)) puts('strings match') else puts('string does not match') end if (browser.getEditbox(guiMap.getWindow('login').getObject('Login Editbox','','').getFysicalDescription().eql?('email at address.com'))) puts('TESTCHECK: PASS correct value found in editbox') else puts('TESTCHECK: FAIL incorrect value found in editbox') end [/CODE] The first if statement returns strings match. which is correct, as they indeed do match. However the 2nd if statement returns the following error: c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1104:in `locate_input_element': undefined method `m atches' for false:FalseClass (NoMethodError) from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1091:in `each' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1091:in `locate_input_element' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:3717:in `locate' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:2412:in `assert_exists' from (eval):2:in `getContents' from ./Classes/CLBrowser.class.rb:338:in `getEditbox' The odd thing about it, is that ther same values are compared with eachother. Any ideas? From bret at pettichord.com Thu Jun 7 12:42:09 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 07 Jun 2007 11:42:09 -0500 Subject: [Wtr-general] forum do not get the postings made using the mailing list In-Reply-To: <4667C8E9.7050003@gslab.com> References: <4667C8E9.7050003@gslab.com> Message-ID: <46683561.5010608@pettichord.com> Manish Sapariya wrote: > This particular mail is targeted to the admin of watir-general > forum on openqa.org. This may be known issue, but I observed that the > postings > done using mailing list mail id, does not get reflected in the > forum and many user's are using just forum for discussing the > queries. > > Is there any way to make sure that the postings do get copied > to forum? > Thanks for the report. The admin of the openqa forums is Patrick Lightbody and he does not read this list. He can be contacted at plightbo at gmail.com. Because of the increased traffic on this list and the ongoing troubles we have had keeping the forums and mailing list synchronized, I have been considering migrating watir-general to google groups. I would like to hear comments on this idea, as well as other suggestions. Bret From christopher.mcmahon at gmail.com Thu Jun 7 13:18:42 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 7 Jun 2007 11:18:42 -0600 Subject: [Wtr-general] forum do not get the postings made using the mailing list In-Reply-To: <46683561.5010608@pettichord.com> References: <4667C8E9.7050003@gslab.com> <46683561.5010608@pettichord.com> Message-ID: <72799cd70706071018y5607e3d6g6c96d9bcca298351@mail.gmail.com> > Because of the increased traffic on this list and the ongoing troubles > we have had keeping the forums and mailing list synchronized, I have > been considering migrating watir-general to google groups. I would like > to hear comments on this idea, as well as other suggestions. +1 Now that I'm subscribed to selenium and selenium-rc groups also, I'm really missing the yahoo/google config options that openqa doesn't have. From bret at pettichord.com Thu Jun 7 14:29:30 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 07 Jun 2007 13:29:30 -0500 Subject: [Wtr-general] Modal dialog In-Reply-To: <41417239.19211181185848527.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <41417239.19211181185848527.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <46684E8A.2050402@pettichord.com> Hayato wrote: > Does anyone know how to resolve this issue? Please let me know. > Don't use threads. Blocking COM calls will block ALL ruby threads. You'll have to spawn code to run in a separate process instead. Bret From hiriumi at gmail.com Thu Jun 7 16:35:17 2007 From: hiriumi at gmail.com (Hayato Iriumi) Date: Thu, 7 Jun 2007 13:35:17 -0700 Subject: [Wtr-general] Modal dialog In-Reply-To: <46684E8A.2050402@pettichord.com> References: <41417239.19211181185848527.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <46684E8A.2050402@pettichord.com> Message-ID: <50c958a0706071335u630ef930ua9ed1c28afcf9b25@mail.gmail.com> Yeah, that's what I was thinking of in my dream. LOL Thanks for your advice, Bret. :-) On 6/7/07, Bret Pettichord wrote: > Hayato wrote: > > Does anyone know how to resolve this issue? Please let me know. > > > Don't use threads. Blocking COM calls will block ALL ruby threads. > You'll have to spawn code to run in a separate process instead. > > Bret > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Thu Jun 7 17:10:54 2007 From: forum-watir-users at openqa.org (matt) Date: Thu, 07 Jun 2007 16:10:54 CDT Subject: [Wtr-general] not able to click ok for the pop up , after a selection from select lis In-Reply-To: <25645049.3681180425146216.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <29296696.3261181250684508.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> It may be a general winClicker issue. I found that in order to get the winClicker to work, the getWindowHandle() had to perform an exact match. This is because many of the IE windows had the same "Microsoft Internet Explorer" text in the title. As a result, the incorrect window handle was returned. And no ok button was present. The behavior that resulted was that the javascript popup window would not dismiss. winClicker.rb, line 236 ### MCB 3/7/2007 *exact match* if title == textCaption[1].to_s This worked for me :-) From forum-watir-users at openqa.org Thu Jun 7 17:17:15 2007 From: forum-watir-users at openqa.org (matt) Date: Thu, 07 Jun 2007 16:17:15 CDT Subject: [Wtr-general] Not able to find the title of newly opened window. In-Reply-To: <31585769.5831180588832842.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <28774252.3491181251065197.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> In many cases, the application I am testing pops up windows with *no* title. As a result, I sometimes encounter similar experiences to you. In these circumstances, right click on the page to get some part of the URL. Then do something like: browser = Watir::IE.attach(:url,/match_string/) In this way, you can define a regular expression to match against the URL. In many cases, the info on the page is reflected in the name of the page you are accessing. For example, say the "Order History" page does not contain a title. But, the "Order History" page is contained in the ".../ordhist.asp" URL. You could execute something like: browser = Watir::IE.attach(:url,/ordhist.asp/) Hope this helps From forum-watir-users at openqa.org Thu Jun 7 19:39:38 2007 From: forum-watir-users at openqa.org (Norris) Date: Thu, 07 Jun 2007 18:39:38 CDT Subject: [Wtr-general] Trouble selecting list box item - Any suggestions Message-ID: <36873209.4231181259608563.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I'm currently having trouble selecting a list box item, any solutions? For example, I'm trying to select the Quantity from the attached Gap site, but I can't. http://www.gap.com/browse/product.do?cid=7389&pid=453549 Any suggestions will help. Thanks in advance. From christopher.mcmahon at gmail.com Thu Jun 7 19:46:25 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 7 Jun 2007 17:46:25 -0600 Subject: [Wtr-general] Trouble selecting list box item - Any suggestions In-Reply-To: <36873209.4231181259608563.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36873209.4231181259608563.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70706071646w7d51ba84x709c2bb832cb46bb@mail.gmail.com> On 6/7/07, Norris wrote: > Hi, > > I'm currently having trouble selecting a list box item, any solutions? > > For example, I'm trying to select the Quantity from the attached Gap site, but I can't. > > http://www.gap.com/browse/product.do?cid=7389&pid=453549 I hope Charley answers this. Firefox DOM Inspector doesn't recognize that Quantity box. From forum-watir-users at openqa.org Thu Jun 7 20:01:37 2007 From: forum-watir-users at openqa.org (Norris) Date: Thu, 07 Jun 2007 19:01:37 CDT Subject: [Wtr-general] Trouble selecting list box item - Any suggestions?? In-Reply-To: <72799cd70706071646w7d51ba84x709c2bb832cb46bb@mail.gmail.com> Message-ID: <37360834.4341181260928024.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for trying. I can't do it with explorer either. Anyone else? From hiriumi at gmail.com Thu Jun 7 20:03:03 2007 From: hiriumi at gmail.com (Hayato Iriumi) Date: Thu, 7 Jun 2007 17:03:03 -0700 Subject: [Wtr-general] Modal dialog In-Reply-To: <46684E8A.2050402@pettichord.com> References: <41417239.19211181185848527.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <46684E8A.2050402@pettichord.com> Message-ID: <50c958a0706071703xead8c69nda57a227ed74b8d7@mail.gmail.com> I spawned another process, but no luck. I tried system and exec, but Ruby waits for the line to finish. Any other way to spawn another process? On 6/7/07, Bret Pettichord wrote: > Hayato wrote: > > Does anyone know how to resolve this issue? Please let me know. > > > Don't use threads. Blocking COM calls will block ALL ruby threads. > You'll have to spawn code to run in a separate process instead. > > Bret > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From charley.baker at gmail.com Thu Jun 7 20:04:07 2007 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 7 Jun 2007 18:04:07 -0600 Subject: [Wtr-general] Trouble selecting list box item - Any suggestions In-Reply-To: <72799cd70706071646w7d51ba84x709c2bb832cb46bb@mail.gmail.com> References: <36873209.4231181259608563.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <72799cd70706071646w7d51ba84x709c2bb832cb46bb@mail.gmail.com> Message-ID: Norris, This will work with Watir 1.5: ie.select_list(:id, 'qtyDropDown').option(:value, '5').select Send me an email, I'm curious to hear what you guys are doing and glad to see you coming out to mailing lists. -Charley On 6/7/07, Chris McMahon wrote: > > On 6/7/07, Norris wrote: > > Hi, > > > > I'm currently having trouble selecting a list box item, any solutions? > > > > For example, I'm trying to select the Quantity from the attached Gap > site, but I can't. > > > > http://www.gap.com/browse/product.do?cid=7389&pid=453549 > > I hope Charley answers this. Firefox DOM Inspector doesn't recognize > that Quantity box. > _______________________________________________ > 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/20070607/f32fe003/attachment-0001.html From forum-watir-users at openqa.org Thu Jun 7 20:47:24 2007 From: forum-watir-users at openqa.org (Norris) Date: Thu, 07 Jun 2007 19:47:24 CDT Subject: [Wtr-general] Trouble selecting list box item - Any suggestions In-Reply-To: Message-ID: <39588411.4511181263674607.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Charley, I don't think Watir 1.5 is out yet. What email address can I reach you at? From arcteryx at comcast.net Thu Jun 7 21:47:34 2007 From: arcteryx at comcast.net (Jason Darling) Date: Thu, 7 Jun 2007 20:47:34 -0500 Subject: [Wtr-general] forum do not get the postings made using themailing list In-Reply-To: <72799cd70706071018y5607e3d6g6c96d9bcca298351@mail.gmail.com> Message-ID: Bret, +2. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chris McMahon Sent: Thursday, June 07, 2007 12:19 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] forum do not get the postings made using themailing list > Because of the increased traffic on this list and the ongoing troubles > we have had keeping the forums and mailing list synchronized, I have > been considering migrating watir-general to google groups. I would like > to hear comments on this idea, as well as other suggestions. +1 Now that I'm subscribed to selenium and selenium-rc groups also, I'm really missing the yahoo/google config options that openqa doesn't have. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From forum-watir-users at openqa.org Thu Jun 7 23:28:56 2007 From: forum-watir-users at openqa.org (sapna) Date: Thu, 07 Jun 2007 22:28:56 CDT Subject: [Wtr-general] To view the message send based on ID created. In-Reply-To: Message-ID: <37954910.5541181273366580.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I think this [ie.link(:href, /id=1274/).click] will help me out but I have another question for this as the id created is dynamic it keep changing for every new transaction. So I need to make transaction and navigate to message page click on the Bill Payment Inquiry link based on the current ID created. So how do I fetch the ID. Regards Sapna From forum-watir-users at openqa.org Fri Jun 8 00:02:20 2007 From: forum-watir-users at openqa.org (sapna) Date: Thu, 07 Jun 2007 23:02:20 CDT Subject: [Wtr-general] To click on the text link which is the combination of number and text Message-ID: <29235712.5601181275370806.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I had posted this question earlier but could not get any answere to this. I need to click on the text link which has combination of number and text. It looks like

Welcome, you have 2 new messages.

. The number is actually the total count of messages received so number keep changing how can I handle this. Regards Sapna From forum-watir-users at openqa.org Fri Jun 8 00:12:33 2007 From: forum-watir-users at openqa.org (sapna) Date: Thu, 07 Jun 2007 23:12:33 CDT Subject: [Wtr-general] How to capture mail box icon Message-ID: <26963774.5691181275983032.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, Help me understand how to do this. I need to capture mail box icon and want to verify whether the mail box is open or closed. Kindly treat this as high priority. Regards Sapna From forum-watir-users at openqa.org Fri Jun 8 00:21:35 2007 From: forum-watir-users at openqa.org (sandeep) Date: Thu, 07 Jun 2007 23:21:35 CDT Subject: [Wtr-general] To click on the text link which is the combination of number and text In-Reply-To: <29235712.5601181275370806.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <33064564.5771181276525536.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Let me know if this works ie.link(:text, /[0-9]+ new messages/).click From forum-watir-users at openqa.org Fri Jun 8 00:31:53 2007 From: forum-watir-users at openqa.org (sapna) Date: Thu, 07 Jun 2007 23:31:53 CDT Subject: [Wtr-general] To click on the text link which is the combination of number and text In-Reply-To: <33064564.5771181276525536.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <37418225.5831181277143594.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks Sandeep................ From forum-watir-users at openqa.org Fri Jun 8 00:38:41 2007 From: forum-watir-users at openqa.org (sapna) Date: Thu, 07 Jun 2007 23:38:41 CDT Subject: [Wtr-general] Fetching Today's date in the mm/dd/yyyy In-Reply-To: Message-ID: <41500271.5891181277551895.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you............... From forum-watir-users at openqa.org Fri Jun 8 00:40:04 2007 From: forum-watir-users at openqa.org (sapna) Date: Thu, 07 Jun 2007 23:40:04 CDT Subject: [Wtr-general] How to get the all the content of list box into variable In-Reply-To: <23175286.341180503331196.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <38348545.5951181277634711.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you................. From forum-watir-users at openqa.org Fri Jun 8 00:42:04 2007 From: forum-watir-users at openqa.org (sapna) Date: Thu, 07 Jun 2007 23:42:04 CDT Subject: [Wtr-general] How to give the next line b/w the sentences for window text. In-Reply-To: Message-ID: <25946119.6011181277754875.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank u............... From forum-watir-users at openqa.org Fri Jun 8 01:20:55 2007 From: forum-watir-users at openqa.org (Norris) Date: Fri, 08 Jun 2007 00:20:55 CDT Subject: [Wtr-general] Trouble selecting list box item - Any suggestions In-Reply-To: <36873209.4231181259608563.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <27057017.6071181280085433.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks Charley. This worked. In addition, do you know how I can select the size of the waist and length? Thanks in advance. From forum-watir-users at openqa.org Fri Jun 8 03:36:43 2007 From: forum-watir-users at openqa.org (Jet Liu) Date: Fri, 08 Jun 2007 02:36:43 CDT Subject: [Wtr-general] Scheduler In-Reply-To: <31890691.16621175001281665.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36911169.7561181288233841.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, When I set up my schedule using something like "C:\Program Files\Mozilla Firefox\firefox.exe" -chrome "chrome://selenium-ide/content/selenium/TestRunner.html?baseURL=http://www.xyz.com&test=file:///C:\Documents%20and%20Settings\Test%20User\Desktop\Selenium\us/testsuite.html" -height 750 -width 1100 My question is, how do I actually make it start to run all the tests? That is, is there a way to make it start running without someone having to manually click the "Run All Tests" button in the TestRunner? Any tips much appreciated. Thanks. Cheers, Jet From forum-watir-users at openqa.org Fri Jun 8 04:52:44 2007 From: forum-watir-users at openqa.org (mihai) Date: Fri, 08 Jun 2007 03:52:44 CDT Subject: [Wtr-general] click link in iframe? In-Reply-To: <30923741.21081181199273196.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36972934.8281181292794146.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> no ideea? From forum-watir-users at openqa.org Fri Jun 8 06:21:57 2007 From: forum-watir-users at openqa.org (Simba) Date: Fri, 08 Jun 2007 05:21:57 CDT Subject: [Wtr-general] Best Combination of Ruby and Watir Message-ID: <30534709.9331181298147654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, Since one month I have been trying to implement Watir in our project , but still now i am struggling to decide which combiniation of ruby & watir suites my project.Presently i am using Raby 1.8.2 & Watir-1.5.1.1158 this will work fine for javascriptscript alert box 's but won't support Modal_Dialog & Javascript events,Please some body tell me in which combination of ruby and watir i can get these Modal_Dialog & Javascript events features. Thanks Simba From zeljko.filipin at gmail.com Fri Jun 8 06:43:11 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 8 Jun 2007 12:43:11 +0200 Subject: [Wtr-general] forum do not get the postings made using the mailing list In-Reply-To: <46683561.5010608@pettichord.com> References: <4667C8E9.7050003@gslab.com> <46683561.5010608@pettichord.com> Message-ID: On 6/7/07, Bret Pettichord wrote: > > I have been considering migrating watir-general to google groups. +1 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070608/c742c101/attachment.html From forum-watir-users at openqa.org Fri Jun 8 06:43:31 2007 From: forum-watir-users at openqa.org (Alister Scott) Date: Fri, 08 Jun 2007 05:43:31 CDT Subject: [Wtr-general] Best Combination of Ruby and Watir In-Reply-To: <30534709.9331181298147654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <34084037.9741181299441297.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> There is a Watir Extension Toolkit (WET) that may be of use to you. It supports modal dialogs. The details are on this site at http://www.openqa.org/wet/ From zeljko.filipin at gmail.com Fri Jun 8 06:56:21 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 8 Jun 2007 12:56:21 +0200 Subject: [Wtr-general] How to capture mail box icon In-Reply-To: <26963774.5691181275983032.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <26963774.5691181275983032.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Sapna, Sometimes I would like to be able to read mind of other people, but unfortunately, I can not do that. Good news is that I do not have to read you mind to be able to help you. You just need to post HTML of that image when it is opened and closed. :) Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070608/a8b0ce19/attachment-0001.html From forum-watir-users at openqa.org Fri Jun 8 06:58:19 2007 From: forum-watir-users at openqa.org (Simba) Date: Fri, 08 Jun 2007 05:58:19 CDT Subject: [Wtr-general] NoMethodError :Undefined method "Process_id" for 1808:Fixnum Message-ID: <27770958.10281181300329871.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> When i Run Below is code in IRB ,its throwinf error require 'watir' ie=Watir::IE.start("www.google.com") Error : NoMethodError :Undefined method "Process_id" for 1808:Fixnum Please some body tell me why this error is coming? Before Going into IRB , I had installed Win32-process 0.4.0 & Watir-1.5.1.1158.gem thanks Vinod mp From esjewett at gmail.com Fri Jun 8 07:18:16 2007 From: esjewett at gmail.com (Ethan Jewett) Date: Fri, 8 Jun 2007 06:18:16 -0500 Subject: [Wtr-general] Modal dialog In-Reply-To: <50c958a0706071703xead8c69nda57a227ed74b8d7@mail.gmail.com> References: <41417239.19211181185848527.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <46684E8A.2050402@pettichord.com> <50c958a0706071703xead8c69nda57a227ed74b8d7@mail.gmail.com> Message-ID: <68f4a0e80706080418u2902b091vca6d347f944879d8@mail.gmail.com> Does the following work? http://rubyforge.org/pipermail/wtr-general/2005-April/001461.html There are a couple of other examples on the FAQ including one that uses click_no_wait, which I think won't block the current process, though you'll have to handle timing issues yourself as with the startClicker exampe: http://wiki.openqa.org/display/WTR/FAQ Ethan On 6/7/07, Hayato Iriumi wrote: > I spawned another process, but no luck. I tried system and exec, but > Ruby waits for the line to finish. Any other way to spawn another > process? > > On 6/7/07, Bret Pettichord wrote: > > Hayato wrote: > > > Does anyone know how to resolve this issue? Please let me know. > > > > > Don't use threads. Blocking COM calls will block ALL ruby threads. > > You'll have to spawn code to run in a separate process instead. > > > > Bret > > > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From esjewett at gmail.com Fri Jun 8 07:38:17 2007 From: esjewett at gmail.com (Ethan Jewett) Date: Fri, 8 Jun 2007 06:38:17 -0500 Subject: [Wtr-general] click link in iframe? In-Reply-To: <36972934.8281181292794146.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30923741.21081181199273196.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <36972934.8281181292794146.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <68f4a0e80706080438s4ec237ave1beb9bdc100f9cf@mail.gmail.com> Mihai, What is the code you are trying to use to click this menu link? It will need to be something like ie.frame(:index, 1).link(:text, "Link text here").click You might want to consider using something like the IE Developer Toolbar or Firebug to see what is inside the iframe. Ethan On 6/8/07, mihai wrote: > no ideea? > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From cjiang at ece.utexas.edu Fri Jun 8 10:12:33 2007 From: cjiang at ece.utexas.edu (Chong Jiang) Date: Fri, 8 Jun 2007 09:12:33 -0500 Subject: [Wtr-general] frames and url() Message-ID: Hello, Is there some way to return the url of a frame, for example, ie.frame(:index, 1), so I can navigate to the page with a goto? Thanks in advance, Chong -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070608/00f415c4/attachment.html From charley.baker at gmail.com Fri Jun 8 10:41:29 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 8 Jun 2007 08:41:29 -0600 Subject: [Wtr-general] Scheduler In-Reply-To: <36911169.7561181288233841.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <31890691.16621175001281665.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <36911169.7561181288233841.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: You might want to ask this on the Selenium forum. On 6/8/07, Jet Liu wrote: > > Hi, > When I set up my schedule using something like > > "C:\Program Files\Mozilla Firefox\firefox.exe" -chrome > "chrome://selenium-ide/content/selenium/TestRunner.html?baseURL= > http://www.xyz.com&test=file:///C:\Documents%20and%20Settings\Test%20User\Desktop\Selenium\us/testsuite.html" > -height 750 -width 1100 > > My question is, how do I actually make it start to run all the tests? That > is, is there a way to make it start running without someone having to > manually click the "Run All Tests" button in the TestRunner? > > Any tips much appreciated. > > Thanks. > > Cheers, > Jet > _______________________________________________ > 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/20070608/e1b772fa/attachment.html From forum-watir-users at openqa.org Fri Jun 8 10:50:07 2007 From: forum-watir-users at openqa.org (mihai) Date: Fri, 08 Jun 2007 09:50:07 CDT Subject: [Wtr-general] click link in iframe? In-Reply-To: <30923741.21081181199273196.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <33365665.12851181314237879.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> tnx, i had a problem with ie.show_frames...it didn't display the frame..now that it works i've solve my problem too just like u said with ie.frame(:index,xx).frame(:index,yy)... and so on From forum-watir-users at openqa.org Fri Jun 8 10:54:44 2007 From: forum-watir-users at openqa.org (mihai) Date: Fri, 08 Jun 2007 09:54:44 CDT Subject: [Wtr-general] mouse right click? Message-ID: <27401231.12911181314515007.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> can i send to a control mouse right click without using autoit? ..fireevent("rightclick") doesn't simulate right click on a html page From charley.baker at gmail.com Fri Jun 8 11:04:00 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 8 Jun 2007 09:04:00 -0600 Subject: [Wtr-general] Trouble selecting list box item - Any suggestions In-Reply-To: <27057017.6071181280085433.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36873209.4231181259608563.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <27057017.6071181280085433.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Sure it's pretty easy. The sizes all show up in divs with size swatch id tags, you can see them all with the IE dev toolbar. Sold out sizes will have a div class of soldOut, so look out for those. Watir 1.5 is coming out soon, until then, you can install a prebuilt development gem : http://wiki.openqa.org/display/WTR/Development+Builds Or follow the FAQ for installing a gem from development source. What's your last name? -c On 6/7/07, Norris wrote: > > Thanks Charley. This worked. In addition, do you know how I can select > the size of the waist and length? Thanks in advance. > _______________________________________________ > 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/20070608/60d93ef3/attachment.html From forum-watir-users at openqa.org Fri Jun 8 11:41:51 2007 From: forum-watir-users at openqa.org (reinier) Date: Fri, 08 Jun 2007 10:41:51 CDT Subject: [Wtr-general] Link description from file In-Reply-To: <26550969.661181206864161.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <32671931.13351181317341377.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have the same issue. Anyone knows how to handle regular expression retrieved from a file? (so they are a string when used) From paul.rogers at shaw.ca Fri Jun 8 14:24:11 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 08 Jun 2007 12:24:11 -0600 Subject: [Wtr-general] mouse right click? References: <27401231.12911181314515007.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <025f01c7a9fa$364a0fd0$6400a8c0@laptop> search the archives for onContextMenu - i posted some code to do right clicks a few months back Paul ----- Original Message ----- From: "mihai" To: Sent: Friday, June 08, 2007 8:54 AM Subject: [Wtr-general] mouse right click? > can i send to a control mouse right click without using autoit? > ..fireevent("rightclick") doesn't simulate right click on a html page > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From charley.baker at gmail.com Fri Jun 8 14:28:51 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 8 Jun 2007 12:28:51 -0600 Subject: [Wtr-general] NoMethodError :Undefined method "Process_id" for 1808:Fixnum In-Reply-To: <27770958.10281181300329871.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <27770958.10281181300329871.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: You might try updating the win32-process gem. Latest version is 0.5.2. There was a similar posting on the win32-process list on rubyforge. That may or may not resolve the issue. -Charley On 6/8/07, Simba wrote: > > When i Run Below is code in IRB ,its throwinf error > require 'watir' > ie=Watir::IE.start("www.google.com") > > Error : > NoMethodError :Undefined method "Process_id" for 1808:Fixnum > > Please some body tell me why this error is coming? > > Before Going into IRB , I had installed Win32-process 0.4.0 & > Watir-1.5.1.1158.gem > > thanks > Vinod mp > _______________________________________________ > 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/20070608/921f853c/attachment-0001.html From bret at pettichord.com Fri Jun 8 14:42:13 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 08 Jun 2007 13:42:13 -0500 Subject: [Wtr-general] Best Combination of Ruby and Watir In-Reply-To: <30534709.9331181298147654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30534709.9331181298147654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4669A305.4080609@pettichord.com> Simba wrote: > Since one month I have been trying to implement Watir in our project , but still now i am struggling to decide which combiniation of ruby & watir suites my project.Presently i am using Raby 1.8.2 & Watir-1.5.1.1158 this will work fine for javascriptscript alert box 's but won't support Modal_Dialog & Javascript events,Please some body tell me in which combination of ruby and watir i can get these Modal_Dialog & Javascript events features. The IE#modal_dialog command only works with Ruby 1.8.2. You can use the latest version of Watir 1.5. Bret From charley.baker at gmail.com Fri Jun 8 14:51:13 2007 From: charley.baker at gmail.com (charley.baker at gmail.com) Date: Fri, 08 Jun 2007 18:51:13 -0000 Subject: [Wtr-general] test Message-ID: <1181328673.605540.24240@d30g2000prg.googlegroups.com> test From jeff.fry at gmail.com Fri Jun 8 15:28:40 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Fri, 8 Jun 2007 12:28:40 -0700 Subject: [Wtr-general] Best Combination of Ruby and Watir In-Reply-To: <4669A305.4080609@pettichord.com> References: <30534709.9331181298147654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <4669A305.4080609@pettichord.com> Message-ID: <970956b0706081228g25486f3y7f670474a6321f7f@mail.gmail.com> On 6/8/07, Bret Pettichord wrote: > > > The IE#modal_dialog command only works with Ruby 1.8.2. You can use the > latest version of Watir 1.5. > > Oops. This may not be clear in the rdocs. To be clear, are you saying that the IE#modal_dialog command works with ruby 1.8.2 but not with earlier OR later versions? Currently readme.rb says: Best is to use Ruby 1.8.2-14 or later. Should I change that? -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070608/e39e3a75/attachment.html From charley.baker at gmail.com Fri Jun 8 16:16:46 2007 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 8 Jun 2007 14:16:46 -0600 Subject: [Wtr-general] Best Combination of Ruby and Watir In-Reply-To: <970956b0706081228g25486f3y7f670474a6321f7f@mail.gmail.com> References: <30534709.9331181298147654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <4669A305.4080609@pettichord.com> <970956b0706081228g25486f3y7f670474a6321f7f@mail.gmail.com> Message-ID: modal_dialog only works for 1.8.2 currently since that's the version of Ruby that the win32ole.so library was compiled against. Bret added an error if you try to use this feature in newer versions of Ruby. If you need modal_dialog, you're limited to 1.8.2. -c On 6/8/07, Jeff Fry wrote: > > > > On 6/8/07, Bret Pettichord wrote: > > > > > > The IE#modal_dialog command only works with Ruby 1.8.2. You can use the > > latest version of Watir 1.5. > > > > Oops. This may not be clear in the rdocs. To be clear, are you saying > that the IE#modal_dialog command works with ruby 1.8.2 but not with > earlier OR later versions? > > Currently readme.rb says: > Best is to use Ruby 1.8.2-14 or later. > > Should I change that? > > > -- > http://testingjeff.wordpress.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070608/14503dd3/attachment.html From jeff.fry at gmail.com Fri Jun 8 16:53:51 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Fri, 8 Jun 2007 13:53:51 -0700 Subject: [Wtr-general] Best Combination of Ruby and Watir In-Reply-To: References: <30534709.9331181298147654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <4669A305.4080609@pettichord.com> <970956b0706081228g25486f3y7f670474a6321f7f@mail.gmail.com> Message-ID: <970956b0706081353l356b4530kebc93fbea9639941@mail.gmail.com> Thanks. Is this an accurate correction then? To Install Ruby: http://ruby-lang.org Best is to use Ruby 1.8.2-14. Most of Watir works with newer versions of ruby as well, but IE#modal_dialog requires the 1.8.2 WIN32OLE library. It will NOT work with Ruby 1.8.1-13. (This version of Ruby has a bad WIN32OLE library.) Jeff On 6/8/07, Charley Baker wrote: > > modal_dialog only works for 1.8.2 currently since that's the version of > Ruby that the win32ole.so library was compiled against. Bret added an > error if you try to use this feature in newer versions of Ruby. If you need > modal_dialog, you're limited to 1.8.2. > > -c > > On 6/8/07, Jeff Fry wrote: > > > > > > > On 6/8/07, Bret Pettichord wrote: > > > > > > > > > The IE#modal_dialog command only works with Ruby 1.8.2. You can use > > > the > > > latest version of Watir 1.5. > > > > > > Oops. This may not be clear in the rdocs. To be clear, are you saying > > that the IE#modal_dialog command works with ruby 1.8.2 but not with > > earlier OR later versions? > > > > Currently readme.rb says: > > Best is to use Ruby 1.8.2-14 or later. > > > > Should I change that? > > > > > > -- > > http://testingjeff.wordpress.com > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070608/7c524b09/attachment.html From bret at pettichord.com Fri Jun 8 17:15:30 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 08 Jun 2007 16:15:30 -0500 Subject: [Wtr-general] Best Combination of Ruby and Watir In-Reply-To: <970956b0706081353l356b4530kebc93fbea9639941@mail.gmail.com> References: <30534709.9331181298147654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <4669A305.4080609@pettichord.com> <970956b0706081228g25486f3y7f670474a6321f7f@mail.gmail.com> <970956b0706081353l356b4530kebc93fbea9639941@mail.gmail.com> Message-ID: <4669C6F2.70807@pettichord.com> I suggest this: Best is to use Ruby 1.8.2-14 or later. However, if you are using the Watir::IE#modal_dialog method, you must use Ruby 1.8.2-14 and not a more recent version. Watir (in general) will not work with Ruby 1.8.1-13. (This version of Ruby has a bad WIN32OLE library.) Jeff Fry wrote: > Thanks. Is this an accurate correction then? > > To Install Ruby: http://ruby-lang.org > Best is to use Ruby 1.8.2-14. > Most of Watir works with newer versions of ruby as well, but > IE#modal_dialog requires the 1.8.2 WIN32OLE library. > It will NOT work with Ruby 1.8.1-13. (This version of Ruby has a > bad WIN32OLE library.) > > Jeff > > On 6/8/07, *Charley Baker* > wrote: > > modal_dialog only works for 1.8.2 currently since that's the > version of Ruby that the win32ole.so library was compiled against. > Bret added an error if you try to use this feature in newer > versions of Ruby. If you need modal_dialog, you're limited to 1.8.2. > > -c > > On 6/8/07, *Jeff Fry* < jeff.fry at gmail.com > > wrote: > > > > On 6/8/07, *Bret Pettichord* > wrote: > > > The IE#modal_dialog command only works with Ruby 1.8.2. > You can use the > latest version of Watir 1.5. > > Oops. This may not be clear in the rdocs. To be clear, are you > saying that the IE#modal_dialog command works with ruby 1.8.2 > but not with earlier OR later versions? > > Currently readme.rb says: > Best is to use Ruby 1.8.2-14 or later. > > Should I change that? > > > -- > http://testingjeff.wordpress.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > -- > http://testingjeff.wordpress.com > ------------------------------------------------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Fri Jun 8 17:17:19 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 08 Jun 2007 16:17:19 -0500 Subject: [Wtr-general] Modal dialog In-Reply-To: <50c958a0706071703xead8c69nda57a227ed74b8d7@mail.gmail.com> References: <41417239.19211181185848527.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <46684E8A.2050402@pettichord.com> <50c958a0706071703xead8c69nda57a227ed74b8d7@mail.gmail.com> Message-ID: <4669C75F.3040000@pettichord.com> Hayato Iriumi wrote: > I spawned another process, but no luck. I tried system and exec, but > Ruby waits for the line to finish. Any other way to spawn another > process? > This works. You can search the watir source code for examples. From bret at pettichord.com Fri Jun 8 17:19:31 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 08 Jun 2007 16:19:31 -0500 Subject: [Wtr-general] Concurrent tests, different regions... In-Reply-To: <37c405480706060645k6843692fxa365c40cab3bc8ea@mail.gmail.com> References: <36841192.6891181111613275.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <37c405480706060645k6843692fxa365c40cab3bc8ea@mail.gmail.com> Message-ID: <4669C7E3.3080602@pettichord.com> Paul Carvalho wrote: > Without seeing more of the code, I'm pretty sure you need to start by > moving away from using Global variables. I agree. You also will want to run each test in a separate thread. From jeff.fry at gmail.com Fri Jun 8 17:23:26 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Fri, 8 Jun 2007 14:23:26 -0700 Subject: [Wtr-general] Best Combination of Ruby and Watir In-Reply-To: <4669C6F2.70807@pettichord.com> References: <30534709.9331181298147654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <4669A305.4080609@pettichord.com> <970956b0706081228g25486f3y7f670474a6321f7f@mail.gmail.com> <970956b0706081353l356b4530kebc93fbea9639941@mail.gmail.com> <4669C6F2.70807@pettichord.com> Message-ID: <970956b0706081423x682aea2bx1a39b631f1d8a41d@mail.gmail.com> On 6/8/07, Bret Pettichord wrote: > > I suggest this: > > > Best is to use Ruby 1.8.2-14 or later. > However, if you are using the Watir::IE#modal_dialog method, you must > use Ruby 1.8.2-14 and not a more recent version. > Watir (in general) will not work with Ruby 1.8.1-13. (This version of > Ruby has a bad WIN32OLE library.) > Looks good to me...and now checked in. Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070608/b06bcf0c/attachment-0001.html From forum-watir-users at openqa.org Sat Jun 9 01:37:20 2007 From: forum-watir-users at openqa.org (mihai) Date: Sat, 09 Jun 2007 00:37:20 CDT Subject: [Wtr-general] mouse right click? In-Reply-To: <27401231.12911181314515007.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <34696793.18621181367470572.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> "ie.button(:id, 'xx').fire_event('onContextMenu')" this doesn't work, this just highlights the buton, not simulating the right click From forum-watir-users at openqa.org Sat Jun 9 03:11:35 2007 From: forum-watir-users at openqa.org (jhun) Date: Sat, 09 Jun 2007 02:11:35 CDT Subject: [Wtr-general] [Firewatir] Fireevent not working Message-ID: <30325229.18871181373126501.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Can you please help me. I have this code: lis = $browser.elements_by_xpath("//li"); lis.each do |li| $logger.log("value: " + li.id); if (li.id == d.id[4..10]) $logger.log("FOUND!!!"); li.fireevent("ondblclick"); break; end end It seems that the event ondblclick is not working. I tried searching on the net just to find an example or any implementation of the fireevent in firewatir but sad to say didnt find any. I hope you could help me with my problem. Thanks a lot!!! From angrez at gmail.com Sat Jun 9 05:52:21 2007 From: angrez at gmail.com (Angrez Singh) Date: Sat, 9 Jun 2007 15:22:21 +0530 Subject: [Wtr-general] [Firewatir] Fireevent not working In-Reply-To: <30325229.18871181373126501.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30325229.18871181373126501.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi, We are working on it. Will let you know the results soon. Regards, Angrez On 6/9/07, jhun wrote: > > Can you please help me. I have this code: > > lis = $browser.elements_by_xpath("//li"); > lis.each do |li| > $logger.log("value: " + li.id); > if (li.id == d.id[4..10]) > $logger.log("FOUND!!!"); > li.fireevent("ondblclick"); > break; > end > end > > It seems that the event ondblclick is not working. I tried searching on > the net just to find an example or any implementation of the fireevent in > firewatir but sad to say didnt find any. I hope you could help me with my > problem. Thanks a lot!!! > _______________________________________________ > 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/20070609/586a650e/attachment.html From forum-watir-users at openqa.org Sat Jun 9 08:46:05 2007 From: forum-watir-users at openqa.org (jhun) Date: Sat, 09 Jun 2007 07:46:05 CDT Subject: [Wtr-general] [Firewatir] Fireevent not working In-Reply-To: Message-ID: <30069960.19021181393195313.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you so much. I'll wait for that. :) From forum-watir-users at openqa.org Sat Jun 9 09:34:02 2007 From: forum-watir-users at openqa.org (mihai) Date: Sat, 09 Jun 2007 08:34:02 CDT Subject: [Wtr-general] sintax error Message-ID: <32404871.19271181396072141.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> i search with a script all buttons on a page; if the name of a button is btnG then it must puts OK else NO the code is: $ie.buttons.each do |bbtns| puts bbtns.name if bbtns.name.equal?('btnG') then puts 'OK' else puts 'NO' end puts bbtns.value puts $i=$i+1 end but the output is: btnG NO Google Search btnI NO I'm Feeling Lucky NO Download Google Toolbar what im doing wrong? tnx From charley.baker at gmail.com Sat Jun 9 10:48:54 2007 From: charley.baker at gmail.com (Charley Baker) Date: Sat, 9 Jun 2007 08:48:54 -0600 Subject: [Wtr-general] sintax error In-Reply-To: <32404871.19271181396072141.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32404871.19271181396072141.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Change equal? to eql? or == and it 'll work. equal? compares object ids, eql? and == compare values. -Charley On 6/9/07, mihai wrote: > > i search with a script all buttons on a page; if the name of a button is > btnG then it must puts OK else NO > the code is: > $ie.buttons.each do |bbtns| > puts bbtns.name > if bbtns.name.equal?('btnG') > then puts 'OK' > else puts 'NO' > end > puts bbtns.value > puts > $i=$i+1 > end > > > but the output is: > > btnG > NO > Google Search > > btnI > NO > I'm Feeling Lucky > > > NO > Download Google Toolbar > > what im doing wrong? > tnx > _______________________________________________ > 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/20070609/7b886c6c/attachment.html From bret at pettichord.com Sat Jun 9 16:52:36 2007 From: bret at pettichord.com (Bret Pettichord) Date: Sat, 09 Jun 2007 15:52:36 -0500 Subject: [Wtr-general] Best Combination of Ruby and Watir In-Reply-To: <970956b0706081423x682aea2bx1a39b631f1d8a41d@mail.gmail.com> References: <30534709.9331181298147654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <4669A305.4080609@pettichord.com> <970956b0706081228g25486f3y7f670474a6321f7f@mail.gmail.com> <970956b0706081353l356b4530kebc93fbea9639941@mail.gmail.com> <4669C6F2.70807@pettichord.com> <970956b0706081423x682aea2bx1a39b631f1d8a41d@mail.gmail.com> Message-ID: <466B1314.8070503@pettichord.com> Jeff Fry wrote: > > Looks good to me...and now checked in. Thanks. I can never remember what is documented where. From paul.rogers at shaw.ca Sun Jun 10 22:48:35 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 10 Jun 2007 20:48:35 -0600 Subject: [Wtr-general] mouse right click? References: <34696793.18621181367470572.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <032b01c7abd3$01f2ffa0$6400a8c0@laptop> this depends on what happens on your onContextMenu. There will probably be some javascript attached to it. If you just want to access the browsers standard context menu, then I suggest using autoit Paul ----- Original Message ----- From: "mihai" To: Sent: Friday, June 08, 2007 11:37 PM Subject: Re: [Wtr-general] mouse right click? > "ie.button(:id, 'xx').fire_event('onContextMenu')" > > this doesn't work, this just highlights the buton, not simulating the > right click > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Mon Jun 11 01:09:00 2007 From: forum-watir-users at openqa.org (sapna) Date: Mon, 11 Jun 2007 00:09:00 CDT Subject: [Wtr-general] How to capture mail box icon In-Reply-To: Message-ID: <35690709.20671181538570170.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Zeljko, As it was generic I did not send HTML of that image. Find below the code.  6/10/2007  6/8/2007 Regards Sapna From forum-watir-users at openqa.org Mon Jun 11 01:44:10 2007 From: forum-watir-users at openqa.org (eisdrache) Date: Mon, 11 Jun 2007 00:44:10 CDT Subject: [Wtr-general] Concurrent tests, different regions... In-Reply-To: <36841192.6891181111613275.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <34443390.20731181540680121.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I understand what you are saying about the global variables, but in this case they are a necessary evil as I am using the following code in order to handle javascript pop-ups: def startClicker( button , waitTime= 9, user_input=nil ) hwnd = $ie.enabled_popup(waitTime) if (hwnd) w = WinClicker.new if ( user_input ) w.setTextValueForFileNameField( hwnd, "#{user_input}" ) end sleep 3 w.clickWindowsButton_hwnd( hwnd, "#{button}" ) w=nil end end From prema.arya at gmail.com Mon Jun 11 01:48:16 2007 From: prema.arya at gmail.com (Prema Arya) Date: Mon, 11 Jun 2007 11:18:16 +0530 Subject: [Wtr-general] [firewatir] Fire_event not working in Firefox In-Reply-To: <27915010706070629x248e4e62qa9657f30007b6ffd@mail.gmail.com> References: <22789869.51181203976545.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <24985303.1851181213876217.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <27915010706070629x248e4e62qa9657f30007b6ffd@mail.gmail.com> Message-ID: <27915010706102248q529f2f82oa2b64cfb8d71d22c@mail.gmail.com> Hi Jhun, One more thing I noticed in your code you have mis-spelled the fire-event its "fireEvent". li.fireEventt("ondblclick"); should work. Let me know if it solves the problem. Regards, Prema On 6/7/07, Prema Arya wrote: > > I have taken this gem from the trunk. > You can install it and start using. Hope this is what you are expecting. > > Regards, > Prema > > On 6/7/07, jhun wrote: > > > > i hope u could help me. Im in a rush. Thanks!!! > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > -- > Prema Arya > -- Prema Arya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070611/585b054f/attachment.html From zeljko.filipin at gmail.com Mon Jun 11 05:30:11 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 11 Jun 2007 11:30:11 +0200 Subject: [Wtr-general] How to capture mail box icon In-Reply-To: <35690709.20671181538570170.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <35690709.20671181538570170.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Sapna, This is how you can find out if mail box is open or closed. Let me know if you do not know how to use this code. irb> ie.image(:index, 1).src =~ /mailclosed/ => 46 irb> ie.image(:index, 1).src =~ /mailopen/ => nil Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070611/fd9f8aef/attachment-0001.html From forum-watir-users at openqa.org Mon Jun 11 05:35:46 2007 From: forum-watir-users at openqa.org (sapna) Date: Mon, 11 Jun 2007 04:35:46 CDT Subject: [Wtr-general] Need to fetch the ID Message-ID: <30422418.22371181554576753.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I had posted this question earlier but did not get any information. So wanted to put the question again. Need help on this. Below is the HTML code. 1> I want to check whether the mail is read or unread depending on the mail icon(first line of HTML) 2> Want to fetch the id generated (id=1303) depending on which I will click on the message link and that would take me to read message window.  6/8/2007 RE: Check Copy Request Thanks in advance. Regards Sapna From forum-watir-users at openqa.org Mon Jun 11 05:43:29 2007 From: forum-watir-users at openqa.org (reinier) Date: Mon, 11 Jun 2007 04:43:29 CDT Subject: [Wtr-general] Link description from file In-Reply-To: <26550969.661181206864161.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <40132134.22771181555039807.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> found the solution: use the following code: [code] object = 'test.html' ie.link(:href,/#{object}/).click [/code] From forum-watir-users at openqa.org Mon Jun 11 06:10:47 2007 From: forum-watir-users at openqa.org (sapna) Date: Mon, 11 Jun 2007 05:10:47 CDT Subject: [Wtr-general] How to capture mail box icon In-Reply-To: Message-ID: <34024365.23221181556677710.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Can u guid me how to use this code. I need to check if it is opened/closed and then open the closed mail. From forum-watir-users at openqa.org Mon Jun 11 06:11:00 2007 From: forum-watir-users at openqa.org (mihai) Date: Mon, 11 Jun 2007 05:11:00 CDT Subject: [Wtr-general] mouse right click? In-Reply-To: <27401231.12911181314515007.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <34784227.23231181556690293.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> with java script it works; but i have this problem, this is the site : http://www.dynamicdrive.com/dynamicindex1/contextmenu.htm right click to select all and it appers a java menu; how do i click, for example, on Message Forum in that menu? From zeljko.filipin at gmail.com Mon Jun 11 08:21:57 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 11 Jun 2007 14:21:57 +0200 Subject: [Wtr-general] Need to fetch the ID In-Reply-To: <30422418.22371181554576753.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30422418.22371181554576753.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 6/11/07, sapna wrote: > > href="/AppsUIWeb/SelfService/MessageDetail.aspx?id=1303&messageToUser=True">RE: > Check Copy Request Sapna, To find id of that link you have to know some other attribute of that link. I will assume that you know text "RE: Check Copy Request" This is how you can get href attribute of that link. irb> ie.link(:text, "RE: Check Copy Request").href => "file:///C:/AppsUIWeb/SelfService/MessageDetail.aspx?id=1303&messageToUser=True" This will extract 1303. irb> m = /id=(1303)/.match(ie.link(:text, "RE: Check Copy Request").href) => # irb> m[1] => "1303" For more information see class MatchData ( http://phrogz.net/ProgrammingRuby/ref_c_matchdata.html) Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070611/7f498e88/attachment.html From zeljko.filipin at gmail.com Mon Jun 11 08:39:21 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 11 Jun 2007 14:39:21 +0200 Subject: [Wtr-general] How to capture mail box icon In-Reply-To: <34024365.23221181556677710.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <34024365.23221181556677710.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 6/11/07, sapna wrote: > > I need to check if it is opened/closed and then open the closed mail. Sapna, This will click a link if mail is closed. You will have to replace ":how" and "what" with something appropriate. ie.link(:how, what).click if ie.image(:how, what).src =~ /mailclosed/ Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070611/0d8848ec/attachment.html From paul.rogers at shaw.ca Mon Jun 11 11:46:18 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 11 Jun 2007 09:46:18 -0600 Subject: [Wtr-general] mouse right click? In-Reply-To: <34784227.23231181556690293.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <27401231.12911181314515007.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <34784227.23231181556690293.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: the code in that page uses the javascript event object, which we've had problems with in watir. I think you will be able to make this work by: simulate right click see if the menuitem div is visible click it based on its text something like this may be what you need ie.link(:index,1).fireEvent("onContextMenu") if ie.div(:text , "Message Formur").style.visibility != "hidden" ie.div(:text , "message forum").click end ----- Original Message ----- From: mihai Date: Monday, June 11, 2007 4:11 am Subject: Re: [Wtr-general] mouse right click? > with java script it works; but i have this problem, this is the > site : http://www.dynamicdrive.com/dynamicindex1/contextmenu.htm > right click to select all and it appers a java menu; how do i > click, for example, on Message Forum in that menu? > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Mon Jun 11 12:32:40 2007 From: forum-watir-users at openqa.org (Hayato) Date: Mon, 11 Jun 2007 11:32:40 CDT Subject: [Wtr-general] Modal dialog In-Reply-To: <68f4a0e80706080418u2902b091vca6d347f944879d8@mail.gmail.com> Message-ID: <38933500.27981181579592432.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> click_no_wait seems to do it. Thank you very much for your help! From areed at relocationcentral.com Mon Jun 11 17:21:03 2007 From: areed at relocationcentral.com (Adam Reed) Date: Mon, 11 Jun 2007 16:21:03 -0500 Subject: [Wtr-general] Running tests from a webserver -- any new information? In-Reply-To: <38933500.27981181579592432.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <68f4a0e80706080418u2902b091vca6d347f944879d8@mail.gmail.com> <38933500.27981181579592432.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36B5DBA88E027F47812ED877C6A978D801372E28@rc-mail.relocationcentral.com> A while ago I posted about the option of running Watir tests from a centralized webserver or desktop. The point would be for others to be able to run the tests and view results without installing Ruby, Watir and dependent libraries and alleviate associated technical problems. I'm the "automation QA guy" at my company, so this would help the rest of my team run tests alongside manual tests, or to support small patches that need a lot of regression testing when I'm away. In case I'm still being vague, the application would list available tests (locally or in SVN -- wouldn't matter), allow the user to click a test to launch it on the host machine, and then display results onscreen. At the time, I believe on person replied and sent a snippet of code out that did work, but was difficult to configure due to the fact it was written by someone else to fill their different needs. Does anyone else use this approach, or know of any applications that make the process easier? I've never written active web code, so it's new ground for me. Thanks, Adam From bob at jdstrategies.net Mon Jun 11 17:43:55 2007 From: bob at jdstrategies.net (Bob) Date: Mon, 11 Jun 2007 14:43:55 -0700 Subject: [Wtr-general] WATiR contract work in San Francisco In-Reply-To: Message-ID: <20070611215036.7DF6E5240A63@rubyforge.org> Experienced test engineer needed to work on Customer Facing Ecommerce applications. Requires significant commercial automation work using the WATiR framework. Immediate, long term contract situation. Very solid team, positive environment. Calls or email are good. Bob Lepesh, JD Strategies. 650-941-2900 bob at jdstrategies.net -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of wtr-general-request at rubyforge.org Sent: Monday, June 11, 2007 2:30 AM To: wtr-general at rubyforge.org Subject: Wtr-general Digest, Vol 43, Issue 13 Send Wtr-general mailing list submissions to wtr-general at rubyforge.org To subscribe or unsubscribe via the World Wide Web, visit http://rubyforge.org/mailman/listinfo/wtr-general or, via email, send a message with subject or body 'help' to wtr-general-request at rubyforge.org You can reach the person managing the list at wtr-general-owner at rubyforge.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Wtr-general digest..." From bret at pettichord.com Mon Jun 11 19:13:13 2007 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 11 Jun 2007 18:13:13 -0500 Subject: [Wtr-general] Concurrent tests, different regions... In-Reply-To: <34443390.20731181540680121.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <34443390.20731181540680121.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <466DD709.5020009@pettichord.com> eisdrache wrote: > I understand what you are saying about the global variables, but in this case they are a necessary evil as I am using the following code in order to handle javascript pop-ups: > > def startClicker( button , waitTime= 9, user_input=nil ) > hwnd = $ie.enabled_popup(waitTime) > if (hwnd) > w = WinClicker.new > if ( user_input ) > w.setTextValueForFileNameField( hwnd, "#{user_input}" ) > end > sleep 3 > w.clickWindowsButton_hwnd( hwnd, "#{button}" ) > w=nil > end > end Using this code with multiple threads will eventually fail unpredictably. You need to pass in the ie object as a parameter to avoid this. Bret From forum-watir-users at openqa.org Mon Jun 11 19:22:29 2007 From: forum-watir-users at openqa.org (Jet Liu) Date: Mon, 11 Jun 2007 18:22:29 CDT Subject: [Wtr-general] Scheduler In-Reply-To: <31890691.16621175001281665.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <29848301.431181604179897.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Adding "&auto=true" to the end of the URL does the trick. Thanks all. From jazzeattle at gmail.com Mon Jun 11 20:27:27 2007 From: jazzeattle at gmail.com (TT Blue) Date: Mon, 11 Jun 2007 17:27:27 -0700 Subject: [Wtr-general] Handling Popup Message-ID: <21fc6efd0706111727x64879dbfyee43932d75111a14@mail.gmail.com> I'm new to Watir as well as Ruby, and I need help handling a pop-up dialog. I've searched both the mailing list as well as the trying all that I've found, but I couldn't get it to click on the "OK" pop-up button. ============================================================== require 'watir' require 'watir\enabled_popup' #require 'watir/WinClicker' def startClicker( button , waitTime= 9, user_input=nil ) # get a handle if one exists hwnd = $ie.enabled_popup(waitTime) if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) w.setTextValueForFileNameField( hwnd, "#{user_input}" ) end # I put this in to see the text being input it is not necessary to work sleep 3 # "OK" or whatever the name on the button is w.clickWindowsButton_hwnd( hwnd, "#{button}" ) # # this is just cleanup w=nil end end switch_role.role.select("my role") startClicker( "OK", 3, "") ============================================================== when I tried code block above, I get this error message: c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- watir\contrib\enabled_popup (LoadError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from CMSlogin.rb:2 when I try this code block: require 'watir/WinClicker' def sstartClicker( button , waitTime = 3) w = WinClicker.new longName = $ie.dir.gsub("/" , "\\" ) shortName = w.getShortFileName(longName) c = "start ruby #{shortName }\\watir\\clickJSDialog.rb #{button } #{ waitTime} " puts "Starting #{c}" w.winsystem(c) w=nil end switch_role.role.select("my role") startClicker( "OK", 3) This just waits forever and does not click on the OK button. ============================================================== Can someone please help? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070611/75f162c0/attachment-0001.html From hiriumi at gmail.com Mon Jun 11 20:31:31 2007 From: hiriumi at gmail.com (Hayato Iriumi) Date: Mon, 11 Jun 2007 17:31:31 -0700 Subject: [Wtr-general] Handling Popup In-Reply-To: <21fc6efd0706111727x64879dbfyee43932d75111a14@mail.gmail.com> References: <21fc6efd0706111727x64879dbfyee43932d75111a14@mail.gmail.com> Message-ID: <50c958a0706111731y3acb099dxfc2c90fe07b7d6e@mail.gmail.com> I just went through exactly the same issue. Try to use click_no_wait and see what happens. On 6/11/07, TT Blue wrote: > I'm new to Watir as well as Ruby, and I need help handling a pop-up dialog. > > I've searched both the mailing list as well as the trying all that I've > found, but I couldn't get it to click on the "OK" pop-up button. > ============================================================== > require 'watir' > require 'watir\enabled_popup' > #require 'watir/WinClicker' > def startClicker( button , waitTime= 9, user_input=nil ) > # get a handle if one exists > hwnd = $ie.enabled_popup(waitTime) > if (hwnd) # yes there is a popup > w = WinClicker.new > if ( user_input ) > w.setTextValueForFileNameField ( hwnd, "#{user_input}" ) > end > # I put this in to see the text being input it is not necessary to > work > sleep 3 > # "OK" or whatever the name on the button is > w.clickWindowsButton_hwnd( hwnd, "#{button}" ) > # > # this is just cleanup > w=nil > end > end > > switch_role.role.select("my role") > startClicker( "OK", 3, "") > ============================================================== > when I tried code block above, I get this error message: > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require': no such file to load -- watir\contrib\enabled_popup > (LoadError) > from > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require' > from CMSlogin.rb:2 > > when I try this code block: > > require 'watir/WinClicker' > def sstartClicker( button , waitTime = 3) > w = WinClicker.new > longName = $ie.dir.gsub("/" , "\\" ) > shortName = w.getShortFileName(longName) > c = "start ruby #{shortName }\\watir\\clickJSDialog.rb #{button } #{ > waitTime} " > puts "Starting #{c}" > w.winsystem(c) > w=nil > end > > switch_role.role.select("my role") > startClicker( "OK", 3) > > This just waits forever and does not click on the OK button. > > ============================================================== > > Can someone please help? > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Tue Jun 12 01:31:44 2007 From: forum-watir-users at openqa.org (sapna) Date: Tue, 12 Jun 2007 00:31:44 CDT Subject: [Wtr-general] Need to fetch the ID In-Reply-To: Message-ID: <33198844.1661181626334759.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Zeljko, I have a quesion on the code you sent me. Kindly find the question below the code. This will extract 1303. irb> m = /id=(1303)/.match(ie.link(:text, "RE: Check Copy Request").href) => # Q: Here I mention the id but I want to fetch automatically because the id keep changing for every message replied. Hope my explaination is fine. irb> m[1] => "1303" From jazzeattle at gmail.com Tue Jun 12 01:59:36 2007 From: jazzeattle at gmail.com (TT Blue) Date: Mon, 11 Jun 2007 22:59:36 -0700 Subject: [Wtr-general] Handling Popup In-Reply-To: <50c958a0706111731y3acb099dxfc2c90fe07b7d6e@mail.gmail.com> References: <21fc6efd0706111727x64879dbfyee43932d75111a14@mail.gmail.com> <50c958a0706111731y3acb099dxfc2c90fe07b7d6e@mail.gmail.com> Message-ID: <21fc6efd0706112259k4d74422dm96881ccf20c45d7c@mail.gmail.com> Tried that too, didn't work. It's somewhat interesting because with QuickTest Pro, it identified that dialog as winDialog and I'd thought the winClicker solution would work... but it didn't. On 6/11/07, Hayato Iriumi wrote: > > I just went through exactly the same issue. > Try to use click_no_wait and see what happens. > > On 6/11/07, TT Blue wrote: > > I'm new to Watir as well as Ruby, and I need help handling a pop-up > dialog. > > > > I've searched both the mailing list as well as the trying all that I've > > found, but I couldn't get it to click on the "OK" pop-up button. > > ============================================================== > > require 'watir' > > require 'watir\enabled_popup' > > #require 'watir/WinClicker' > > def startClicker( button , waitTime= 9, user_input=nil ) > > # get a handle if one exists > > hwnd = $ie.enabled_popup(waitTime) > > if (hwnd) # yes there is a popup > > w = WinClicker.new > > if ( user_input ) > > w.setTextValueForFileNameField ( hwnd, "#{user_input}" ) > > end > > # I put this in to see the text being input it is not necessary > to > > work > > sleep 3 > > # "OK" or whatever the name on the button is > > w.clickWindowsButton_hwnd( hwnd, "#{button}" ) > > # > > # this is just cleanup > > w=nil > > end > > end > > > > switch_role.role.select("my role") > > startClicker( "OK", 3, "") > > ============================================================== > > when I tried code block above, I get this error message: > > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > > `gem_original_require': no such file to load -- > watir\contrib\enabled_popup > > (LoadError) > > from > > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > > `require' > > from CMSlogin.rb:2 > > > > when I try this code block: > > > > require 'watir/WinClicker' > > def sstartClicker( button , waitTime = 3) > > w = WinClicker.new > > longName = $ie.dir.gsub("/" , "\\" ) > > shortName = w.getShortFileName(longName) > > c = "start ruby #{shortName }\\watir\\clickJSDialog.rb #{button } #{ > > waitTime} " > > puts "Starting #{c}" > > w.winsystem(c) > > w=nil > > end > > > > switch_role.role.select("my role") > > startClicker( "OK", 3) > > > > This just waits forever and does not click on the OK button. > > > > ============================================================== > > > > Can someone please help? > > > > > > > > > > _______________________________________________ > > 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/20070611/68828741/attachment.html From forum-watir-users at openqa.org Tue Jun 12 03:18:17 2007 From: forum-watir-users at openqa.org (mihai) Date: Tue, 12 Jun 2007 02:18:17 CDT Subject: [Wtr-general] $ie show/hide? Message-ID: <39789039.2551181632727291.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> can i hide my IE page while its being test? something like: $ie.hide #test command $ie.show From forum-watir-users at openqa.org Tue Jun 12 04:39:40 2007 From: forum-watir-users at openqa.org (imran) Date: Tue, 12 Jun 2007 03:39:40 CDT Subject: [Wtr-general] Upgrading the gem for watir 1.5.1.1192 In-Reply-To: <4665AB4A.7030404@pettichord.com> Message-ID: <28182982.4091181637610043.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, Bret Thanks for considering my question. I have un-installed the watir 1.4.1, so the problem get resolved now. But there is another query. I am working on writing the scripts for my web application but the problem is that i am unable to locate the object named Microsoft Tab strip. Code is like that Patient Info *Insurance Info* *Admission Info* I did try the method to get the url of the respective tab and send it to that location but in vain due to the serverside session creation which is the part of the URL. Some session number dynamically generated is part of that URL. SO when i use that approach it says session expired/ no such session exists. I have to click the *Admisison Info* tab. Please suggest some solution to resolve this burning issue. Thanks :) kind Regards, M.Imran From forum-watir-users at openqa.org Tue Jun 12 04:43:06 2007 From: forum-watir-users at openqa.org (imran) Date: Tue, 12 Jun 2007 03:43:06 CDT Subject: [Wtr-general] Microsoft Tab Strip - Message-ID: <30735302.4151181637816359.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, All I am working on writing the scripts for my web application but the problem is that i am unable to locate the object named Microsoft Tab strip. Code is like that Patient Info *Insurance Info* *Admission Info* I did try the method to get the url of the respective tab and send it to that location but in vain due to the serverside session creation which is the part of the URL. Some session number dynamically generated is part of that URL. So when i use that approach it says session expired/ no such session exists. I have to click the Admisison Info tab. Please suggest some solution to resolve this burning issue. Thanks kind Regards, M.Imran From forum-watir-users at openqa.org Tue Jun 12 04:50:24 2007 From: forum-watir-users at openqa.org (sandeep) Date: Tue, 12 Jun 2007 03:50:24 CDT Subject: [Wtr-general] $ie show/hide? In-Reply-To: <39789039.2551181632727291.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <33762064.4211181638254883.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> you can user $ie.bring_to_front() method which brings the window come to front. For hiding you may use $ie.minimize which minimizes the window (appears as icon on taskbar). Is this what you want? From forum-watir-users at openqa.org Tue Jun 12 05:02:17 2007 From: forum-watir-users at openqa.org (imran) Date: Tue, 12 Jun 2007 04:02:17 CDT Subject: [Wtr-general] $ie show/hide? In-Reply-To: <39789039.2551181632727291.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <34147116.4461181638967887.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi,carabusu To bring the IE at front use the line = $ie.bring_to_front() To Maximize the IE use the line = $ie.maximize() To Minimize the IE use the line = $ie.minimize() To hide the IE follow the link below: URL = http://rubyonwindows.blogspot.com/2007/05/automating-internet-explorer-with-ruby.html kind Regards, M.Imran From zeljko.filipin at gmail.com Tue Jun 12 05:39:49 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 12 Jun 2007 11:39:49 +0200 Subject: [Wtr-general] Need to fetch the ID In-Reply-To: <33198844.1661181626334759.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <33198844.1661181626334759.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Sapna, You should really read something about Regular Expressions. You can start here. http://www.rubycentral.com/book/tut_stdtypes.html There is chapter named Regular Expressions. For now, try this (Bret left it in comment at my blog). (ie.link(:text, "RE: Check Copy Request").href =~ /id=(.*)&/)[1] Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070612/272982fc/attachment-0001.html From Mark_Cain at RL.gov Tue Jun 12 09:51:55 2007 From: Mark_Cain at RL.gov (Cain, Mark) Date: Tue, 12 Jun 2007 06:51:55 -0700 Subject: [Wtr-general] Handling Popup In-Reply-To: <21fc6efd0706112259k4d74422dm96881ccf20c45d7c@mail.gmail.com> References: <21fc6efd0706111727x64879dbfyee43932d75111a14@mail.gmail.com><50c958a0706111731y3acb099dxfc2c90fe07b7d6e@mail.gmail.com> <21fc6efd0706112259k4d74422dm96881ccf20c45d7c@mail.gmail.com> Message-ID: <74805676EA7D9243BDF45D637BAD341067D9A6@EX01-3.rl.gov> I had to alter this method when I had a Pop-up occur from clicking a radio button (couldn't use the click_no_wait). This seemed to get me past that problem. require 'tread' ... def startClicker(button, ieObj) # Strart a new thread that will dismiss the JSPopup. if ieObj != nil then t = Thread.new { w = WinClicker.new hwnd = ieObj.enabled_popup(10) if nil == hwnd w.clickWindowsButton_hwnd(hwnd, button) t.join t = nil w = nil } end ... startClicker('OK', $ie) switch_role.role.select("my role") Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of TT Blue Sent: Monday, June 11, 2007 11:00 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Handling Popup Tried that too, didn't work. It's somewhat interesting because with QuickTest Pro, it identified that dialog as winDialog and I'd thought the winClicker solution would work... but it didn't. On 6/11/07, Hayato Iriumi wrote: I just went through exactly the same issue. Try to use click_no_wait and see what happens. On 6/11/07, TT Blue wrote: > I'm new to Watir as well as Ruby, and I need help handling a pop-up dialog. > > I've searched both the mailing list as well as the trying all that I've > found, but I couldn't get it to click on the "OK" pop-up button. > ============================================================== > require 'watir' > require 'watir\enabled_popup' > #require 'watir/WinClicker' > def startClicker( button , waitTime= 9, user_input=nil ) > # get a handle if one exists > hwnd = $ie.enabled_popup(waitTime) > if (hwnd) # yes there is a popup > w = WinClicker.new > if ( user_input ) > w.setTextValueForFileNameField ( hwnd, "#{user_input}" ) > end > # I put this in to see the text being input it is not necessary to > work > sleep 3 > # "OK" or whatever the name on the button is > w.clickWindowsButton_hwnd( hwnd, "#{button}" ) > # > # this is just cleanup > w=nil > end > end > > switch_role.role.select("my role") > startClicker( "OK", 3, "") > ============================================================== > when I tried code block above, I get this error message: > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require': no such file to load -- watir\contrib\enabled_popup > (LoadError) > from > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require' > from CMSlogin.rb:2 > > when I try this code block: > > require 'watir/WinClicker' > def sstartClicker( button , waitTime = 3) > w = WinClicker.new > longName = $ie.dir.gsub("/" , "\\" ) > shortName = w.getShortFileName(longName) > c = "start ruby #{shortName }\\watir\\clickJSDialog.rb #{button } #{ > waitTime} " > puts "Starting #{c}" > w.winsystem (c) > w=nil > end > > switch_role.role.select("my role") > startClicker( "OK", 3) > > This just waits forever and does not click on the OK button. > > ============================================================== > > Can someone please help? > > > > > _______________________________________________ > 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/20070612/63e18a10/attachment.html From bret at pettichord.com Tue Jun 12 10:25:52 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 12 Jun 2007 09:25:52 -0500 Subject: [Wtr-general] $ie show/hide? In-Reply-To: <39789039.2551181632727291.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <39789039.2551181632727291.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <466EACF0.9060009@pettichord.com> mihai wrote: > can i hide my IE page while its being test? > something like: > > $ie.hide > #test command > $ie.show $ie.visible = false # test $ie.visible = true From forum-watir-users at openqa.org Tue Jun 12 10:49:07 2007 From: forum-watir-users at openqa.org (santosh) Date: Tue, 12 Jun 2007 09:49:07 CDT Subject: [Wtr-general] What are people using for 'test executive'? In-Reply-To: <35027834.1173877138636.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <31444847.11661181659778019.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> We too are using FitNesse to run our Selenium tests, but are getting this exception on RC server and browser too gets killed, Logs on RC: _____________________________________________________________________________ GET: cmd=getNewBrowserSession&1=*iexplore&2=http%3A%2F%2Fwww.google.com Backing up registry settings... Modifying registry settings... Launching Internet Explorer... Not handling: http://www.google.com/selenium-server/core/jsunit/app/jsUnitCore.js?null Browser 340453/:top sel_82573 posted START NEW req: true:POST http://www.google.com/selenium-server/core/driver/?seleniumStart=true&localFrameAddress=top&seleniumWindowName=&uniqueId=sel_82573&sessionId=3404 53&counterToMakeURsUniqueAndSoStopPageCachingInTheBrowser=1181655348218 HTTP/1.0 Accept: */* Referer: http://www.google.com/selenium-server/core/RemoteRunner.html?sessionId=340453&multiWindow=false&debugMode=false Accept-Language: en-us Proxy-Connection: keep-alive User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Host: www.google.com Cookie: PREF=ID=9f5a9971d8484878:TM=1181294031:LM=1181294031:S=UpSXpU9rw9Nma3jP Pragma: no-cache Content-Length: 5 Allocated session 340453 for http://www.google.com Browser 340453/:top sel_82573 posted OK req: null:POST http://www.google.com/selenium-server/core/driver/?&localFrameAdd ress=top&seleniumWindowName=&uniqueId=sel_82573&sessionId=340453&counterToMakeURsUniqueAndSoStopPageCachingInTheBrowser=1181655348281 HTTP/1.0 Accept: */* Referer: http://www.google.com/selenium-server/core/RemoteRunner.html?sessionId=340453&multiWindow=false&debugMode=false Accept-Language: en-us Proxy-Connection: keep-alive User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1 .4322) Host: www.google.com Cookie: PREF=ID=9f5a9971d8484878:TM=1181294031:LM=1181294031:S=UpSXpU9rw9Nma3jP Pragma: no-cache Content-Length: 2 Got result: OK,340453 on session 340453 GET: cmd=testComplete&sessionId=340453 Restoring registry settings (won't affect running browsers)... Got result: OK on session 340453 Please can anyone help with the solution..? -Santosh From bcolfer at shopping.com Tue Jun 12 12:22:17 2007 From: bcolfer at shopping.com (Colfer, Brian) Date: Tue, 12 Jun 2007 10:22:17 -0600 Subject: [Wtr-general] Upgrading the gem for watir 1.5.1.1192 In-Reply-To: <28182982.4091181637610043.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <4665AB4A.7030404@pettichord.com> <28182982.4091181637610043.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <5A95EAE4A3FE1645992FAF868AD6DCDC03C05F1F@DEN-EXM-06.corp.ebay.com> I have both 1.4.1 and 1.5.1.1192 installed ... I installed the gem by running gem -l install watir in the directory where the watir 1.5.1.1192 is located. I have two versions of the scripts using gem 'watir', '= 1.4.1' and gem 'watir', '= 1.5.1.1192' There may be a better way to determine the necessary version of a gem... but I know you can run two versions of your tests with different versions of WATIR. Brian -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of imran Sent: Tuesday, June 12, 2007 1:40 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Upgrading the gem for watir 1.5.1.1192 Hi, Bret Thanks for considering my question. I have un-installed the watir 1.4.1, so the problem get resolved now. From forum-watir-users at openqa.org Tue Jun 12 13:12:34 2007 From: forum-watir-users at openqa.org (mihai) Date: Tue, 12 Jun 2007 12:12:34 CDT Subject: [Wtr-general] $ie.text.include? problem Message-ID: <27215568.13481181668384130.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> i have this code: testSite = 'http://www.google.com' $ie = IE.new $ie.goto(testSite) if $ie.text.include?("Programs") then puts "OK" else puts "CRAP" end end and the output: OK OK OK why does 3 OK appears? how can i do that only one OK appear and how can i write the code for, example,: if strings "Microsoft" and "Programs" and "OK" are in $ie.text puts OK From paul.rogers at shaw.ca Tue Jun 12 13:21:58 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 12 Jun 2007 11:21:58 -0600 Subject: [Wtr-general] $ie.text.include? problem In-Reply-To: <27215568.13481181668384130.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <27215568.13481181668384130.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: I just ran your code fro mirb using watir 1.4.1 and it only printed it once.... ----- Original Message ----- From: mihai Date: Tuesday, June 12, 2007 11:12 am Subject: [Wtr-general] $ie.text.include? problem > i have this code: > > testSite = 'http://www.google.com' > $ie = IE.new > $ie.goto(testSite) > > if $ie.text.include?("Programs") > then puts "OK" > else puts "CRAP" > end > > > end > > and the output: > OK > OK > OK > > why does 3 OK appears? how can i do that only one OK appear and > how can i write the code for, example,: > > if strings "Microsoft" and "Programs" and "OK" are in $ie.text > puts OK > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Tue Jun 12 13:30:33 2007 From: forum-watir-users at openqa.org (mihai) Date: Tue, 12 Jun 2007 12:30:33 CDT Subject: [Wtr-general] $ie.text.include? problem In-Reply-To: <27215568.13481181668384130.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <37595444.13921181669463982.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> but i need watir 1.5 because i'm working with some java scripts From jeff.fry at gmail.com Tue Jun 12 13:41:54 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Tue, 12 Jun 2007 10:41:54 -0700 Subject: [Wtr-general] syntax error, unexpected tIVAR Message-ID: <970956b0706121041t138725bckd8fa8146a35ae726@mail.gmail.com> Hey gang, I am updating a script due to a GUI change. There was previously only one button on the page where class = 'Button Menu'. Now there are two. I'm trying to identify the button by the div it's in, like so: @ie.div(:class, 'PopupMenuLabel title'). at ie.button(:class,'Button Menu').click But I get the following syntax error: add_many_types.rb:34: syntax error, unexpected tIVAR @ie.div(:class, 'PopupMenuLabel title'). at ie.button(:class,'Button Menu').click When I cut that line back to the original @ie.button(:class,'Button Menu').click The script runs...but hits the wrong button. My second choice for resolving this was the somewhat more fragile @ie.button(:class =>'Button Menu', :index => 2).click which yielded c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1098:in `send': {:class=>"Button Menu", :index=>2} is not a symbol (TypeError) from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1098:in `locate_input_element' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1091:in `each' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1091:in `locate_input_element' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:3716:in `locate' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2411:in `assert_exists' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2642:in `enabled?' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2417:in `assert_enabled' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2587:in `click!' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2573:in `click' I'm wondering what I am doing wrong in both cases. Thanks! Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070612/be745fce/attachment.html From jeff.fry at gmail.com Tue Jun 12 13:48:07 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Tue, 12 Jun 2007 10:48:07 -0700 Subject: [Wtr-general] Capturing HTML source from modular/constructed pages Message-ID: <970956b0706121048u7cfe500blfe41713956457dd4@mail.gmail.com> The pages I am automating now are very modular, and often the element I'm driving comes from some included js like: include("metaweb/domain/domainApplication.js"); include("metaweb/core/components/EditableMetawebText.js"); include("metaweb/core/mqlquery/MQLDomainTypesQuery.js"); For an example, check out http://sandbox.freebase.com/signin/signin Note that none of the fields on the page are listed in the source for the page. The IE Dev Toolbar works perfectly for me in these cases, showing many things that aren't visible by viewing source. I realize though that I don't know of a good way to capture the constructed source code to paste into an email. Can I capture the source of the constructed page via IE Dev Toolbar (or something else)? Thanks again, Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070612/a52bc425/attachment.html From paul.rogers at shaw.ca Tue Jun 12 13:50:37 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 12 Jun 2007 11:50:37 -0600 Subject: [Wtr-general] syntax error, unexpected tIVAR In-Reply-To: <970956b0706121041t138725bckd8fa8146a35ae726@mail.gmail.com> References: <970956b0706121041t138725bckd8fa8146a35ae726@mail.gmail.com> Message-ID: use this instead @ie.div(:class, 'PopupMenuLabel title').button(:class,'Button Menu').click -------------- next part -------------- Hey gang, I am updating a script due to a GUI change. There was previously only one button on the page where class = 'Button Menu'. Now there are two. I'm trying to identify the button by the div it's in, like so: @ie.div(:class, 'PopupMenuLabel title'). at ie.button(:class,'Button Menu').click But I get the following syntax error: add_many_types.rb:34: syntax error, unexpected tIVAR @ie.div(:class, 'PopupMenuLabel title'). at ie.button(:class,'Button Menu').click When I cut that line back to the original @ie.button(:class,'Button Menu').click The script runs...but hits the wrong button. My second choice for resolving this was the somewhat more fragile @ie.button(:class =>'Button Menu', :index => 2).click which yielded c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1098:in `send': {:class=>"Button Menu", :index=>2} is not a symbol (TypeError) from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1098:in `locate_input_element' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1091:in `each' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1091:in `locate_input_element' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:3716:in `locate' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2411:in `assert_exists' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2642:in `enabled?' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2417:in `assert_enabled' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2587:in `click!' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2573:in `click' I'm wondering what I am doing wrong in both cases. Thanks! Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070612/2882b60b/attachment.html -------------- next part -------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Tue Jun 12 13:51:13 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 12 Jun 2007 11:51:13 -0600 Subject: [Wtr-general] Capturing HTML source from modular/constructed pages In-Reply-To: <970956b0706121048u7cfe500blfe41713956457dd4@mail.gmail.com> References: <970956b0706121048u7cfe500blfe41713956457dd4@mail.gmail.com> Message-ID: in irb use ie.html -------------- next part -------------- The pages I am automating now are very modular, and often the element I'm driving comes from some included js like: include("metaweb/domain/domainApplication.js"); include("metaweb/core/components/EditableMetawebText.js"); include("metaweb/core/mqlquery/MQLDomainTypesQuery.js"); For an example, check out http://sandbox.freebase.com/signin/signin Note that none of the fields on the page are listed in the source for the page. The IE Dev Toolbar works perfectly for me in these cases, showing many things that aren't visible by viewing source. I realize though that I don't know of a good way to capture the constructed source code to paste into an email. Can I capture the source of the constructed page via IE Dev Toolbar (or something else)? Thanks again, Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070612/ddfbaa87/attachment.html -------------- next part -------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From jeff.fry at gmail.com Tue Jun 12 13:58:26 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Tue, 12 Jun 2007 10:58:26 -0700 Subject: [Wtr-general] $ie.text.include? problem In-Reply-To: <37595444.13921181669463982.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <27215568.13481181668384130.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <37595444.13921181669463982.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <970956b0706121058t614a3f92s33f3aa2424c6af60@mail.gmail.com> I don't believe Watir 1.5 is your issue here. I tried your code in 1.5 and also only got one OK. Specifically, I tried: > require 'test/unit' > require 'watir' > > class TC_sample < Test::Unit::TestCase > include Watir > > def test_sample > testSite = 'http://www.google.com' > $ie = IE.new > $ie.goto(testSite) > > if $ie.text.include?("Programs") > then puts "OK" > else puts "CRAP" > end > > end # method > > end #class > And got: > >ruby test_sample.rb > Loaded suite test_sample > Started > OK > . > Finished in 1.442 seconds. > If you run exactly what I pasted above, do you see 3 OKs? If not, how does your script differ from mine? How does your actual test site differ from google.com? Jeff On 6/12/07, mihai wrote: > > but i need watir 1.5 because i'm working with some java scripts > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070612/0d9a99b5/attachment.html From jeff.fry at gmail.com Tue Jun 12 13:59:37 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Tue, 12 Jun 2007 10:59:37 -0700 Subject: [Wtr-general] syntax error, unexpected tIVAR In-Reply-To: References: <970956b0706121041t138725bckd8fa8146a35ae726@mail.gmail.com> Message-ID: <970956b0706121059t3e3b5e1fh95ceba7090a532bc@mail.gmail.com> Doh! Thanks Paul :) On 6/12/07, Paul Rogers wrote: > > use this instead > @ie.div(:class, 'PopupMenuLabel title').button(:class,'Button Menu').click > > Hey gang, > > I am updating a script due to a GUI change. There was previously only one > button on the page where class = 'Button Menu'. Now there are two. I'm > trying to identify the button by the div it's in, like so: > @ie.div(:class, 'PopupMenuLabel title'). at ie.button(:class,'Button > Menu').click > > But I get the following syntax error: > add_many_types.rb:34: syntax error, unexpected tIVAR > @ie.div(:class, 'PopupMenuLabel title').@ ie.button(:class,'Button > Menu').click > When I cut that line back to the original > @ie.button(:class,'Button Menu').click > The script runs...but hits the wrong button. My second choice for > resolving this was the somewhat more fragile > @ie.button(:class =>'Button Menu', :index => 2).click > > which yielded > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1098:in `send': > {:class=>"Button Menu", :index=>2} is not a symbol (TypeError) > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1098:in > `locate_input_element' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1091:in > `each' > from c:/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.1166/./watir.rb:1091:in > `locate_input_element' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:3716:in > `locate' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2411:in > `assert_exists' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2642:in > `enabled?' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2417:in > `assert_enabled' > from c:/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.1166/./watir.rb:2587:in > `click!' > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:2573:in > `click' > > I'm wondering what I am doing wrong in both cases. > > Thanks! > Jeff > > -- > http://testingjeff.wordpress.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070612/9296f0fc/attachment-0001.html From paul.rogers at shaw.ca Tue Jun 12 14:18:48 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 12 Jun 2007 12:18:48 -0600 Subject: [Wtr-general] safari on windows Message-ID: http://www.apple.com/safari/ From jeff.fry at gmail.com Tue Jun 12 15:44:36 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Tue, 12 Jun 2007 12:44:36 -0700 Subject: [Wtr-general] safari on windows In-Reply-To: References: Message-ID: <970956b0706121244h5029ad61n6268b837137934d0@mail.gmail.com> ...which was followed within hours by reports of 4 DoS and 2 remote code execution bugs http://erratasec.blogspot.com/2007/06/niiiice.html I have to say, I'd really like to see Apple concentrate on getting Safari working on the Mac before they port it to Windows. Jeff On 6/12/07, Paul Rogers wrote: > > http://www.apple.com/safari/ > _______________________________________________ > 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/20070612/b07528cf/attachment.html From jazzeattle at gmail.com Tue Jun 12 21:43:15 2007 From: jazzeattle at gmail.com (TT Blue) Date: Tue, 12 Jun 2007 18:43:15 -0700 Subject: [Wtr-general] Handling Popup In-Reply-To: <74805676EA7D9243BDF45D637BAD341067D9A6@EX01-3.rl.gov> References: <21fc6efd0706111727x64879dbfyee43932d75111a14@mail.gmail.com> <50c958a0706111731y3acb099dxfc2c90fe07b7d6e@mail.gmail.com> <21fc6efd0706112259k4d74422dm96881ccf20c45d7c@mail.gmail.com> <74805676EA7D9243BDF45D637BAD341067D9A6@EX01-3.rl.gov> Message-ID: <21fc6efd0706121843q1ca928edi69dc413f4cd7fe31@mail.gmail.com> I was able to clear a security dialog box using the similar method that you've described below, but I couldn't get it to clear this dialog box. I'll have to go ask the developer that exactly it is so maybe I can tackle this in a different way. On 6/12/07, Cain, Mark wrote: > > I had to alter this method when I had a Pop-up occur from clicking a > radio button (couldn't use the click_no_wait). This seemed to get me past > that problem. > > > require 'tread' > > ... > > def startClicker(button, ieObj) > # Strart a new thread that will dismiss the JSPopup. > if ieObj != nil then > t = Thread.new { > w = WinClicker.new > hwnd = ieObj.enabled_popup(10) if nil == hwnd > w.clickWindowsButton_hwnd(hwnd, button) > t.join > t = nil > w = nil > } > end > ... > > startClicker('OK', $ie) > switch_role.role.select("my role") > Hope this helps, > > *--Mark*** > > > > > ------------------------------ > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *TT Blue > *Sent:* Monday, June 11, 2007 11:00 PM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] Handling Popup > > Tried that too, didn't work. > > It's somewhat interesting because with QuickTest Pro, it identified that > dialog as winDialog and I'd thought the winClicker solution would work... > but it didn't. > > On 6/11/07, Hayato Iriumi wrote: > > > > I just went through exactly the same issue. > > Try to use click_no_wait and see what happens. > > > > On 6/11/07, TT Blue wrote: > > > I'm new to Watir as well as Ruby, and I need help handling a pop-up > > dialog. > > > > > > I've searched both the mailing list as well as the trying all that > > I've > > > found, but I couldn't get it to click on the "OK" pop-up button. > > > ============================================================== > > > require 'watir' > > > require 'watir\enabled_popup' > > > #require 'watir/WinClicker' > > > def startClicker( button , waitTime= 9, user_input=nil ) > > > # get a handle if one exists > > > hwnd = $ie.enabled_popup(waitTime) > > > if (hwnd) # yes there is a popup > > > w = WinClicker.new > > > if ( user_input ) > > > w.setTextValueForFileNameField ( hwnd, "#{user_input}" ) > > > end > > > # I put this in to see the text being input it is not > > necessary to > > > work > > > sleep 3 > > > # "OK" or whatever the name on the button is > > > w.clickWindowsButton_hwnd( hwnd, "#{button}" ) > > > # > > > # this is just cleanup > > > w=nil > > > end > > > end > > > > > > switch_role.role.select("my role") > > > startClicker( "OK", 3, "") > > > ============================================================== > > > when I tried code block above, I get this error message: > > > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > > > `gem_original_require': no such file to load -- > > watir\contrib\enabled_popup > > > (LoadError) > > > from > > > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > > > `require' > > > from CMSlogin.rb:2 > > > > > > when I try this code block: > > > > > > require 'watir/WinClicker' > > > def sstartClicker( button , waitTime = 3) > > > w = WinClicker.new > > > longName = $ie.dir.gsub("/" , "\\" ) > > > shortName = w.getShortFileName(longName) > > > c = "start ruby #{shortName }\\watir\\clickJSDialog.rb #{button } #{ > > > waitTime} " > > > puts "Starting #{c}" > > > w.winsystem (c) > > > w=nil > > > end > > > > > > switch_role.role.select("my role") > > > startClicker( "OK", 3) > > > > > > This just waits forever and does not click on the OK button. > > > > > > ============================================================== > > > > > > Can someone please help? > > > > > > > > > > > > > > > _______________________________________________ > > > Wtr-general mailing list > > > Wtr-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070612/28f42460/attachment.html From jeff.fry at gmail.com Tue Jun 12 22:45:20 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Tue, 12 Jun 2007 19:45:20 -0700 Subject: [Wtr-general] OT-ish - What is determining the order this hash gets iterated through? Message-ID: <970956b0706121945y7434e096jca215955bcc06dc1@mail.gmail.com> Hey gang, I've set up a hash of labeled URLs: $pages = {"clint_eastwood" =>"/view?id=%239202a8c04000641f8000000000056de6", "wood" =>"/view?id=%239202a8c04000641f80000000002bb2f4", "home" =>"/view/", "all_domains" =>"/view/allDomains", "discuss_boats" =>"/discuss/view?id=%2Fboats%2Fboat", "filter_musical_artist" =>"/view/filter?id=/music/artist", "filter_location" =>"/view/filter?id=/location/location", "top_user_druderman" =>"/view/user?id=/user/druderman"} and have code that iterates through them and logs page load times to a CSV: $pages.each_key do |page| $results_array = [] $results_array << page 10.times do url = $url_root + $pages[page] $ie.goto(url) $results_array << $ie.down_load_time.to_s end which in turn creates a CSV like this: filter_musical_artist,1.212,1.282,1.442,1.296,1.242,1.512,1.282,1.182,1.292, 1.232 top_user_druderman,1.763,1.432,1.582,1.623,1.462,1.412,1.422,1.612,1.582, 1.422 filter_location,0.971,0.982,1.242,1.152,1.532,1.162,1.202,1.151,1.221,1.151 all_domains,1.032,0.951,0.661,0.851,0.731,0.871,0.49,0.882,0.701,0.851 wood,1.382,1.321,1.462,1.382,1.332,1.342,1.232,1.292,3.416,1.232 clint_eastwood,2.574,2.864,2.804,3.055,2.994,2.864,2.714,2.975,2.744,2.884 discuss_boats,1.041,0.561,0.561,0.531,0.551,0.571,0.551,0.571,0.541,0.531 home,1.001,1.041,1.032,1.041,1.031,0.982,1.011,1.052,1.132,1.011 So here's the question: Why aren't the csv results in the order of the hash? And what order /are/ they in? There seems to be some method to the madness here, because they come out consistently in the /same/ order...but it isn't the order they are listed in the hash, or alphabetical by key or value...anyone know how this works? Thanks, Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070612/09b87026/attachment.html From christopher.mcmahon at gmail.com Tue Jun 12 22:58:52 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 12 Jun 2007 20:58:52 -0600 Subject: [Wtr-general] OT-ish - What is determining the order this hash gets iterated through? In-Reply-To: <970956b0706121945y7434e096jca215955bcc06dc1@mail.gmail.com> References: <970956b0706121945y7434e096jca215955bcc06dc1@mail.gmail.com> Message-ID: <72799cd70706121958q7ca2a1fo94c24d07cf31628a@mail.gmail.com> > So here's the question: Why aren't the csv results in the order of the hash? > And what order /are/ they in? There seems to be some method to the madness > here, because they come out consistently in the /same/ order...but it isn't > the order they are listed in the hash, or alphabetical by key or > value...anyone know how this works? Hashes are not sorted in predictable ways, regardless of which language you're using. Luckily, in Ruby, the Hash object has a sort() method: http://www.rubycentral.com/book/ref_c_hash.html#Hash.sort I'm not a huge expert at this stuff, but I've tripped over it before. From jeff.fry at gmail.com Wed Jun 13 00:52:58 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Tue, 12 Jun 2007 21:52:58 -0700 Subject: [Wtr-general] OT-ish - What is determining the order this hash gets iterated through? In-Reply-To: <72799cd70706121958q7ca2a1fo94c24d07cf31628a@mail.gmail.com> References: <970956b0706121945y7434e096jca215955bcc06dc1@mail.gmail.com> <72799cd70706121958q7ca2a1fo94c24d07cf31628a@mail.gmail.com> Message-ID: <466F782A.90909@gmail.com> Chris McMahon wrote: >> So here's the question: Why aren't the csv results in the order of the hash? >> And what order /are/ they in? There seems to be some method to the madness >> here, because they come out consistently in the /same/ order...but it isn't >> the order they are listed in the hash, or alphabetical by key or >> value...anyone know how this works? >> > > Hashes are not sorted in predictable ways, regardless of which > language you're using. Luckily, in Ruby, the Hash object has a sort() > method: http://www.rubycentral.com/book/ref_c_hash.html#Hash.sort > > I'm not a huge expert at this stuff, but I've tripped over it before. ...and here comes Chris McMahon, champion of the off topic question! Thanks dude. I half-wondered if my tagging my post as OT would call you out. ;) Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070612/e55d2805/attachment.html From christopher.mcmahon at gmail.com Wed Jun 13 01:11:20 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 12 Jun 2007 23:11:20 -0600 Subject: [Wtr-general] OT-ish - What is determining the order this hash gets iterated through? In-Reply-To: <466F782A.90909@gmail.com> References: <970956b0706121945y7434e096jca215955bcc06dc1@mail.gmail.com> <72799cd70706121958q7ca2a1fo94c24d07cf31628a@mail.gmail.com> <466F782A.90909@gmail.com> Message-ID: <72799cd70706122211nef85670yfe259703f9ebc84d@mail.gmail.com> > I'm not a huge expert at this stuff, but I've tripped over it before. > > ...and here comes Chris McMahon, champion of the off topic question! Thanks > dude. I half-wondered if my tagging my post as OT would call you out. ;) heehee! I am so not-Ruby not-Watir these days. I am heads-down-elbows-up in Selenium/Perl, but I remember dealing with hash sorting in Perl back in the day, and I had to jump in... From forum-watir-users at openqa.org Wed Jun 13 03:20:53 2007 From: forum-watir-users at openqa.org (sapna) Date: Wed, 13 Jun 2007 02:20:53 CDT Subject: [Wtr-general] Want to display data in the same row using Puts Message-ID: <36630437.51181719287190.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I want display data in the same row using puts. For the reference see below. Thanks in advance. puts "{a[4][1]):{a[4][2]}" --> This is not working but. Tell me how to put this value. Regards Sapna From forum-watir-users at openqa.org Wed Jun 13 04:35:07 2007 From: forum-watir-users at openqa.org (reinier) Date: Wed, 13 Jun 2007 03:35:07 CDT Subject: [Wtr-general] how to properly use the snippet function? Message-ID: <25003293.371181723737709.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am trying to get rid of all cookies via a function. On this forum I found the Snippet thingy. http://rubyforge.org/snippet/detail.php?type=snippet&id=26 So I included that code in my script and trying to use it, but I can't figure out how. this is the code: [code] DeleteUrlCacheEntry = Win32API.new("wininet", "DeleteUrlCacheEntry", ['P'], 'V') [/code] So what function should be called to delete all the cookies? From zeljko.filipin at gmail.com Wed Jun 13 06:12:17 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 13 Jun 2007 12:12:17 +0200 Subject: [Wtr-general] syntax error, unexpected tIVAR In-Reply-To: <970956b0706121041t138725bckd8fa8146a35ae726@mail.gmail.com> References: <970956b0706121041t138725bckd8fa8146a35ae726@mail.gmail.com> Message-ID: On 6/12/07, Jeff Fry wrote: > > @ie.button(:class =>'Button Menu', :index => 2).click > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1098:in `send': > {:class=>"Button Menu", :index=>2} is not a symbol (TypeError) > Hi Jeff, I guess that button is one of those elements that still do not have multiple attribute support. Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070613/6327b051/attachment.html From zeljko.filipin at gmail.com Wed Jun 13 06:23:11 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 13 Jun 2007 12:23:11 +0200 Subject: [Wtr-general] Want to display data in the same row using Puts In-Reply-To: <36630437.51181719287190.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36630437.51181719287190.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Sapna, If you have variable called var, you can display its value inside string like this. puts "var = #{var}" Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070613/2209b63f/attachment.html From zeljko.filipin at gmail.com Wed Jun 13 06:59:17 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 13 Jun 2007 12:59:17 +0200 Subject: [Wtr-general] Best Combination of Ruby and Watir In-Reply-To: <4669C6F2.70807@pettichord.com> References: <30534709.9331181298147654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <4669A305.4080609@pettichord.com> <970956b0706081228g25486f3y7f670474a6321f7f@mail.gmail.com> <970956b0706081353l356b4530kebc93fbea9639941@mail.gmail.com> <4669C6F2.70807@pettichord.com> Message-ID: On 6/8/07, Bret Pettichord wrote: > > However, if you are using the Watir::IE#modal_dialog method, you must > use Ruby 1.8.2-14 and not a more recent version. I just installed ruby182-14.exe on clean xp pro machine. Components: only RubyGems Package Manager. Then I tried to install watir-1.5.1.1192.gem. I first executed Y:\>gem install win32-process --include-dependencies and got this error message. Y:\>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" install win32-process --include-dep endencies ERROR: While executing gem ... (OptionParser::InvalidOption) invalid option: --include-dependencies I uninstalled ruby182-14.exe and installed ruby182-15.exe and did not get that error message. Am I doing something wrong? Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070613/6e5cbf2a/attachment.html From npadmana at thoughtworks.com Wed Jun 13 06:46:24 2007 From: npadmana at thoughtworks.com (Nivetha Padmanaban) Date: Wed, 13 Jun 2007 16:16:24 +0530 Subject: [Wtr-general] Porting Watir to JRuby Message-ID: Any plans of porting WATIR to JRuby?? Regards, Nivetha Email - nivetha at thoughtworks.com Mobile - (0) 98807 17518 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070613/d82f0624/attachment.html From forum-watir-users at openqa.org Wed Jun 13 08:28:13 2007 From: forum-watir-users at openqa.org (reinier) Date: Wed, 13 Jun 2007 07:28:13 CDT Subject: [Wtr-general] how to delete cookies (trying now with snippet but this is quite unclear) In-Reply-To: <25003293.371181723737709.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <30189218.1281181737723946.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> got it working myself. by calling the delete_cache and including the file mentioned below (got that from this forum somewhere) [code] #!/bin/ruby # # # # # # set TEMPIF=%USERPROFILE%\Local Settings\Temporary Internet Files # %TEMPIF%\Content.IE5\Index.DAT require 'Win32API' # # # HashMethods = a Hash that can be accessed with methods # e.g. h = MethodHash.new # h['street'] = 'Broadway' # h.street = 'Broadway' # puts h.street ===> Broadway require 'delegate' class MethodHash < SimpleDelegator def initialize h = {} super h end def method_missing(method_name, *args) name = method_name.to_s if name.ends_with?('=') self[ name.chop ] = args[0] else self[ name ] end end end class String def ends_with?(substr) len = substr.length self.reverse() [0 .. len-1].reverse == substr end def starts_with?(substr) len = substr.length self[0 .. len-1] == substr end alias start_with? starts_with? alias begin_with? starts_with? alias begins_with? starts_with? alias end_with? ends_with? # String each() operator reads line-by-line # These functions return characters def each_char self.each_byte{|x| yield x.chr } end def collect_char r = [] self.each_byte{|x| r << x.chr } r end end =begin // Windows System calls needed to clear cache. // BOOL DeleteUrlCacheEntry( LPCTSTR lpszUrlName ); HANDLE FindFirstUrlCacheEntry( LPCTSTR lpszUrlSearchPattern, LPINTERNET_CACHE_ENTRY_INFO lpFirstCacheEntryInfo, LPDWORD lpdwFirstCacheEntryInfoBufferSize ); BOOL FindNextUrlCacheEntry( HANDLE hEnumHandle, LPINTERNET_CACHE_ENTRY_INFO lpNextCacheEntryInfo, LPWORD lpdwNextCacheEntryInfoBufferSize ); BOOL FindCloseUrlCache( IN HANDLE hEnumHandle ); typedef struct _INTERNET_CACHE_ENTRY_INFO { DWORD dwStructSize; LPTSTR lpszSourceUrlName; LPTSTR lpszLocalFileName; DWORD CacheEntryType; DWORD dwUseCount; DWORD dwHitRate; DWORD dwSizeLow; DWORD dwSizeHigh; FILETIME LastModifiedTime; FILETIME ExpireTime; FILETIME LastAccessTime; FILETIME LastSyncTime; LPBYTE lpHeaderInfo; DWORD dwHeaderInfoSize; LPTSTR lpszFileExtension; union { DWORD dwReserved; DWORD dwExemptDelta; } } INTERNET_CACHE_ENTRY_INFO, *LPINTERNET_CACHE_ENTRY_INFO; =end def delete_cache w = get_api('wininet',FUNCS) i = 0 info,infosize = get_first_info(w) cache = w.FindFirstUrlCacheEntry.Call(nil,info,infosize) if cache != 0 begin len, source_file_ptr, local_file_ptr = info.unpack 'LLL' w.DeleteUrlCacheEntry.Call(source_file_ptr) i += 1 info,infosize = get_next_info( w, cache ) end while w.FindNextUrlCacheEntry.Call(cache, info, infosize) != 0 end w.FindCloseUrlCache.Call(cache) i end def get_first_info(api) sizenum = [0,0].pack('L*') buf = [1024,0].pack('L*').ljust(1024) r = api.FindFirstUrlCacheEntry.Call(nil,nil,sizenum) n = sizenum.unpack('L')[0] info = sizenum.ljust(n) [info,sizenum] end def get_next_info(api, handle) sizenum = [0,0].pack('L*') buf = [1024,0].pack('L*').ljust(1024) r = api.FindNextUrlCacheEntry.Call(handle,nil,sizenum) n = sizenum.unpack('L')[0] info = sizenum.ljust(n) [info,sizenum] end # # Win32 API used in this file is listed here. # Each system call can be instatiated like this # DeleteUrlCacheEntry = Win32API.new("wininet", "DeleteUrlCacheEntry", ['P'], 'V') # Instead, the functions are defined dynamically from this list: # FUNCS = { 'FindFirstUrlCacheEntry' => ['ppp','n'], 'FindNextUrlCacheEntry' => ['npp','n'], 'DeleteUrlCacheEntry' => ['n', 'n'], 'FindCloseUrlCache' => ['n', 'n'] } # # get_api returns a hash with Win32 API system calls # Usage: # api = get_api('Kernel32', {'GetLastError'=>['V', 'N'],...}) # def get_api(library, function_hash) f = MethodHash.new function_hash.each{|funcname,types| in_types = types[0].collect_char{|x| x} out_type = types[1] f[funcname] = Win32API.new(library, funcname, in_types, out_type) } f end def getLastError f = Win32API.new('Kernel32', 'GetLastError', ['V'], 'N') f.call end if __FILE__ == $0 n = main # print "Deleted #{n} items\n" end [/code] From nicksieger at gmail.com Wed Jun 13 09:29:49 2007 From: nicksieger at gmail.com (Nick Sieger) Date: Wed, 13 Jun 2007 08:29:49 -0500 Subject: [Wtr-general] Porting Watir to JRuby In-Reply-To: References: Message-ID: On 6/13/07, Nivetha Padmanaban wrote: > > Any plans of porting WATIR to JRuby?? None that I know of at the moment. The stumbling block is to get a compatible version of 'win32ole' on JRuby which we don't have. /Nick From tester.paul at gmail.com Wed Jun 13 09:46:59 2007 From: tester.paul at gmail.com (Paul Carvalho) Date: Wed, 13 Jun 2007 09:46:59 -0400 Subject: [Wtr-general] OT-ish - What is determining the order this hash gets iterated through? In-Reply-To: <72799cd70706121958q7ca2a1fo94c24d07cf31628a@mail.gmail.com> References: <970956b0706121945y7434e096jca215955bcc06dc1@mail.gmail.com> <72799cd70706121958q7ca2a1fo94c24d07cf31628a@mail.gmail.com> Message-ID: <37c405480706130646n63282068ldeaf551b20921829@mail.gmail.com> Just remember that if you 'sort' a hash, you get an *array* not a hash. You may need to adjust your code to match. That's tripped me up before. On 12/06/07, Chris McMahon wrote: > > > So here's the question: Why aren't the csv results in the order of the > hash? > > And what order /are/ they in? There seems to be some method to the > madness > > here, because they come out consistently in the /same/ order...but it > isn't > > the order they are listed in the hash, or alphabetical by key or > > value...anyone know how this works? > > Hashes are not sorted in predictable ways, regardless of which > language you're using. Luckily, in Ruby, the Hash object has a sort() > method: http://www.rubycentral.com/book/ref_c_hash.html#Hash.sort > > I'm not a huge expert at this stuff, but I've tripped over it before. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070613/26b000e7/attachment.html From forum-watir-users at openqa.org Wed Jun 13 10:17:34 2007 From: forum-watir-users at openqa.org (imran) Date: Wed, 13 Jun 2007 09:17:34 CDT Subject: [Wtr-general] $ie.text.include? problem In-Reply-To: <27215568.13481181668384130.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <28441807.4621181744284909.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, *carabasu* Please execute the code below, i have just removed form your code an extra *end*. and added require 'watir' and replaced IE.new with Watir::IE.new because i didn't use include WATIR Execute below code it will print one .. OK require 'watir' testSite = 'http://www.google.com' $ie = Watir::IE.new $ie.goto(testSite) if $ie.text.include?("Programs") then puts "OK" else puts "CRAP" end :) *kind Regards* M.Imran From carl.l.shaulis at convergys.com Wed Jun 13 10:21:08 2007 From: carl.l.shaulis at convergys.com (carl.l.shaulis at convergys.com) Date: Wed, 13 Jun 2007 09:21:08 -0500 Subject: [Wtr-general] Carl L Shaulis is out of the office. Message-ID: I will be out of the office starting 06/13/2007 and will not return until 06/14/2007. If you need immediate assistance please try Cari Spruiell or my cell phone at 512-560-5773. Thanks! -- "NOTICE: The information contained in this electronic mail transmission is intended by Convergys Corporation for the use of the named individual or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone (collect), so that the sender's address records can be corrected." From Mark_Cain at RL.gov Wed Jun 13 10:33:39 2007 From: Mark_Cain at RL.gov (Cain, Mark) Date: Wed, 13 Jun 2007 07:33:39 -0700 Subject: [Wtr-general] how to properly use the snippet function? In-Reply-To: <25003293.371181723737709.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <25003293.371181723737709.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <74805676EA7D9243BDF45D637BAD341067D9A8@EX01-3.rl.gov> The attached file works on my Windows XP/IE7 machine. It will delete all the temporary internet files and the cookies. I don't remember where I got it or who wrote it originally, but I tweaked it to get it to work right for me. Hope this helps, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of reinier Sent: Wednesday, June 13, 2007 1:35 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] how to properly use the snippet function? I am trying to get rid of all cookies via a function. On this forum I found the Snippet thingy. http://rubyforge.org/snippet/detail.php?type=snippet&id=26 So I included that code in my script and trying to use it, but I can't figure out how. this is the code: [code] DeleteUrlCacheEntry = Win32API.new("wininet", "DeleteUrlCacheEntry", ['P'], 'V') [/code] So what function should be called to delete all the cookies? _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- A non-text attachment was scrubbed... Name: CookieKiller.rb Type: application/octet-stream Size: 1858 bytes Desc: CookieKiller.rb Url : http://rubyforge.org/pipermail/wtr-general/attachments/20070613/7c598543/attachment.obj From carl.l.shaulis at convergys.com Wed Jun 13 10:35:08 2007 From: carl.l.shaulis at convergys.com (carl.l.shaulis at convergys.com) Date: Wed, 13 Jun 2007 09:35:08 -0500 Subject: [Wtr-general] Carl L Shaulis is out of the office. Message-ID: I will be out of the office starting 06/13/2007 and will not return until 06/14/2007. If you need immediate assistance please try Cari Spruiell or my cell phone at 512-560-5773. Thanks! -- "NOTICE: The information contained in this electronic mail transmission is intended by Convergys Corporation for the use of the named individual or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone (collect), so that the sender's address records can be corrected." From forum-watir-users at openqa.org Wed Jun 13 11:12:55 2007 From: forum-watir-users at openqa.org (imran) Date: Wed, 13 Jun 2007 10:12:55 CDT Subject: [Wtr-general] Microsoft Tab Strip Issues - urgent Message-ID: <38224533.6441181747605648.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, All I am working on writing the scripts for my web application but the problem is that i am unable to locate the object named Microsoft Tab strip. Code is like that Patient Info *Insurance Info* *Admission Info* I did try the method to get the url of the respective tab and send it to that location but in vain due to the serverside session creation which is the part of the URL. Some session number dynamically generated is part of that URL. So when i use that approach it says session expired/ no such session exists. I have to click the Admisison Info tab. Please suggest some solution to resolve this burning issue. Thanks kind Regards, M.Imran From billagee at gmail.com Wed Jun 13 13:55:53 2007 From: billagee at gmail.com (Bill Agee) Date: Wed, 13 Jun 2007 10:55:53 -0700 Subject: [Wtr-general] how to properly use the snippet function? In-Reply-To: <25003293.371181723737709.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <25003293.371181723737709.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <73e7817e0706131055p38497c79y3ea25b8bf91d0878@mail.gmail.com> When I needed to use that snippet, I just left the whole thing in a separate file, and initiated the cache/cookie cleanup with system('ruby del_cache.rb') You could also probably paste the whole blob of code into a new method and it should work. It would be possible to do the same work in fewer lines of code, but you'd have to refactor the script somewhat. On 6/13/07, reinier wrote: > I am trying to get rid of all cookies via a function. > On this forum I found the Snippet thingy. > http://rubyforge.org/snippet/detail.php?type=snippet&id=26 > So I included that code in my script and trying to use it, but I can't figure out how. > > this is the code: > [code] > DeleteUrlCacheEntry = Win32API.new("wininet", "DeleteUrlCacheEntry", ['P'], 'V') > [/code] > > So what function should be called to delete all the cookies? > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Wed Jun 13 14:09:28 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 13 Jun 2007 13:09:28 -0500 Subject: [Wtr-general] Best Combination of Ruby and Watir In-Reply-To: References: <30534709.9331181298147654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <4669A305.4080609@pettichord.com> <970956b0706081228g25486f3y7f670474a6321f7f@mail.gmail.com> <970956b0706081353l356b4530kebc93fbea9639941@mail.gmail.com> <4669C6F2.70807@pettichord.com> Message-ID: <467032D8.7000402@pettichord.com> ?eljko Filipin wrote: > On 6/8/07, *Bret Pettichord* > wrote: > I just installed ruby182-14.exe on clean xp pro machine. Components: > only RubyGems Package Manager. Then I tried to install > watir-1.5.1.1192.gem. I first executed > > Y:\>gem install win32-process --include-dependencies > > and got this error message. > > Y:\>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" install win32-process > --include-dep > endencies > ERROR: While executing gem ... (OptionParser::InvalidOption) > invalid option: --include-dependencies > > I uninstalled ruby182-14.exe and installed ruby182-15.exe and did not > get that error message. Am I doing something wrong? Probably not. My guess is that you have run into a problem with the version of rubygems installed with 182-14. What happens if you don't use the "--include-dependencies" option? Bret From bret at pettichord.com Wed Jun 13 14:13:02 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 13 Jun 2007 13:13:02 -0500 Subject: [Wtr-general] Upgrading the gem for watir 1.5.1.1192 In-Reply-To: <28182982.4091181637610043.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28182982.4091181637610043.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <467033AE.1040805@pettichord.com> imran wrote: > But there is another query. > If you have a new question, please submit it under a (different) subject line that describes the problem. From bret at pettichord.com Wed Jun 13 14:36:14 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 13 Jun 2007 13:36:14 -0500 Subject: [Wtr-general] NoMethodError :Undefined method "Process_id" for 1808:Fixnum In-Reply-To: <27770958.10281181300329871.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <27770958.10281181300329871.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4670391E.3080901@pettichord.com> Simba wrote: > When i Run Below is code in IRB ,its throwinf error > require 'watir' > ie=Watir::IE.start("www.google.com") > > Error : > NoMethodError :Undefined method "Process_id" for 1808:Fixnum > > Please some body tell me why this error is coming? > > Before Going into IRB , I had installed Win32-process 0.4.0 & Watir-1.5.1.1158.gem > Could you please provide a stack trace? From forum-watir-users at openqa.org Wed Jun 13 14:36:29 2007 From: forum-watir-users at openqa.org (B Smith) Date: Wed, 13 Jun 2007 13:36:29 CDT Subject: [Wtr-general] Save results to file Message-ID: <39841913.6971181759819214.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Pls be patient. I just d/l'd Watir and am just starting... I used this .rb from the tutorial of Watir ---------snippet start------------------ require 'watir' # the watir controller # set a variable test_site = 'http://www.google.com' # open the IE browser ie = Watir::IE.new # print some comments puts "## Beginning of test: Google search" puts " " puts "Step 1: go to the test site: " + test_site ie.goto(test_site) puts " Action: entered " + test_site + " in the address bar." puts "Step 2: enter 'pickaxe' in the search text field" ie.text_field(:name, "q").set("Beer + Bottle + Label") # q is the name of the search field puts " Action: entered pickaxe in the search field" puts "Step 3: click the 'Google Search' button" ie.button(:name, "btnG").click # "btnG" is the name of the Search button puts " Action: clicked the Google Search button." puts "Expected Result: " puts " - a Google page with results should be shown. 'Programming Ruby' should be high on the list." puts "Actual Result: Check that the 'Programming Ruby' link appears on the results page " if ie.contains_text("Programming Ruby") puts "Test Passed. Found the test string: 'Programming Ruby'. Actual Results match Expected Results." else puts "Test Failed! Could not find: 'Programming Ruby'" end puts " " puts "## End of test: Google search" ----------end snippet-------------- It opens the window and performs the search. NOW...How do I save the text of the results to a file? I will eventually want to save the results to a MySQL tble, but I'm trying baby steps to learn the syntax. Thanks, B From bret at pettichord.com Wed Jun 13 14:44:30 2007 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 13 Jun 2007 13:44:30 -0500 Subject: [Wtr-general] Microsoft Tab Strip Issues - urgent In-Reply-To: <38224533.6441181747605648.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <38224533.6441181747605648.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <46703B0E.6080908@pettichord.com> This looks like an ActiveX control. I don't know how to handle ActiveX controls with Watir. Can you point us to a page that includes this control? Bret From areed at relocationcentral.com Wed Jun 13 14:47:16 2007 From: areed at relocationcentral.com (Adam Reed) Date: Wed, 13 Jun 2007 13:47:16 -0500 Subject: [Wtr-general] Save results to file In-Reply-To: <39841913.6971181759819214.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <39841913.6971181759819214.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36B5DBA88E027F47812ED877C6A978D801372E2C@rc-mail.relocationcentral.com> There are quite a few other steps that I'm skipping because they're pretty easy to google (checking if a log file exists already, appending the log name with the date to preven overwrites, etc), but here's a real simple intro: textlog = File.open("text.log", File::CREAT|File::APPEND|File::WRONLY) This creates a file named text.log in the root directory. The flags at the end tell it to create the file it if doesn't exist, append the file if it already exists, and allow write access. Now, when you want to write something to the log, you use: textlog.puts "Here's some stuff" I store my logging function in a separate library and call it at the beginning of each test, and then call a separate function that enters some formatting for the end of the log at the end of each test. I just use simple formatting like "## " at the beginning of every heading line to make the important information easier to read. Hope that helps, Adam -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of B Smith Sent: Wednesday, June 13, 2007 1:36 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Save results to file Pls be patient. I just d/l'd Watir and am just starting... I used this .rb from the tutorial of Watir ---------snippet start------------------ require 'watir' # the watir controller # set a variable test_site = 'http://www.google.com' # open the IE browser ie = Watir::IE.new # print some comments puts "## Beginning of test: Google search" puts " " puts "Step 1: go to the test site: " + test_site ie.goto(test_site) puts " Action: entered " + test_site + " in the address bar." puts "Step 2: enter 'pickaxe' in the search text field" ie.text_field(:name, "q").set("Beer + Bottle + Label") # q is the name of the search field puts " Action: entered pickaxe in the search field" puts "Step 3: click the 'Google Search' button" ie.button(:name, "btnG").click # "btnG" is the name of the Search button puts " Action: clicked the Google Search button." puts "Expected Result: " puts " - a Google page with results should be shown. 'Programming Ruby' should be high on the list." puts "Actual Result: Check that the 'Programming Ruby' link appears on the results page " if ie.contains_text("Programming Ruby") puts "Test Passed. Found the test string: 'Programming Ruby'. Actual Results match Expected Results." else puts "Test Failed! Could not find: 'Programming Ruby'" end puts " " puts "## End of test: Google search" ----------end snippet-------------- It opens the window and performs the search. NOW...How do I save the text of the results to a file? I will eventually want to save the results to a MySQL tble, but I'm trying baby steps to learn the syntax. Thanks, B _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From forum-watir-users at openqa.org Wed Jun 13 15:16:35 2007 From: forum-watir-users at openqa.org (B Smith) Date: Wed, 13 Jun 2007 14:16:35 CDT Subject: [Wtr-general] Save results to file In-Reply-To: <36B5DBA88E027F47812ED877C6A978D801372E2C@rc-mail.relocationcentral.com> Message-ID: <36372109.7181181762225640.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks, The File Create worked...But How do I d'l all the hyperink to the file? I.E. I thought of ie.put(:text,) But, this syntax is more of a 'push' and I'm trying to 'pull' the result data (i.e. scrape results and iterate thru the results into a file) so I know it is wrong before I even tried it -----from watir online tutorial------------- Text Attribute This is the Watir code you need to click a hyperlink using the text attribute: ie.link(:text, "Pickaxe").click What you see in the HTML source (attribute highlighted): ---------end snippet------------------- From areed at relocationcentral.com Wed Jun 13 15:23:34 2007 From: areed at relocationcentral.com (Adam Reed) Date: Wed, 13 Jun 2007 14:23:34 -0500 Subject: [Wtr-general] Save results to file In-Reply-To: <36372109.7181181762225640.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36B5DBA88E027F47812ED877C6A978D801372E2C@rc-mail.relocationcentral.com> <36372109.7181181762225640.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36B5DBA88E027F47812ED877C6A978D801372E2D@rc-mail.relocationcentral.com> I'm not sure what you're trying to say -- you lost me here. If you want to scrape a page for URLs and then write them to the log file: ie.links.each do |link| # for each link on the current page in IE... textlog.puts link.src # print url of the link in the textlog we created end #ie.links.each Otherwise, please include the purpose of your script and the html from the page you're testing. Thanks, Adam -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of B Smith Sent: Wednesday, June 13, 2007 2:17 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Save results to file Thanks, The File Create worked...But How do I d'l all the hyperink to the file? I.E. I thought of ie.put(:text,) But, this syntax is more of a 'push' and I'm trying to 'pull' the result data (i.e. scrape results and iterate thru the results into a file) so I know it is wrong before I even tried it -----from watir online tutorial------------- Text Attribute This is the Watir code you need to click a hyperlink using the text attribute: ie.link(:text, "Pickaxe").click What you see in the HTML source (attribute highlighted): ---------end snippet------------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From areed at relocationcentral.com Wed Jun 13 15:29:18 2007 From: areed at relocationcentral.com (Adam Reed) Date: Wed, 13 Jun 2007 14:29:18 -0500 Subject: [Wtr-general] Save results to file In-Reply-To: <36B5DBA88E027F47812ED877C6A978D801372E2D@rc-mail.relocationcentral.com> References: <36B5DBA88E027F47812ED877C6A978D801372E2C@rc-mail.relocationcentral.com><36372109.7181181762225640.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <36B5DBA88E027F47812ED877C6A978D801372E2D@rc-mail.relocationcentral.com> Message-ID: <36B5DBA88E027F47812ED877C6A978D801372E2E@rc-mail.relocationcentral.com> I don't know what's up with the formatting, the "end #ie.links.each" should be on the next line (or else it'll get tied into the previous comment). -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Adam Reed Sent: Wednesday, June 13, 2007 2:24 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Save results to file I'm not sure what you're trying to say -- you lost me here. If you want to scrape a page for URLs and then write them to the log file: ie.links.each do |link| # for each link on the current page in IE... textlog.puts link.src # print url of the link in the textlog we created end #ie.links.each Otherwise, please include the purpose of your script and the html from the page you're testing. Thanks, Adam -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of B Smith Sent: Wednesday, June 13, 2007 2:17 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Save results to file Thanks, The File Create worked...But How do I d'l all the hyperink to the file? I.E. I thought of ie.put(:text,) But, this syntax is more of a 'push' and I'm trying to 'pull' the result data (i.e. scrape results and iterate thru the results into a file) so I know it is wrong before I even tried it -----from watir online tutorial------------- Text Attribute This is the Watir code you need to click a hyperlink using the text attribute: ie.link(:text, "Pickaxe").click What you see in the HTML source (attribute highlighted): ---------end snippet------------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From jeff.fry at gmail.com Wed Jun 13 21:18:38 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Wed, 13 Jun 2007 18:18:38 -0700 Subject: [Wtr-general] OT: ruby/eclipse question Message-ID: <970956b0706131818j7ac4f5eeq4f100942d8be6269@mail.gmail.com> Hey, I know a few of y'all use Eclipse so I figured its worth a shot to ask this here. The shop I'm working for has a bunch of (non-GUI) automation written in Python, to which I'll be adding some GUI scripts written in Ruby/Watir. There is an existing svn repository like https://OurSVNrepository.com/svn/mwtest/trunk/misc I added a /mwtest/trunk/misc/watir folder to the project and tried to save my .rb file there, but eclipse is complaining: Save could not be completed. Reason: The project trunk is supposed to have a ruby nature. Googling: "The project trunk is supposed to have a" nature. gets me 0 results. Do I need to create a separate project for my ruby scripts? Can I somehow give this project a 'dual nature'? I should note that I have RDT 0.9.0 installed, and have a project for the watir project here that works just fine (I can save to https://svn.openqa.org/svn/watir/trunk/watir ) so my eclipse setup in general shouldn't be the issue. Thanks, Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070613/233d4b59/attachment.html From arcteryx at comcast.net Wed Jun 13 21:33:16 2007 From: arcteryx at comcast.net (Jason Darling) Date: Wed, 13 Jun 2007 20:33:16 -0500 Subject: [Wtr-general] OT: ruby/eclipse question In-Reply-To: <970956b0706131818j7ac4f5eeq4f100942d8be6269@mail.gmail.com> Message-ID: Hey Jeff, Make sure when you create your project, that it's a Ruby Project. You check out it out from svn and then create your project/workspace as a Ruby project. There is a little "ruby" icon that shows up for .rb files if this is done. Are you seeing this? Cheers, Jason -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Jeff Fry Sent: Wednesday, June 13, 2007 8:19 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] OT: ruby/eclipse question Hey, I know a few of y'all use Eclipse so I figured its worth a shot to ask this here. The shop I'm working for has a bunch of (non-GUI) automation written in Python, to which I'll be adding some GUI scripts written in Ruby/Watir. There is an existing svn repository like https://OurSVNrepository.com/svn/mwtest/trunk/misc I added a /mwtest/trunk/misc/watir folder to the project and tried to save my .rb file there, but eclipse is complaining: Save could not be completed. Reason: The project trunk is supposed to have a ruby nature. Googling: "The project trunk is supposed to have a" nature. gets me 0 results. Do I need to create a separate project for my ruby scripts? Can I somehow give this project a 'dual nature'? I should note that I have RDT 0.9.0 installed, and have a project for the watir project here that works just fine (I can save to https://svn.openqa.org/svn/watir/trunk/watir ) so my eclipse setup in general shouldn't be the issue. Thanks, Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070613/94b3d6b9/attachment-0001.html From charley.baker at gmail.com Wed Jun 13 21:56:38 2007 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 13 Jun 2007 19:56:38 -0600 Subject: [Wtr-general] OT: ruby/eclipse question In-Reply-To: References: <970956b0706131818j7ac4f5eeq4f100942d8be6269@mail.gmail.com> Message-ID: Hey Jeff, You can create a .project file at the root of your project directory and put this in it - replace project_name with your project name. project_name org.rubypeople.rdt.core.rubybuilder org.rubypeople.rdt.core.rubynature -Charley On 6/13/07, Jason Darling wrote: > > Hey Jeff, > > Make sure when you create your project, that it's a Ruby Project. You > check out it out from svn and then create your project/workspace as a Ruby > project. There is a little "ruby" icon that shows up for .rb files if > this is done. Are you seeing this? > > Cheers, > Jason > > -----Original Message----- > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org]*On Behalf Of *Jeff Fry > *Sent:* Wednesday, June 13, 2007 8:19 PM > *To:* wtr-general at rubyforge.org > *Subject:* [Wtr-general] OT: ruby/eclipse question > > Hey, I know a few of y'all use Eclipse so I figured its worth a shot to > ask this here. > > The shop I'm working for has a bunch of (non-GUI) automation written in > Python, to which I'll be adding some GUI scripts written in Ruby/Watir. > > There is an existing svn repository like https://OurSVNrepository.com/svn/mwtest/trunk/misc > > > I added a /mwtest/trunk/misc/watir folder to the project and tried to save > my .rb file there, but eclipse is complaining: > Save could not be completed. > Reason: The project trunk is supposed to have a ruby nature. > > Googling: "The project trunk is supposed to have a" nature. gets me 0 > results. Do I need to create a separate project for my ruby scripts? Can I > somehow give this project a 'dual nature'? > > I should note that I have RDT 0.9.0 installed, and have a project for the > watir project here that works just fine (I can save to https://svn.openqa.org/svn/watir/trunk/watir > ) so my eclipse setup in general shouldn't be the issue. > > Thanks, > Jeff > > -- > http://testingjeff.wordpress.com > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070613/828756b0/attachment.html From jeff.fry at gmail.com Wed Jun 13 22:05:24 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Wed, 13 Jun 2007 19:05:24 -0700 Subject: [Wtr-general] OT: ruby/eclipse question In-Reply-To: References: Message-ID: <4670A264.7040507@gmail.com> Thanks Jason, Normally I do that, but I didn't with this one because when I created it it was a Python project. That said - I found the solution. I went exploring again and found the amusingly straightforward Project > Add Ruby Nature...which did the trick. It leaves me wondering what a project nature in eclipse is, and what it means for a project to have more than one nature. Definitely one of the most metaphysical roadblocks I've stumbled across in recent months. Jeff "Off looking for 'Add Buddha Nature '" Fry Jason Darling wrote: > Hey Jeff, > > Make sure when you create your project, that it's a Ruby Project. You > check out it out from svn and then create your project/workspace as a > Ruby project. There is a little "ruby" icon that shows up for .rb > files if this is done. Are you seeing this? > > Cheers, > Jason > > -----Original Message----- > *From:* wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org]*On Behalf Of *Jeff Fry > *Sent:* Wednesday, June 13, 2007 8:19 PM > *To:* wtr-general at rubyforge.org > *Subject:* [Wtr-general] OT: ruby/eclipse question > > Hey, I know a few of y'all use Eclipse so I figured its worth a > shot to ask this here. > > The shop I'm working for has a bunch of (non-GUI) automation > written in Python, to which I'll be adding some GUI scripts > written in Ruby/Watir. > > There is an existing svn repository like > https://OurSVNrepository.com/svn/mwtest/trunk/misc > > > I added a /mwtest/trunk/misc/watir folder to the project and tried > to save my .rb file there, but eclipse is complaining: > Save could not be completed. > Reason: The project trunk is supposed to have a ruby nature. > > Googling: "The project trunk is supposed to have a" nature. gets > me 0 results. Do I need to create a separate project for my ruby > scripts? Can I somehow give this project a 'dual nature'? > > I should note that I have RDT 0.9.0 installed, and have a project > for the watir project here that works just fine (I can save to > https://svn.openqa.org/svn/watir/trunk/watir > ) so my eclipse > setup in general shouldn't be the issue. > > Thanks, > Jeff > > -- > http://testingjeff.wordpress.com > > ------------------------------------------------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070613/6a641127/attachment.html From forum-watir-users at openqa.org Thu Jun 14 00:29:03 2007 From: forum-watir-users at openqa.org (sapna) Date: Wed, 13 Jun 2007 23:29:03 CDT Subject: [Wtr-general] Want to display data in the same row using Puts In-Reply-To: Message-ID: <30960400.8271181795373730.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks a lot Zeljko. Is there any book to refer regarding WATIR for beginner. From angrez at gmail.com Thu Jun 14 00:50:21 2007 From: angrez at gmail.com (Angrez Singh) Date: Thu, 14 Jun 2007 10:20:21 +0530 Subject: [Wtr-general] Want to display data in the same row using Puts In-Reply-To: <30960400.8271181795373730.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30960400.8271181795373730.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi, The question you asked was related to Ruby and not to Watir. I think you should start reading the book "Programming Ruby". It will be there in your installation directory i.e. where you have installed ruby. - Angrez On 6/14/07, sapna wrote: > > Thanks a lot Zeljko. Is there any book to refer regarding WATIR for > beginner. > _______________________________________________ > 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/20070614/e24da194/attachment.html From forum-watir-users at openqa.org Thu Jun 14 04:27:55 2007 From: forum-watir-users at openqa.org (imran) Date: Thu, 14 Jun 2007 03:27:55 CDT Subject: [Wtr-general] Microsoft Tab Strip Issues - urgent In-Reply-To: <46703B0E.6080908@pettichord.com> Message-ID: <36648699.9211181809705192.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, Bret Thanks. Its a health application deployed at my machine locally. So no one can access it from abroad. Actually its a Microsoft Tab Strip, the better way to explain it i found a link. Please follow it. http://msdn2.microsoft.com/en-us/library/ms529257.aspx Thanks waiting for the response. Kind Regards, M.Imran From zeljko.filipin at gmail.com Thu Jun 14 05:33:11 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 14 Jun 2007 11:33:11 +0200 Subject: [Wtr-general] Best Combination of Ruby and Watir In-Reply-To: <467032D8.7000402@pettichord.com> References: <30534709.9331181298147654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <4669A305.4080609@pettichord.com> <970956b0706081228g25486f3y7f670474a6321f7f@mail.gmail.com> <970956b0706081353l356b4530kebc93fbea9639941@mail.gmail.com> <4669C6F2.70807@pettichord.com> <467032D8.7000402@pettichord.com> Message-ID: On 6/13/07, Bret Pettichord wrote: > > What happens if you don't use the "--include-dependencies" option? It politely asks if I want to install dependencies. :) Works fine that way. Thanks Bret. Zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070614/ade31f1b/attachment.html From forum-watir-users at openqa.org Thu Jun 14 05:58:33 2007 From: forum-watir-users at openqa.org (Simba) Date: Thu, 14 Jun 2007 04:58:33 CDT Subject: [Wtr-general] OnMouseOver EVENT error Message-ID: <23240489.51181815144176.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Below is the Csstest.rb # feature tests for css # revision: $Revision: 962 $ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ require 'unittests/setup' class TC_CSS < Test::Unit::TestCase include Watir def divTester( message ) divs = $ie.getIE.document.getElementsByTagName("DIV") puts "Found #{divs.length} div tags" divs.each do |d| puts "Checking div #{d.id}" puts "div #{d.invoke("id") } class is #{d.invoke("className") }" end end def isMessageDisplayed(message) s = false divs = $ie.getIE.document.getElementsByTagName("DIV") #puts "Found #{divs.length} div tags" divs.each do |d| #puts "----Checking div #{d.id} innertext is ( #{d.innerText} )" if d.innerText.to_s.downcase.match( /#{message}/i ) #puts "div #{d.invoke("id") } class is #{d.invoke("className") }" if d.invoke("className").to_s.downcase.match(/show/i) #puts "message is shown!!!" s = true end end end #puts "Not Shown " if s== false return s end def gotoCSSPage $ie.goto($htmlRoot + "cssTest.html") end def test_SuccessMessage gotoCSSPage sleep(5) $ie.button( :caption , "Success").click #isMessageDisplayed( "Success" ) #divTester( "Success" ) assert( isMessageDisplayed("Success") ) $ie.button( :caption , "Failure").fire_event("onmouseover") assert(!isMessageDisplayed("Success") ) end end ================================================================================= Below is the Code for Csstest.html Test Hidden Message
Success!
Failure!

Click on a button to display a message.

========================================================================= When i Run Csstest.rb file , Last assertion is failing (Ie assert(!isMessageDisplayed("Success") )) Any reason why this failing? From forum-watir-users at openqa.org Thu Jun 14 08:48:24 2007 From: forum-watir-users at openqa.org (B Smith) Date: Thu, 14 Jun 2007 07:48:24 CDT Subject: [Wtr-general] Save results to file In-Reply-To: <36B5DBA88E027F47812ED877C6A978D801372E2E@rc-mail.relocationcentral.com> Message-ID: <23366909.551181825334774.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am very close, this finds the links but errors on a variable and the .txt file is empty #-------------------------------------------------------------------------------------------------------------# # # I'm a Pretty Flower Box # # # #------------------------------------------------------------------------------------------------------------# require 'watir' # the watir controller # set a variable test_site = 'http://www.google.com' # set the log file textlog = File.open("text.log", File::CREAT|File::APPEND|File::WRONLY) # open the IE browser ie = Watir::IE.new # print some comments puts "## Beginning of test: Google search" puts " " ie.goto(test_site) puts " Action: entered " + test_site + " in the address bar." ie.text_field(:name, "q").set("Beer + Bottle + Label") # q is the name of the search field puts "Step 3: click the 'Google Search' button" ie.button(:name, "btnG").click # "btnG" is the name of the Search button puts " Action: clicked the Google Search button." puts "Expected Result: " puts " - a Google page with results should be shown." puts "Iterate thru links on page a pull them into txt file " puts "Test Passed. Found the test string: 'Beer Bottle Label'." ie.links.each do |link| # for each link on the current page in IE... textlog.puts link.src # print url of the link in the textlog we created end # createdtextlog.puts "Here's some stuff" puts "## End of test: Google search" if ie.contains_text("Beer + Bottle + Label") else puts "Test Failed!" end From tester.paul at gmail.com Thu Jun 14 09:45:17 2007 From: tester.paul at gmail.com (Paul Carvalho) Date: Thu, 14 Jun 2007 09:45:17 -0400 Subject: [Wtr-general] Save results to file In-Reply-To: <23366909.551181825334774.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36B5DBA88E027F47812ED877C6A978D801372E2E@rc-mail.relocationcentral.com> <23366909.551181825334774.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <37c405480706140645x5500df3du2b44eec40a622e94@mail.gmail.com> Hey B! Just a few things. First off, there is a more efficient way of opening a file for writing. Try the following instead: textlog = File.open("text.log", "w") Secondly, when I run your script, the text.log file is *not* empty. There are in fact 70 blank lines in the output file. That tells me something. It tells me that you are correctly opening and writing to the file, but you just aren't capturing the right information somewhere. I replaced your link iteration with the following and I got the log file to list all the URL's: ie.links.each do |link| textlog.puts link.href end Is that what you wanted to do? If not, please post some more details with what you are looking for and we'll try to help. Cheers! Paul C. On 14/06/07, B Smith wrote: > > I am very close, this finds the links but errors on a variable and the > .txt file is empty > > > > > #-------------------------------------------------------------------------------------------------------------# > # > # I'm a Pretty Flower Box > # > # > # > > #------------------------------------------------------------------------------------------------------------# > > require 'watir' # the watir controller > > # set a variable > test_site = 'http://www.google.com' > # set the log file > textlog = File.open("text.log", File::CREAT|File::APPEND|File::WRONLY) > > # open the IE browser > ie = Watir::IE.new > # print some comments > puts "## Beginning of test: Google search" > puts " " > ie.goto(test_site) > puts " Action: entered " + test_site + " in the address bar." > ie.text_field(:name, "q").set("Beer + Bottle + Label") # q is > the name of the search field > puts "Step 3: click the 'Google Search' button" > ie.button(:name, "btnG").click # "btnG" is the name of the Search > button > puts " Action: clicked the Google Search button." > > puts "Expected Result: " > puts " - a Google page with results should be shown." > puts "Iterate thru links on page a pull them into txt file " > puts "Test Passed. Found the test string: 'Beer Bottle Label'." > ie.links.each do |link| # for each link on the current page in IE... > textlog.puts link.src # print url of the link in the textlog we > created end > # createdtextlog.puts "Here's some stuff" > > puts "## End of test: Google search" > if ie.contains_text("Beer + Bottle + Label") > else > puts "Test Failed!" > end > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070614/9b703dc6/attachment.html From forum-watir-users at openqa.org Thu Jun 14 10:16:52 2007 From: forum-watir-users at openqa.org (B Smith) Date: Thu, 14 Jun 2007 09:16:52 CDT Subject: [Wtr-general] Save results to file In-Reply-To: <37c405480706140645x5500df3du2b44eec40a622e94@mail.gmail.com> Message-ID: <29780406.1951181830642841.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks, That worked. From bret at pettichord.com Thu Jun 14 18:28:53 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 14 Jun 2007 17:28:53 -0500 Subject: [Wtr-general] Microsoft Tab Strip Issues - urgent In-Reply-To: <36648699.9211181809705192.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36648699.9211181809705192.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4671C125.4010706@pettichord.com> imran wrote: > Actually its a Microsoft Tab Strip, the better way to explain it i found a link. > Please follow it. > > http://msdn2.microsoft.com/en-us/library/ms529257.aspx > > Thanks waiting for the response. > OK. That is not ActiveX (i guessed wrong). It is a server-side code. When it hits the browser, it will be transformed into traditional HTML elements. You can see them using View Source. That is what Watir works with. Bret From bret at pettichord.com Thu Jun 14 18:43:45 2007 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 14 Jun 2007 17:43:45 -0500 Subject: [Wtr-general] Best Combination of Ruby and Watir In-Reply-To: References: <30534709.9331181298147654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <4669A305.4080609@pettichord.com> <970956b0706081228g25486f3y7f670474a6321f7f@mail.gmail.com> <970956b0706081353l356b4530kebc93fbea9639941@mail.gmail.com> <4669C6F2.70807@pettichord.com> <467032D8.7000402@pettichord.com> Message-ID: <4671C4A1.3070900@pettichord.com> ?eljko Filipin wrote: > On 6/13/07, *Bret Pettichord* > wrote: > > What happens if you don't use the "--include-dependencies" option? > > > It politely asks if I want to install dependencies. :) > Works fine that way. Thanks Bret. Since we are still supporting 1.8.2 (esp. for modal dialog support), we should document this somewhere. From jeff.fry at gmail.com Thu Jun 14 19:24:45 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Thu, 14 Jun 2007 16:24:45 -0700 Subject: [Wtr-general] Best Combination of Ruby and Watir In-Reply-To: <4671C4A1.3070900@pettichord.com> References: <30534709.9331181298147654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <4669A305.4080609@pettichord.com> <970956b0706081228g25486f3y7f670474a6321f7f@mail.gmail.com> <970956b0706081353l356b4530kebc93fbea9639941@mail.gmail.com> <4669C6F2.70807@pettichord.com> <467032D8.7000402@pettichord.com> <4671C4A1.3070900@pettichord.com> Message-ID: <970956b0706141624h56bb05c5xec84478fa5e31c3a@mail.gmail.com> On 6/14/07, Bret Pettichord wrote: > > ?eljko Filipin wrote: > > On 6/13/07, *Bret Pettichord* > > wrote: > > > > What happens if you don't use the "--include-dependencies" option? > > > > > > It politely asks if I want to install dependencies. :) > > Works fine that way. Thanks Bret. > Since we are still supporting 1.8.2 (esp. for modal dialog support), we > should document this somewhere. OK, readme.rb seems to be a reasonable option, unless this needs more space than we need there. Even then, perhaps the readme would point to a page on the wiki. Here's the current (relevant) text: To Install Ruby: http://ruby-lang.org Best is to use Ruby 1.8.2-14 or later. However, if you are using the Watir::IE#modal_dialog method, you must use Ruby 1.8.2-14 and not a more recent version. Watir (in general) will not work with Ruby 1.8.1-13. (This version of Ruby has a bad WIN32OLE library.) To Install Watir: Best way to install is to use the gem. From your command line: > gem install win32-process --include-dependencies > gem install watir This will download and install watir, win32-process and all dependencies. A few questions coming out of this conversation. 1. When we say "if you are using the Watir::IE#modal_dialog method, you must use Ruby 1.8.2-14 and not a more recent version." Do we really mean 1.8.2-14? It sounds like 1.8.2-15 worked correctly with --include-dependencies. Can we safely just change references from 1.8.2-14 to 1.8.2-15? 2. If not, should we change the above to: To Install Watir: Best way to install is to use the gem. From your command line: > gem install win32-process You will be prompted to install dependencies. Say yes. > gem install watir This will download and install watir, win32-process and all dependencies. One more question: Do these instructions change in any way if you have a previous version installed? If so, what should I know to add? Thoughts? Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070614/a3f44e47/attachment.html From forum-watir-users at openqa.org Fri Jun 15 04:41:30 2007 From: forum-watir-users at openqa.org (imran) Date: Fri, 15 Jun 2007 03:41:30 CDT Subject: [Wtr-general] Microsoft Tab Strip Issues - urgent In-Reply-To: <4671C125.4010706@pettichord.com> Message-ID: <36275577.8831181896920914.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, Bret Thanks. Now, there is another approach to handle this situation, following is the link to hit the required tab. action="CCAdmissionDefAdmissionInfo.aspx?&Mode=1&UniqueID=69504512&Key2DSInSession=ASP.CCAdmissionDefGeneral_aspx69504512&CallerPage=CCAdmissionDefGeneral.aspx&MainTableID=421651&MainTableMode=1&NavigatingToDetailPage=1&NavigateToDetailPage=CCAdmissionDefAdmissionInfo.aspx&LookupName=CCAdmission&ID=421651&ReturningFromDetail=1" I can go to that page using this dynamic URL, but in this case one of the field is dynamically generated and contains the session id so when i use this hardcoded url i can not get that session field. Could you tell me how to get that session id from the server so that i could use ie.goto(site) line to follow the link. sesion key is Key2DSInSession=ASP.CCAdmissionDefGeneral_aspx69504512 Here dynamic portion is 69504512, this number represent the session thats why i can not move to that page. When i try to use that number in new browser it does not work and say no such session key exist. Can you help me how to get that dynamic number from the server. Waiting for you response. Kind Regards, M.Imran From forum-watir-users at openqa.org Fri Jun 15 06:22:26 2007 From: forum-watir-users at openqa.org (Bface) Date: Fri, 15 Jun 2007 05:22:26 CDT Subject: [Wtr-general] WET or WATIR, support for DIV tag Message-ID: <32843964.10181181902976614.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am new to WET / WATIR Trying to script this site that uses DIV dynamically generated. I am using WET/Ruby. Using the Ruby text editor to see how the test runs. However, I get an error when I script click on DIV See: ie.Frame('name:=nav').document.all['297'].click ie.Frame('name:=content2').div('id:Opener_cont_live').click I get this error bug1499.rb:19: undefined method `div' for # (NoMethodError) How do I get round this because the CMS I am testing does not support selenium and I need to parameterise the test Should I use WATIR ? If yes, how do I get started with WATIR asap. I am confused Please urgent help From forum-watir-users at openqa.org Fri Jun 15 07:23:47 2007 From: forum-watir-users at openqa.org (Bface) Date: Fri, 15 Jun 2007 06:23:47 CDT Subject: [Wtr-general] WET or WATIR, support for DIV tag In-Reply-To: <32843964.10181181902976614.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <31527414.10651181906657495.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello, No one is contributing? >From what I can see, DIV is not supported by WET, but supported using WATIR. However, I prefer using WET. How can I include WATIR so that all supported tags in WATIR will work in my Ruby test code that is based on WET Then I will be able to use DIV Thanks Expert From zeljko.filipin at gmail.com Fri Jun 15 07:29:14 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 15 Jun 2007 13:29:14 +0200 Subject: [Wtr-general] WET or WATIR, support for DIV tag In-Reply-To: <31527414.10651181906657495.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32843964.10181181902976614.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <31527414.10651181906657495.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 6/15/07, Bface wrote: > > No one is contributing? I guess they are sleeping now. Maybe you should post this question at wet forum? Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070615/efdcee3a/attachment.html From mrussell at inpses.co.uk Fri Jun 15 12:46:40 2007 From: mrussell at inpses.co.uk (Max Russell) Date: Fri, 15 Jun 2007 17:46:40 +0100 Subject: [Wtr-general] Load error Message-ID: Hi there, I'm getting the following. `require': no such file to load -- watir (LoadError) I've checked the FAQs and downloaded the latest 1.5 version for my Ruby version 1.8.6. I've listed my local gems and I can see that water is installed, yet whenever I try and run my script, I still get the error? Max Russell Test Analyst INPS -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070615/89558cc5/attachment.html From arcteryx at comcast.net Fri Jun 15 13:38:05 2007 From: arcteryx at comcast.net (Jason Darling) Date: Fri, 15 Jun 2007 12:38:05 -0500 Subject: [Wtr-general] Load error In-Reply-To: References: Message-ID: <7860894a0706151038u2bdbe5ceo6e2c847137ffdbe1@mail.gmail.com> can you post your test script? it would help to diagnose your problem. Cheers, Jason On 6/15/07, Max Russell wrote: > > Hi there, I'm getting the following. > > > > `require': no such file to load -- watir (LoadError) > > > > I've checked the FAQs and downloaded the latest 1.5 version for my Ruby > version 1.8.6. > > I've listed my local gems and I can see that water is installed, yet > whenever I try and run my script, I still get the error? > > > > > > *Max Russell* > Test Analyst > INPS** > > _______________________________________________ > 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/20070615/7572b157/attachment.html From bret at pettichord.com Fri Jun 15 13:42:57 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 15 Jun 2007 12:42:57 -0500 Subject: [Wtr-general] Best Combination of Ruby and Watir In-Reply-To: <970956b0706141624h56bb05c5xec84478fa5e31c3a@mail.gmail.com> References: <30534709.9331181298147654.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <4669A305.4080609@pettichord.com> <970956b0706081228g25486f3y7f670474a6321f7f@mail.gmail.com> <970956b0706081353l356b4530kebc93fbea9639941@mail.gmail.com> <4669C6F2.70807@pettichord.com> <467032D8.7000402@pettichord.com> <4671C4A1.3070900@pettichord.com> <970956b0706141624h56bb05c5xec84478fa5e31c3a@mail.gmail.com> Message-ID: <4672CFA1.6020906@pettichord.com> Jeff Fry wrote: > > 1. When we say "if you are using the Watir::IE#modal_dialog method, > you must use Ruby 1.8.2-14 and not a more recent version." Do we > really mean 1.8.2-14? It sounds like 1.8.2-15 worked correctly > with --include-dependencies. Can we safely just change > references from 1.8.2-14 to 1.8.2-15? > 2. If not, should we change the above to: > Yeah, i'm wondering if we should just tell people not to use 1.8.2-14. > To Install Watir: > Best way to install is to use the gem. > From your command line: > > gem install win32-process > You will be prompted to install dependencies. Say yes. > > gem install watir > This will download and install watir, win32-process and all > dependencies. > > One more question: Do these instructions change in any way if you have > a previous version installed? If so, what should I know to add? Yes. See here for details: http://wiki.openqa.org/display/WTR/Development+Builds From christopher.mcmahon at gmail.com Fri Jun 15 14:04:17 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 15 Jun 2007 12:04:17 -0600 Subject: [Wtr-general] OT-ish: How many reqistered OpenQA Watir users? Message-ID: <72799cd70706151104h4d6ce9cve6b71bcb8eb66f08@mail.gmail.com> I'm interested in how many registered users the project has. Other information like page traffic, downloads, would be fun to know also. From bret at pettichord.com Fri Jun 15 14:16:39 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 15 Jun 2007 13:16:39 -0500 Subject: [Wtr-general] OT-ish: How many reqistered OpenQA Watir users? In-Reply-To: <72799cd70706151104h4d6ce9cve6b71bcb8eb66f08@mail.gmail.com> References: <72799cd70706151104h4d6ce9cve6b71bcb8eb66f08@mail.gmail.com> Message-ID: <4672D787.4030200@pettichord.com> Chris McMahon wrote: > I'm interested in how many registered users the project has. > Other information like page traffic, downloads, would be fun to know also. > I don't believe users register for specific projects. You can ask Patrick for the other information. Bret From bret at pettichord.com Fri Jun 15 14:18:40 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 15 Jun 2007 13:18:40 -0500 Subject: [Wtr-general] Microsoft Tab Strip Issues - urgent In-Reply-To: <36275577.8831181896920914.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36275577.8831181896920914.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4672D800.1080509@pettichord.com> Can you find the session key in the page itself? From bret at pettichord.com Fri Jun 15 14:19:37 2007 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 15 Jun 2007 13:19:37 -0500 Subject: [Wtr-general] frames and url() In-Reply-To: References: Message-ID: <4672D839.90802@pettichord.com> Chong Jiang wrote: > Is there some way to return the url of a frame, for example, > ie.frame(:index, 1), so I can navigate to the page with a goto? ie.frame(:index, 1).url From jeff.fry at gmail.com Fri Jun 15 14:30:15 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Fri, 15 Jun 2007 11:30:15 -0700 Subject: [Wtr-general] Microsoft Tab Strip Issues - urgent In-Reply-To: <4672D800.1080509@pettichord.com> References: <36275577.8831181896920914.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <4672D800.1080509@pettichord.com> Message-ID: <970956b0706151130mef7ff03r44e8b8e77e463201@mail.gmail.com> Another approach might be to work around not knowing the session key with regular expressions, perhaps something like: $ie.form(:action, /CCAdmissionDefAdmissionInfo.aspx/) Note that ie.form and :action above are blind guesses, since I haven't worked tabs like this, but hopefully illustrate how you would use a regular expression to identify an element by a substring. Regexes can be used in many many more complex ways. See for example http://www.regular-expressions.info/ Jeff On 6/15/07, Bret Pettichord wrote: > > Can you find the session key in the page itself? > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070615/8bc20df5/attachment-0001.html From jeff.fry at gmail.com Fri Jun 15 15:20:33 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Fri, 15 Jun 2007 12:20:33 -0700 Subject: [Wtr-general] Understanding down_load_time on AJAXy pages Message-ID: <970956b0706151220w1d66ba3an5ebbbc3a4dd45e86@mail.gmail.com> Hi, The app I'm testing has very dynamic pages, constructed by a series of queries, leading to certain elements loading faster than others. I'd like to benchmark how long it takes for various pages to load. Toward that end I wrote: 100.times do url = $url_root + "/view?id=%239202a8c04000641f8000000000056de6" start = Time.now $ie.goto(url) if $ie.link(:text,'Million Dollar Baby').exists? $results_array << $ie.down_load_time.to_s p '$ie.down_load_time: '+$ie.down_load_time.to_s else # there's a problem with the page $results_array << 'e' p 'e' end #if took = Time.now - start p 'Took: ' + took.to_s end #N.times do Which yields results like: >ruby performance_benchmark2.rb Loaded suite performance_benchmark2 Started "$ie.down_load_time: 1.993" "Took: 2.434" "$ie.down_load_time: 2.473" "Took: 2.583" "$ie.down_load_time: 2.404" "Took: 2.564" I'm curious why I get up to .5 seconds more for 'took' than I do for down_load_time. Does down_load_time have a way of knowing when everything on the page has finished loading on a page where various elements render in phases? I can include more of my script if that's helpful. Our site freebase.com is in an invite-only alpha right now, but if anyone wants to dig further into this I would happily forward along on invite. Thanks, Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070615/fc41c55f/attachment.html From forum-watir-users at openqa.org Fri Jun 15 19:11:16 2007 From: forum-watir-users at openqa.org (Bach Le) Date: Fri, 15 Jun 2007 18:11:16 CDT Subject: [Wtr-general] Our contribution to Watir Message-ID: <32105796.15641181949107087.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello all, We've been working with Watir for a while now and sort of using watir was a browser driver for our monitoring product. Internally, there were monitoring directives/functions that we found useful in our proprietary monitoring language. I've reproduced these functions to be used with watir as we move to a more open platform. The details can be found at [http://jira.openqa.org/browse/WTR-162|http://jira.openqa.org/browse/WTR-162] Please take a look and contribute any comments or code where you can. Any help would be appreciated. Our view is that Watir is a useful tool in automated testing and we are trying to use that to develop a package that could be paired with Watir for performance testing. This contribution is only the beginning. We have more useful things that will be coming down the pipe and we look forward to contributing more in the future. Bach Le Software Engineer Webmetrics Inc. bmle at webmetrics.com From jeff.fry at gmail.com Fri Jun 15 20:43:45 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Fri, 15 Jun 2007 17:43:45 -0700 Subject: [Wtr-general] Breaking code into several classes and methods Message-ID: <970956b0706151743h41fab083o930968aee2c0c56f@mail.gmail.com> Hi all, I'm using my trusty pickaxe plus various code samples to try to take a script of mine and break it up a bit into several classes and methods within classes...and getting stuck. When I run the code below, I get: test_benchmark_page(TC_PerformanceBenchmark): NoMethodError: undefined method `link_to_text' for # performance_benchmark2.rb:56:in `benchmark' performance_benchmark2.rb:54:in `times' performance_benchmark2.rb:54:in `benchmark' performance_benchmark2.rb:69:in `test_benchmark_page' It complains about this line in particular: if $ie.link(:text, page.link_to_text).exists? But when I try it in irb it seems that page.link_to_text shouldn't be a problem: irb(main):040:0> $page = Page.new("c_eastwood", "/view?id=%239202a8c04000641f800000000056de6", "Mystic River") => # irb(main):041:0> $page.link_to_test => "Mystic River" Here's my relevant code: class TC_PerformanceBenchmark < Test::Unit::TestCase ... def benchmark(page) 1.times do $ie.goto($url_root + page.url) if $ie.link(:text, page.link_to_text).exists? $results_array << $ie.down_load_time.to_s p '$ie.down_load_time: '+$ie.down_load_time.to_s else $results_array << 'e' p 'e' end #if end #do end def test_benchmark_page login($url_root, $user, $pw) $page = Page.new("c_eastwood", "/view?id=%239202a8c04000641f8000000000056de6", "Mystic River") benchmark($page) end end #class class Page def initialize (key, url, link_to_test) @key = key @url = url @link_to_test = link_to_test end attr_reader :key attr_reader :url attr_reader :link_to_test end Any ideas? Thanks, Jeff -- http://testingjeff.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070615/e921ea6e/attachment.html From aidy.lewis at googlemail.com Sat Jun 16 03:53:12 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Sat, 16 Jun 2007 08:53:12 +0100 Subject: [Wtr-general] Our contribution to Watir In-Reply-To: <32105796.15641181949107087.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32105796.15641181949107087.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <7ac2300c0706160053q58671b5erce58acb21b8a131c@mail.gmail.com> On 16/06/07, Bach Le wrote: > The details can be found at [http://jira.openqa.org/browse/WTR-162|http://jira.openqa.org/browse/WTR-162] There is no project on this URL. Cheers Aidy From jeff.fry at gmail.com Sun Jun 17 11:39:26 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Sun, 17 Jun 2007 08:39:26 -0700 Subject: [Wtr-general] Our contribution to Watir In-Reply-To: <7ac2300c0706160053q58671b5erce58acb21b8a131c@mail.gmail.com> References: <32105796.15641181949107087.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <7ac2300c0706160053q58671b5erce58acb21b8a131c@mail.gmail.com> Message-ID: <467555AE.6050404@gmail.com> aidy lewis wrote: > On 16/06/07, Bach Le wrote: > >> The details can be found at [http://jira.openqa.org/browse/WTR-162|http://jira.openqa.org/browse/WTR-162] >> > > There is no project on this URL. > > The url got doubled. If you take either side of the bar it works - and looks interesting! http://jira.openqa.org/browse/WTR-162 Thanks Bach &etc. for passing this on! Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070617/de8acd69/attachment.html From charley.baker at gmail.com Sat Jun 16 18:35:43 2007 From: charley.baker at gmail.com (Charley Baker) Date: Sat, 16 Jun 2007 16:35:43 -0600 Subject: [Wtr-general] Our contribution to Watir In-Reply-To: <467555AE.6050404@gmail.com> References: <32105796.15641181949107087.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <7ac2300c0706160053q58671b5erce58acb21b8a131c@mail.gmail.com> <467555AE.6050404@gmail.com> Message-ID: It's great to have user contributions, I haven't had a chance to look at it yet, but will soon. Instead of adding it to a jira ticket, you should add it to the user contribution area of the wiki on openqa. http://wiki.openqa.org/display/WTR/Contributions -Charley On 6/17/07, Jeff Fry wrote: > > aidy lewis wrote: > > On 16/06/07, Bach Le wrote: > > The details can be found at [http://jira.openqa.org/browse/WTR-162|http://jira.openqa.org/browse/WTR-162] > > There is no project on this URL. > > The url got doubled. If you take either side of the bar it works - and > looks interesting! > > http://jira.openqa.org/browse/WTR-162 > > Thanks Bach &etc. for passing this on! > > Jeff > > _______________________________________________ > 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/20070616/3326b34e/attachment.html From bret at pettichord.com Sat Jun 16 18:42:16 2007 From: bret at pettichord.com (Bret Pettichord) Date: Sat, 16 Jun 2007 17:42:16 -0500 Subject: [Wtr-general] Our contribution to Watir In-Reply-To: <32105796.15641181949107087.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32105796.15641181949107087.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <46746748.2070103@pettichord.com> Bach Le wrote: > The details can be found at [http://jira.openqa.org/browse/WTR-162|http://jira.openqa.org/browse/WTR-162] > > Please take a look and contribute any comments or code where you can. Any help would be appreciated. > Thanks for the contribution. We will be looking at it. Bret From bret at pettichord.com Sat Jun 16 18:45:45 2007 From: bret at pettichord.com (Bret Pettichord) Date: Sat, 16 Jun 2007 17:45:45 -0500 Subject: [Wtr-general] Our contribution to Watir In-Reply-To: References: <32105796.15641181949107087.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <7ac2300c0706160053q58671b5erce58acb21b8a131c@mail.gmail.com> <467555AE.6050404@gmail.com> Message-ID: <46746819.3070309@pettichord.com> Charley Baker wrote: > It's great to have user contributions, I haven't had a chance to look > at it yet, but will soon. Instead of adding it to a jira ticket, you > should add it to the user contribution area of the wiki on openqa. > http://wiki.openqa.org/display/WTR/Contributions I've been talking the people at Webmetrics off-list. They would like their enhancements to be bundled in the watir gem. I explained that we would need unit tests and need to review the enhancements for consistency with the Watir design principles. Submissions via Jira are appropriate for this kind of thing. For changes, we prefer a patch file, but since this submission amounts to a monkey patch, it's current form is acceptable. Just for the record, we don't have these constraints (tests, consistency) for code that submitted to the contributions page of the wiki. Bret From aidy.lewis at googlemail.com Sun Jun 17 04:44:28 2007 From: aidy.lewis at googlemail.com (aidy lewis) Date: Sun, 17 Jun 2007 09:44:28 +0100 Subject: [Wtr-general] Porting Watir to JRuby In-Reply-To: References: Message-ID: <7ac2300c0706170144m480f3668r6b61673b256ae5ec@mail.gmail.com> Hi, On 13/06/07, Nick Sieger wrote: > On 6/13/07, Nivetha Padmanaban wrote: > > > > Any plans of porting WATIR to JRuby?? > > None that I know of at the moment. The stumbling block is to get a > compatible version of 'win32ole' on JRuby which we don't have. Watij uses Groovy as it's scripting language. Groovy is a dynamic lanagage that exists within a JVM. Groovy can access COM. http://groovy.codehaus.org/COM+Scripting aidy From paul.rogers at shaw.ca Sun Jun 17 09:54:38 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 17 Jun 2007 07:54:38 -0600 Subject: [Wtr-general] Breaking code into several classes and methods References: <970956b0706151743h41fab083o930968aee2c0c56f@mail.gmail.com> Message-ID: <00be01c7b0e7$0c6184c0$6400a8c0@laptop> a very quick look suggesrs you need if $ie.link(:text, $page.link_to_text ).exists? in place of if $ie.link(:text, page.link_to_text ).exists? ----- Original Message ----- From: Jeff Fry To: wtr-general at rubyforge.org Sent: Friday, June 15, 2007 6:43 PM Subject: [Wtr-general] Breaking code into several classes and methods Hi all, I'm using my trusty pickaxe plus various code samples to try to take a script of mine and break it up a bit into several classes and methods within classes...and getting stuck. When I run the code below, I get: test_benchmark_page(TC_PerformanceBenchmark): NoMethodError: undefined method `link_to_text' for # performance_benchmark2.rb:56:in `benchmark' performance_benchmark2.rb:54:in `times' performance_benchmark2.rb:54:in `benchmark' performance_benchmark2.rb:69:in `test_benchmark_page' It complains about this line in particular: if $ie.link(:text, page.link_to_text).exists? But when I try it in irb it seems that page.link_to_text shouldn't be a problem: irb(main):040:0> $page = Page.new("c_eastwood", "/view?id=%239202a8c04000641f800000000056de6", "Mystic River") => # irb(main):041:0> $page.link_to_test => "Mystic River" Here's my relevant code: class TC_PerformanceBenchmark < Test::Unit::TestCase ... def benchmark(page) 1.times do $ie.goto($url_root + page.url) if $ie.link(:text, page.link_to_text ).exists? $results_array << $ie.down_load_time.to_s p '$ie.down_load_time: '+$ie.down_load_time.to_s else $results_array << 'e' p 'e' end #if end #do end def test_benchmark_page login($url_root, $user, $pw) $page = Page.new("c_eastwood", "/view?id=%239202a8c04000641f8000000000056de6", "Mystic River") benchmark($page) end end #class class Page def initialize (key, url, link_to_test) @key = key @url = url @link_to_test = link_to_test end attr_reader :key attr_reader :url attr_reader :link_to_test end Any ideas? Thanks, Jeff -- http://testingjeff.wordpress.com ------------------------------------------------------------------------------ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070617/48993a75/attachment.html From paul.rogers at shaw.ca Sun Jun 17 10:06:12 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 17 Jun 2007 08:06:12 -0600 Subject: [Wtr-general] Our contribution to Watir References: <32105796.15641181949107087.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <7ac2300c0706160053q58671b5erce58acb21b8a131c@mail.gmail.com> <467555AE.6050404@gmail.com> <46746819.3070309@pettichord.com> Message-ID: <00e501c7b0e8$a9b39b90$6400a8c0@laptop> looking at the methods provided, it would seem that some are definite candidates for inclusion the dialog code for example ) some of the others, like the regex methods, dont seem to be particularly suited watir. But saying that, thanks for the contributions, they are always welcome, and give people ideas of what can be done Paul ----- Original Message ----- From: "Bret Pettichord" To: Sent: Saturday, June 16, 2007 4:45 PM Subject: Re: [Wtr-general] Our contribution to Watir > Charley Baker wrote: >> It's great to have user contributions, I haven't had a chance to look >> at it yet, but will soon. Instead of adding it to a jira ticket, you >> should add it to the user contribution area of the wiki on openqa. >> http://wiki.openqa.org/display/WTR/Contributions > I've been talking the people at Webmetrics off-list. They would like > their enhancements to be bundled in the watir gem. I explained that we > would need unit tests and need to review the enhancements for > consistency with the Watir design principles. Submissions via Jira are > appropriate for this kind of thing. For changes, we prefer a patch file, > but since this submission amounts to a monkey patch, it's current form > is acceptable. > > Just for the record, we don't have these constraints (tests, > consistency) for code that submitted to the contributions page of the > wiki. > > Bret > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Sun Jun 17 11:09:23 2007 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 17 Jun 2007 10:09:23 -0500 Subject: [Wtr-general] Breaking code into several classes and methods In-Reply-To: <970956b0706151743h41fab083o930968aee2c0c56f@mail.gmail.com> References: <970956b0706151743h41fab083o930968aee2c0c56f@mail.gmail.com> Message-ID: <46754EA3.5050301@pettichord.com> Jeff Fry wrote: > It complains about this line in particular: > if $ie.link(:text, page.link_to_text).exists? > > But when I try it in irb it seems that page.link_to_text shouldn't be > a problem: > irb(main):040:0> $page = Page.new("c_eastwood", > "/view?id=%239202a8c04000641f800000000056de6", "Mystic River") > => # @url="/view?id=%239202a8c0400641f8000000000056de6", @key="c_eastwood"> > irb(main):041:0> $page.link_to_test > => "Mystic River" you've confused link_to_text for link_to_test From bret at pettichord.com Sun Jun 17 11:22:39 2007 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 17 Jun 2007 10:22:39 -0500 Subject: [Wtr-general] Understanding down_load_time on AJAXy pages In-Reply-To: <970956b0706151220w1d66ba3an5ebbbc3a4dd45e86@mail.gmail.com> References: <970956b0706151220w1d66ba3an5ebbbc3a4dd45e86@mail.gmail.com> Message-ID: <467551BF.1080307@pettichord.com> Jeff Fry wrote: > 100.times do > url = $url_root + "/view?id=%239202a8c04000641f8000000000056de6" > start = Time.now > $ie.goto(url) > if $ie.link(:text,'Million Dollar Baby').exists? > $results_array << $ie.down_load_time.to_s > p '$ie.down_load_time: '+$ie.down_load_time.to_s > else # there's a problem with the page > $results_array << 'e' > p 'e' > end #if > took = Time.now - start > > I'm curious why I get up to .5 seconds more for 'took' than I do for > down_load_time. Does down_load_time have a way of knowing when > everything on the page has finished loading on a page where various > elements render in phases? You should take a look at the code in the wait method that compiles the download_time (which really is the page load time). ie.goto calls navigate before starting the counter, you could measure it to see how much time it is taking. You are also calling ie.link().exists? before stopping your counter and it is also probably taking some time. Bret From bret at pettichord.com Sun Jun 17 11:31:03 2007 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 17 Jun 2007 10:31:03 -0500 Subject: [Wtr-general] how to properly use the snippet function? In-Reply-To: <25003293.371181723737709.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <25003293.371181723737709.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <467553B7.7090104@pettichord.com> reinier wrote: > I am trying to get rid of all cookies via a function. > On this forum I found the Snippet thingy. > http://rubyforge.org/snippet/detail.php?type=snippet&id=26 > So I included that code in my script and trying to use it, but I can't figure out how. > > this is the code: > [code] > DeleteUrlCacheEntry = Win32API.new("wininet", "DeleteUrlCacheEntry", ['P'], 'V') > [/code] > > So what function should be called to delete all the cookies main From forum-watir-users at openqa.org Mon Jun 18 01:47:02 2007 From: forum-watir-users at openqa.org (imran) Date: Mon, 18 Jun 2007 00:47:02 CDT Subject: [Wtr-general] Microsoft Tab Strip Issues - urgent In-Reply-To: <970956b0706151130mef7ff03r44e8b8e77e463201@mail.gmail.com> Message-ID: <26274769.371182145652273.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, Bret Thanks. I will try the regular expression. If you means to say any hidden parameter as session key then no. I need to work on regular expressions. thanks for the link. I will let you know about the progress i made. I think microsft tab strip support must be added to the watir. Also if one wants to add one's own function then what one will have to do. Please refer any site "How to contribute to watir and what are the required skills." Thanks again. Kind Regards, M.Imran From forum-watir-users at openqa.org Mon Jun 18 02:50:41 2007 From: forum-watir-users at openqa.org (kumari) Date: Mon, 18 Jun 2007 01:50:41 CDT Subject: [Wtr-general] Not able to find the title of newly opened window. In-Reply-To: <28774252.3491181251065197.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <33371265.751182149471352.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> i think the window doesn't have URL ,it has only tiltle which can't be caputred before clicking the link.And the title is with respect to name of the person which changes depending on the link which we r clicking. From manish at gslab.com Mon Jun 18 02:57:23 2007 From: manish at gslab.com (Manish Sapariya) Date: Mon, 18 Jun 2007 12:27:23 +0530 Subject: [Wtr-general] OT: Is cruisecontrol.rb by thoughworks is withdrawn Message-ID: <46762CD3.2030109@gslab.com> I am trying to access following url for last two days, but no success. http://cruisecontrolrb.thoughtworks.com/ Is anybody out here facing same problem. Thanks, Manish From mrussell at inpses.co.uk Mon Jun 18 04:34:52 2007 From: mrussell at inpses.co.uk (Max Russell) Date: Mon, 18 Jun 2007 09:34:52 +0100 Subject: [Wtr-general] Load Error Message-ID: >can you post your test script? it would help to diagnose your problem. # Simple test harness require 'watir' require 'watir/testcase' #require 'test/unit' #$LOAD_PATH << '..' if $0 == __FILE__ $LOAD_PATH << './Tests' class TestSuite < Watir::TestCase File.open(ARGV[0]).each_line do |entry| code = lambda{load "#{entry.strip}.rb" } self.send(:define_method, entry.strip, code)#{load "#{entry.strip}.rb" }#puts "#{entry.strip}" #self.send(:public, entry.strip.to_sym ) end end if $0 == __FILE__ require 'test/unit/ui/console/testrunner' Test::Unit::UI::Console::TestRunner.run(TestSuite) End Done, the only change I've made from the previously working version is that this should take command line arguments. I don't believe this has anything to do with my script at all, but something to do with the environment it's running under. Ruby 1.8.6 watir 1.5 - I did have all this working some time ago. The only real updates have been the Ruby and WATiR versions. Max Russell Test Analyst INPS Tel: 01382564346 Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ Registered Number: 1788577 Registered in the UK Visit our Internet Web site at www.inps.co.uk The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of INPS or any of its affiliates. If you are not the intended recipient please contact is.helpdesk at inps.co.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070618/33bdee4b/attachment-0001.html From forum-watir-users at openqa.org Mon Jun 18 07:52:44 2007 From: forum-watir-users at openqa.org (sourabh jain) Date: Mon, 18 Jun 2007 06:52:44 CDT Subject: [Wtr-general] How to get properties of a JSP page using Watir. Message-ID: <24767057.2411182167594511.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> hi i am trying to automate a jsp page. when i am doing ie.showAllObjects its only showing HTML Document name=MX_HIDDEN id=MX_HIDDEN src=javascript:document.writeln();document.close() HTML Document name= id= src=MxPortal.jsp I want to click a link using watir methods but since all the properties are hidden i am not able to go to that particular link. i also used firefox with firebug to get the properties or DOM of that page but i am getting only html source code. and the source code of the page is disabled. if i do ie.html then its displaying following code and the information about the link name is not visible. "" is there any way to get the link name and parent frame of that particular link. From forum-watir-users at openqa.org Mon Jun 18 08:45:48 2007 From: forum-watir-users at openqa.org (mihai) Date: Mon, 18 Jun 2007 07:45:48 CDT Subject: [Wtr-general] control existing IE window? Message-ID: <28456310.3211182170778265.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> how can i control a already IE opened window for example if i have www.google.com window open but not with watir can i associate a variable $ie to that window an then click links etc using that variable? From zeljko.filipin at gmail.com Mon Jun 18 08:54:56 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 18 Jun 2007 14:54:56 +0200 Subject: [Wtr-general] control existing IE window? In-Reply-To: <28456310.3211182170778265.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <28456310.3211182170778265.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: >From WATIR User Guide (http://wtr.rubyforge.org/watir_user_guide.html), section New Windows. ie = Watir::IE.attach(:url, 'http://mytestsite') ie = Watir::IE.attach(:title, 'Test New Window') ie = Watir::IE.attach(:title, /Test New/) Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070618/c070ec96/attachment.html From forum-watir-users at openqa.org Mon Jun 18 09:02:55 2007 From: forum-watir-users at openqa.org (mihai) Date: Mon, 18 Jun 2007 08:02:55 CDT Subject: [Wtr-general] control existing IE window? In-Reply-To: <28456310.3211182170778265.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <38062644.3951182171805431.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> tnx a lot From jeff.fry at gmail.com Tue Jun 19 10:53:35 2007 From: jeff.fry at gmail.com (Jeff Fry) Date: Tue, 19 Jun 2007 07:53:35 -0700 Subject: [Wtr-general] OT: Is cruisecontrol.rb by thoughworks is withdrawn In-Reply-To: <46762CD3.2030109@gslab.com> References: <46762CD3.2030109@gslab.com> Message-ID: <4677EDEF.1090200@gmail.com> Manish Sapariya wrote: > I am trying to access following url for last two days, > but no success. > > http://cruisecontrolrb.thoughtworks.com/ > > Is anybody out here facing same problem. > Just tried and yes, it times out for me too. Not sure what's on which page, but http://rubyforge.org/projects/cruisecontrolrb/ works, if that helps. Otherwise, you could try the mailing list http://www.nabble.com/CruiseControl.rb---Users-f22849.html to find out what's up at ThoughtWorks. Jeff From forum-watir-users at openqa.org Mon Jun 18 11:24:06 2007 From: forum-watir-users at openqa.org (B Smith) Date: Mon, 18 Jun 2007 10:24:06 CDT Subject: [Wtr-general] iterate thru forum Message-ID: <34250428.4641182180276531.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am trying to develop a check for replies vs. views for a forum. Problems, A) dynamically find categories B) dynamically iterate thru topics to cull answer Since I am still new to WATIR, I don't know howto set up the iteration and I'm trying to get the navstrip info so that I know what area the info came from Any help appreciated --------------.rb starts ------------------------------------- #--------------------------------------------------------------# # # # Edit of Simple LAWSON SITE check # # #------------------------------------------------------------------# require 'watir' # the watir controller # set a variable base_site = 'http://lawsontalk.com/index.php' forum_detail = '?showforum=17' test_site = base_site + forum_detail # open the IE browser ie = Watir::IE.new # print some comments puts "## Beginning; open Lawsontalk" puts " " puts "go to the test site: " + test_site ie.goto(test_site) puts " Action: entered " + test_site + " in the address bar." # Set Login Info - This WORKS # puts " Action: Enter Login info for forum" # ie.text_field(:name, "UserName").set("Login") # ie.text_field(:name, "PassWord").set("Password") # This should press 'GO' button to complete login, disabled for testing # ie.button(:name, "Go").click # Once Logged in perform Housekeeping # # this should be LawsonTalk -> Community -> General Thread_area = ie.div(:id, "navstrip") # this should be an iteration of all forum topics Topic = ie.row(:row, "forum topics") # Compare Replies to Views # If views > 50 and Replies = 0 then Thread requires attention puts " Action: Find threads not answered" puts " The following Topic" + Topic + " in area" + Thread_area + " has " + Views + " and no replies, this may require attention " puts " " # end of test puts "## End of test" # End -------------.rb ends------------------------------------- From bret at pettichord.com Mon Jun 18 13:01:15 2007 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 18 Jun 2007 12:01:15 -0500 Subject: [Wtr-general] Load Error In-Reply-To: References: Message-ID: <4676BA5B.3000504@pettichord.com> Max Russell wrote: > > > can you post your test script? it would help to diagnose your problem. > > > > # Simple test harness > What was your original question? Your reply was not indexed with the original post. Bret From bret at pettichord.com Mon Jun 18 13:09:59 2007 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 18 Jun 2007 12:09:59 -0500 Subject: [Wtr-general] OT: Is cruisecontrol.rb by thoughworks is withdrawn In-Reply-To: <46762CD3.2030109@gslab.com> References: <46762CD3.2030109@gslab.com> Message-ID: <4676BC67.9040501@pettichord.com> Manish Sapariya wrote: > I am trying to access following url for last two days, > but no success. > > http://cruisecontrolrb.thoughtworks.com/ > > See http://rubyforge.org/projects/cruisecontrolrb/ Both Alexey and Jeremy have made commits in the past week, but it does look like the project has lost some degree of support from TW. Here's the place to ask: http://rubyforge.org/pipermail/cruisecontrolrb-users/ From forum-watir-users at openqa.org Mon Jun 18 13:25:57 2007 From: forum-watir-users at openqa.org (B Smith) Date: Mon, 18 Jun 2007 12:25:57 CDT Subject: [Wtr-general] iterate thru forum In-Reply-To: <34250428.4641182180276531.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <26091920.5071182187587376.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I got this far on my own table = ie.table(:index,5) v_3 = table[1][3].to_s v_4 = table[1][4].to_s v_5 = table[1][5].to_s v_6 = table[1][6].to_s variable = v_3 + " " + v_4 + " " + v_5 + " " + v_6 puts variable This now returns the HEADER row from the correct table in the page. HOW DO I set this to iterate thru all the threads?? I saw a forum posting for counting links :: ie.(:index,1).links.length, but it isn't working for my variable. thanks, From jfitisoff at yahoo.com Mon Jun 18 13:33:49 2007 From: jfitisoff at yahoo.com (John Fitisoff) Date: Mon, 18 Jun 2007 10:33:49 -0700 (PDT) Subject: [Wtr-general] control existing IE window? In-Reply-To: <28456310.3211182170778265.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <32526.10633.qm@web54109.mail.re2.yahoo.com> ie = IE.attach(:title, /TitlebarText/) --- mihai wrote: > how can i control a already IE opened window > for example if i have www.google.com window open but > not with watir can i associate a variable $ie to > that window an then click links etc using that > variable? > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > ____________________________________________________________________________________ Park yourself in front of a world of choices in alternative vehicles. Visit the Yahoo! Auto Green Center. http://autos.yahoo.com/green_center/ From bret at pettichord.com Mon Jun 18 14:29:36 2007 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 18 Jun 2007 13:29:36 -0500 Subject: [Wtr-general] Not able to find the title of newly opened window. In-Reply-To: <33371265.751182149471352.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <33371265.751182149471352.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4676CF10.5050405@pettichord.com> kumari wrote: > i think the window doesn't have URL ,it has only tiltle which can't be caputred before clicking the link.And the title is with respect to name of the person which changes depending on the link which we r clicking. Every browser window has a URL. Sometimes the browser will hide the URL widget. But it still has a URL and watir can use it. From exortech at gmail.com Mon Jun 18 14:30:57 2007 From: exortech at gmail.com (Owen Rogers) Date: Mon, 18 Jun 2007 11:30:57 -0700 Subject: [Wtr-general] OT: Is cruisecontrol.rb by thoughworks is withdrawn In-Reply-To: <46762CD3.2030109@gslab.com> References: <46762CD3.2030109@gslab.com> Message-ID: On 17/06/07, Manish Sapariya wrote: > I am trying to access following url for last two days, > but no success. > > http://cruisecontrolrb.thoughtworks.com/ > > Is anybody out here facing same problem. try now. the server needed a reboot. cheers, owen. -- Owen Rogers | http://dotnetjunkies.com/weblog/exortech | CruiseControl.NET - http://ccnet.thoughtworks.com From forum-watir-users at openqa.org Mon Jun 18 15:23:00 2007 From: forum-watir-users at openqa.org (Lauren) Date: Mon, 18 Jun 2007 14:23:00 CDT Subject: [Wtr-general] Method Precedence confusion Message-ID: <30223399.5701182194610910.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello, I apologize for my confusion yet again, but I hope this will be a simple answer for someone... I have written a script that asserts whether labels on a page exist or not. Here is a small snippet of code to serve as an example: class TC_banking_info_labels < Test::Unit::TestCase include Watir def test_bank_name assert($ie.span(:text, "bank name").exists?) $logger.log(" FOUND! Banking Information: 'Bank Name' field...") end end I have discovered that the order of operation within the class is alphabetical. (method test_a* will execute before test_z*). My problem is that I have a teardown script located in another file. I can access the methods in the files just fine by accessing them directly. For example by typing in: $close_logger $close_browser The problem with that is that my teardown methods/variables get executed before my Test::Unit::TestCase classes/methods which causes my browser to close before my tests are executed, which causes all 66 of my tests to fail. Here are the contents of my teardown.rb script: require 'watir' #includes for using logger require 'example_logger1' $close_logger = $logger.log("## Testing Complete ##") $close_browser = $ie.close My question is: How can I call this teardown script into my test script and have it executed LAST. How do I control the order in which methods are executed? As always, thank you for your help. I have been researching quite a bit about methods & classes, etc...but there is still a disconnect somewhere...and I am stuck. From areed at relocationcentral.com Mon Jun 18 15:29:00 2007 From: areed at relocationcentral.com (Adam Reed) Date: Mon, 18 Jun 2007 14:29:00 -0500 Subject: [Wtr-general] Method Precedence confusion In-Reply-To: <30223399.5701182194610910.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <30223399.5701182194610910.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36B5DBA88E027F47812ED877C6A978D801372E36@rc-mail.relocationcentral.com> The teardown script automatically runs at the completion of all test functions. The alphabetical order only affects multiple test_* functions. If you have: def setup end def test_01 end def test_02 end def teardown end They will run in this order: setup, test_01, teardown, setup, test_02, teardown. So if you have 66 tests, only the ones that are called after the first testname should fail, because you're closing the browser and the logger after the first test runs. Hope that helps, Adam -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lauren Sent: Monday, June 18, 2007 2:23 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Method Precedence confusion Hello, I apologize for my confusion yet again, but I hope this will be a simple answer for someone... I have written a script that asserts whether labels on a page exist or not. Here is a small snippet of code to serve as an example: class TC_banking_info_labels < Test::Unit::TestCase include Watir def test_bank_name assert($ie.span(:text, "bank name").exists?) $logger.log(" FOUND! Banking Information: 'Bank Name' field...") end end I have discovered that the order of operation within the class is alphabetical. (method test_a* will execute before test_z*). My problem is that I have a teardown script located in another file. I can access the methods in the files just fine by accessing them directly. For example by typing in: $close_logger $close_browser The problem with that is that my teardown methods/variables get executed before my Test::Unit::TestCase classes/methods which causes my browser to close before my tests are executed, which causes all 66 of my tests to fail. Here are the contents of my teardown.rb script: require 'watir' #includes for using logger require 'example_logger1' $close_logger = $logger.log("## Testing Complete ##") $close_browser = $ie.close My question is: How can I call this teardown script into my test script and have it executed LAST. How do I control the order in which methods are executed? As always, thank you for your help. I have been researching quite a bit about methods & classes, etc...but there is still a disconnect somewhere...and I am stuck. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From forum-watir-users at openqa.org Mon Jun 18 16:40:52 2007 From: forum-watir-users at openqa.org (Lauren) Date: Mon, 18 Jun 2007 15:40:52 CDT Subject: [Wtr-general] Method Precedence confusion In-Reply-To: <36B5DBA88E027F47812ED877C6A978D801372E36@rc-mail.relocationcentral.com> Message-ID: <30372873.6121182199282899.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Yes Indeed! Your reply was a great help! Your explanation was so clear - I don't know how I missed that in the first place! I have redesigned my tests. There are only 4 tests now with 66 assertions only because I didn't want my browser to open and close 66x. Now it opens and closes 4 times. It does bring up an interesting discussion on method organization "best practices". For example, is it better to have one or two assertions per test case, or 4 test cases with 66 assertions between them... Anyway. I am all set for now...Onward and upward! Many thanks to you, Adam. From areed at relocationcentral.com Mon Jun 18 16:55:43 2007 From: areed at relocationcentral.com (Adam Reed) Date: Mon, 18 Jun 2007 15:55:43 -0500 Subject: [Wtr-general] Method Precedence confusion In-Reply-To: <30372873.6121182199282899.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36B5DBA88E027F47812ED877C6A978D801372E36@rc-mail.relocationcentral.com> <30372873.6121182199282899.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36B5DBA88E027F47812ED877C6A978D801372E39@rc-mail.relocationcentral.com> Glad I could help. One thing you'd have most likely noticed if you were to run those 66 separate functions is an "RPC Error" that would stop your testing cold. Eventually IE can't open/close fast enough to keep up with the script, and basically crashes itself. So, you're already one step ahead on best practices there. I generally keep my test cases organized by objective or method of testing. For instance, if it's a simple navigation test, I'll keep all the sidebar navigation element testing in one case, and the main div navigation elements in another, etc. If I'm testing forms, each form will get a separate case, etc. However, I also have one script that checks our dynamically created pages for a specific link -- I query the DB for the pages that should exist and check each for the target link in a loop. That single test case has around 16,000 assertions because of that loop. The one thing that makes this test remain useful is effective logging and error reporting. Thanks, Adam -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lauren Sent: Monday, June 18, 2007 3:41 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Method Precedence confusion Yes Indeed! Your reply was a great help! Your explanation was so clear - I don't know how I missed that in the first place! I have redesigned my tests. There are only 4 tests now with 66 assertions only because I didn't want my browser to open and close 66x. Now it opens and closes 4 times. It does bring up an interesting discussion on method organization "best practices". For example, is it better to have one or two assertions per test case, or 4 test cases with 66 assertions between them... Anyway. I am all set for now...Onward and upward! Many thanks to you, Adam. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Mon Jun 18 16:59:42 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 18 Jun 2007 14:59:42 -0600 Subject: [Wtr-general] Fwd: Re: Fwd: Re: OT: Is cruisecontrol.rb by thoughworks is withdrawn Message-ID: heres why cruise.rb was down -------------- next part -------------- An embedded message was scrubbed... From: Alexey Verkhovsky Subject: Re: Fwd: Re: [Wtr-general] OT: Is cruisecontrol.rb by thoughworks is withdrawn Date: Mon, 18 Jun 2007 15:19:04 -0500 Size: 6064 Url: http://rubyforge.org/pipermail/wtr-general/attachments/20070618/1d44f5b2/attachment.mht From bret at pettichord.com Mon Jun 18 16:59:57 2007 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 18 Jun 2007 15:59:57 -0500 Subject: [Wtr-general] Method Precedence confusion In-Reply-To: <36B5DBA88E027F47812ED877C6A978D801372E39@rc-mail.relocationcentral.com> References: <36B5DBA88E027F47812ED877C6A978D801372E36@rc-mail.relocationcentral.com> <30372873.6121182199282899.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <36B5DBA88E027F47812ED877C6A978D801372E39@rc-mail.relocationcentral.com> Message-ID: <4676F24D.7020205@pettichord.com> Adam Reed wrote: > Glad I could help. One thing you'd have most likely noticed if you were > to run those 66 separate functions is an "RPC Error" that would stop > your testing cold. Eventually IE can't open/close fast enough to keep > up with the script, and basically crashes itself. So, you're already > one step ahead on best practices there. > Actually, this problem can be avoided if you use the latest version of Watir and the new "IE.new_process" method. This is what i am using in my tests when i have to close and re-open the browser. Bret From areed at relocationcentral.com Mon Jun 18 17:07:22 2007 From: areed at relocationcentral.com (Adam Reed) Date: Mon, 18 Jun 2007 16:07:22 -0500 Subject: [Wtr-general] Method Precedence confusion In-Reply-To: <4676F24D.7020205@pettichord.com> References: <36B5DBA88E027F47812ED877C6A978D801372E36@rc-mail.relocationcentral.com> <30372873.6121182199282899.JavaMail.oqa-j2ee@openqa01.managed.contegix.com><36B5DBA88E027F47812ED877C6A978D801372E39@rc-mail.relocationcentral.com> <4676F24D.7020205@pettichord.com> Message-ID: <36B5DBA88E027F47812ED877C6A978D801372E3B@rc-mail.relocationcentral.com> Aha - I haven't been keeping up with the new release docs. I'll have to try that out. Thanks -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Monday, June 18, 2007 4:00 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Method Precedence confusion Adam Reed wrote: > Glad I could help. One thing you'd have most likely noticed if you > were to run those 66 separate functions is an "RPC Error" that would > stop your testing cold. Eventually IE can't open/close fast enough to > keep up with the script, and basically crashes itself. So, you're > already one step ahead on best practices there. > Actually, this problem can be avoided if you use the latest version of Watir and the new "IE.new_process" method. This is what i am using in my tests when i have to close and re-open the browser. Bret _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From manish at gslab.com Mon Jun 18 22:22:02 2007 From: manish at gslab.com (Manish Sapariya) Date: Tue, 19 Jun 2007 07:52:02 +0530 Subject: [Wtr-general] OT: Is cruisecontrol.rb by thoughworks is withdrawn In-Reply-To: References: <46762CD3.2030109@gslab.com> Message-ID: <46773DCA.2070106@gslab.com> Owen Rogers wrote: > try now. the server needed a reboot. > cheers, > owen. > Thanks all. -Manish From mrussell at inpses.co.uk Tue Jun 19 04:10:54 2007 From: mrussell at inpses.co.uk (Max Russell) Date: Tue, 19 Jun 2007 09:10:54 +0100 Subject: [Wtr-general] Load Error Message-ID: My original question was: On 6/15/07, Max Russell wrote: > > Hi there, I'm getting the following. > > > > `require': no such file to load -- watir (LoadError) > > > > I've checked the FAQs and downloaded the latest 1.5 version for my > Ruby version 1.8.6. > > I've listed my local gems and I can see that water is installed, yet > whenever I try and run my script, I still get the error? My script was: # Simple test harness require 'watir' require 'watir/testcase' #require 'test/unit' #$LOAD_PATH << '..' if $0 == __FILE__ $LOAD_PATH << './Tests' class TestSuite < Watir::TestCase File.open(ARGV[0]).each_line do |entry| code = lambda{load "#{entry.strip}.rb" } self.send(:define_method, entry.strip, code)#{load "#{entry.strip}.rb" }#puts "#{entry.strip}" #self.send(:public, entry.strip.to_sym ) end end if $0 == __FILE__ require 'test/unit/ui/console/testrunner' Test::Unit::UI::Console::TestRunner.run(TestSuite) End Done, the only change I've made from the previously working version is that this should take command line arguments. I don't believe this has anything to do with my script at all, but something to do with the environment it's running under. Ruby 1.8.6 watir 1.5 - I did have all this working some time ago. The only real updates have been the Ruby and WATiR versions. Max Russell Test Analyst INPS -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070619/7ae6ab17/attachment-0001.html From forum-watir-users at openqa.org Tue Jun 19 06:04:27 2007 From: forum-watir-users at openqa.org (Jason) Date: Tue, 19 Jun 2007 05:04:27 CDT Subject: [Wtr-general] WYSIWYG editor inside Any thoughts??? - J From forum-watir-users at openqa.org Tue Jun 19 06:45:00 2007 From: forum-watir-users at openqa.org (sapna) Date: Tue, 19 Jun 2007 05:45:00 CDT Subject: [Wtr-general] Is there any script to click on the image icon Message-ID: <31073247.10171182249930934.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, Kindly let me know if there are any command to click on the image. Below the HTML snippet. Regards Sapna From zeljko.filipin at gmail.com Tue Jun 19 07:07:48 2007 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 19 Jun 2007 13:07:48 +0200 Subject: [Wtr-general] Is there any script to click on the image icon In-Reply-To: <31073247.10171182249930934.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <31073247.10171182249930934.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Sapna, Try ie.image(:src, /mailclosed/).click Zeljko -- ZeljkoFilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070619/d5f08b94/attachment.html From forum-watir-users at openqa.org Tue Jun 19 09:30:43 2007 From: forum-watir-users at openqa.org (B Smith) Date: Tue, 19 Jun 2007 08:30:43 CDT Subject: [Wtr-general] get all rows from table in webpage Message-ID: <39368413.10791182259873527.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> this doesn't work v_1 = Array.new ie.table(:index,5).rows.each_with_index do |row, i| end v_1.each do |i| puts v_1 it throws this error:: .rb:44: undefined method `rows' for # (NoMethodError) What is so difficult about retrieving all the rows??? this should be easy any help appreciated From bret at pettichord.com Tue Jun 19 11:12:46 2007 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Jun 2007 10:12:46 -0500 Subject: [Wtr-general] And now Rbehave Message-ID: <4677F26E.8040702@pettichord.com> I've been using Rspec more and more lately and am working on a article describing how i use it. But today, I see this: http://dannorth.net/2007/06/introducing-rbehave and realize that things are really moving in the Ruby world! Bret From paul.rogers at shaw.ca Tue Jun 19 11:18:28 2007 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 19 Jun 2007 09:18:28 -0600 Subject: [Wtr-general] From comp.lang.ruby Message-ID: THis was posted on clr http://groups.google.ca/group/comp.lang.ruby/browse_thread/thread/2170f6b9401536fc/77f9db176b92b8d0?lnk=raot#77f9db176b92b8d0 Thanks Kevin! Kev Jackson View profile I've never been so impressed with a piece of software so quickly in my life. This is perhaps the most useful piece of software I've ever evaluated (for my current needs). Perfect fir to what I need Big thanks to the watir developers, and big thanks to matz for ruby, big thanks to the ruby community - this will make our testing here so much more rigorous Kev More options Nov 24 2005, 2:24 am Newsgroups: comp.lang.ruby From: Kev Jackson Date: Thu, 24 Nov 2005 17:24:33 +0900 Local: Thurs, Nov 24 2005 2:24 am Subject: Watir - evaluation... Reply to author | Forward | Print | Individual message | Show original | Report this message | Find messages by this author I've never been so impressed with a piece of software so quickly in my life. This is perhaps the most useful piece of software I've ever evaluated (for my current needs). Perfect fir to what I need Big thanks to the watir developers, and big thanks to matz for ruby, big thanks to the ruby community - this will make our testing here so much more rigorous Kev From christopher.mcmahon at gmail.com Tue Jun 19 11:18:53 2007 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 19 Jun 2007 09:18:53 -0600 Subject: [Wtr-general] WYSIWYG editor inside