From zeljko.filipin at gmail.com Fri Sep 1 04:24:35 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Fri, 1 Sep 2006 10:24:35 +0200 Subject: [Wtr-general] cannot set a text_field after form submit In-Reply-To: <78849894.1157060144519.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <78849894.1157060144519.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: It looks to me that after the first form submit, that text field is disabled. Zeljko Filipin On 8/31/06, Gabe wrote: > > WIN32OLERuntimeError: unknown property or method `disabled' > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060901/066c96d0/attachment.html From forum-watir-users at openqa.org Fri Sep 1 12:11:15 2006 From: forum-watir-users at openqa.org (David) Date: Fri, 01 Sep 2006 11:11:15 CDT Subject: [Wtr-general] I am a newb Message-ID: <97392691.1157127109844.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Ok so I just started using ruby and watir, when I say just started I mean no programming experience. The company I work for has me using/learning Watir. I can't make it click a button. I can make it click other buttons though. The software we developed doesnt use buttons per say, but something using href's and that such. I was wondering when you tell watir to ie.link(:text, "Cancel").click , does it search the page source for just cancel? We have several so-called buttons named cancel. Does watir just hit the first cancel? If so how do I make it hit this specific cancel? Any thought are much appreciated. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917&messageID=10762#10762 From christopher.mcmahon at gmail.com Fri Sep 1 12:29:08 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 1 Sep 2006 09:29:08 -0700 Subject: [Wtr-general] I am a newb In-Reply-To: <97392691.1157127109844.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <97392691.1157127109844.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70609010929l5dcd6867r67ccc0c2df9134f6@mail.gmail.com> On 9/1/06, David wrote: > > Ok so I just started using ruby and watir, when I say just started I mean > no programming experience. Welcome! The company I work for has me using/learning Watir. I can't make it click a > button. I can make it click other buttons though. The software we developed > doesnt use buttons per say, but something using href's and that such. I was > wondering when you tell watir to ie.link(:text, "Cancel").click , does it > search the page source for just cancel? We have several so-called buttons > named cancel. Does watir just hit the first cancel? If so how do I make it > hit this specific cancel? Any thought are much appreciated. So I have several suggestions: Use "view source" to look at the HTML in the page. All of the clickable things should have a value "id=foo". Use id to identify page elements to Watir whenever possible. Download Microsoft's Internet Explorer Developer's Toolbar here: http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en It allows you to easily see things about all of the elements on the page. Finally, we like helping newbs, but it is immensely helpful when you ask this sort of question to have both your Watir code and the HTML of the page element that you are trying to manipulate. Finally, Watir is a little ambiguous sometimes about what it considers a button and what it considers a link. If "ie.link(:text, "Cancel").click" doesn't work, try "ie.button(:text, "Cancel").click" -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060901/0a92810d/attachment.html From Mark_Cain at RL.gov Fri Sep 1 12:39:34 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Fri, 1 Sep 2006 09:39:34 -0700 Subject: [Wtr-general] I am a newb In-Reply-To: <97392691.1157127109844.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: When buttons all have the same names and id etc, you will need to use $ie.button(:index, x).click where x is the 1-based index of the button you want to click (from the top down). So if there are 3 cancel buttons on the page and you want to click the 2nd one then your code will look like this: $ie.button(:index, 2).click There are some really good examples of just about everything you would want to do in the unittests directory installed when you install Watir. Hope this helps, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David Sent: Friday, September 01, 2006 9:11 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] I am a newb Ok so I just started using ruby and watir, when I say just started I mean no programming experience. The company I work for has me using/learning Watir. I can't make it click a button. I can make it click other buttons though. The software we developed doesnt use buttons per say, but something using href's and that such. I was wondering when you tell watir to ie.link(:text, "Cancel").click , does it search the page source for just cancel? We have several so-called buttons named cancel. Does watir just hit the first cancel? If so how do I make it hit this specific cancel? Any thought are much appreciated. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917&messageID=10762#10762 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From phlip2005 at gmail.com Fri Sep 1 13:12:01 2006 From: phlip2005 at gmail.com (Phlip) Date: Fri, 1 Sep 2006 10:12:01 -0700 Subject: [Wtr-general] I am a newb In-Reply-To: References: <97392691.1157127109844.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <860c114f0609011012h6a01e113o7404be49eede0b64@mail.gmail.com> GUI testers: David has asked how to start using Watir to drive a website and test it. To the David: Read a book about Ruby ASAP! To the Ruby users: Where's the nearest ProgrammingRuby.chm for the OP? Does Watir come with it? Next topic: If anyone here uses the TFUI "reveal()" technique, could they describe it in Watir terms? to wtr-general at rubyforge.org ? Using it will give this Watir initiate more propulsion than a capture/playback system! -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! From tester.paul at gmail.com Fri Sep 1 13:30:12 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Fri, 1 Sep 2006 13:30:12 -0400 Subject: [Wtr-general] I am a newb In-Reply-To: <860c114f0609011012h6a01e113o7404be49eede0b64@mail.gmail.com> References: <97392691.1157127109844.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <860c114f0609011012h6a01e113o7404be49eede0b64@mail.gmail.com> Message-ID: <37c405480609011030v2d85db51y4ee5384c5bc2c9ab@mail.gmail.com> On 01/09/06, Phlip wrote: > > > To the Ruby users: Where's the nearest ProgrammingRuby.chm for the OP? > Does Watir come with it? Should be installed with Ruby itself. On my hard drive, I found a copy located in the /ruby/doc folder. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060901/8b9e3738/attachment.html From phlip2005 at gmail.com Fri Sep 1 13:36:33 2006 From: phlip2005 at gmail.com (Phlip) Date: Fri, 1 Sep 2006 10:36:33 -0700 Subject: [Wtr-general] I am a newb In-Reply-To: <37c405480609011030v2d85db51y4ee5384c5bc2c9ab@mail.gmail.com> References: <97392691.1157127109844.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <860c114f0609011012h6a01e113o7404be49eede0b64@mail.gmail.com> <37c405480609011030v2d85db51y4ee5384c5bc2c9ab@mail.gmail.com> Message-ID: <860c114f0609011036y2cab0fddref2d8c4c41b05d25@mail.gmail.com> Paul Carvalho wrote: > Should be installed with Ruby itself. On my hard drive, I found a copy > located in the /ruby/doc folder. Ouch right just found it: C:/ruby/doc/ProgrammingRuby.chm I gave up too soon. -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! From forum-watir-users at openqa.org Fri Sep 1 14:19:55 2006 From: forum-watir-users at openqa.org (David) Date: Fri, 01 Sep 2006 13:19:55 CDT Subject: [Wtr-general] I am a newb In-Reply-To: <860c114f0609011036y2cab0fddref2d8c4c41b05d25@mail.gmail.com> Message-ID: <72454011.1157134825733.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I want to say thanks to everyone, I am trying to understand. With the $ie.button(:index, 2).click command how does it know that it is looking for Cancel. This is the html source I am trying to pull from: Cancel I have exhausted all of my ideas, I havent tried to do the $ie.button(:index, 2) command yet. I am going to buy a book on Ruby, but college textbooks come first. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917&messageID=10774#10774 From Mark_Cain at RL.gov Fri Sep 1 14:35:13 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Fri, 1 Sep 2006 11:35:13 -0700 Subject: [Wtr-general] I am a newb In-Reply-To: <72454011.1157134825733.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Using :index it doesn't. What it is doing if finding the Xth button from the top of the page (you could count them from view source). I have to use this quite often in the applications I test because of auto-generated page elements which use the same button attributes (id, name, and values) for all similar buttons on the page. For instance, there could be 100 rows of data all with the same 'Add', 'Edit', and 'Delete' buttons. Using the button index is the only way of finding a particular button on the page. --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David Sent: Friday, September 01, 2006 11:20 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] I am a newb I want to say thanks to everyone, I am trying to understand. With the $ie.button(:index, 2).click command how does it know that it is looking for Cancel. This is the html source I am trying to pull from: Cancel I have exhausted all of my ideas, I havent tried to do the $ie.button(:index, 2) command yet. I am going to buy a book on Ruby, but college textbooks come first. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917&messageID=10774#10774 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Fri Sep 1 14:40:54 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 1 Sep 2006 11:40:54 -0700 Subject: [Wtr-general] I am a newb In-Reply-To: <72454011.1157134825733.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <860c114f0609011036y2cab0fddref2d8c4c41b05d25@mail.gmail.com> <72454011.1157134825733.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70609011140x7139a6a9m338c9fe10b5844d3@mail.gmail.com> On 9/1/06, David wrote: > > I want to say thanks to everyone, I am trying to understand. With the > $ie.button(:index, 2).click command how does it know that it is looking for > Cancel. This is the html source I am trying to pull from: > > href="JavaScript:hideSessionDialog();">Cancel Try $ie.button(:id,"sessionDialogCancel").click Also try using the "flash" method to see what's happening: $ie.button(:index, 2).flash $ie.button(:index, 3).flash $ie.button(:index, 4).flash $ie.button(:index, 5).flash -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060901/3ef1972c/attachment.html From Bill.Attebery at twtelecom.com Fri Sep 1 14:42:32 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Fri, 1 Sep 2006 12:42:32 -0600 Subject: [Wtr-general] I am a newb In-Reply-To: <72454011.1157134825733.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <485A27FF1E164B4FB51E2A066D5265A503ED69@SRVMSXMB1.ad.twtelecom.com> this looks like a link, not a button. try ie.link(:text, 'Cancel').click or ie.link(:index, index).click where index is the 1-based number of this link in the page (as described for button using index previously) > href="JavaScript:hideSessionDialog();">Cancel > The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. From paul.rogers at shaw.ca Fri Sep 1 14:44:09 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 01 Sep 2006 12:44:09 -0600 Subject: [Wtr-general] I am a newb References: <860c114f0609011036y2cab0fddref2d8c4c41b05d25@mail.gmail.com> <72454011.1157134825733.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <72799cd70609011140x7139a6a9m338c9fe10b5844d3@mail.gmail.com> Message-ID: <01bb01c6cdf6$9ca6bde0$6400a8c0@laptop> thats a link, so ie.link(:id , "sessionDialogCancel" ).flash is what you need ----- Original Message ----- From: Chris McMahon To: wtr-general at rubyforge.org Sent: Friday, September 01, 2006 12:40 PM Subject: Re: [Wtr-general] I am a newb On 9/1/06, David wrote: I want to say thanks to everyone, I am trying to understand. With the $ie.button(:index, 2).click command how does it know that it is looking for Cancel. This is the html source I am trying to pull from: Cancel Try $ie.button(:id,"sessionDialogCancel").click Also try using the "flash" method to see what's happening: $ie.button(:index, 2).flash $ie.button(:index, 3).flash $ie.button(:index, 4).flash $ie.button(:index, 5).flash ------------------------------------------------------------------------------ _______________________________________________ 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/20060901/df5e9ff7/attachment.html From forum-watir-users at openqa.org Fri Sep 1 15:06:28 2006 From: forum-watir-users at openqa.org (David) Date: Fri, 01 Sep 2006 14:06:28 CDT Subject: [Wtr-general] I am a newb In-Reply-To: <01bb01c6cdf6$9ca6bde0$6400a8c0@laptop> Message-ID: <73127693.1157137618667.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Apparently I need more help than thought. I have tried all of the ideas every one has given me(thank you). I am still unclear on how to use index or flash method. The button or link I am trying to get to, I have done many others just like it, but for some reason I cant get it to press cancel this time. I have been using ie.link(:text, "Export Data").click format, but I figure the one I am trying to do watir is grabbing one of the first Cancel's in the source. In the ruby prompt, it will go through and act like everything went smoothly. It is laid out the same way as others, but I dont know. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917&messageID=10779#10779 From Bill.Attebery at twtelecom.com Fri Sep 1 15:19:40 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Fri, 1 Sep 2006 13:19:40 -0600 Subject: [Wtr-general] I am a newb In-Reply-To: <73127693.1157137618667.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <485A27FF1E164B4FB51E2A066D5265A503ED6A@SRVMSXMB1.ad.twtelecom.com> If you have more than one link with 'Cancel' as the text -- it probably is grabbing a different one is you use ie.link(:text, 'Cancel').click In that case you need to uniquely identify it, and may need to use the index. Try this: get the page to where this link exists open a command prompt run irb and put in the following to connect to your browser instance require 'watir' include 'Watir' ie=IE.attach(:title, /title of your browser window/) ie.show_links try to figure out which one is your link you can do ie.link(:index, index_number).flash to try to flash different ones to help you identify it, once you know the index then ie.link(:index, index_number).click should work I'd think hope this helps > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David > Sent: Friday, September 01, 2006 1:06 PM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] I am a newb > > Apparently I need more help than thought. I have tried all of > the ideas every one has given me(thank you). I am still > unclear on how to use index or flash method. The button or > link I am trying to get to, I have done many others just like > it, but for some reason I cant get it to press cancel this > time. I have been using ie.link(:text, "Export Data").click > format, but I figure the one I am trying to do watir is > grabbing one of the first Cancel's in the source. In the ruby > prompt, it will go through and act like everything went > smoothly. It is laid out the same way as others, but I dont know. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=3917&messageID=1 > 0779#10779 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. From bret at pettichord.com Fri Sep 1 15:19:51 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 01 Sep 2006 14:19:51 -0500 Subject: [Wtr-general] cannot set a text_field after form submit In-Reply-To: <78849894.1157060144519.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <78849894.1157060144519.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <44F887D7.4040602@pettichord.com> Gabe wrote: > I have some watir tests for my form validation code. Basically, I try entering some invalid text, submitting, making sure I got an error, etc. > > The problem is that I cannot set a text field after the first form submit. When I try, I get this error: > > > test_address_validation(LocatorTests): > WIN32OLERuntimeError: unknown property or method `disabled' > HRESULT error code:0x80070005 > Access is denied. > C:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:2063:in `invoke' > C:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:2063:in `enabled?' > C:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1932:in `assert_enabled' > C:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:3383:in `set' > LocatorTests.rb:43:in `test_address_validation' > > > This is my test code: > > def setup > #initialize browser > @ie = IE.new > > #load the page > @ie.goto("http://localhost/site/page.aspx") > @ie.wait > > #find buttons and fields > @locate_button = @ie.button( :value, "Locate" ) > @addr_field = @ie.text_field( :id, "AddrTxt") > @city_field = @ie.text_field( :id, "CityTxt") > @state_field = @ie.select_list( :id, "StateDropDown") > @zip_field = @ie.text_field( :id, 'ZipTxt') > This code tries to resolve these objects at setup time. Your problem is that after you load a page, none of these references are valid any more. > end > > def test_address_validation > #must enter a minimum of zip or both city and state > @locate_button.click > assert( @ie.contains_text("City and State, or Zip Code is required!") ) > > @zip_field.set("asdf") #ERROR HERE! > @locate_button.click > assert( @ie.contains_text("Invalid Zip Code!") ) > end > > And there is nothing special about the Zip element: > > > > > Any help would be appreciated, > Gabe > The best approach would be to use methods rather than variables. Thus: def locate_button @ie.button( :value, "Locate" ) end and then use locate_button.click in your test Bret From christopher.mcmahon at gmail.com Fri Sep 1 15:27:22 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 1 Sep 2006 12:27:22 -0700 Subject: [Wtr-general] I am a newb In-Reply-To: <73127693.1157137618667.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <01bb01c6cdf6$9ca6bde0$6400a8c0@laptop> <73127693.1157137618667.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70609011227g74f2bf1ev5ca349e55163c7c3@mail.gmail.com> Try this. Bring up a command prompt and type "irb" (this is the interactive Ruby shell) and type the following commands. (instead of http://google.com, though, type in the address of your page. Do you see your link in the output from " ie.show_links"? If you send that to the list, we might be able to make more headway. C:\Documents and Settings\cmcmahon>irb irb(main):001:0> require 'watir' => false irb(main):002:0> include Watir => Object irb(main):003:0> ie = IE.new => #, @dev=#, @ shift_size=nil, @shift_age=nil>, @level=2, @formatter=nil, @default_formatter=#>, @ie=#, @activeObjectHighLightColor ="yellow", @error_checkers=[#], @typingspeed=0.08> irb(main):004:0> ie.goto("http://google.com") => 6.891 irb(main):005:0> ie.show_links On 9/1/06, David wrote: > > Apparently I need more help than thought. I have tried all of the ideas > every one has given me(thank you). I am still unclear on how to use index or > flash method. The button or link I am trying to get to, I have done many > others just like it, but for some reason I cant get it to press cancel this > time. I have been using ie.link(:text, "Export Data").click format, but I > figure the one I am trying to do watir is grabbing one of the first Cancel's > in the source. In the ruby prompt, it will go through and act like > everything went smoothly. It is laid out the same way as others, but I dont > know. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=3917&messageID=10779#10779 > _______________________________________________ > 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/20060901/7df523a6/attachment-0001.html From phlip2005 at gmail.com Fri Sep 1 15:28:57 2006 From: phlip2005 at gmail.com (Phlip) Date: Fri, 1 Sep 2006 12:28:57 -0700 Subject: [Wtr-general] I am a newb In-Reply-To: <485A27FF1E164B4FB51E2A066D5265A503ED6A@SRVMSXMB1.ad.twtelecom.com> References: <73127693.1157137618667.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <485A27FF1E164B4FB51E2A066D5265A503ED6A@SRVMSXMB1.ad.twtelecom.com> Message-ID: <860c114f0609011228q3b4897eava0b7e9a71e220e7e@mail.gmail.com> Attebery, Bill wrote: > If you have more than one link with 'Cancel' as the text -- it probably > is grabbing a different one is you use > ie.link(:text, 'Cancel').click > > In that case you need to uniquely identify it, and may need to use the > index. > > Try this: > get the page to where this link exists > open a command prompt > run irb and put in the following to connect to your browser instance > > require 'watir' > include 'Watir' > ie=IE.attach(:title, /title of your browser window/) > ie.show_links > try to figure out which one is your link > you can do ie.link(:index, index_number).flash to try to flash different > ones to help you identify it, once you know the index then > ie.link(:index, index_number).click should work I'd think Note that's the inverse of the reveal() technique I suggested. How would that look in Watir code? The two techniques could reinforce each other! -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! From forum-watir-users at openqa.org Fri Sep 1 15:46:19 2006 From: forum-watir-users at openqa.org (David) Date: Fri, 01 Sep 2006 14:46:19 CDT Subject: [Wtr-general] I am a newb In-Reply-To: <72799cd70609011227g74f2bf1ev5ca349e55163c7c3@mail.gmail.com> Message-ID: <72587056.1157140009982.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I dont know how to pull up irb, i know how to get into ruby though. I think the "real" programmer that helped me set up ruby and watir didnt follow all the directions, and we just kinda winged it. I am still a little lost. If it helps I could throw up all the source code for everyone to see. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917&messageID=10783#10783 From christopher.mcmahon at gmail.com Fri Sep 1 15:52:45 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 1 Sep 2006 12:52:45 -0700 Subject: [Wtr-general] I am a newb In-Reply-To: <72587056.1157140009982.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <72799cd70609011227g74f2bf1ev5ca349e55163c7c3@mail.gmail.com> <72587056.1157140009982.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70609011252l1e20786g2acdbef48bdeb3d3@mail.gmail.com> bring up a CMD shell; type "irb"; you;ll get a prompt like irb(main):001:0> then issue the commands noted above. On 9/1/06, David wrote: > > I dont know how to pull up irb, i know how to get into ruby though. I > think the "real" programmer that helped me set up ruby and watir didnt > follow all the directions, and we just kinda winged it. I am still a little > lost. If it helps I could throw up all the source code for everyone to see. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=3917&messageID=10783#10783 > _______________________________________________ > 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/20060901/db312821/attachment.html From lonny at titanez.net Fri Sep 1 16:13:45 2006 From: lonny at titanez.net (Lonny Eachus) Date: Fri, 01 Sep 2006 13:13:45 -0700 Subject: [Wtr-general] I am a newb In-Reply-To: References: Message-ID: <44F89479.80400@titanez.net> David, sometimes these people forget what it is like to be a newb, and give you specific information might be helpful *IF* you had a context in which to put it. From what you say, it appears you need some more general information first. Watir can find elements on a page in a variety of ways. Among these are :name, :id, :index, and :text. Which is more appropriate depends on your specific use. As somebody mentioned, you should use :id when you can... but this presumes that the designer of the page used element ids properly. That is to say, in a well-formed page every element should have a unique id. Keep that in mind when designing your own pages. Sometimes you will encounter a page with elements that do not have an id, but do have a name. Then you are forced to use name instead, but name (according to the rules) is not required to be unique. If you have neither name or id, then you might have to fall back to using :index or even :text. In this particular case the type of element you are trying to click is a link, and it has an id. So you probably want to do $ie.link(:id, 'sessionDialogCancel').click However, I will caution you that it is usually not a good idea to use global variables like $ie. In the vast majority of cases, you will want to use an instance variable instead, which uses the @ sign. So rather than $ie you would have @ie. Lonny Eachus ========== From tester.paul at gmail.com Fri Sep 1 16:57:22 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Fri, 1 Sep 2006 16:57:22 -0400 Subject: [Wtr-general] I am a newb In-Reply-To: <44F89479.80400@titanez.net> References: <44F89479.80400@titanez.net> Message-ID: <37c405480609011357t64470a4es4ea659865f149fbb@mail.gmail.com> Word to the wise.. On 01/09/06, Lonny Eachus wrote: > > David, sometimes these people forget what it is like to be a newb, and > give you specific information might be helpful *IF* you had a context in > which to put it. From what you say, it appears you need some more > general information first. [snip] $ie.link(:id, 'sessionDialogCancel').click > > However, I will caution you that it is usually not a good idea to use > global variables like $ie. In the vast majority of cases, you will want > to use an instance variable instead, which uses the @ sign. So rather > than $ie you would have @ie. I hardly think that bringing up the difference between global and instance variables to someone who doesn't know how to start IRB is a good idea right now. I think you should follow your own advice and keep things simple right now. I don't consider myself a newb anymore but I still can't be bothered working out the difference between global and instance variables in my scripts. $ie works quite nicely for me and I am really not interested in sorting out the difference right now. Global/class/instance/local variables all have their place and everyone has their own ideas about how to use them based on their level of programming experience. Do you really think this is the right time to spring them on David? I remember all too well the frustrations I went through in the beginning trying to figure out Ruby and Watir and getting advanced advice like yours above that had almost no meaning to me whatsoever from where I was coming from. Points for hitting the target, but you missed the bullseye. (i.e. added to the confusion factor) Just a friendly reminder. (I'm not shooting the messenger, just letting you know that I don't believe the message was helpful this time.) Cheers. Paul. (The recent post-newb who's more interested in solving testing problems with scripts than learning to become a programmer.) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060901/cbd3809c/attachment.html From bret at pettichord.com Fri Sep 1 17:23:21 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 01 Sep 2006 16:23:21 -0500 Subject: [Wtr-general] Global Variables In-Reply-To: <37c405480609011357t64470a4es4ea659865f149fbb@mail.gmail.com> References: <44F89479.80400@titanez.net> <37c405480609011357t64470a4es4ea659865f149fbb@mail.gmail.com> Message-ID: <44F8A4C9.5040601@pettichord.com> Paul Carvalho wrote: > I hardly think that bringing up the difference between global and > instance variables to someone who doesn't know how to start IRB is a > good idea right now. I think you should follow your own advice and > keep things simple right now. > > I don't consider myself a newb anymore but I still can't be bothered > working out the difference between global and instance variables in my > scripts. $ie works quite nicely for me and I am really not interested > in sorting out the difference right now. Global/class/instance/local > variables all have their place and everyone has their own ideas about > how to use them based on their level of programming experience. Do > you really think this is the right time to spring them on David? I concur with this advice. I usually teach global variables first (these start with "$") and then local variables (no special marking). I don't get into instance variables (start with "@") until we actually have an object, like for example a test case in a testing framework, which provides the context for understanding the scope of the instance variable. When i taught testers Python, i started with local variables and this worked well, but there are subtle but significant differences to how the two languages handle toplevel "local" scope that push me to start with globals in Ruby. A local variable at "top level" in Python had the same context whether in the shell, in the current file being executed or in another file being loaded. These are all different contexts in Ruby, and i try to encourage testers early on to be able to trust that code executed in any of these ways will do the same thing, but this is only true of they use global variables. Bret From phlip2005 at gmail.com Fri Sep 1 17:36:52 2006 From: phlip2005 at gmail.com (Phlip) Date: Fri, 1 Sep 2006 14:36:52 -0700 Subject: [Wtr-general] Global Variables In-Reply-To: <44F8A4C9.5040601@pettichord.com> References: <44F89479.80400@titanez.net> <37c405480609011357t64470a4es4ea659865f149fbb@mail.gmail.com> <44F8A4C9.5040601@pettichord.com> Message-ID: <860c114f0609011436y79ca4b0dq3786b1c60643467f@mail.gmail.com> Bret Pettichord wrote: > I concur with this advice. I usually teach global variables first (these > start with "$") I though test rigs that drove IE had the extra burden of building and breaking down the entire iexplore.exe object stack once per test case. So I thought that some Watirists would make their IE object global, and reuse it between test cases. This mild efficiency doesn't violate the Test Isolation guideline when you put $wie.goto("about:blank") between each test case. -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! From christopher.mcmahon at gmail.com Fri Sep 1 17:42:45 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 1 Sep 2006 14:42:45 -0700 Subject: [Wtr-general] Global Variables In-Reply-To: <44F8A4C9.5040601@pettichord.com> References: <44F89479.80400@titanez.net> <37c405480609011357t64470a4es4ea659865f149fbb@mail.gmail.com> <44F8A4C9.5040601@pettichord.com> Message-ID: <72799cd70609011442p6b34337exf15bd594a8df8c06@mail.gmail.com> > A local variable at "top level" in Python had the same > context whether in the shell, in the current file being executed or in > another file being loaded. These are all different contexts in Ruby, and > i try to encourage testers early on to be able to trust that code > executed in any of these ways will do the same thing, but this is only > true of they use global variables. Perl forces you to understand scope of variables fairly early (unless you write bad Perl using package variables, not lexical variables, and don't use warnings and don't use strictures, in which case you can ignore everything that follows): unless you declare variables' scope the first time the variable is used, the compiler gives you a warning. Variables declared within a routine with "my $var" are available only to that routine; variables declared outside routines with "my $var" are available to all subroutines declared in that scope. Global variables are designated by "our", not "my". "our $var" is available to all routines in the program. Managing this sometimes gets tricky. One of the most popular Perl FAQs of all time is "Coping with Scoping": http://perl.plover.com/FAQs/Namespaces.html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060901/91369a13/attachment.html From tester.paul at gmail.com Fri Sep 1 18:30:10 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Fri, 1 Sep 2006 18:30:10 -0400 Subject: [Wtr-general] Global Variables In-Reply-To: <72799cd70609011442p6b34337exf15bd594a8df8c06@mail.gmail.com> References: <44F89479.80400@titanez.net> <37c405480609011357t64470a4es4ea659865f149fbb@mail.gmail.com> <44F8A4C9.5040601@pettichord.com> <72799cd70609011442p6b34337exf15bd594a8df8c06@mail.gmail.com> Message-ID: <37c405480609011530j1fdc4ce7xa5312c0f1bab2ea8@mail.gmail.com> Is it called "Duck Typing" when Ruby figures out the variables as it goes along? That totally rocks. I only declare things as I need them in my scripts, and if my tests didn't run sequentially I would be totally screwed. =) On 01/09/06, Chris McMahon wrote: > > > Perl forces you to understand scope of variables fairly early (unless you > write bad Perl using package variables, not lexical variables, and don't use > warnings and don't use strictures, in which case you can ignore everything > that follows): unless you declare variables' scope the first time the > variable is used, the compiler gives you a warning. Variables declared > within a routine with "my $var" are available only to that routine; > variables declared outside routines with "my $var" are available to all > subroutines declared in that scope. > > Global variables are designated by "our", not "my". "our $var" is > available to all routines in the program. > > Managing this sometimes gets tricky. One of the most popular Perl FAQs of > all time is "Coping with Scoping": > http://perl.plover.com/FAQs/Namespaces.html > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060901/8f0c9b75/attachment-0001.html From lonny at titanez.net Sat Sep 2 02:47:57 2006 From: lonny at titanez.net (Lonny Eachus) Date: Fri, 01 Sep 2006 23:47:57 -0700 Subject: [Wtr-general] I am a newb In-Reply-To: References: Message-ID: <44F9291D.9000305@titanez.net> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060901/6708137d/attachment.html From bret at pettichord.com Sat Sep 2 17:52:26 2006 From: bret at pettichord.com (Bret Pettichord) Date: Sat, 02 Sep 2006 16:52:26 -0500 Subject: [Wtr-general] A strict testing-centric view In-Reply-To: <44F9291D.9000305@titanez.net> References: <44F9291D.9000305@titanez.net> Message-ID: <44F9FD1A.2020209@pettichord.com> Lonny Eachus wrote: > And please keep in mind that people use Watir for things other than > testing !! Without trying to be insulting, I must be honest and state > that I find the strict testing-centric view to be more than a little > myopic. This mailing list is explicitly chartered as having a test-centric focus. To wit: The wtr-general mailing focusses on using Watir for testing web applications, but actually questions and discussions about any aspect of using Ruby for testing are welcome. We'll even tolerate the occassional bit of Perl. Postings for jobs using Watir are also welcome. (http://rubyforge.org/mailman/listinfo/wtr-general) Questions about how to use Watir for non-testing purposes are not necessarily inappropriate for the list. However, suggestions that it is myopic to focus the conversation on testing are ill informed and unhelpful. The premise of this list is that the members are interested in using Ruby for testing. Any one who has trouble accepting this should consider moving their conversation elsewhere, like perhaps to a new list that that focuses on using Watir for building web-scraping applications. Bret From phil at andyb.com Mon Sep 4 14:17:12 2006 From: phil at andyb.com (Phil Winstanley) Date: Mon, 4 Sep 2006 19:17:12 +0100 Subject: [Wtr-general] Checking the Visibility of an element? Message-ID: <11D45BA7AADDBF419B5A5741383E07D8099DC9@monolith.andyb.com> Hi there, What's the best way to check if an individual element is visible (ignoring parent elements for the moment)? Thanks, Phil. Search Tags: Display CSS Style Visibility Hidden ------------------------------------------------------------------------ This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the originator of the message. This footer also confirms that this email message has been scanned for the presence of computer viruses, though it is not guaranteed virus free. Original Recipient: wtr-general at rubyforge.org Original Sender : phil at andyb.com Original Send Date: 04/09/2006 - 19:17:44 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060904/2eaef694/attachment.html From forum-watir-users at openqa.org Tue Sep 5 09:14:15 2006 From: forum-watir-users at openqa.org (David) Date: Tue, 05 Sep 2006 08:14:15 CDT Subject: [Wtr-general] I am a newb In-Reply-To: <72799cd70609011252l1e20786g2acdbef48bdeb3d3@mail.gmail.com> Message-ID: <78792675.1157462086468.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Doesnt work --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917&messageID=10851#10851 From forum-watir-users at openqa.org Tue Sep 5 10:19:19 2006 From: forum-watir-users at openqa.org (David) Date: Tue, 05 Sep 2006 09:19:19 CDT Subject: [Wtr-general] I am a newb In-Reply-To: <78792675.1157462086468.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <90572480.1157465990631.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I cant pull up "irb". I am in the command prompt, it is defaulted at C:\Documents and Settings\user> I have typed in "irb" here, I have changed the directory to just C:\ and tried. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917&messageID=10853#10853 From davids at tower-mt.com Tue Sep 5 10:31:03 2006 From: davids at tower-mt.com (David Schmidt) Date: Tue, 05 Sep 2006 07:31:03 -0700 Subject: [Wtr-general] Checking the Visibility of an element? In-Reply-To: <11D45BA7AADDBF419B5A5741383E07D8099DC9@monolith.andyb.com> References: <11D45BA7AADDBF419B5A5741383E07D8099DC9@monolith.andyb.com> Message-ID: <44FD8A27.9070507@tower-mt.com> Phil, I see from your personal e-mail to me that you've already found my wiki entry at http://wiki.openqa.org/pages/viewpage.action?pageId=1119. I was on vacation last week and will undoubtedly have some catching up at work, but I will look at your issues as soon as I can and hopefully have a working version for you soon. I haven't seen the problems you have seen, but this shows how difficult working with the IE DOM can be because different elements have different sets of supported OLE methods, and what works with one element may not work at all with a different element type. In your case, the SPAN tag as you used it may not support the same calls. More later... David Phil Winstanley wrote: > > Hi there, > > What?s the best way to check if an individual element is visible > (ignoring parent elements for the moment)? > > Thanks, > > Phil. > > Search Tags: Display CSS Style Visibility Hidden > From Mark_Cain at RL.gov Tue Sep 5 10:34:20 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Tue, 5 Sep 2006 07:34:20 -0700 Subject: [Wtr-general] I am a newb In-Reply-To: <90572480.1157465990631.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Make sure the default ruby install directories (bin and lib) are in the PATH environment variable. The ruby installer should have done this by default, but maybe it didn't. For me it is: C:\ruby\bin;c:\ruby\lib Hope this helps, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David Sent: Tuesday, September 05, 2006 7:19 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] I am a newb I cant pull up "irb". I am in the command prompt, it is defaulted at C:\Documents and Settings\user> I have typed in "irb" here, I have changed the directory to just C:\ and tried. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917&messageID=10853#10853 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From zeljko.filipin at gmail.com Tue Sep 5 10:37:52 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 5 Sep 2006 16:37:52 +0200 Subject: [Wtr-general] I am a newb In-Reply-To: <90572480.1157465990631.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <78792675.1157462086468.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <90572480.1157465990631.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: David, what do you do (exactly) and what happens when you do it? This is how I open irb: - click "start" - click "Run..." - type "cmd" in "Open:" text field - press enter - command prompt window opens with text: "Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\zfilipin>" - type "irb" - press enter - command prompt now looks like this: "Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\zfilipin>irb irb(main):001:0>" What do you get? ?eljko Filipin On 9/5/06, David wrote: > > I cant pull up "irb". I am in the command prompt, it is defaulted at > C:\Documents and Settings\user> I have typed in "irb" here, I have changed > the directory to just C:\ and tried. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060905/3b8e457c/attachment-0001.html From forum-watir-users at openqa.org Tue Sep 5 10:45:29 2006 From: forum-watir-users at openqa.org (David) Date: Tue, 05 Sep 2006 09:45:29 CDT Subject: [Wtr-general] I am a newb In-Reply-To: <90572480.1157465990631.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <75555641.1157467561708.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> 1 javascript:logout(); Log Out 2 http://www2.lymba.com/test/propmen3/documents/Pana lyst_UserGuide.pdfUser Guide (PDF) 3 http://www2.lymba.com/test/propmen3/documents/Pana lyst_UserGuide.pdfUser Guide 4 http://www2.lymba.com/test/propmen3/documents/Pana lyst_TechnicalDescription.pdfTechnical Description and Algorithms 5 http://www2.lymba.com/test/propmen3/documents/Pana lyst_Assumptions.pdfPurpose and Assumptions 6 javascript:showSessionDialog('Restore'); Restore Session 7 javascript:buildClusters(); Create Panels 8 javascript:backHome(); New 9 javascript:revertPanels(); Revert Panels 10 javascript:submitSearch(document.getElementById('s earchTypeSelect').value,%20document.getElementById('searchInput').value);Search 11 undoButton javascript:undo(); Undo 12 redoButton javascript:redo(); Redo 13 javascript:clearReviewers(); Clear Reviewers 14 javascript:assignReviewers(); Match Reviewers 15 javascript:showExportDialog(); Export Data 16 javascript:showSessionDialog('Save'); Save Session 17 javascript:showSessionDialog('Restore'); Restore Session 18 overviewModeLinkProposalsjavascript:setOverviewMode('Proposals '); Proposals 19 overviewModeLinkReviewersjavascript:setOverviewMode('Reviewers '); Reviewers 20 detailModeLinkProposalsjavascript:setDetailMode('Proposals'); Proposals 21 detailModeLinkReviewersjavascript:setDetailMode('Reviewers'); Reviewers 22 detailModeLinkAssignmentsjavascript:setDetailMode('Assignments '); Assignments 23 detailModeLinkGridjavascript:setDetailMode('Grid'); Grid 24 javascript:moveInspectedProposal(); Move 25 javascript:moveInspectedReviewer(); Move 26 sessionDialogCanceljavascript:hideSessionDialog(); Cancel 27 javascript:exportData('clusters'); Export All Panels With Proposals 28 javascript:exportData('reviewers'); Export Reviewer Data 29 javascript:exportData('panels'); Export All Panels with Assignments 30 sessionDialogCanceljavascript:hideExportDialog(); Cancel => nil irb(main):012:0> OK I hope this helps, I want to click or select the link on line 30. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3917&messageID=10855#10855 From Bill.Attebery at twtelecom.com Tue Sep 5 11:28:18 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Tue, 5 Sep 2006 09:28:18 -0600 Subject: [Wtr-general] I am a newb In-Reply-To: <75555641.1157467561708.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <485A27FF1E164B4FB51E2A066D5265A503ED6D@SRVMSXMB1.ad.twtelecom.com> I assume this is the output from ie.show_links. So ie.link(:index, 30).flash should make the link flash in your browser, and ie.link(:index, 30).click should click it. Note: replace ie with $ie, or @ie however you defined the scope of your IE object. > 30 sessionDialogCanceljavascript:hideExportDialog(); > Cancel > => nil > irb(main):012:0> > > > OK I hope this helps, I want to click or select the link on line 30. The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. From Mark_Cain at RL.gov Fri Sep 1 11:01:38 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Fri, 1 Sep 2006 08:01:38 -0700 Subject: [Wtr-general] Error clicking a button... In-Reply-To: Message-ID: What appears to be happening is the $ie object is not retaining the page objects during the attachment to the non-modal window (I am probably not describing this right). Because when I put these two line of code: table = $ie.table(:index, 8) table[1][5].click Immediately after when the non-modal window closes, I no longer get the error and the script completes as expected. What the two lines of code do is to re-click the tab which causes the page to reload. I posted my test case as it was when failing but I can't post the web page because there are security and propriety issues. Failing Test Case: def test5_ca table = $ie.table(:index, 8) table[1][5].click #$ie.show_all_objects $ie.button(:id, 'EnterEditCorrectiveActions').click sleep 3 cw2 = IE.attach(:title, /PER CA Management/i) cw2.button( :index, 3 ).click cw2.text_field( :index, 1 ).set("^CH2M") cw2.button("Search").click cw2.selectBox( :index, 1 ).select_value(/15319/) cw2.text_field( :index, 2 ).set("#{$d}") cw2.text_field( :name, "Action" ).set('Actions to be taken for this') startClicker("OK" , 3) cw2.button("Save").click sleep 1 unless $ie.status == 'Done' cw2.button("Close Window").click_no_wait while $ie.status != 'Done' sleep 1 end $ie.text_field( :name, "DescriptionofOccurrence" ).set('Description of Occurrence Text') $ie.text_field( :name, "Extent" ).set('Extent Text') $ie.text_field( :name, "SafetySig").set('Safety Significance Text') #$ie.text_field( :name, "GenericImp" ).set('Generic Implications Text') $ie.text_field( :name, "RemedialCA" ).set('Remedial Corrective Actions Text') $ie.text_field( :name, "ApparentCauseAnalysis" ).set('Apparent Cause Analysis Text') #$ie.show_all_objects sleep 1 $ie.button('Save').click # Fails HERE assert($ie.text_field(:name, "DescriptionofOccurrence").verify_contains("Description of Occurrence Text")) assert($ie.text_field(:name, "Extent").verify_contains("Extent Text")) assert($ie.text_field(:name, "SafetySig").verify_contains("Safety Significance Text")) assert($ie.text_field(:name, "RemedialCA").verify_contains("Remedial Corrective Actions Text")) assert($ie.text_field(:name, "ApparentCauseAnalysis").verify_contains("Apparent Cause Analysis Text")) startClicker("OK" , 3) #sleep 1 $ie.button("Submit").click $ie.link(:text, /PER-2006-/i).click end --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Charley Baker Sent: Thursday, August 31, 2006 12:12 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Error clicking a button... Hey Mark, It's good you're trying to track down the error by process of elimination, somehow not something that occurs to a lot of people. It's a bit hard to pin down what's happening remotely without some more information. Try posting your script code and possibly some part of the html. -Charley On 8/31/06, Cain, Mark wrote: Here is a curious addition to my previous post. If I put an "$ie.show_all_objects" at the top of the test case then all the object on the page are displayed in the output-as expected, nothing curious here. However, if I move the "$ie.show_all_objects" method to after where the Non-modal windows closes then only a very small part of the object show in the output, and then the error. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Thursday, August 31, 2006 10:46 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Error clicking a button... I am getting the following error when I click a 'Save' button on a page. The application has several tabbed pages and on each is the same 'Save, Submit, and Clear' button pattern. The other tab pages click the save button without error. This error occurs after attaching and closing a Non-modal window. NoMethodError: undefined method `all' for nil:NilClass C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1257 :in `ole_inner_elements' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1313 :in `locate_input_element' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3608 :in `locate' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2337 :in `assert_exists' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2480 :in `click' C:/watir_bonus/working/PER/tc_PERwResloution_test.rb:279 :in `test5_ca' Has anyone else seen this or similar behavior? ____________________ Mark L. Cain LMIT - E *STARS (r) ~ Lead Test Engineer 1981 Snyder, MSIN: G3-62, Richland, WA 99354 Mark_Cain at RL.gov 509.376.5458 "640 Kilobytes of computer memory ought to be enough for anybody." - Bill Gates, 1981 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060901/6626b0f8/attachment-0001.html From Mark_Cain at RL.gov Tue Sep 5 10:39:49 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Tue, 5 Sep 2006 07:39:49 -0700 Subject: [Wtr-general] Error clicking a button... In-Reply-To: Message-ID: What appears to be happening is the $ie object is not retaining the page objects during the attachment to the non-modal window (I am probably not describing this right). Because when I put these two line of code: table = $ie.table(:index, 8) table[1][5].click Immediately after when the non-modal window closes, I no longer get the error and the script completes as expected. What the two lines of code do is to re-click the tab which causes the page to reload. I posted my test case as it was when failing but I can't post the web page because there are security and propriety issues. Failing Test Case: def test5_ca table = $ie.table(:index, 8) table[1][5].click #$ie.show_all_objects $ie.button(:id, 'EnterEditCorrectiveActions').click sleep 3 cw2 = IE.attach(:title, /PER CA Management/i) cw2.button( :index, 3 ).click cw2.text_field( :index, 1 ).set("^CH2M") cw2.button("Search").click cw2.selectBox( :index, 1 ).select_value(/15319/) cw2.text_field( :index, 2 ).set("#{$d}") cw2.text_field( :name, "Action" ).set('Actions to be taken for this') startClicker("OK" , 3) cw2.button("Save").click sleep 1 unless $ie.status == 'Done' cw2.button("Close Window").click_no_wait while $ie.status != 'Done' sleep 1 end $ie.text_field( :name, "DescriptionofOccurrence" ).set('Description of Occurrence Text') $ie.text_field( :name, "Extent" ).set('Extent Text') $ie.text_field( :name, "SafetySig").set('Safety Significance Text') #$ie.text_field( :name, "GenericImp" ).set('Generic Implications Text') $ie.text_field( :name, "RemedialCA" ).set('Remedial Corrective Actions Text') $ie.text_field( :name, "ApparentCauseAnalysis" ).set('Apparent Cause Analysis Text') #$ie.show_all_objects sleep 1 $ie.button('Save').click # Fails HERE assert($ie.text_field(:name, "DescriptionofOccurrence").verify_contains("Description of Occurrence Text")) assert($ie.text_field(:name, "Extent").verify_contains("Extent Text")) assert($ie.text_field(:name, "SafetySig").verify_contains("Safety Significance Text")) assert($ie.text_field(:name, "RemedialCA").verify_contains("Remedial Corrective Actions Text")) assert($ie.text_field(:name, "ApparentCauseAnalysis").verify_contains("Apparent Cause Analysis Text")) startClicker("OK" , 3) #sleep 1 $ie.button("Submit").click $ie.link(:text, /PER-2006-/i).click end --Mark _______________________________________________ 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/20060905/d894e5a6/attachment-0001.html From forum-watir-users at openqa.org Tue Sep 5 12:20:51 2006 From: forum-watir-users at openqa.org (CJ) Date: Tue, 05 Sep 2006 11:20:51 CDT Subject: [Wtr-general] no such file to load -- watir (LoadError) Message-ID: <79251785.1157473292640.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I cannot get WatiR to load/run. Error= no such file to load -- watir (LoadError) Info: Windows XP SP2, IE 7.0 I Installed Ruby 1.8.5-20 stable via the .exe (Used all default options) I then installed Watir 1.4.1 via the .exe. I received an installation Error opening file for writing: \watir\AutoItX.chm so I manually created c:\watir directory and set destination folder to c:\watir and then the installation completed successfully. I noticed that I only have one system variable created from the installations that appears related to Watir or Ruby. RUBYOPT = -rubygems When I am trying to run the unit tests and/or examples [as listed in the Watir User Guide @ http://wtr.rubyforge.org/watir_user_guide.html] I get the no such file to load error. [b]I entered this at the command line for launching Examples.[/b] C:\watir\examples>googlesearch.rb c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- watir (LoadError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from C:/watir/examples/googleSearch.rb:15 [b]I entered this at the command line for launching Unit Tests.[/b] C:\watir\unittests>all_tests.rb c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- watir (LoadError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from C:/watir/unittests/../unittests/setup.rb:4 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from C:/watir/unittests/all_tests.rb:4 [b]MORE INFO:[/b] I successfully can pull version of ruby. C:\ruby\bin>ruby -v ruby 1.8.4 (2006-04-14) [i386-mswin32] I CANNOT pull version of Watir. C:\ruby\bin>ruby -e 'require "watir"; puts Watir::IE::VERSION' C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- watir (LoadError) from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from -e:1 Please, Please Help! Any help will be greatly appreciated!!! CJ --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3949&messageID=10863#10863 From bret at pettichord.com Tue Sep 5 12:32:09 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 05 Sep 2006 11:32:09 -0500 Subject: [Wtr-general] Error clicking a button... In-Reply-To: References: Message-ID: <44FDA689.9010609@pettichord.com> Mark, I see that you have some hard-coded sleep statements. This a bad sign. Can you replace these with calls to $ie.wait? This will probably fix the problem you reported as well. Bret From Mark_Cain at RL.gov Tue Sep 5 13:28:05 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Tue, 5 Sep 2006 10:28:05 -0700 Subject: [Wtr-general] Error clicking a button... In-Reply-To: <44FDA689.9010609@pettichord.com> Message-ID: This was code I wrote awhile ago (when $ie.wait didn't work right) and was getting back to update. The call to $ie.wait? didn't work but $ie.wait did (seems to be a bit faster then before). I still get the same error message I originally posted until I put call that reloads the page in, and sometimes I get this error too: 1) Error: test5_ca(TC_PERwResolution): WIN32OLERuntimeError: Unknown property or method `fireEvent' HRESULT error code:0x80070005 Access is denied. C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3941:in `method_missing' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3941:in `doKeyPress' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3935:in `doKeyPress' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3907:in `set' C:/watir_bonus/working/PER/tc_PERwResloution_test.rb:277:in `test5_ca' This is odd since I am not using the 'fireEvent' method in my script nor do I know what the 'Access is denied' message is all about. --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Tuesday, September 05, 2006 9:32 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Error clicking a button... Mark, I see that you have some hard-coded sleep statements. This a bad sign. Can you replace these with calls to $ie.wait? This will probably fix the problem you reported as well. Bret _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From knoorani at e-xact.com Tue Sep 5 14:36:48 2006 From: knoorani at e-xact.com (knoorani at e-xact.com) Date: Tue, 5 Sep 2006 11:36:48 -0700 (PDT) Subject: [Wtr-general] Cannot access input element Message-ID: <3578.10.1.1.237.1157481408.squirrel@10.1.1.237> Hey all, I have a form which I click on to perform an action. I get a result back from the action and a screen displays with an OK option. Inspecting the code through view source does not show me any input tags, yet when I download Dev tools for firefox and view the generated source I see the elements like
but if I add ie.button(:value,"OK").click nothing happens Any help would be much appreciated From bret at pettichord.com Tue Sep 5 15:06:09 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 05 Sep 2006 14:06:09 -0500 Subject: [Wtr-general] Problem reading tables In-Reply-To: <20060831210522.95820.qmail@web82803.mail.mud.yahoo.com> References: <20060831210522.95820.qmail@web82803.mail.mud.yahoo.com> Message-ID: <44FDCAA1.1020902@pettichord.com> I'm not surprised to hear that this doesn't work. It's not a common situation. If you'd like to see a fix, please log this in Jira. Bret RadhaKrishna Sunkari wrote: > I get the following error, if I've an empty table(with > no or tags in it). In this case my table #2 > is empty. > I'm using watir 1.4.1. Did someone notice the same > problem? Thanks. > > irb(main):069:0> ie.show_tables > Found 19 tables > 1 id= rows=1 columns=1 > WIN32OLERuntimeError: Unknown property or method `0' > HRESULT error code:0x80020006 > Unknown name. > from > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1622:in `[]' > from > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1622:in > `show_tables' > from > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1621:in `each' > from > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1621:in > `show_tables' > from (irb):69 > from ♥:0 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Tue Sep 5 15:08:20 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 05 Sep 2006 14:08:20 -0500 Subject: [Wtr-general] Cannot access input element In-Reply-To: <3578.10.1.1.237.1157481408.squirrel@10.1.1.237> References: <3578.10.1.1.237.1157481408.squirrel@10.1.1.237> Message-ID: <44FDCB24.8000000@pettichord.com> Sounds like frames to me. True? knoorani at e-xact.com wrote: > Hey all, > > I have a form which I click on to perform an action. > > I get a result back from the action and a screen displays with an OK option. > > Inspecting the code through view source does not show me any input tags, > yet when I download Dev tools for firefox and view the generated source I > see the elements like > > >
> type="button">
> > but if I add > ie.button(:value,"OK").click > nothing happens > > Any help would be much appreciated > From bret at pettichord.com Tue Sep 5 15:18:07 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 05 Sep 2006 14:18:07 -0500 Subject: [Wtr-general] OT: more on testing email In-Reply-To: References: <72799cd70608300826m6b17444cx6d0b54f2b3b0f0ea@mail.gmail.com> <44F5C0D9.3080500@pettichord.com> Message-ID: <44FDCD6F.3030102@pettichord.com> You communicate with an SMTP server using a socket, so it don't much matter what it is written it. The idea here is that the SMTP server is under the control of the testing system. Instead of forwarding email, it can be queried to find out what email it would have sent. This query interface is what we would want to be in Ruby. 1. Run Mock SMTP server on port 25 2. When application sends email it will go to your mock server. 3. You ask your mock server what email it got. Another option would be to add a mock/test interface to dumbster that would bind to another socket -- then it could be used from any language. Bret Paul Rogers wrote: > Where would this be used in a ruby system? I didnt read thoroughly but I thought this mocked out the smtp server for a java system. Is your web app written in ruby, so a ruby version of this can become a mock in your app? > > But saying that, I do agree it would be a great thing to do > > Paul > > ----- Original Message ----- > From: Bret Pettichord > Date: Wednesday, August 30, 2006 10:46 am > Subject: Re: [Wtr-general] OT: more on testing email > > >> Any one want to port this to Ruby? It would be awesome! >> >> Chris McMahon wrote: >> >>> This link just got posted on the agile-testing list, it looks >>> effective: http://quintanasoft.com/dumbster/ >>> >> _______________________________________________ >> 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 knoorani at e-xact.com Tue Sep 5 15:23:49 2006 From: knoorani at e-xact.com (knoorani at e-xact.com) Date: Tue, 5 Sep 2006 12:23:49 -0700 (PDT) Subject: [Wtr-general] Cannot access input element In-Reply-To: <44FDCB24.8000000@pettichord.com> References: <3578.10.1.1.237.1157481408.squirrel@10.1.1.237> <44FDCB24.8000000@pettichord.com> Message-ID: <3767.10.1.1.237.1157484229.squirrel@10.1.1.237> No it is a div with absolute position. > Sounds like frames to me. True? > > knoorani at e-xact.com wrote: >> Hey all, >> >> I have a form which I click on to perform an action. >> >> I get a result back from the action and a screen displays with an OK >> option. >> >> Inspecting the code through view source does not show me any input tags, >> yet when I download Dev tools for firefox and view the generated source >> I >> see the elements like >> >> >>
>> > type="button">
>> >> but if I add >> ie.button(:value,"OK").click >> nothing happens >> >> Any help would be much appreciated >> > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From bret at pettichord.com Tue Sep 5 15:24:05 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 05 Sep 2006 14:24:05 -0500 Subject: [Wtr-general] no such file to load -- watir (LoadError) In-Reply-To: <79251785.1157473292640.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <79251785.1157473292640.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <44FDCED5.9090005@pettichord.com> Sounds like Watir isn't installed. I suggest you uninstall and reinstall. If that doesn't work, try installing the gem instead. (gem install watir). CJ wrote: > I cannot get WatiR to load/run. Error= no such file to load -- watir (LoadError) > > Info: > > Windows XP SP2, IE 7.0 > > I Installed Ruby 1.8.5-20 stable via the .exe (Used all default options) > > I then installed Watir 1.4.1 via the .exe. I received an installation Error opening file for writing: \watir\AutoItX.chm so I manually created c:\watir directory and set destination folder to c:\watir and then the installation completed successfully. > > I noticed that I only have one system variable created from the installations that appears related to Watir or Ruby. > RUBYOPT = -rubygems > > When I am trying to run the unit tests and/or examples [as listed in the Watir User Guide @ http://wtr.rubyforge.org/watir_user_guide.html] I get the no such file to load error. > > [b]I entered this at the command line for launching Examples.[/b] > C:\watir\examples>googlesearch.rb > > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- watir (LoadError) > from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' > from C:/watir/examples/googleSearch.rb:15 > > [b]I entered this at the command line for launching Unit Tests.[/b] > C:\watir\unittests>all_tests.rb > > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- watir (LoadError) > from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' > from C:/watir/unittests/../unittests/setup.rb:4 > from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' > from C:/watir/unittests/all_tests.rb:4 > > [b]MORE INFO:[/b] > > I successfully can pull version of ruby. > C:\ruby\bin>ruby -v > > ruby 1.8.4 (2006-04-14) [i386-mswin32] > > I CANNOT pull version of Watir. > > C:\ruby\bin>ruby -e 'require "watir"; puts Watir::IE::VERSION' > > C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- watir (LoadError) > from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' > from -e:1 > > > Please, Please Help! > > Any help will be greatly appreciated!!! > > CJ > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=3949&messageID=10863#10863 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Tue Sep 5 15:30:03 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 05 Sep 2006 14:30:03 -0500 Subject: [Wtr-general] Error clicking a button... In-Reply-To: References: Message-ID: <44FDD03B.9090109@pettichord.com> You are getting an error in fireEvent because this method is being called from the set method that you are calling. The call stack shows us this. (Actually it shows that set calls doKeyPress, which calls fireEvent.) I still think it is a synchronization problem. You can verify this by putting really long hard-coded sleeps before any lines in your script that are giving you errors. If this fixes the problem (even if only intermittently) then it is definitely a synchronization problem. You said that ie.wait wasn't working for you. Were you getting errors? Was it simply not waiting long enough? Bret Cain, Mark wrote: > This was code I wrote awhile ago (when $ie.wait didn't work right) and > was getting back to update. > > The call to $ie.wait? didn't work but $ie.wait did (seems to be a bit > faster then before). > > I still get the same error message I originally posted until I put call > that reloads the page in, and sometimes I get this error too: > > 1) Error: > test5_ca(TC_PERwResolution): > WIN32OLERuntimeError: Unknown property or method `fireEvent' > HRESULT error code:0x80070005 > Access is denied. > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3941:in `method_missing' > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3941:in `doKeyPress' > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3935:in `doKeyPress' > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3907:in `set' > C:/watir_bonus/working/PER/tc_PERwResloution_test.rb:277:in > `test5_ca' > > This is odd since I am not using the 'fireEvent' method in my script nor > do I know what the 'Access is denied' message is all about. > > --Mark > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord > Sent: Tuesday, September 05, 2006 9:32 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Error clicking a button... > > Mark, > > I see that you have some hard-coded sleep statements. This a bad sign. > Can you replace these with calls to $ie.wait? This will probably fix the > > problem you reported as well. > > 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 Mark_Cain at RL.gov Tue Sep 5 15:45:15 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Tue, 5 Sep 2006 12:45:15 -0700 Subject: [Wtr-general] Error clicking a button... In-Reply-To: <44FDD03B.9090109@pettichord.com> Message-ID: It appears to be a synchronization problem as you described, how do I fix it? I am using the click_no_wait method to exit the non-modal window (regular click error ironically enough in wait) and that is where the synch error occurs. I am not sure why ie.wait was not working before, I suspect it was not waiting long enough but can not prove that conclusively. --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Tuesday, September 05, 2006 12:30 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Error clicking a button... You are getting an error in fireEvent because this method is being called from the set method that you are calling. The call stack shows us this. (Actually it shows that set calls doKeyPress, which calls fireEvent.) I still think it is a synchronization problem. You can verify this by putting really long hard-coded sleeps before any lines in your script that are giving you errors. If this fixes the problem (even if only intermittently) then it is definitely a synchronization problem. You said that ie.wait wasn't working for you. Were you getting errors? Was it simply not waiting long enough? Bret Cain, Mark wrote: > This was code I wrote awhile ago (when $ie.wait didn't work right) and > was getting back to update. > > The call to $ie.wait? didn't work but $ie.wait did (seems to be a bit > faster then before). > > I still get the same error message I originally posted until I put call > that reloads the page in, and sometimes I get this error too: > > 1) Error: > test5_ca(TC_PERwResolution): > WIN32OLERuntimeError: Unknown property or method `fireEvent' > HRESULT error code:0x80070005 > Access is denied. > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3941:in `method_missing' > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3941:in `doKeyPress' > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3935:in `doKeyPress' > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3907:in `set' > C:/watir_bonus/working/PER/tc_PERwResloution_test.rb:277:in > `test5_ca' > > This is odd since I am not using the 'fireEvent' method in my script nor > do I know what the 'Access is denied' message is all about. > > --Mark > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord > Sent: Tuesday, September 05, 2006 9:32 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Error clicking a button... > > Mark, > > I see that you have some hard-coded sleep statements. This a bad sign. > Can you replace these with calls to $ie.wait? This will probably fix the > > problem you reported as well. > > 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 > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Tue Sep 5 15:56:41 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 05 Sep 2006 14:56:41 -0500 Subject: [Wtr-general] Error clicking a button... In-Reply-To: References: Message-ID: <44FDD679.6060909@pettichord.com> Cain, Mark wrote: > It appears to be a synchronization problem as you described, how do I > fix it? I am using the click_no_wait method to exit the non-modal > window (regular click error ironically enough in wait) and that is where > the synch error occurs. > * cw2.button( ** "Close Window" ** ).click_no_wait $ie.wait* # add this > I am not sure why ie.wait was not working before, I suspect it was not > waiting long enough but can not prove that conclusively. > That answers my question, which really was "what did you see that made you think it didn't work". From Mark_Cain at RL.gov Tue Sep 5 16:11:10 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Tue, 5 Sep 2006 13:11:10 -0700 Subject: [Wtr-general] Error clicking a button... In-Reply-To: <44FDD679.6060909@pettichord.com> Message-ID: I ran this: cw2.button( "Close Window" ).click_no_wait $ie.wait* And got this error: 1) Error: test5_ca(TC_PER_Significant): TypeError: true can't be coerced into Fixnum C:/watir_bonus/working/PER/tc_PER_Significant.rb:261:in `*' C:/watir_bonus/working/PER/tc_PER_Significant.rb:261:in `test5_ca' --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Tuesday, September 05, 2006 12:57 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Error clicking a button... Cain, Mark wrote: > It appears to be a synchronization problem as you described, how do I > fix it? I am using the click_no_wait method to exit the non-modal > window (regular click error ironically enough in wait) and that is where > the synch error occurs. > * cw2.button( ** "Close Window" ** ).click_no_wait $ie.wait* # add this > I am not sure why ie.wait was not working before, I suspect it was not > waiting long enough but can not prove that conclusively. > That answers my question, which really was "what did you see that made you think it didn't work". _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From lisa.crispin at gmail.com Tue Sep 5 16:29:45 2006 From: lisa.crispin at gmail.com (Lisa Crispin) Date: Tue, 5 Sep 2006 14:29:45 -0600 Subject: [Wtr-general] Suite hanging sporadically Message-ID: <63915d6a0609051329u65a047e3he2e135bcd66eb083@mail.gmail.com> Hi, We have a suite of 33 tests with 1474 assertions that takes over 100 minutes to run. I run it every night with --runner=t and -b options. Sometimes it runs just fine, other times it just seems to hang up part way through, it doesn't get an error, it is just sitting there. This happened to me this morning, and I stopped the testrunner and the traceback shows: c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1383:in 'sleep': interrupt from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1383:in 'wait' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2014:in 'click' then it goes on to point to a line of code in one of our modules which is an ie.button click, which never fails when we run just that script (and normally never fails in the suite, either). We ran the tests again and they ran with no problem. I can' t figure out why we're having these sporadic hangings or how to fix them. The hangup occurs in different places. I run the suite with nothing else running on the machine. It's as if watir is dying somehow. This has happened on a couple of different machines, so I don't think it's the particular machine or installation of watir. We have a way to run a much shorter version of the suite; we pass in an option that makes some scripts that would normally loop through 100 or more scenarios just do one each, so that it only takes about 10 minutes. This usually works but every now and then it will also get stuck, usually where a script is using autoit to click a modal dialog button. The scripts never fail when run directly, only sporadically from the suite. We had a lot of trouble getting that modal dialog problem licked, so that one doesn't surprise me so much, but these hangups in other places do. How can I run these problems to earth? This is driving me nuts. I apologize if this isn't much information, but I'm not sure what to look for. thanks Lisa -- Lisa Crispin Co-author, Testing Extreme Programming http://lisa.crispin.home.att.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060905/a913f690/attachment.html From bret at pettichord.com Tue Sep 5 16:56:26 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 05 Sep 2006 15:56:26 -0500 Subject: [Wtr-general] Error clicking a button... In-Reply-To: References: Message-ID: <44FDE47A.2070608@pettichord.com> Remove the "*" The asterisks somehow got inserted into my email as consequence of me quoting your html-email. Bret Cain, Mark wrote: > I ran this: > > cw2.button( "Close Window" ).click_no_wait > > $ie.wait* > > And got this error: > 1) Error: > test5_ca(TC_PER_Significant): > TypeError: true can't be coerced into Fixnum > C:/watir_bonus/working/PER/tc_PER_Significant.rb:261:in `*' > C:/watir_bonus/working/PER/tc_PER_Significant.rb:261:in `test5_ca' > > > From forum-watir-users at openqa.org Tue Sep 5 16:59:20 2006 From: forum-watir-users at openqa.org (CJ) Date: Tue, 05 Sep 2006 15:59:20 CDT Subject: [Wtr-general] no such file to load -- watir (LoadError) In-Reply-To: <79251785.1157473292640.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <78754376.1157489991209.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> The .exe for version 1.4.1 did not work after multiple attempts. Resolution: Installed via the .gem file version 1.5.1.1065 per your suggestion. THANK YOU! --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3949&messageID=10884#10884 From bret at pettichord.com Tue Sep 5 17:13:33 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 05 Sep 2006 16:13:33 -0500 Subject: [Wtr-general] Suite hanging sporadically In-Reply-To: <63915d6a0609051329u65a047e3he2e135bcd66eb083@mail.gmail.com> References: <63915d6a0609051329u65a047e3he2e135bcd66eb083@mail.gmail.com> Message-ID: <44FDE87D.7090306@pettichord.com> Lisa Crispin wrote: > Hi, > We have a suite of 33 tests with 1474 assertions that takes over 100 > minutes to run. I run it every night with --runner=t and -b options. > Sometimes it runs just fine, other times it just seems to hang up part > way through, it doesn't get an error, it is just sitting there. This > happened to me this morning, and I stopped the testrunner and the > traceback shows: > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1383:in 'sleep': interrupt > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1383:in 'wait' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2014:in 'click' > then it goes on to point to a line of code in one of our modules which > is an ie.button click, which never fails when we run just that script > (and normally never fails in the suite, either). First of all, you should look at that line of watir to see what is happening there. I just did that. It is waiting for @ie.busy to be false, which apparently it never will be. In other words, the browser is still loading. > We ran the tests again and they ran with no problem. I can' t figure > out why we're having these sporadic hangings or how to fix them. The > hangup occurs in different places. I run the suite with nothing else > running on the machine. It's as if watir is dying somehow. This has > happened on a couple of different machines, so I don't think it's the > particular machine or installation of watir. > > We have a way to run a much shorter version of the suite; we pass in > an option that makes some scripts that would normally loop through 100 > or more scenarios just do one each, so that it only takes about 10 > minutes. This usually works but every now and then it will also get > stuck, usually where a script is using autoit to click a modal dialog > button. The scripts never fail when run directly, only sporadically > from the suite. We had a lot of trouble getting that modal dialog > problem licked, so that one doesn't surprise me so much, but these > hangups in other places do. > > How can I run these problems to earth? This is driving me nuts. I > apologize if this isn't much information, but I'm not sure what to > look for. > thanks One thing you can do, is add a call to timeout. Bret From jinzhao at ebay.com Tue Sep 5 18:26:32 2006 From: jinzhao at ebay.com (Zhao, Jing) Date: Tue, 5 Sep 2006 16:26:32 -0600 Subject: [Wtr-general] unsubscribe Message-ID: -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060905/881b0d59/attachment.html From knoorani at e-xact.com Tue Sep 5 18:27:51 2006 From: knoorani at e-xact.com (knoorani at e-xact.com) Date: Tue, 5 Sep 2006 15:27:51 -0700 (PDT) Subject: [Wtr-general] Cannot access input element In-Reply-To: <3767.10.1.1.237.1157484229.squirrel@10.1.1.237> References: <3578.10.1.1.237.1157481408.squirrel@10.1.1.237> <44FDCB24.8000000@pettichord.com> <3767.10.1.1.237.1157484229.squirrel@10.1.1.237> Message-ID: <4150.10.1.1.237.1157495271.squirrel@10.1.1.237> Any Suggestions? > No it is a div with absolute position. > >> Sounds like frames to me. True? >> >> knoorani at e-xact.com wrote: >>> Hey all, >>> >>> I have a form which I click on to perform an action. >>> >>> I get a result back from the action and a screen displays with an OK >>> option. >>> >>> Inspecting the code through view source does not show me any input >>> tags, >>> yet when I download Dev tools for firefox and view the generated source >>> I >>> see the elements like >>> >>> >>>
>>> >> type="button">
>>> >>> but if I add >>> ie.button(:value,"OK").click >>> nothing happens >>> >>> Any help would be much appreciated >>> >> _______________________________________________ >> Wtr-general mailing list >> Wtr-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-general >> >> > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From bret at pettichord.com Tue Sep 5 23:13:02 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 05 Sep 2006 22:13:02 -0500 Subject: [Wtr-general] Cannot access input element In-Reply-To: <4150.10.1.1.237.1157495271.squirrel@10.1.1.237> References: <3578.10.1.1.237.1157481408.squirrel@10.1.1.237> <44FDCB24.8000000@pettichord.com> <3767.10.1.1.237.1157484229.squirrel@10.1.1.237> <4150.10.1.1.237.1157495271.squirrel@10.1.1.237> Message-ID: <44FE3CBE.9050807@pettichord.com> knoorani at e-xact.com wrote: > Any Suggestions? Yes, send more info. You said that view source doesn't show the div. What does it show? Can you send it? You said ie.button(:value, "OK").click didn't work. What did it do? Did you get an error? Did it click a different button? Bret From forum-watir-users at openqa.org Wed Sep 6 00:26:23 2006 From: forum-watir-users at openqa.org (MR) Date: Tue, 05 Sep 2006 23:26:23 CDT Subject: [Wtr-general] Newbie Question: Verify and Then Click URL Message-ID: <74448062.1157516814308.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am not sure the best way to do this and am very new to this. I am trying to write a script that will verify that a link is on a page by checking for the URL. Once verified, I want to click on the link. I need to check the URL because the links are dynamic and identified by unique URLs. Thanks in advance. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3965&messageID=10902#10902 From davids at tower-mt.com Wed Sep 6 02:12:56 2006 From: davids at tower-mt.com (David Schmidt) Date: Tue, 05 Sep 2006 23:12:56 -0700 Subject: [Wtr-general] Cannot access input element In-Reply-To: <3767.10.1.1.237.1157484229.squirrel@10.1.1.237> References: <3578.10.1.1.237.1157481408.squirrel@10.1.1.237> <44FDCB24.8000000@pettichord.com> <3767.10.1.1.237.1157484229.squirrel@10.1.1.237> Message-ID: <44FE66E8.3090500@tower-mt.com> The lack of any input tags in a view source is easy to explain. I've found that a view source will only show the *initial* HTML that was sent to the browser. Any changes due to AJAX or Dynamic HTML will not show up in a view source, but will show up using development tools which show you the active DOM. As to why the button isn't being clicked, it isn't clear from the HTML below, but perhaps there is something in the onClick() handler that aborts the effects of the click. One thing I've done in our web scraping applications is to re-write the HTML before clicking to prevent some un-necessary events from firing. David knoorani at e-xact.com wrote: > No it is a div with absolute position. > >> Sounds like frames to me. True? >> >> knoorani at e-xact.com wrote: >> >>> Hey all, >>> >>> I have a form which I click on to perform an action. >>> >>> I get a result back from the action and a screen displays with an OK >>> option. >>> >>> Inspecting the code through view source does not show me any input tags, >>> yet when I download Dev tools for firefox and view the generated source >>> I >>> see the elements like >>> >>> >>>
>>> >> type="button">
>>> >>> but if I add >>> ie.button(:value,"OK").click >>> nothing happens >>> >>> Any help would be much appreciated >>> From zeljko.filipin at gmail.com Wed Sep 6 06:51:02 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 6 Sep 2006 12:51:02 +0200 Subject: [Wtr-general] Newbie Question: Verify and Then Click URL In-Reply-To: <74448062.1157516814308.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <74448062.1157516814308.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: If you have html that looks like Watir Home Page you can verify that link that points to "http://www.openqa.org/watir/" exists with: ie.link(:url, 'http://www.openqa.org/watir/').exists? and you can click it with: ie.link(:url, 'http://www.openqa.org/watir/').click ?eljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060906/79ce88d5/attachment.html From forum-watir-users at openqa.org Wed Sep 6 08:44:53 2006 From: forum-watir-users at openqa.org (MR) Date: Wed, 06 Sep 2006 07:44:53 CDT Subject: [Wtr-general] Newbie Question: Verify and Then Click URL In-Reply-To: Message-ID: <91751473.1157546724592.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am still not able to successfully search for a partial URL. For example, I tried using the .exists? method as such: test_search = 'B8110+002' test_var = ie.link(:url,/test_search).exists? puts test_var It returns false despite the fact that I know a link on the open page contain the following partial url: %2F0%2F0%2F3.0%2F162%2Fnull%2F915&sp=SB8110+002 Thanks again --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3965&messageID=10921#10921 From ravishan at BIWORLDWIDE.com Wed Sep 6 09:22:42 2006 From: ravishan at BIWORLDWIDE.com (Ravishankar, MG) Date: Wed, 6 Sep 2006 08:22:42 -0500 Subject: [Wtr-general] Newbie Question: Verify and Then Click URL Message-ID: <03CAD54D1DFAE5488B6C53178EF9EA3C07041073@EXCHANGE1.biperf.com> try test_var = ie.link(:url,/#{test_search}/).exists? ---- I am still not able to successfully search for a partial URL. For example, I tried using the .exists? method as such: test_search = 'B8110+002' test_var = ie.link(:url,/test_search).exists? puts test_var It returns false despite the fact that I know a link on the open page contain the following partial url: %2F0%2F0%2F3.0%2F162%2Fnull%2F915&sp=SB8110+002 ---- This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you. From zeljko.filipin at gmail.com Wed Sep 6 09:23:37 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 6 Sep 2006 15:23:37 +0200 Subject: [Wtr-general] Newbie Question: Verify and Then Click URL In-Reply-To: <91751473.1157546724592.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <91751473.1157546724592.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Variables inside regular expressions should be inside #{}. Try this: test_var = ie.link(:url,/#{test_search}/).exists? ?eljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060906/7e001639/attachment.html From Bill.Attebery at twtelecom.com Wed Sep 6 09:44:48 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Wed, 6 Sep 2006 07:44:48 -0600 Subject: [Wtr-general] Cannot access input element In-Reply-To: <44FE66E8.3090500@tower-mt.com> Message-ID: <485A27FF1E164B4FB51E2A066D5265A503ED78@SRVMSXMB1.ad.twtelecom.com> I also found that with Ajax that the javascript event handling may get handled by the window object and not the dom. One of our developers was playing with the google ajax tree, I could find the objects in the tree (they were table elements inside a div) that I wanted to click, but there was no onClick event and clicking them through watir didn't work -- I had to use the execScript method of the window object. Seems that this was somehow building the event handler on the fly and clicking through watir API wasn't the same as actually clicking the tree entry manually -- a bit over my head how/why but just fyi. > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David Schmidt > Sent: Wednesday, September 06, 2006 12:13 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Cannot access input element > > The lack of any input tags in a view source is easy to > explain. I've found that a view source will only show the > *initial* HTML that was sent to the browser. Any changes due > to AJAX or Dynamic HTML will not show up in a view source, > but will show up using development tools which show you the > active DOM. > > As to why the button isn't being clicked, it isn't clear from > the HTML below, but perhaps there is something in the > onClick() handler that aborts the effects of the click. One > thing I've done in our web scraping applications is to > re-write the HTML before clicking to prevent some > un-necessary events from firing. > > David > > knoorani at e-xact.com wrote: > > No it is a div with absolute position. > > > >> Sounds like frames to me. True? > >> > >> knoorani at e-xact.com wrote: > >> > >>> Hey all, > >>> > >>> I have a form which I click on to perform an action. > >>> > >>> I get a result back from the action and a screen displays > with an OK > >>> option. > >>> > >>> Inspecting the code through view source does not show me > any input > >>> tags, yet when I download Dev tools for firefox and view the > >>> generated source I see the elements like > >>> > >>> > >>>
> >>> class="cancel_button" > >>> type="button">
> >>> > >>> but if I add > >>> ie.button(:value,"OK").click > >>> nothing happens > >>> > >>> Any help would be much appreciated > >>> > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. From aslak.hellesoy at gmail.com Wed Sep 6 10:06:07 2006 From: aslak.hellesoy at gmail.com (aslak hellesoy) Date: Wed, 6 Sep 2006 16:06:07 +0200 Subject: [Wtr-general] RSpec and Watir Message-ID: <8d961d900609060706h29ab680egd908a18321dffbe2@mail.gmail.com> Hi all, (Sorry for cross-posting - please reply to only one list, preferrably wtr-general) I just started on a project where it looks like we might start using Watir. I just whipped up a little example and some doco about how to (and why) use RSpec with Watir. It's in RSpec's subversion under trunk/vendor/watir http://rubyforge.org/scm/?group_id=797 http://rubyforge.org/plugins/scmsvn/viewcvs.php/trunk/vendor/watir/?root=rspec There is a README where I try explain some of the benefits of the RSpec/Watir combo - from a user/qa/tester perspective. RSpec's specdoc feature, documentation and communication is key here. Please take a look and give some feedback. I'd like to put this up on RSpec's web page soon. Aslak From forum-watir-users at openqa.org Wed Sep 6 10:16:01 2006 From: forum-watir-users at openqa.org (MR) Date: Wed, 06 Sep 2006 09:16:01 CDT Subject: [Wtr-general] Newbie Question: Verify and Then Click URL In-Reply-To: Message-ID: <82722359.1157552207030.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks again. For some reason it is still not working. When I view the source code of the page, I definitely see what appears to be a url containing my regular expression. And, when I copy the shortcut in a browser and paste it into a text editor, the shortcut contains the regular expression that I am searching for. I believe the link is contained in a table of data with the link performing actions according to what row it is in. Could that be the root of my difficulties. Sorry for being such a neophyte --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3965&messageID=10926#10926 From shsnyder at us.ibm.com Wed Sep 6 10:20:33 2006 From: shsnyder at us.ibm.com (Scott H Snyder) Date: Wed, 6 Sep 2006 10:20:33 -0400 Subject: [Wtr-general] WATIR for Rich Internet Applications using Eclipse RCP ? Message-ID: An increasing number of the products that I am looking at are being implemented using Eclipse RCP and are not solely browser based. Has there been any thoughts or discussions of extending WATIR to support exercising the UI of Eclipse based RCP (Rich Client Platform) applications? There are some tools that support this but they are either commercial or very tightly integrated into the Eclipse framework. I would very interested in working with a lightweight library, such as WATIR, that would make RCP application testing as easy and accessable as IE (browser) based web testing. Just wondering, Scott "The supreme misfortune is when theory outstrips performance." "There are three classes of people. Those who see; those who see when they are shown; those who do not see." - Leonardo da Vinci Scott Snyder IBM Performance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060906/3989c7c4/attachment-0001.html From zeljko.filipin at gmail.com Wed Sep 6 10:21:25 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 6 Sep 2006 16:21:25 +0200 Subject: [Wtr-general] Newbie Question: Verify and Then Click URL In-Reply-To: <82722359.1157552207030.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <82722359.1157552207030.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Please post html snippet relevant to this problem, your code (just a snippet, too), and error (and any other) messages, if any. Thanks, ?eljko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060906/7a11cf43/attachment.html From amlu01 at yahoo.com Wed Sep 6 10:33:10 2006 From: amlu01 at yahoo.com (amol deshpande) Date: Wed, 6 Sep 2006 07:33:10 -0700 (PDT) Subject: [Wtr-general] Newbie Question: Verify and Then Click URL In-Reply-To: <03CAD54D1DFAE5488B6C53178EF9EA3C07041073@EXCHANGE1.biperf.com> Message-ID: <20060906143310.1090.qmail@web36802.mail.mud.yahoo.com> HI, try putting the URL in a string and then do the assert. strUrl="www.google.com" assert(strUrl.include?"google") Hope this helps. Amol --- "Ravishankar, MG" wrote: > > try > > test_var = ie.link(:url,/#{test_search}/).exists? > > ---- > I am still not able to successfully search for a > partial URL. For > example, I tried using the .exists? method as such: > > test_search = 'B8110+002' > test_var = ie.link(:url,/test_search).exists? > puts test_var > > It returns false despite the fact that I know a link > on the open page > contain the following partial url: > > %2F0%2F0%2F3.0%2F162%2Fnull%2F915&sp=SB8110+002 > ---- > > This e-mail message is being sent solely for use by > the intended recipient(s) and may contain > confidential information. Any unauthorized review, > use, disclosure or distribution is prohibited. If > you are not the intended recipient, please contact > the sender by phone or reply by e-mail, delete the > original message and destroy all copies. Thank you. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > No Body Has ever Collided With The Sky...So Sky Is The Limit! __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From aidy.rutter at gmail.com Wed Sep 6 10:40:05 2006 From: aidy.rutter at gmail.com (aidy rutter) Date: Wed, 6 Sep 2006 15:40:05 +0100 Subject: [Wtr-general] Count number of tables in HTML page Message-ID: <859d18f20609060740q1ba2525ax42ea0f434339c277@mail.gmail.com> Hi, I have a number of tables with an ID="SearchResults". Is it possible to count the number of tables with this ID? Cheers Aidy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060906/695d0ac1/attachment.html From forum-watir-users at openqa.org Wed Sep 6 10:52:04 2006 From: forum-watir-users at openqa.org (MR) Date: Wed, 06 Sep 2006 09:52:04 CDT Subject: [Wtr-general] Newbie Question: Verify and Then Click URL In-Reply-To: Message-ID: <77638550.1157554355094.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I believe that the link that I am trying to identify generates a shortcut based on nearby table data. For example, if I view the page in a browser and hold the mouse over the link, I do NOT see the regular expression ('B8110+002')that I am searching for. If, however, I view the source code, I see the regular expression within a url that appears as such: [add] CODE snippet: test_search = 'B8110+002' puts test_search test_var = ie.link(:url,/#{linkForClass}/).exists? puts test_var This outputs: B8110+002 false I iterated through the tables in the page. It appears that the table that I am searching for a link within doesn't have an ID or name. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3965&messageID=10933#10933 From forum-watir-users at openqa.org Wed Sep 6 10:54:32 2006 From: forum-watir-users at openqa.org (MR) Date: Wed, 06 Sep 2006 09:54:32 CDT Subject: [Wtr-general] Newbie Question: Verify and Then Click URL In-Reply-To: <77638550.1157554355094.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <80569144.1157554502595.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> CODE snippet: test_search = 'B8110+002' puts test_search test_var = ie.link(:url,/#{test_search}/).exists? puts test_var This outputs: B8110+002 false I iterated through the tables in the page. It appears that the table that I am searching for a link within doesn't have an ID or name. Message was edited by: mhr2x --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3965&messageID=10934#10934 From forum-watir-users at openqa.org Wed Sep 6 11:38:29 2006 From: forum-watir-users at openqa.org (MR) Date: Wed, 06 Sep 2006 10:38:29 CDT Subject: [Wtr-general] Click Link In Table Based on Row and Column Numbers Message-ID: <88653545.1157557140506.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> This is a rephrased question because i realized what i was asking before didn't capture what i was trying to do. Basically, I need to click on a link that may or may not exist in a table. The table doesn't have an ID, but I do know that it is the second table on the page. I need to indentify the possible link by contents in the same row. For example, I want to search the table for rows that contain 'Column1Data' and 'Column2Data' in columns 1 and 2. Once I find this data, I want to click on a link in the same row, but in column three IF it exists. This link may not exist. Thanks again This is in reference to this thread: http://forums.openqa.org/thread.jspa?threadID=3965&tstart=0 --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3981&messageID=10937#10937 From forum-watir-users at openqa.org Wed Sep 6 11:39:49 2006 From: forum-watir-users at openqa.org (MR) Date: Wed, 06 Sep 2006 10:39:49 CDT Subject: [Wtr-general] Newbie Question: Find and Click Link Based on Partial URL In-Reply-To: <74448062.1157516814308.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <74187266.1157557219420.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for your help. My question, I now realize, is different from the one which I started with. As such, I started a new thread so that topics are parsimonious. It is here: http://forums.openqa.org/thread.jspa?threadID=3981&tstart=0 --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3965&messageID=10938#10938 From christopher.mcmahon at gmail.com Wed Sep 6 11:49:00 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 6 Sep 2006 08:49:00 -0700 Subject: [Wtr-general] WATIR for Rich Internet Applications using Eclipse RCP ? In-Reply-To: References: Message-ID: <72799cd70609060849s35147881r5a8a1cda3d022b40@mail.gmail.com> > > I would very interested in working with a lightweight library, such as > WATIR, that would make RCP application testing as easy and accessable as IE > (browser) based web testing. > http://rubyforge.org/projects/guitest/ http://raa.ruby-lang.org/list.rhtml?name=win32-guitest Neither of them are as robust as Perl's Win32::GuiTest module, but they're a good place to start. The rubyforge project was a great start that petered out. Someone reasonably well-motivated should be able to pick up that code and run with it. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060906/298b94be/attachment.html From christopher.mcmahon at gmail.com Wed Sep 6 12:04:36 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 6 Sep 2006 09:04:36 -0700 Subject: [Wtr-general] Count number of tables in HTML page In-Reply-To: <859d18f20609060740q1ba2525ax42ea0f434339c277@mail.gmail.com> References: <859d18f20609060740q1ba2525ax42ea0f434339c277@mail.gmail.com> Message-ID: <72799cd70609060904v558beddkb25072706c7a8bc6@mail.gmail.com> On 9/6/06, aidy rutter wrote: > > Hi, > > I have a number of tables with an ID="SearchResults". > > Is it possible to count the number of tables with this ID? > Here's a goofy way to do it. Someone else might have a better suggestion: raw_data = ie.html silly_array = rawdata.split(/ID=SearchResults/) number_of_tables = silly_array.length - 1 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060906/eab9a741/attachment.html From Bill.Attebery at twtelecom.com Wed Sep 6 12:05:45 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Wed, 6 Sep 2006 10:05:45 -0600 Subject: [Wtr-general] Click Link In Table Based on Row and Column Numbers In-Reply-To: <88653545.1157557140506.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <485A27FF1E164B4FB51E2A066D5265A503ED7C@SRVMSXMB1.ad.twtelecom.com> One way I can think of - not necessarily the best, based on some posts I've seen there seems to be the concept of cell in 1.5 that I haven't been able to try. But for what it's worth I think this would work. if ie.table(:index, 2).exists? row_count=ie.table(:index, 2).row_count unless row_count == nil for i in 1..row_count #assumes you're looking for data that is displayed in the browser as text, use a different attribute if not #could also use regexp ie.table(:index, 2)[i][1].text ~= /ColumnData/ if (ie.table(:index, 2)[i][1].text == 'Column1Data' and ie.table(:index, 2)[i][2].text == 'Column2Data') ie.table(:index, 2)[i][3].click break end end end else puts "table not found" end > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of MR > Sent: Wednesday, September 06, 2006 9:38 AM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] Click Link In Table Based on Row and > Column Numbers > > This is a rephrased question because i realized what i was > asking before didn't capture what i was trying to do. > Basically, I need to click on a link that may or may not > exist in a table. The table doesn't have an ID, but I do know > that it is the second table on the page. I need to indentify > the possible link by contents in the same row. For example, I > want to search the table for rows that contain 'Column1Data' > and 'Column2Data' in columns 1 and 2. Once I find this data, > I want to click on a link in the same row, but in column > three IF it exists. This link may not exist. > > Thanks again > > This is in reference to this thread: > http://forums.openqa.org/thread.jspa?threadID=3965&tstart=0 > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=3981&messageID=1 > 0937#10937 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. From knoorani at e-xact.com Wed Sep 6 12:30:39 2006 From: knoorani at e-xact.com (knoorani at e-xact.com) Date: Wed, 6 Sep 2006 09:30:39 -0700 (PDT) Subject: [Wtr-general] Cannot access input element In-Reply-To: <44FE3CBE.9050807@pettichord.com> References: <3578.10.1.1.237.1157481408.squirrel@10.1.1.237> <44FDCB24.8000000@pettichord.com> <3767.10.1.1.237.1157484229.squirrel@10.1.1.237> <4150.10.1.1.237.1157495271.squirrel@10.1.1.237> <44FE3CBE.9050807@pettichord.com> Message-ID: <1437.10.1.1.237.1157560239.squirrel@10.1.1.237> the script is written such that it clicks a form and this causes the a new screen to "popup". The new "popup" is not javascript but a div with absolute positioning. When I view source I see the code for the screen in the background. When I view generated source I see the div. adding the code gives me this error: c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1928:in `assert_exists': U nable to locate object, using value and OK (Watir::Exception::UnknownObjectExcep tion) from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:2009:in `clic k' from tescase.rb:51 Thanks, Karim > knoorani at e-xact.com wrote: >> Any Suggestions? > Yes, send more info. > > You said that view source doesn't show the div. What does it show? Can > you send it? > > You said ie.button(:value, "OK").click didn't work. What did it do? Did > you get an error? Did it click a different button? > > Bret > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From davids at tower-mt.com Wed Sep 6 13:13:29 2006 From: davids at tower-mt.com (David Schmidt) Date: Wed, 06 Sep 2006 10:13:29 -0700 Subject: [Wtr-general] Newbie Question: Verify and Then Click URL In-Reply-To: <77638550.1157554355094.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <77638550.1157554355094.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <44FF01B9.2090701@tower-mt.com> I see the problem here. In a regular expression the '+' character has special meaning. It indicates in this case that the previous character can be repeated one or more times. Thus, your regular expression would have matched "B8110002" or even "B81100000002", but won't match a URL with a plus sign in the middle. Try changing your test_search to 'B8110\+002'. That should work: irb(main):010:0> url = "blah blah B8110+002 blah blah" => "blah blah B8110+002 blah blah" irb(main):011:0> test_search = 'B8110\+002' => "B8110\\+002" irb(main):012:0> url =~ /#{test_search}/ => 10 irb(main):013:0> Also, a good way to test Watir is to run it from within IRB in an interactive mode: C:\Documents and Settings\davids>irb irb(main):001:0> require 'watir' => true irb(main):002:0> include Watir => Object irb(main):003:0> ie = IE.new => # ie.goto('www.google.com') => 1.235 irb(main):005:0> ie.show_all_objects -----------Objects in page ------------- etc. MR wrote: > I believe that the link that I am trying to identify generates a shortcut based on nearby table data. For example, if I view the page in a browser and hold the mouse over the link, I do NOT see the regular expression ('B8110+002')that I am searching for. If, however, I view the source code, I see the regular expression within a url that appears as such: > > [add] > > CODE snippet: > > test_search = 'B8110+002' > puts test_search > test_var = ie.link(:url,/#{linkForClass}/).exists? > puts test_var > > This outputs: > B8110+002 > false > > I iterated through the tables in the page. It appears that the table that I am searching for a link within doesn't have an ID or name. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=3965&messageID=10933#10933 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Wed Sep 6 14:23:30 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 06 Sep 2006 13:23:30 -0500 Subject: [Wtr-general] Count number of tables in HTML page In-Reply-To: <859d18f20609060740q1ba2525ax42ea0f434339c277@mail.gmail.com> References: <859d18f20609060740q1ba2525ax42ea0f434339c277@mail.gmail.com> Message-ID: <44FF1222.9030601@pettichord.com> aidy rutter wrote: > I have a number of tables with an ID="SearchResults". > > Is it possible to count the number of tables with this ID? ie.tables.select{|t| t.id == 'SearchResults'}.length Our collections include the Ruby "Enumerable" module. That's what allows you to do this and lots of other cool things. Bret From davids at tower-mt.com Wed Sep 6 14:31:09 2006 From: davids at tower-mt.com (David Schmidt) Date: Wed, 06 Sep 2006 11:31:09 -0700 Subject: [Wtr-general] Click Link In Table Based on Row and Column Numbers In-Reply-To: <485A27FF1E164B4FB51E2A066D5265A503ED7C@SRVMSXMB1.ad.twtelecom.com> References: <485A27FF1E164B4FB51E2A066D5265A503ED7C@SRVMSXMB1.ad.twtelecom.com> Message-ID: <44FF13ED.6080705@tower-mt.com> Be warned that this method will only work if there are no sub-tables contained in the rows searched. This is because row_count will show the number of rows in a single table, but ie.table[row][column] will find every row located in OR BELOW that table. So, if the cell at ie.table[1][1] contained a table with 2 rows then ie.table[2][1] would be the first row of the sub-table, NOT the 2'nd row in ie.table. David Attebery, Bill wrote: > One way I can think of - not necessarily the best, based on some posts > I've seen there seems to be the concept of cell in 1.5 that I haven't > been able to try. But for what it's worth I think this would work. > > if ie.table(:index, 2).exists? > row_count=ie.table(:index, 2).row_count > unless row_count == nil > for i in 1..row_count > #assumes you're looking for data that is displayed in the > browser as text, use a different attribute if not > #could also use regexp ie.table(:index, 2)[i][1].text ~= > /ColumnData/ > if (ie.table(:index, 2)[i][1].text == 'Column1Data' and > ie.table(:index, 2)[i][2].text == 'Column2Data') > ie.table(:index, 2)[i][3].click > break > end > end > end > else > puts "table not found" > end > > >> -----Original Message----- >> From: wtr-general-bounces at rubyforge.org >> [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of MR >> Sent: Wednesday, September 06, 2006 9:38 AM >> To: wtr-general at rubyforge.org >> Subject: [Wtr-general] Click Link In Table Based on Row and >> Column Numbers >> >> This is a rephrased question because i realized what i was >> asking before didn't capture what i was trying to do. >> Basically, I need to click on a link that may or may not >> exist in a table. The table doesn't have an ID, but I do know >> that it is the second table on the page. I need to indentify >> the possible link by contents in the same row. For exampl