From ati.ozgur at gmail.com Sat Jan 1 09:11:24 2005 From: ati.ozgur at gmail.com (Atilla Ozgur) Date: Sat, 1 Jan 2005 16:11:24 +0200 Subject: [Wtr-general] Link- Patch- Asp.Net Message-ID: I am using watir to test asp.net pages. Since I am writing underlying server side code, I am almost exclusively using ID attribute to reach html objects. I need this code to be included in getLink method. when :text ...... # patch starts when :id links.each do |thisLink| if thisLink.invoke("id") == what link = thisLink if link == nil end end # patch ends.. I have copied and pasted this code from watir itself. What is the guidelines for submitting patches to project? Should I add unit test to link_test also? Thank you for your time. From paul.rogers at shaw.ca Sat Jan 1 13:32:23 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sat, 01 Jan 2005 11:32:23 -0700 Subject: [Wtr-general] releases In-Reply-To: <41D4E902.8030808@clabs.org> Message-ID: <002c01c4f030$3c3eedb0$6400a8c0@NewDell> I think we should start with a 1.0 as Chris suggests. The watir code has been around awhile now, so should be bug free (hahahaha!!!) I think the outstanding things are add some detail to the exceptions ( what failed and why) clean up the winClickers code create an installer ( where do libraries usually go ? \ruby\lib\site-ruby\1.8 ?? ) where do the docs, unittests, samples go? add the patch that Atilla Ozgur posted anything else? Since its likely to be -20degrees C here for the next week, I may get most of this done in the next few days. Did it really snow in Texas? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris Morris Sent: 30 December 2004 22:52 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] releases Bret Pettichord wrote: > I'd like to see us make a release of watir real soon. I'd like to see > them happen every week or two actually. > > I may do it myself as soon as i get caught up on mail and resynced > with this project. > > I suggest we call the first release 0.1.0 and then 0.1.1 etc. At some > point when we have something that Paul is happy with we can give it a > much bigger number like 0.2.0 or even higher. I'm personally more a fan of starting at 1.0 these days, unless we've (and when I say 'we' I mean 'y'all' :-) got a clear plan on what milestone constitutes a 1.0 and there's a good reason for some end-users to wait until 1.0. Otherwise we just keep inching towards 1.0 forever and ever, then you finally muster up the courage to go 1.0, and then, oops, there came 3 bugs, and now we've 'ruined' it and are at 1.01. :-) That or merely a date based release number scheme (2004.12.30) or (2004.363) (363rd day of the year). My half-pence. -- Chris http://clabs.org/blogki _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From faught at tejasconsulting.com Sat Jan 1 13:47:06 2005 From: faught at tejasconsulting.com (Danny R. Faught) Date: Sat, 01 Jan 2005 12:47:06 -0600 Subject: [Wtr-general] browser-based testing survey published In-Reply-To: <002c01c4f030$3c3eedb0$6400a8c0@NewDell> References: <002c01c4f030$3c3eedb0$6400a8c0@NewDell> Message-ID: <41D6F02A.9050907@tejasconsulting.com> Yesterday I posted my survey of browser-based testing tools on Open Testware Reviews, which includes Watir and sample code for a test that's coded using both Watir and Samie. I'd like to get your feedback. If you're willing to take a look, let me know, and I'll set up you with a trial subscription to Open Testware Reviews. -- Danny R. Faught Tejas Software Consulting http://tejasconsulting.com/ From chrismo at clabs.org Sun Jan 2 12:24:50 2005 From: chrismo at clabs.org (Chris Morris) Date: Sun, 02 Jan 2005 11:24:50 -0600 Subject: [Wtr-general] releases In-Reply-To: <002c01c4f030$3c3eedb0$6400a8c0@NewDell> References: <002c01c4f030$3c3eedb0$6400a8c0@NewDell> Message-ID: <41D82E62.2010404@clabs.org> Paul Rogers wrote: >Did it really snow in Texas? > > Yeup, on Christmas even (well, a few days before, though it still hadn't all melted by the 25th). All in all, in the DFW area, it's not /that/ unusual ... we generally have one snow/ice storm event, though not always, and usually in Jan or Feb. Of course that same storm brought snow to Houston, IIRC, which is a lot more unusual, being farther south and on the coast. -- Chris http://clabs.org/blogki From paul.rogers at shaw.ca Sun Jan 2 20:49:13 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 02 Jan 2005 18:49:13 -0700 Subject: [Wtr-general] Link- Patch- Asp.Net In-Reply-To: Message-ID: <001401c4f136$6d66fb10$6400a8c0@NewDell> Thanks for submitting this. Ive added it into watir. Ive added tests and chenged the html too I havent checked it in as Im doing a bunch of other changes too. Watir was developed almost entirely as test first development ( or tdd or what ever you choose to call it) . So if we want to add a new feature, we also need to have unit tests. This implies we also need html to run against. I guess to submit a patch, just post it as you did, but please add tests and html too. Thanks Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Atilla Ozgur Sent: 01 January 2005 07:11 To: wtr-general at rubyforge.org Subject: [Wtr-general] Link- Patch- Asp.Net I am using watir to test asp.net pages. Since I am writing underlying server side code, I am almost exclusively using ID attribute to reach html objects. I need this code to be included in getLink method. when :text ...... # patch starts when :id links.each do |thisLink| if thisLink.invoke("id") == what link = thisLink if link == nil end end # patch ends.. I have copied and pasted this code from watir itself. What is the guidelines for submitting patches to project? Should I add unit test to link_test also? Thank you for your time. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From jkohl at telusplanet.net Sun Jan 2 20:54:53 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Sun, 2 Jan 2005 18:54:53 -0700 Subject: [Wtr-general] Link- Patch- Asp.Net In-Reply-To: <001401c4f136$6d66fb10$6400a8c0@NewDell> Message-ID: <20050103015337.TUS15387.priv-edtnes40.telusplanet.net@tintin> Thanks Paul. Chris McMahon had mentioned that he would like to have "id" attributes for most tags. I think it would be a good idea to support the id attribute for any tag that can have one. -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of Paul Rogers > Sent: January 2, 2005 6:49 PM > To: wtr-general at rubyforge.org > Subject: RE: [Wtr-general] Link- Patch- Asp.Net > > Thanks for submitting this. Ive added it into watir. Ive added tests and > chenged the html too > I havent checked it in as Im doing a bunch of other changes too. > > Watir was developed almost entirely as test first development ( or tdd > or what ever you choose to call it) . So if we want to add a new > feature, we also need to have unit tests. This implies we also need html > to run against. > > I guess to submit a patch, just post it as you did, but please add tests > and html too. > > Thanks > > Paul > > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Atilla Ozgur > Sent: 01 January 2005 07:11 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] Link- Patch- Asp.Net > > > I am using watir to test asp.net pages. Since I am writing underlying > server side code, I am almost exclusively using ID attribute to reach > html objects. I need this code to be included in getLink method. > when :text > ...... > # patch starts > when :id > links.each do |thisLink| > if thisLink.invoke("id") == what > link = thisLink if link == nil > end > end > # patch ends.. > > I have copied and pasted this code from watir itself. What is the > guidelines for submitting patches to project? Should I add unit test to > link_test also? > > Thank you for your time. _______________________________________________ > 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 paul.rogers at shaw.ca Sun Jan 2 21:04:32 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 02 Jan 2005 19:04:32 -0700 Subject: [Wtr-general] Link- Patch- Asp.Net In-Reply-To: <20050103015337.TUS15387.priv-edtnes40.telusplanet.net@tintin> Message-ID: <001501c4f138$90efbe30$6400a8c0@NewDell> This is the list of tags tht support id. Get typing ;-) STYLE, A, ACRONYM, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BDO, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, CUSTOM, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAME, FRAMESET, HEAD, hn, HR, HTML, I, IFRAME, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=hidden, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, INS, ISINDEX, KBD, LABEL, LEGEND, LI, LINK, LISTING, MAP, MARQUEE, MENU, nextID, NOBR, NOFRAMES, NOSCRIPT, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, Q, RT, RUBY, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, styleSheet, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, WBR, XML, XMP Not all of them apply, so maybe its not too bad. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jonathan Kohl Sent: 02 January 2005 18:55 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Link- Patch- Asp.Net Thanks Paul. Chris McMahon had mentioned that he would like to have "id" attributes for most tags. I think it would be a good idea to support the id attribute for any tag that can have one. -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of Paul Rogers > Sent: January 2, 2005 6:49 PM > To: wtr-general at rubyforge.org > Subject: RE: [Wtr-general] Link- Patch- Asp.Net > > Thanks for submitting this. Ive added it into watir. Ive added tests > and chenged the html too I havent checked it in as Im doing a bunch of > other changes too. > > Watir was developed almost entirely as test first development ( or tdd > or what ever you choose to call it) . So if we want to add a new > feature, we also need to have unit tests. This implies we also need > html to run against. > > I guess to submit a patch, just post it as you did, but please add > tests and html too. > > Thanks > > Paul > > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Atilla Ozgur > Sent: 01 January 2005 07:11 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] Link- Patch- Asp.Net > > > I am using watir to test asp.net pages. Since I am writing underlying > server side code, I am almost exclusively using ID attribute to reach > html objects. I need this code to be included in getLink method. > when :text > ...... > # patch starts > when :id > links.each do |thisLink| > if thisLink.invoke("id") == what > link = thisLink if link == nil > end > end > # patch ends.. > > I have copied and pasted this code from watir itself. What is the > guidelines for submitting patches to project? Should I add unit test > to link_test also? > > Thank you for your time. > _______________________________________________ > 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 paul.rogers at shaw.ca Mon Jan 3 00:04:51 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 02 Jan 2005 22:04:51 -0700 Subject: [Wtr-general] Watir changes In-Reply-To: <001501c4f138$90efbe30$6400a8c0@NewDell> Message-ID: <001701c4f151$c1b89140$6400a8c0@NewDell> Ive just checked in lots of changes. Watir now has an installer. The files now goto the C:\ruby\lib\ruby\site_ruby\1.8 directory I think this will be better in the long run, although it's a pain now. To use watir, in a test you will have to do: require 'watir/watir' But you don't need to worry about setting the path up anymore So all the unit tests have changed! Ive added some better exception information. Added the patch Atilla sent out To use the installer, cd to where ever you downloaded. install.rb That's it! ** Ive also removed the code that deals with new windows. Its sort of still there - look at the new_winwow_test.rb to see Basically you have to switch on the code to handle new windows. This was breaking when used in irb, and Jonathan is writing an article for Better Software about watir, and the article is much nicer if we can demonstrate watir and irb Please let me know how this works. Jonathan has already suggested some changes to the installer, which I may get to eventually. If this works ok in the next few days I think we should consider this to be the 1.0 release of watir Paul Ps - does anyone use the clickers under cygwin? Looks like they are broken because of the paths. I'll fix soon Happy New Year Everyone and Thanks for your contributions in 2004! From paul.rogers at shaw.ca Mon Jan 3 00:09:40 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 02 Jan 2005 22:09:40 -0700 Subject: [Wtr-general] FW: no buttons to do a submit In-Reply-To: <20041230173923.IALR25352.priv-edtnes46.telusplanet.net@tintin> Message-ID: <001801c4f152$6dcd4d40$6400a8c0@NewDell> In this case I think you can do something like: $ie.form(:index, "2").button(:caption, "Submit").clcik Or $ie.form(:index, "2").submit There is code in the form object to find it based on index, so it should work.... -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jonathan Kohl Sent: 30 December 2004 10:41 To: wtr-general at rubyforge.org Subject: [Wtr-general] FW: no buttons to do a submit Forwarding to the list... -----Original Message----- From: Jonathan Kohl [mailto:jonathan at kohl.ca] Sent: December 30, 2004 8:34 AM To: 'Mike at MichaelDKelly.com' Subject: RE: [Wtr-general] User guide Michael; What Watir does in this case is to just submit the form. I'll have to dig out the code that can do this and add it to the User Guide. On the BookPool page, the Forms don't have unique identifiers as tag attributes, so it makes things harder. Still doable, but harder. On amazon.com, the "Go" button after the Search input field is in two different forms that are easily identifiable. The first one:
is different from the second one: On BookPool, the first form looks like this: While the second looks like this: So we will have to do something different to distinguish one form from the other. In the DOM, elements are stored in arrays, so if we can't do anything else, we can access it by its form array element in the DOM like this: foo = $ie.getIE().document.forms and do a submit on the ith element in the forms array, where "i" is the form we want. I had to do this on a couple of e-commerce pages with WTR, but I haven't done it with Watir yet. I'll look into it and get back to you on how best to handle it. Thanks; -Jonathan > -----Original Message----- > From: Michael Kelly [mailto:Mike at MichaelDKelly.com] > Sent: December 30, 2004 7:55 AM > To: jonathan at kohl.ca > Subject: Re: [Wtr-general] User guide > > Jonathan, > > The user guide mentions using the Enter/Return key to select a button > or image, but it does not show me how. You might want to add something > on this. I could use it in this situation. > > Thanks, > Mike _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Mon Jan 3 00:10:58 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 02 Jan 2005 22:10:58 -0700 Subject: [Wtr-general] click images and text In-Reply-To: <20041230173944.HYMU17618.priv-edtnes40.telusplanet.net@tintin> Message-ID: <001901c4f152$9caf4140$6400a8c0@NewDell> Er, I think we can actually click an image. $ie.image(:src, /car.jpg/).click() For example, should work. I think there is a unit test in the images_test.rb Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jonathan Kohl Sent: 30 December 2004 10:41 To: wtr-general at rubyforge.org Subject: FW: [Wtr-general] click images and text Forwarding to the list... -----Original Message----- From: Jonathan Kohl [mailto:jonathan at kohl.ca] Sent: December 30, 2004 9:55 AM To: 'Mike at MichaelDKelly.com' Subject: RE: [Wtr-general] User guide Currently we can only click an image that is in a form, and acting like a form button. Since plain images and text don't trigger events in the DOM like form buttons, hyperlinks, etc., they don't have associated methods in Windows OLE interface (which is what Watir uses). Does that make sense? Basically if a click event triggers an action, it is supported, but we can't click on plain text or images that don't do anything. Paul and I have talked about clicking on any object in a page, even if it doesn't have an event tied to it like the other objects do, but that hasn't been implemented yet. The Image methods you are seeing in RDoc were added for verification actions. We use the fact of whether an image has loaded or not to ensure the correct action has taken place. I would like to be able to click on any object using Watir in case text or an image has a JavaScript fireEvent() hooked to it for a mouseover to cause a drop down menu to appear. The only reason I've found to click an image that isn't doing a FORM submit or on plain text is to trigger JS events. Can you think of other reasons? We should get a story page or wishlist page up and running for Watir soon so that feature requests can be submitted. I've been working on that, and Bret has some ideas. Thanks; -Jonathan > -----Original Message----- > From: Michael Kelly [mailto:Mike at MichaelDKelly.com] > Sent: December 30, 2004 9:06 AM > To: Jonathan Kohl > Subject: RE: [Wtr-general] User guide > > Is the RDoc up to date? I'm looking at Image and the only methods it > shows are "hasLoaded?" and "new". How do I click an image? > > Thanks, > Mike > > ---- Original message ---- > >Date: Thu, 30 Dec 2004 08:34:13 -0700 > >From: "Jonathan Kohl" > >Subject: RE: [Wtr-general] User guide > >To: > > > >Michael; > > > >What Watir does in this case is to just submit the form. > I'll have to dig > >out the code that can do this and add it to the User Guide. > > > >On the BookPool page, the Forms don't have unique > identifiers as tag > >attributes, so it makes things harder. Still doable, but > harder. > > > >On amazon.com, the "Go" button after the Search input field > is in two > >different forms that are easily identifiable. The first > one: >method="post" action="/exec/obidos/search-handle-form/102- > 8258892-7883346" > >name="searchform"> > >is different from the second one: > > >action="/exec/obidos/search-handle-form/102-8258892- > 7883346"> > > > >On BookPool, the first form looks like this: > > > >While the second looks like this: > > > > > >So we will have to do something different to distinguish > one form from the > >other. In the DOM, elements are stored in arrays, so if we > can't do anything > >else, we can access it by its form array element in the DOM > like this: > >foo = $ie.getIE().document.forms > >and do a submit on the ith element in the forms array, > where "i" is the form > >we want. > > > >I had to do this on a couple of e-commerce pages with WTR, > but I haven't > >done it with Watir yet. I'll look into it and get back to > you on how best to > >handle it. > > > >Thanks; > > > >-Jonathan > > > >> -----Original Message----- > >> From: Michael Kelly [mailto:Mike at MichaelDKelly.com] > >> Sent: December 30, 2004 7:55 AM > >> To: jonathan at kohl.ca > >> Subject: Re: [Wtr-general] User guide > >> > >> Jonathan, > >> > >> The user guide mentions using the Enter/Return key to > select > >> a button or image, but it does not show me how. You might want to > >> add something on this. I could use it in this situation. > >> > >> Thanks, > >> Mike > > > > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Mon Jan 3 00:12:48 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 02 Jan 2005 22:12:48 -0700 Subject: [Wtr-general] Another feature request: address multiple windowsbytitle? In-Reply-To: <20041229210857.IXGL15878.priv-edtnes27.telusplanet.net@tintin> Message-ID: <001a01c4f152$de06b3d0$6400a8c0@NewDell> If I can find a way to attach to an existing IE window using OLE (I have a few ideas, just havent tried them) this becomes easy. Until then.... -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jonathan Kohl Sent: 29 December 2004 14:10 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Another feature request: address multiple windowsbytitle? I would also like that feature. -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of McMahon, Chris > Sent: December 29, 2004 1:55 PM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] Another feature request: address multiple > windows bytitle? > > > > Assume File.html and window2.html on the same directory like so: > > ################################################################## > > > Window 1 Title > > Window2 > ################################################################## > > > Window 222222 Title > > This text. ######################################################### > > It would be nifty to be able to something like > > assert($ie.page "Window 222222 Title" ContainsText("This text") ) > > Just a thought... > -Chris > > > > ______________________________________________________________________ > ____ > ________________ > This electronic message may contain proprietary and confidential > information of Verint Systems Inc., its affiliates and/or subsidiaries. > The information is intended to be for the use of the individual(s) or > entity(ies) named above. If you are not the intended recipient (or > authorized to receive this e-mail for the intended recipient), you may not > use, copy, disclose or distribute to anyone this message or any > information contained in this message. If you have received this > electronic message in error, please notify us by replying to this e-mail. > (1) > > _______________________________________________ > 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 paul.rogers at shaw.ca Mon Jan 3 00:16:15 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 02 Jan 2005 22:16:15 -0700 Subject: [Wtr-general] Fixed it, but interesting issue. In-Reply-To: <0I9I00GG02518UJ0@pd7mr1no.prod.shaw.ca> Message-ID: <001b01c4f153$5a00fbd0$6400a8c0@NewDell> Doesn't going to the page effectively invalidate the test? Otherwise this looks almost identical to the pop_ups unit test, which seems to work. The whole clickers stuff is ugly and needs reworking. Maybe for 1.1 ? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of McMahon, Chris Sent: 29 December 2004 12:58 To: wtr-general at rubyforge.org Subject: [Wtr-general] Fixed it, but interesting issue. Hi... I had (have?) a basic misunderstanding of how WinClicker works. I had cargo-culted stuff from the unittest into my script that broke what I was trying to do. The following script does the Right Thing in my app. The interesting part is that I have to invoke gotoPopUpPage again after having clicked the JS popup thingie in order to get the script to do the final assert statement correctly. -Chris ##################################################### class TC_PopUps < Test::Unit::TestCase def gotoPopUpPage() $ie.goto("http://10.1.2.3") end def test_simple gotoPopUpPage() $ie.textField(:name, "txtUser").set("username") $ie.textField(:name, "txtPassword").set("password") $ie.button(:name, "Button1").click c = "start #{$ie.dir.gsub("/" , "\\" )}\\clickJSDialog.rb OK 3" puts "Starting #{c}" w = WinClicker.new w.winsystem(c ) $ie.button(:name, "cmdLogout").click gotoPopUpPage() assert($ie.pageContainsText("Please enter") ) end end ########################################################### _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From jkohl at telusplanet.net Mon Jan 3 00:20:17 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Sun, 2 Jan 2005 22:20:17 -0700 Subject: [Wtr-general] click images and text In-Reply-To: <001901c4f152$9caf4140$6400a8c0@NewDell> Message-ID: <20050103051900.JPCK20992.priv-edtnes57.telusplanet.net@tintin> I didn't know this. Shows what I know... :-) Very cool. -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of Paul Rogers > Sent: January 2, 2005 10:11 PM > To: wtr-general at rubyforge.org > Subject: RE: [Wtr-general] click images and text > > Er, I think we can actually click an image. > > $ie.image(:src, /car.jpg/).click() > > For example, should work. I think there is a unit test in the > images_test.rb > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jonathan Kohl > Sent: 30 December 2004 10:41 > To: wtr-general at rubyforge.org > Subject: FW: [Wtr-general] click images and text > > > > Forwarding to the list... > > -----Original Message----- > From: Jonathan Kohl [mailto:jonathan at kohl.ca] > Sent: December 30, 2004 9:55 AM > To: 'Mike at MichaelDKelly.com' > Subject: RE: [Wtr-general] User guide > > Currently we can only click an image that is in a form, and acting like > a form button. Since plain images and text don't trigger events in the > DOM like form buttons, hyperlinks, etc., they don't have associated > methods in Windows OLE interface (which is what Watir uses). Does that > make sense? Basically if a click event triggers an action, it is > supported, but we can't click on plain text or images that don't do > anything. > > Paul and I have talked about clicking on any object in a page, even if > it doesn't have an event tied to it like the other objects do, but that > hasn't been implemented yet. > > The Image methods you are seeing in RDoc were added for verification > actions. We use the fact of whether an image has loaded or not to ensure > the correct action has taken place. > > I would like to be able to click on any object using Watir in case text > or an image has a JavaScript fireEvent() hooked to it for a mouseover to > cause a drop down menu to appear. The only reason I've found to click an > image that isn't doing a FORM submit or on plain text is to trigger JS > events. Can you think of other reasons? > > We should get a story page or wishlist page up and running for Watir > soon so that feature requests can be submitted. I've been working on > that, and Bret has some ideas. > > Thanks; > > -Jonathan > > > -----Original Message----- > > From: Michael Kelly [mailto:Mike at MichaelDKelly.com] > > Sent: December 30, 2004 9:06 AM > > To: Jonathan Kohl > > Subject: RE: [Wtr-general] User guide > > > > Is the RDoc up to date? I'm looking at Image and the only methods it > > shows are "hasLoaded?" and "new". How do I click an image? > > > > Thanks, > > Mike > > > > ---- Original message ---- > > >Date: Thu, 30 Dec 2004 08:34:13 -0700 > > >From: "Jonathan Kohl" > > >Subject: RE: [Wtr-general] User guide > > >To: > > > > > >Michael; > > > > > >What Watir does in this case is to just submit the form. > > I'll have to dig > > >out the code that can do this and add it to the User Guide. > > > > > >On the BookPool page, the Forms don't have unique > > identifiers as tag > > >attributes, so it makes things harder. Still doable, but > > harder. > > > > > >On amazon.com, the "Go" button after the Search input field > > is in two > > >different forms that are easily identifiable. The first > > one: > >method="post" action="/exec/obidos/search-handle-form/102- > > 8258892-7883346" > > >name="searchform"> > > >is different from the second one: > > > > >action="/exec/obidos/search-handle-form/102-8258892- > > 7883346"> > > > > > >On BookPool, the first form looks like this: > > > > > >While the second looks like this: > > > > > > > > >So we will have to do something different to distinguish > > one form from the > > >other. In the DOM, elements are stored in arrays, so if we > > can't do anything > > >else, we can access it by its form array element in the DOM > > like this: > > >foo = $ie.getIE().document.forms > > >and do a submit on the ith element in the forms array, > > where "i" is the form > > >we want. > > > > > >I had to do this on a couple of e-commerce pages with WTR, > > but I haven't > > >done it with Watir yet. I'll look into it and get back to > > you on how best to > > >handle it. > > > > > >Thanks; > > > > > >-Jonathan > > > > > >> -----Original Message----- > > >> From: Michael Kelly [mailto:Mike at MichaelDKelly.com] > > >> Sent: December 30, 2004 7:55 AM > > >> To: jonathan at kohl.ca > > >> Subject: Re: [Wtr-general] User guide > > >> > > >> Jonathan, > > >> > > >> The user guide mentions using the Enter/Return key to > > select > > >> a button or image, but it does not show me how. You might want to > > >> add something on this. I could use it in this situation. > > >> > > >> Thanks, > > >> Mike > > > > > > > > > _______________________________________________ > 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 Mon Jan 3 00:32:12 2005 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 02 Jan 2005 23:32:12 -0600 Subject: [Wtr-general] Danny's review Message-ID: <5.1.0.14.2.20050102233104.025d48b8@127.0.0.1> Here is the summary of Danny's review that i posted to my blog. http://www.io.com/~wazmo/blog/archives/2005_01.html#000226 Danny Faught published a review (sub req'd) that compares Watir with Samie and has Watir coming out ahead. This is especially noteworthy because Samie is written in Perl and Danny is an avowed Perl affectionado. Watir, of course, is in Ruby. The highlights: The most noticeable difference betwen the two is that Watir does more of the synchronization automatically, waiting for IE to complete an operation before allowing the script to continue. I had to do this manually with Samie.... Overall, I preferred Watir over Samie for several reasons. Most importantly, I could not get the Samie scripts to run reliably. While sometimes it works fine, other times it would simply hang in the middle. And several times I hit a fatal error.... Samie is poorly documented, while there is a decent user manual for Watir.... I didn't find a way to print out a full DOM representation of a web page with Samie.... So i ended up using Watir's showAllObjects method to help me write the Perl script. The review appears in Open Testware Reviews, a subscription-based website. The review also touches on some areas where we could improve Watir. He says: "I had a hard time figuring out which property to use to identify an object using both libraries. The names of the properties only loosely correlate witht he tags that you see in the HTML source." I'd like to review all our object and property names against their standard HTML and DOM representations. I agree that this kind of consistency is very useful. It was also nice to hear that he liked our showAllObjects method, but i'd really like to see us promote a richer method for getting this information. Mozilla has a really great DOM inspector; it's a shame there is nothing close for IE. I have wondered whether it might be useful to build a version of showAllObjects that actually decorates the current page with IDs (or whatever) instead of just dumping data to stdout. Anyone want to give it a shot? I've been annoyed at some of the instabilities that Ruby has shown as a platform, particularly the WIN32OLE seg fault that showed in at least one of the recent releases. Danny actually ran into this problem, which were able to help him overcome when he mentioned it to us. Yet i was surprised to see that that Samie actually ran into more serious instabilities. I'm wondering whether our extensive unit tests are making a difference for us here. Danny says that he used 'a version of Watir that I pulled from the cvs server in mid-December.' It was actually quite generous of him not review our code in this form. In retrospect, i wish we had cut a release back then, so that people would be in a position to duplicate his results. Since then, well, there have been a lot of changes.... _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Mon Jan 3 00:37:57 2005 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 02 Jan 2005 23:37:57 -0600 Subject: [Wtr-general] Watir changes In-Reply-To: <001701c4f151$c1b89140$6400a8c0@NewDell> References: <001501c4f138$90efbe30$6400a8c0@NewDell> Message-ID: <5.1.0.14.2.20050102233549.025d7438@127.0.0.1> At 11:04 PM 1/2/2005, Paul Rogers wrote: > require 'watir/watir' I really, really want us to be able to say require 'watir'. Wouldn't it work to replace copyFile( 'watir.rb' , siteLib + '/watir/' ) with copyFile( 'watir.rb' , siteLib ) in install.rb? Anyhow, i look forward to trying out the installer. Very cool! _____________________ Bret Pettichord www.pettichord.com From jkohl at telusplanet.net Mon Jan 3 00:57:17 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Sun, 2 Jan 2005 22:57:17 -0700 Subject: [Wtr-general] Danny's review In-Reply-To: <5.1.0.14.2.20050102233104.025d48b8@127.0.0.1> Message-ID: <20050103055559.LPLI21001.priv-edtnes51.telusplanet.net@tintin> > The review also touches on some areas where we could improve Watir. He > says: "I had a hard time figuring out which property to use to > identify an object using both libraries. The names of the properties > only loosely correlate witht he tags that you see in the HTML source." > I'd like to review all our object and property names against their > standard HTML and DOM representations. I agree, and I think it will be tricky in some cases. For example, can mean several things including a text field. I'm sure we can get around it though. Some of the html tags aren't terribly intuitive which is why I think the naming convention came about. Maybe we could use "alias" to help with this? Some people might find it intuitive to click an "image" or "link", but it would be good to support click "img src" or "a href" to map directly to the HTML tags as well. In the input tag example, we could probably deal with in a similar same way. >I agree that this kind of > consistency is very useful. It was also nice to hear that he liked our > showAllObjects method, but i'd really like to see us promote a richer > method for getting this information. Mozilla has a really great DOM > inspector; it's a shame there is nothing close for IE. I like the Mozilla DOM inspector, but I didn't find it terribly useful for writing scripts. Have others found it useful? I find just looking at the HTML source the easiest way to write tests, and used to get frustrated with record/playback testing tools that used window maps as a result. I always wanted to just deal with the source. I realize I am not a typical user though. > I have wondered > whether it might be useful to build a version of showAllObjects that > actually decorates the current page with IDs (or whatever) instead of > just dumping data to stdout. Anyone want to give it a shot? I really like this idea. I think there are some cool things with the Mozilla DOM inspector that we could borrow such as clicking on a page element and having it highlighted. We could take a step further and show the HTML tag for that element so that it can be used with Watir. Taking it a step further, we could suggest the method to use. Click on a link, and the HTML tag shows up in one field, and the suggested Watir method shows in another so the user can copy and paste it into their script. That might be a bit ambitious right now, but could be really cool. Could help as a learning tool as well for those who aren't as familiar with HTML. > I've been annoyed at some of the instabilities that Ruby has shown as > a platform, particularly the WIN32OLE seg fault that showed in at > least one of the recent releases. Danny actually ran into this > problem, which were able to help him overcome when he mentioned it to > us. The 1.8.1-13 release has caught a lot of people I think. I would like to put up both the User Guide and a Trouble Shooting page on the web which may help a bit if people have a place to go to check these things when installing. >Yet i was surprised to see that that Samie actually ran into more > serious instabilities. I'm wondering whether our extensive unit tests > are making a difference for us here. That probably has something to do with it. > Danny says that he used 'a version of Watir that I pulled from the cvs > server in mid-December.' It was actually quite generous of him not > review our code in this form. In retrospect, i wish we had cut a > release back then, so that people would be in a position to duplicate > his results. Since then, well, there have been a lot of changes.... It was pretty cool of him to do a review. It really helps give the project some good feedback from someone who knows these sorts of tools. Very helpful. It would be nice to get on a regular release schedule. The old Open Source mantra is "release early, release often after all. I think the project has come pretty far this fall though. I'm pretty impressed with what has been done to date. -Jonathan > _____________________ > Bret Pettichord > www.pettichord.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From jkohl at telusplanet.net Mon Jan 3 01:21:15 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Sun, 2 Jan 2005 23:21:15 -0700 Subject: [Wtr-general] Danny's review In-Reply-To: <20050103055559.LPLI21001.priv-edtnes51.telusplanet.net@tintin> Message-ID: <20050103061957.ELGI8601.priv-edtnes84.telusplanet.net@tintin> > I really like this idea. I think there are some cool things with the > Mozilla > DOM inspector that we could borrow such as clicking on a page element and > having it highlighted. We could take a step further and show the HTML tag > for that element so that it can be used with Watir. Taking it a step > further, we could suggest the method to use. Click on a link, and the HTML > tag shows up in one field, and the suggested Watir method shows in another > so the user can copy and paste it into their script. That might be a bit > ambitious right now, but could be really cool. Could help as a learning > tool > as well for those who aren't as familiar with HTML. Another reason why having a tool where we could click on an element in a page and get related Watir scripts to use would be when there are identical forms or other elements on a page. On Amazon.com, the Search section appears with a "Go" button near the top of the page on the left, and then on the bottom of the page. If you try to fill in the field and click the "Go" image, you get an error because there are two of them. Michael Kelly also ran into this here: http://www.bookpool.com/ -- there are two forms with "Search" buttons with pretty much identical tag attributes. We can get around it by doing something like this: $ie.form(:index, "1").submit (this uses the first form and submits it). It would really help people if we could have the tool detect identical elements, and provide suggestions to work around that they could copy and paste out of the tool. This is getting very, very ambitious, I know. -Jonathan From Mike at MichaelDKelly.com Mon Jan 3 08:40:19 2005 From: Mike at MichaelDKelly.com (Michael Kelly) Date: Mon, 3 Jan 2005 08:40:19 -0500 Subject: [Wtr-general] click images and text Message-ID: <200501031340.DAX87802@ms2.netsolmail.com> Paul, I tried that. Am I using the latest version? I downloaded the tarball from http://rubyforge.org/cgi-bin/viewcvs.cgi/? cvsroot=wtr and am having no luck. My Code: $ie.image (:src, "http://g.bookpool.com/hp/search_btn.gif").click Error: Finding an image how: src What http://g.bookpool.com/hp/search_btn.gif Image on page: src = http://g.bookpool.com/hp/clear_dot.gif [...] Image on page: src = http://g.bookpool.com/hp/grey_dot.gif Bookpool_Search.rb:25: undefined method `submit' for # (NoMethodError) Exit code: 1 Is there a different download I should try? Thanks, Mike ---- Original message ---- >Date: Sun, 02 Jan 2005 22:10:58 -0700 >From: Paul Rogers >Subject: RE: [Wtr-general] click images and text >To: wtr-general at rubyforge.org > >Er, I think we can actually click an image. > >$ie.image(:src, /car.jpg/).click() > >For example, should work. I think there is a unit test in the >images_test.rb > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jonathan Kohl >Sent: 30 December 2004 10:41 >To: wtr-general at rubyforge.org >Subject: FW: [Wtr-general] click images and text > > > >Forwarding to the list... > >-----Original Message----- >From: Jonathan Kohl [mailto:jonathan at kohl.ca] >Sent: December 30, 2004 9:55 AM >To: 'Mike at MichaelDKelly.com' >Subject: RE: [Wtr-general] User guide > >Currently we can only click an image that is in a form, and acting like >a form button. Since plain images and text don't trigger events in the >DOM like form buttons, hyperlinks, etc., they don't have associated >methods in Windows OLE interface (which is what Watir uses). Does that >make sense? Basically if a click event triggers an action, it is >supported, but we can't click on plain text or images that don't do >anything. > >Paul and I have talked about clicking on any object in a page, even if >it doesn't have an event tied to it like the other objects do, but that >hasn't been implemented yet. > >The Image methods you are seeing in RDoc were added for verification >actions. We use the fact of whether an image has loaded or not to ensure >the correct action has taken place. > >I would like to be able to click on any object using Watir in case text >or an image has a JavaScript fireEvent() hooked to it for a mouseover to >cause a drop down menu to appear. The only reason I've found to click an >image that isn't doing a FORM submit or on plain text is to trigger JS >events. Can you think of other reasons? > >We should get a story page or wishlist page up and running for Watir >soon so that feature requests can be submitted. I've been working on >that, and Bret has some ideas. > >Thanks; > >-Jonathan > >> -----Original Message----- >> From: Michael Kelly [mailto:Mike at MichaelDKelly.com] >> Sent: December 30, 2004 9:06 AM >> To: Jonathan Kohl >> Subject: RE: [Wtr-general] User guide >> >> Is the RDoc up to date? I'm looking at Image and the only methods it >> shows are "hasLoaded?" and "new". How do I click an image? >> >> Thanks, >> Mike >> >> ---- Original message ---- >> >Date: Thu, 30 Dec 2004 08:34:13 -0700 >> >From: "Jonathan Kohl" >> >Subject: RE: [Wtr-general] User guide >> >To: >> > >> >Michael; >> > >> >What Watir does in this case is to just submit the form. >> I'll have to dig >> >out the code that can do this and add it to the User Guide. >> > >> >On the BookPool page, the Forms don't have unique >> identifiers as tag >> >attributes, so it makes things harder. Still doable, but >> harder. >> > >> >On amazon.com, the "Go" button after the Search input field >> is in two >> >different forms that are easily identifiable. The first >> one: > >method="post" action="/exec/obidos/search-handle- form/102- >> 8258892-7883346" >> >name="searchform"> >> >is different from the second one: >> >> >action="/exec/obidos/search-handle-form/102-8258892- >> 7883346"> >> > >> >On BookPool, the first form looks like this: >> > >> >While the second looks like this: >> > >> > >> >So we will have to do something different to distinguish >> one form from the >> >other. In the DOM, elements are stored in arrays, so if we >> can't do anything >> >else, we can access it by its form array element in the DOM >> like this: >> >foo = $ie.getIE().document.forms >> >and do a submit on the ith element in the forms array, >> where "i" is the form >> >we want. >> > >> >I had to do this on a couple of e-commerce pages with WTR, >> but I haven't >> >done it with Watir yet. I'll look into it and get back to >> you on how best to >> >handle it. >> > >> >Thanks; >> > >> >-Jonathan >> > >> >> -----Original Message----- >> >> From: Michael Kelly [mailto:Mike at MichaelDKelly.com] >> >> Sent: December 30, 2004 7:55 AM >> >> To: jonathan at kohl.ca >> >> Subject: Re: [Wtr-general] User guide >> >> >> >> Jonathan, >> >> >> >> The user guide mentions using the Enter/Return key to >> select >> >> a button or image, but it does not show me how. You might want to >> >> add something on this. I could use it in this situation. >> >> >> >> Thanks, >> >> Mike >> > >> > > > >_______________________________________________ >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 faught at tejasconsulting.com Mon Jan 3 10:34:44 2005 From: faught at tejasconsulting.com (Danny R. Faught) Date: Mon, 03 Jan 2005 09:34:44 -0600 Subject: [Wtr-general] Danny's review In-Reply-To: <5.1.0.14.2.20050102233104.025d48b8@127.0.0.1> References: <5.1.0.14.2.20050102233104.025d48b8@127.0.0.1> Message-ID: <41D96614.9060509@tejasconsulting.com> Bret Pettichord wrote: > Yet i was surprised to see that that Samie actually ran into more > serious instabilities. I'm wondering whether our extensive unit tests > are making a difference for us here. I don't see any unit tests for Samie. I imagine that Watir's unit tests do make a dramatic difference. That was the first place I looked when I wanted to know if Watir would work on my system and to see examples of how it's used. Sending patches against the tests also was an unintimidating way to start contributing. But the unit test I looked at most is a bit disorganized. There is html for the button test that isn't getting used by the test, which gives the person running the test a false sense of completeness. > Danny says that he used 'a version of Watir that I pulled from the cvs > server in mid-December.' I did update my sources a few times, I just don't know how to ask cvs when was the last time I did that. > It was actually quite generous of him not > review our code in this form. Luckily I wasn't doing one of my more thorough reviews. :-) -- Danny R. Faught Tejas Software Consulting http://tejasconsulting.com/ From faught at tejasconsulting.com Mon Jan 3 10:42:30 2005 From: faught at tejasconsulting.com (Danny R. Faught) Date: Mon, 03 Jan 2005 09:42:30 -0600 Subject: [Wtr-general] Danny's review In-Reply-To: <20050103055559.LPLI21001.priv-edtnes51.telusplanet.net@tintin> References: <20050103055559.LPLI21001.priv-edtnes51.telusplanet.net@tintin> Message-ID: <41D967E6.6080608@tejasconsulting.com> Jonathan Kohl wrote: > I find just looking at the HTML source the easiest way to write tests, That's that I did. The case I needed to look at the DOM was a button tag that I didn't recognize (having cut my teeth on pre-XHTML standards) - it was tied to JavaScript code and didn't have have an obvious form it was associated with. The DOM representation of it more closely matched the library's methods than what it looked like in the source. > Click on a link, and the HTML > tag shows up in one field, and the suggested Watir method shows in another > so the user can copy and paste it into their script. But which property is the best one to use to identify it? > It would be nice to get on a regular release schedule. The old Open Source > mantra is "release early, release often after all. I think the project has > come pretty far this fall though. I'm pretty impressed with what has been > done to date. My tool that's on SourceForge, the stress_driver, was largely ignored until I packaged up a release. Making it easy to download is an important step in getting more people to try it. -- Danny R. Faught Tejas Software Consulting http://tejasconsulting.com/ From faught at tejasconsulting.com Mon Jan 3 10:47:27 2005 From: faught at tejasconsulting.com (Danny R. Faught) Date: Mon, 03 Jan 2005 09:47:27 -0600 Subject: [Wtr-general] being ambitious In-Reply-To: <20050103061957.ELGI8601.priv-edtnes84.telusplanet.net@tintin> References: <20050103061957.ELGI8601.priv-edtnes84.telusplanet.net@tintin> Message-ID: <41D9690F.3070200@tejasconsulting.com> Jonathan Kohl wrote: > It would really help people if we could have the tool detect identical > elements, and provide suggestions to work around that they could copy and > paste out of the tool. > > This is getting very, very ambitious, I know. As long as you're getting ambitious, write a tool that measures the testability of the web page and suggests changes that should be made to the source, like having no identical elements. And elements that are explicitly named are better than those that you have to identify using an alt tag or even the href. Maybe someone has already done that - there are plenty of html analysis tools out there. -- Danny R. Faught Tejas Software Consulting http://tejasconsulting.com/ From chris.mcmahon at verint.com Mon Jan 3 10:50:52 2005 From: chris.mcmahon at verint.com (McMahon, Chris) Date: Mon, 3 Jan 2005 08:50:52 -0700 Subject: [Wtr-general] Danny's review Message-ID: Danny said: > I don't see any unit tests for Samie. I imagine that Watir's > unit tests do make a dramatic difference. That was the first > place I looked when I wanted to know if Watir would work on > my system and to see examples of how it's used. SAMIE source is pretty nasty. All subroutines and no objects; deeply nested "if" statements that invoke obscure Win32::GUI and Win32::OLE commands. SAMIE even has different "wait" statements depending on if you're waiting for a popup window or a non-popup window. Sketchy error handling. It'd be pretty nice if it were refactored and documented, but WATIR's a lot better engineered. -Chris __________________________________________________________________________________________ This electronic message may contain proprietary and confidential information of Verint Systems Inc., its affiliates and/or subsidiaries. The information is intended to be for the use of the individual(s) or entity(ies) named above. If you are not the intended recipient (or authorized to receive this e-mail for the intended recipient), you may not use, copy, disclose or distribute to anyone this message or any information contained in this message. If you have received this electronic message in error, please notify us by replying to this e-mail. (1) From jkohl at telusplanet.net Mon Jan 3 11:33:05 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Mon, 3 Jan 2005 09:33:05 -0700 Subject: [Wtr-general] Danny's review In-Reply-To: <41D967E6.6080608@tejasconsulting.com> Message-ID: <20050103163141.GATB2994.priv-edtnes51.telusplanet.net@tintin> > That's that I did. The case I needed to look at the DOM was a button > tag that I didn't recognize (having cut my teeth on pre-XHTML standards) > - it was tied to JavaScript code and didn't have have an obvious form it > was associated with. The DOM representation of it more closely matched > the library's methods than what it looked like in the source. Interesting. I could see that being the case. When I am using this to automate web apps, I'm usually working close enough with the developers to ask them how something works, and if it is confusing, we usually work together to make the source cleaner and the app more testable. In one case we had to use a 3rd party API, and it had some really nasty HTML. It took a lot of time to go through it by hand. > > Click on a link, and the HTML > > tag shows up in one field, and the suggested Watir method shows in > another > > so the user can copy and paste it into their script. > But which property is the best one to use to identify it? That would be difficult to fill in completely, but at least they could see what method to use, and then go from there as a starting point. -Jonathan From jkohl at telusplanet.net Mon Jan 3 11:38:05 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Mon, 3 Jan 2005 09:38:05 -0700 Subject: [Wtr-general] being ambitious In-Reply-To: <41D9690F.3070200@tejasconsulting.com> Message-ID: <20050103163641.FZXR3508.priv-edtnes57.telusplanet.net@tintin> > As long as you're getting ambitious, write a tool that measures the > testability of the web page and suggests changes that should be made to > the source, like having no identical elements. And elements that are > explicitly named are better than those that you have to identify using > an alt tag or even the href. > Maybe someone has already done that - there are plenty of html analysis > tools out there. This would be a good idea. I don't recall running an HTML validator and it complaining about identical elements. I have found it helpful to run HTML validators when automating tests the way we do with Watir. In most cases, the more W3C compliant the HTML source, the easier it is to automate. -Jonathan From paul.rogers at shaw.ca Mon Jan 3 11:53:24 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 03 Jan 2005 09:53:24 -0700 Subject: [Wtr-general] Watir changes In-Reply-To: <5.1.0.14.2.20050102233549.025d7438@127.0.0.1> Message-ID: <000c01c4f1b4$bf0e28c0$6400a8c0@NewDell> Yes we could do that. That would then dump our code into the site_lib dir, which seems a little nasty. Consider when you usse test::unit require 'test/unit' I think we are being nice. We could of course put a single file into site_lib that did Require 'watir/watir' And then the user would only need to do require 'watir' -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 02 January 2005 22:38 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Watir changes At 11:04 PM 1/2/2005, Paul Rogers wrote: > require 'watir/watir' I really, really want us to be able to say require 'watir'. Wouldn't it work to replace copyFile( 'watir.rb' , siteLib + '/watir/' ) with copyFile( 'watir.rb' , siteLib ) in install.rb? Anyhow, i look forward to trying out the installer. Very cool! _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Mon Jan 3 11:56:31 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 03 Jan 2005 09:56:31 -0700 Subject: [Wtr-general] click images and text In-Reply-To: <200501031340.DAX87802@ms2.netsolmail.com> Message-ID: <000d01c4f1b5$2cd6dd70$6400a8c0@NewDell> I understand Jonathans been helping too. On the bookpool site you can do this: ie.button(:src, /search_btn.gif/).click This is because when an image is used as a submit button, its really a button. We did find some bugs in watir which Im trying to fix now though. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Michael Kelly Sent: 03 January 2005 06:40 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] click images and text Paul, I tried that. Am I using the latest version? I downloaded the tarball from http://rubyforge.org/cgi-bin/viewcvs.cgi/? cvsroot=wtr and am having no luck. My Code: $ie.image (:src, "http://g.bookpool.com/hp/search_btn.gif").click Error: Finding an image how: src What http://g.bookpool.com/hp/search_btn.gif Image on page: src = http://g.bookpool.com/hp/clear_dot.gif [...] Image on page: src = http://g.bookpool.com/hp/grey_dot.gif Bookpool_Search.rb:25: undefined method `submit' for # (NoMethodError) Exit code: 1 Is there a different download I should try? Thanks, Mike ---- Original message ---- >Date: Sun, 02 Jan 2005 22:10:58 -0700 >From: Paul Rogers >Subject: RE: [Wtr-general] click images and text >To: wtr-general at rubyforge.org > >Er, I think we can actually click an image. > >$ie.image(:src, /car.jpg/).click() > >For example, should work. I think there is a unit test in the >images_test.rb > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jonathan Kohl >Sent: 30 December 2004 10:41 >To: wtr-general at rubyforge.org >Subject: FW: [Wtr-general] click images and text > > > >Forwarding to the list... > >-----Original Message----- >From: Jonathan Kohl [mailto:jonathan at kohl.ca] >Sent: December 30, 2004 9:55 AM >To: 'Mike at MichaelDKelly.com' >Subject: RE: [Wtr-general] User guide > >Currently we can only click an image that is in a form, and acting like >a form button. Since plain images and text don't trigger events in the >DOM like form buttons, hyperlinks, etc., they don't have associated >methods in Windows OLE interface (which is what Watir uses). Does that >make sense? Basically if a click event triggers an action, it is >supported, but we can't click on plain text or images that don't do >anything. > >Paul and I have talked about clicking on any object in a page, even if >it doesn't have an event tied to it like the other objects do, but that >hasn't been implemented yet. > >The Image methods you are seeing in RDoc were added for verification >actions. We use the fact of whether an image has loaded or not to ensure >the correct action has taken place. > >I would like to be able to click on any object using Watir in case text >or an image has a JavaScript fireEvent() hooked to it for a mouseover to >cause a drop down menu to appear. The only reason I've found to click an >image that isn't doing a FORM submit or on plain text is to trigger JS >events. Can you think of other reasons? > >We should get a story page or wishlist page up and running for Watir >soon so that feature requests can be submitted. I've been working on >that, and Bret has some ideas. > >Thanks; > >-Jonathan > >> -----Original Message----- >> From: Michael Kelly [mailto:Mike at MichaelDKelly.com] >> Sent: December 30, 2004 9:06 AM >> To: Jonathan Kohl >> Subject: RE: [Wtr-general] User guide >> >> Is the RDoc up to date? I'm looking at Image and the only methods it >> shows are "hasLoaded?" and "new". How do I click an image? >> >> Thanks, >> Mike >> >> ---- Original message ---- >> >Date: Thu, 30 Dec 2004 08:34:13 -0700 >> >From: "Jonathan Kohl" >> >Subject: RE: [Wtr-general] User guide >> >To: >> > >> >Michael; >> > >> >What Watir does in this case is to just submit the form. >> I'll have to dig >> >out the code that can do this and add it to the User Guide. >> > >> >On the BookPool page, the Forms don't have unique >> identifiers as tag >> >attributes, so it makes things harder. Still doable, but >> harder. >> > >> >On amazon.com, the "Go" button after the Search input field >> is in two >> >different forms that are easily identifiable. The first >> one: > >method="post" action="/exec/obidos/search-handle- form/102- >> 8258892-7883346" >> >name="searchform"> >> >is different from the second one: >> >> >action="/exec/obidos/search-handle-form/102-8258892- >> 7883346"> >> > >> >On BookPool, the first form looks like this: >> > >> >While the second looks like this: >> > >> > >> >So we will have to do something different to distinguish >> one form from the >> >other. In the DOM, elements are stored in arrays, so if we >> can't do anything >> >else, we can access it by its form array element in the DOM >> like this: >> >foo = $ie.getIE().document.forms >> >and do a submit on the ith element in the forms array, >> where "i" is the form >> >we want. >> > >> >I had to do this on a couple of e-commerce pages with WTR, >> but I haven't >> >done it with Watir yet. I'll look into it and get back to >> you on how best to >> >handle it. >> > >> >Thanks; >> > >> >-Jonathan >> > >> >> -----Original Message----- >> >> From: Michael Kelly [mailto:Mike at MichaelDKelly.com] >> >> Sent: December 30, 2004 7:55 AM >> >> To: jonathan at kohl.ca >> >> Subject: Re: [Wtr-general] User guide >> >> >> >> Jonathan, >> >> >> >> The user guide mentions using the Enter/Return key to >> select >> >> a button or image, but it does not show me how. You might want to >> >> add something on this. I could use it in this situation. >> >> >> >> Thanks, >> >> Mike >> > >> > > > >_______________________________________________ >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 chrismo at clabs.org Mon Jan 3 11:56:39 2005 From: chrismo at clabs.org (Chris Morris) Date: Mon, 03 Jan 2005 10:56:39 -0600 Subject: [Wtr-general] Danny's review In-Reply-To: <20050103055559.LPLI21001.priv-edtnes51.telusplanet.net@tintin> References: <20050103055559.LPLI21001.priv-edtnes51.telusplanet.net@tintin> Message-ID: <41D97947.3030002@clabs.org> Jonathan Kohl wrote: >>I've been annoyed at some of the instabilities that Ruby has shown as >>a platform, particularly the WIN32OLE seg fault that showed in at >>least one of the recent releases. Danny actually ran into this >>problem, which were able to help him overcome when he mentioned it to >>us. >> >> >The 1.8.1-13 release has caught a lot of people I think. I would like to put >up both the User Guide and a Trouble Shooting page on the web which may help >a bit if people have a place to go to check these things when installing. > > And, FWIW, WIN32OLE is, AFAIK, separate to the main Ruby install. ... Well, the source may be in the core Ruby CVS by now, but it's just been an extra lib maintained by one guy, it's not something Matz and the rest of the core group is ever concerned with. -- Chris http://clabs.org/blogki From paul.rogers at shaw.ca Mon Jan 3 12:08:03 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 03 Jan 2005 10:08:03 -0700 Subject: [Wtr-general] Danny's review In-Reply-To: <41D96614.9060509@tejasconsulting.com> Message-ID: <000e01c4f1b6$c9599650$6400a8c0@NewDell> "..There is html for the button test that isn't getting used by the test.." Which test/html page was this? These started out very organised, but as Ive added more they got confusing. There is also lots of things in the html to try to 'prove' that the correct thing was done. For example there should be a button called x inside a form and a button outside a form also called x that do different things, so that I am sure that I clicked the right thing -