From bret at pettichord.com Fri Oct 1 05:32:27 2004 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 01 Oct 2004 04:32:27 -0500 Subject: [Wtr-general] watir - preview release In-Reply-To: <25e1f6b25de35e.25de35e25e1f6b@shaw.ca> Message-ID: <5.1.0.14.2.20041001043209.02bab500@127.0.0.1> This looks great Paul, thanks. At 09:37 AM 9/30/2004, Paul Rogers wrote: >Ive added the first attempt at watir to cvs. > >Please let me know if there is anything you like, dont like, want done >differently, need, dont need etc > >Paul > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From paul.rogers at shaw.ca Tue Oct 5 10:08:08 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 05 Oct 2004 08:08:08 -0600 Subject: [Wtr-general] watir - release with text fields Message-ID: <29abbca29a9904.29a990429abbca@shaw.ca> Ive added the first methods for dealing with text fields, and unit tests for them. Chris - I'd like to use your method_missing and dom saver in this code - is that ok? I also added some code for forms, but it didnt work as well as Id hoped, so Ive taken it out again. I'll rethink how it should work and try again Paul From chrismo at clabs.org Tue Oct 5 10:13:38 2004 From: chrismo at clabs.org (Chris Morris) Date: Tue, 05 Oct 2004 09:13:38 -0500 Subject: [Wtr-general] watir - release with text fields In-Reply-To: <29abbca29a9904.29a990429abbca@shaw.ca> References: <29abbca29a9904.29a990429abbca@shaw.ca> Message-ID: <4162AC12.6030804@clabs.org> Paul Rogers wrote: >Ive added the first methods for dealing with text fields, and unit tests for them. > >Chris - I'd like to use your method_missing and dom saver in this code - is that ok? > > Absolutely, that's what open source is all about :-) -- Chris http://clabs.org From jbarrett at finaplex.com Wed Oct 6 20:51:40 2004 From: jbarrett at finaplex.com (Jeff Barrett) Date: Wed, 6 Oct 2004 17:51:40 -0700 Subject: [Wtr-general] automated testing and non IE platforms Message-ID: Hello, A post I was directed to (http://www.io.com/~wazmo/blog/archives/2004_08.html) described how "Ruby's support for COM and IE's extensive COM interface" are integral in allowing the WATIR framework to drive the browser. What about support for different browsers? This would allow: 1) testing application functionality across multiple browsers, 2) automation of test cases on platforms that don't have IE (yeah this can be gotten around, but I'm curious). Any thoughts on how/if this would fit in to WATIR? Thanks, Jeff From chrismo at clabs.org Wed Oct 6 21:25:33 2004 From: chrismo at clabs.org (Chris Morris) Date: Wed, 06 Oct 2004 20:25:33 -0500 Subject: [Wtr-general] automated testing and non IE platforms In-Reply-To: References: Message-ID: <41649B0D.2080700@clabs.org> Jeff Barrett wrote: >A post I was directed to (http://www.io.com/~wazmo/blog/archives/2004_08.html) described how "Ruby's support for COM and IE's extensive COM interface" are integral in allowing the WATIR framework to drive the browser. What about support for different browsers? This would allow: 1) testing application functionality across multiple browsers, 2) automation of test cases on platforms that don't have IE (yeah this can be gotten around, but I'm curious). > >Any thoughts on how/if this would fit in to WATIR? > > IE's COM interface is really nice -- pretty complete and easy to work with. We'd love to support other browsers -- the only info we've got right now is on Mozilla: http://www.clabs.org/wtr/index.cgi?page=/MozAxc -- Chris http://clabs.org/blogki From chris.mcmahon at verint.com Thu Oct 7 12:29:50 2004 From: chris.mcmahon at verint.com (McMahon, Chris) Date: Thu, 7 Oct 2004 10:29:50 -0600 Subject: [Wtr-general] RE: Wtr-general Digest, Vol 11, Issue 3 Message-ID: > IE's COM interface is really nice -- pretty complete and easy > to work with. We'd love to support other browsers -- the only > info we've got right now is on Mozilla: > > http://www.clabs.org/wtr/index.cgi?page=/MozAxc > I don't know if you've seen the latest Firefox browser, but under the "Tools" menu is a "DOM Inspector". I haven't tried any programming with it, but it looks like it might be possible to parse output from the DOM Inspector for the purpose of driving the browser. I could be wrong... -Chris From chrismo at clabs.org Thu Oct 7 13:00:17 2004 From: chrismo at clabs.org (Chris Morris) Date: Thu, 07 Oct 2004 12:00:17 -0500 Subject: [Wtr-general] RE: Wtr-general Digest, Vol 11, Issue 3 In-Reply-To: References: Message-ID: <41657621.7090307@clabs.org> McMahon, Chris wrote: > I don't know if you've seen the latest Firefox browser, but >under the "Tools" menu is a "DOM Inspector". I haven't tried any >programming with it, but it looks like it might be possible to parse >output from the DOM Inspector for the purpose of driving the browser. > I could be wrong... > > The MozAxc interests us because of the emulation of the IE COM interface, which, theoretically would allow the same Ruby test scripts to manipulate IE and Moz. There are probably ways to introduce our own layer of talking to MozAxc to achieve the same transparency, but that would mean us writing the layer, rather than having one already out there that works. -- Chris http://clabs.org From paul.rogers at shaw.ca Thu Oct 7 21:23:09 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 07 Oct 2004 19:23:09 -0600 Subject: [Wtr-general] RE: WTR Library In-Reply-To: <1097185644.4165b96c8255c@webmail.telusplanet.net> Message-ID: <000601c4acd5$5f16d580$6400a8c0@NewDell> Hi Louanne, Probably the best thing to do right now is let us know what you want this to do, what sort of api etc. Right now it will work something like this: ie = IE.new ie.goto("http://google.com") # enter something in a text field ie.text( :name , "searchtext").set("wtr Chris Morris") # click a button ie.button( :caption , "Search").click Other controls and links will work in a similar manner. Eg ie.link( :text , "Chris Morris Home Page").click If some one wants to create some test html and maybe write some tests, go ahead! Paul -----Original Message----- From: jkohl at telusplanet.net [mailto:jkohl at telusplanet.net] Sent: 07 October 2004 15:47 To: lpoisson at starband.net Cc: paul.rogers at shaw.ca Subject: Re: WTR Library Hi Louanne; Thanks for the interest in the Web Testing with Ruby project. To get involved, check out the RubyForge project http://rubyforge.org/projects/wtr/ and join the mailing list: http://rubyforge.org/mailman/listinfo/wtr-general A lot has happened since the wiki on clabs was put together. Paul Rogers developed a library which I contributed a little bit to, and have used quite a bit for testing. Bret Pettichord and Paul have started a new project called WATIR to get a better version together. http://www.io.com/~wazmo/blog/archives/2004_08.html#000221 Under the WATIR project, a brand new version of the library is being developed and released here: http://rubyforge.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/watir/?cvsroot=wtr (download the tarball) There is some info on what has been developed so far in the mailing list archives: http://rubyforge.org/pipermail/wtr-general/2004-October/thread.html So far there is support to click buttons and to verify text in text fields. A lot of work still needs to be done, but this approach is the best so far utilizing test::unit for development. I would also contact Paul Rogers for submission information and on what needs to be developed as he and Bret are heading it up. You can contact Paul via the mailing list or through "paul.rogers at shaw.ca" These are rough requirements which Paul managed to satisfy with an IE Controller developed over the past year. The idea with the WATIR project is to make a superior library to that one. Here are my original requirements: http://www.clabs.org/wtr/index.cgi?page=/ClIEController/DefineRequiremen ts Thanks again for your interest, welcome to the Web Testing with Ruby gang. -Jonathan > Jonathan, > > As you said at clabs.org: > > "I would like to have a library of objects or functions that would > interact with all widgets on a web site. At the very least, I'd like > to help out with this project in any way I can." > > May I "join the group" so I can help organize and populate the > library? > > Thanks. > > Louanne Poisson > > > From paul.rogers at shaw.ca Fri Oct 8 00:51:54 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 07 Oct 2004 22:51:54 -0600 Subject: [Wtr-general] Text fields Message-ID: <000e01c4acf2$88de7540$6400a8c0@NewDell> I think Ive completed these - please let me know if there is anything broken, wrong etc. The unit tests don't have javascript, so we may need to revisit the fireEvents lines Im back in cvs hell, so I'll try and check them in from work tomorrow Paul -------------- next part -------------- A non-text attachment was scrubbed... Name: watir.rb Type: application/octet-stream Size: 10984 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20041007/f769322b/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: textfields_test.rb Type: application/octet-stream Size: 4794 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20041007/f769322b/attachment-0001.obj -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20041007/f769322b/attachment.html From jkohl at telusplanet.net Fri Oct 8 05:49:38 2004 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Fri, 8 Oct 2004 03:49:38 -0600 Subject: [Wtr-general] Text fields In-Reply-To: <000e01c4acf2$88de7540$6400a8c0@NewDell> Message-ID: <20041008094906.VZHB12079.priv-edtnes56.telusplanet.net@tintin> > I think Ive completed these - please let me know if there is anything > broken, wrong etc. Thanks Paul! > The unit tests don't have javascript, so we may need to revisit the > fireEvents lines > > Im back in cvs hell, so I'll try and check them in from work tomorrow Tortoise CVS is your friend. :-) -Jonathan From paul.rogers at shaw.ca Fri Oct 8 09:52:11 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 08 Oct 2004 07:52:11 -0600 Subject: [Wtr-general] Text fields Message-ID: <2cf05fe2ceb266.2ceb2662cf05fe@shaw.ca> just a few minutes after my post about cvs hell, I was thrown a lifeline by Tortoise and managed to check the code in. ----- Original Message ----- From: Jonathan Kohl Date: Friday, October 8, 2004 3:49 am Subject: RE: [Wtr-general] Text fields > > > I think Ive completed these - please let me know if there is > anything> broken, wrong etc. > Thanks Paul! > > > The unit tests don't have javascript, so we may need to revisit the > > fireEvents lines > > > > Im back in cvs hell, so I'll try and check them in from work > tomorrowTortoise CVS is your friend. :-) > > -Jonathan > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Fri Oct 8 13:59:06 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 08 Oct 2004 11:59:06 -0600 Subject: [Wtr-general] Web Testing and Ruby Message-ID: <2d34ec92d382fa.2d382fa2d34ec9@shaw.ca> Will - this is the mailing list for the wtr project. You may wawnt to sign up. The url is at: http://rubyforge.org/projects/wtr For the others on the mailing list, Will recently posted some questions about IE dom interfaces on clr: http://groups.google.ca/groups?hl=en&lr=&threadm=ck6067%24q5v%241%40license1.unx.sas.com&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26group%3Dcomp.lang.ruby From paul.rogers at shaw.ca Tue Oct 12 23:46:01 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 12 Oct 2004 21:46:01 -0600 Subject: [Wtr-general] Select boxes added to Watir In-Reply-To: <2cf05fe2ceb266.2ceb2662cf05fe@shaw.ca> Message-ID: <000a01c4b0d7$29686060$6400a8c0@NewDell> Ive checked in some code that allows a user to access select boxes. I still need to add a few things ( highlights, javascript support) any problems, please let me know Jonathan had some problems running a script against google last week, so I need to look into those. The quick workaround is to add a sleep2 to the end of the goto method Paul From jkohl at telusplanet.net Wed Oct 13 10:31:45 2004 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Wed, 13 Oct 2004 07:31:45 -0700 Subject: [Wtr-general] Select boxes added to Watir In-Reply-To: <000a01c4b0d7$29686060$6400a8c0@NewDell> References: <000a01c4b0d7$29686060$6400a8c0@NewDell> Message-ID: <1097677905.416d3c51643a8@webmail.telusplanet.net> > Ive checked in some code that allows a user to access select boxes. > I still need to add a few things ( highlights, javascript support) any > problems, please let me know Thanks Paul - I'll do a demo test based around this new functionality when I get a moment. > Jonathan had some problems running a script against google last week, so > I need to look into those. The quick workaround is to add a sleep2 to > the end of the goto method When that issue is taken care of, I'll email the google test out to the mailing list so people can see an example of WATIR driving a web page. -Jonathan > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Wed Oct 13 11:00:28 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 13 Oct 2004 09:00:28 -0600 Subject: [Wtr-general] Checkboxes Message-ID: <304ce233046efa.3046efa304ce23@shaw.ca> Ive added the checkboxes code to watir again, no support for javascript, but it will be there soon ( I promise ) Paul From paul.rogers at shaw.ca Wed Oct 13 14:38:38 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 13 Oct 2004 12:38:38 -0600 Subject: [Wtr-general] Radio Buttons Message-ID: <30934c330969f1.30969f130934c3@shaw.ca> Ive added radio buttons to watir Once again no javascript.... From paul.rogers at shaw.ca Thu Oct 14 00:26:44 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 13 Oct 2004 22:26:44 -0600 Subject: [Wtr-general] Links In-Reply-To: <30934c330969f1.30969f130934c3@shaw.ca> Message-ID: <000c01c4b1a6$035d2520$6400a8c0@NewDell> First attempt at links is now in Watir From chrismo at clabs.org Fri Oct 15 15:23:18 2004 From: chrismo at clabs.org (Chris Morris) Date: Fri, 15 Oct 2004 14:23:18 -0500 Subject: [Wtr-general] Avignon Message-ID: <417023A6.6000203@clabs.org> http://www.nolacom.com/avignon/index.asp Saw this on the XP list today -- open source testing tool that includes a .jar that can talk to IE via COM. -- Chris http://clabs.org From jkohl at telusplanet.net Fri Oct 15 15:23:10 2004 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Fri, 15 Oct 2004 12:23:10 -0700 Subject: [Wtr-general] support for "input type = file" tags Message-ID: <1097868190.4170239e2c5e1@webmail.telusplanet.net> Do we have any support for this tag available? input type = "file" name="myFile" value="" Thanks; -Jonathan From chrismo at clabs.org Fri Oct 15 15:25:55 2004 From: chrismo at clabs.org (Chris Morris) Date: Fri, 15 Oct 2004 14:25:55 -0500 Subject: [Wtr-general] Avignon In-Reply-To: <417023A6.6000203@clabs.org> References: <417023A6.6000203@clabs.org> Message-ID: <41702443.3070907@clabs.org> Chris Morris wrote: > http://www.nolacom.com/avignon/index.asp > > Saw this on the XP list today -- open source testing tool that > includes a .jar that can talk to IE via COM. Here's an example test script (xml, bleh) The TestSuite tag groups a test of acceptance tests and helps define the name for them in any errors that may occur. Note that Avignon ignores the text body of tags, so you can use it for detailed descriptions of the test. The AcceptanceTest tag delimits an individual acceptance test. It helps (with the TestSuite) define the name of the test in any errors that may occur. It is also resposible for running the setUp and tearDown scripts when the tag is opened and closed respectively. The OpenBrowser tag instantiates an instance of the browser defined by the browserClass property used for the current test runner. The OpenPage tag opens a URL given by the 'address' attribute. The XPathAssert tag allows you to assert something about the current page in the browser. In this case, we're asserting that there exists an img tag whose parent has an href attribute that points to 'download.asp'. Please see the XPath documentation at http://www.w3c.org for more information on the syntax used in the select attribute. In this test, we're searching Google for the text 'Avignon testing' and asserting that the first page of the results will have exactly one link pointing to the Avignon home page. This test is not actually guaranteed to pass, since I can't control what Google returns, but it makes a good example of the EnterText and ClickBrowser tags. It would not be a good test in the real world. -- Chris http://clabs.org From paul.rogers at shaw.ca Fri Oct 15 16:07:19 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 15 Oct 2004 14:07:19 -0600 Subject: [Wtr-general] support for "input type = file" tags Message-ID: <4440448215.4821544404@shaw.ca> eventually.... We cant directly write to this type of input. In script as soon as you try to write a value the file requester dialog will pop up ( its a security thing) We need to take the existing code that I have for manipulating the win api and make it nicer to use to fill in the file requester dialog. Its not high on my list of things to do, but if you want it pushed up, let me know Paul ----- Original Message ----- From: jkohl at telusplanet.net Date: Friday, October 15, 2004 1:23 pm Subject: [Wtr-general] support for "input type = file" tags > Do we have any support for this tag available? > > input type = "file" name="myFile" value="" > > Thanks; > > -Jonathan > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From jkohl at telusplanet.net Fri Oct 15 16:21:32 2004 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Fri, 15 Oct 2004 13:21:32 -0700 Subject: [Wtr-general] support for "input type = file" tags In-Reply-To: <4440448215.4821544404@shaw.ca> References: <4440448215.4821544404@shaw.ca> Message-ID: <1097871692.4170314c7c8e6@webmail.telusplanet.net> Thanks! > eventually.... > We cant directly write to this type of input. In script as soon as you try to > write a value the file requester dialog will pop up ( its a security thing) > We need to take the existing code that I have for manipulating the win api > and make it nicer to use to fill in the file requester dialog. right. So we'll need something for handling Windows objects as well as IE objects to handle this. > Its not high on my list of things to do, but if you want it pushed up, let me > know I don't really need it, but I have had a couple of people ask for it. I'd rather see support for JavaScript popup messages come sooner. Thanks; -Jonathan > Paul > > ----- Original Message ----- > From: jkohl at telusplanet.net > Date: Friday, October 15, 2004 1:23 pm > Subject: [Wtr-general] support for "input type = file" tags > > > Do we have any support for this tag available? > > > > input type = "file" name="myFile" value="" > > > > Thanks; > > > > -Jonathan > > > > > > _______________________________________________ > > 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 Fri Oct 15 16:58:32 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 15 Oct 2004 14:58:32 -0600 Subject: [Wtr-general] Avignon Message-ID: <5080556024.5602450805@shaw.ca> this is nice. I dont like xml, but you can write your own apps in java and then compile them. The biggest problem I have with ruby is the lack of an IDE. wtj ???? ----- Original Message ----- From: Chris Morris Date: Friday, October 15, 2004 1:23 pm Subject: [Wtr-general] Avignon > http://www.nolacom.com/avignon/index.asp > > Saw this on the XP list today -- open source testing tool that > includes > a .jar that can talk to IE via COM. > > -- > Chris > http://clabs.org > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From marick at testing.com Sat Oct 16 12:43:03 2004 From: marick at testing.com (Brian Marick) Date: Sat, 16 Oct 2004 11:43:03 -0500 Subject: [Wtr-general] API Message-ID: <72B2EAD0-1F92-11D9-9E94-0003939BC6F4@testing.com> I wonder if it would be wise to have an API (probably not the main one) that looks very much like HTTPUnit. Ease the transition? I was hard-pressed to justify a Ruby approach a couple of nights ago. Someone said that there was poorly-documented HTTPUnit support for Javascript - but I didn't get to ask how complete - and I've always thought of Javascript as a killer advantage for a COM approach(*). Off the top of my head, I couldn't think of anything but the usefulness of an interpreter and faster test-writing than in Java (once you've learned Ruby). Maybe a "Why WATIR?" document would be a good idea someday. (Maybe it exists - I'm on a plane, can't check.) * My first tack would be to try testing the Javascript with jsunit and hope I could ignore it in most through-GUI tests. Isn't a big point of javascript testing browser configuration testing? ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant www.exampler.com, www.testing.com/cgi-bin/blog Book in progress: www.exampler.com/book From jkohl at telusplanet.net Sat Oct 16 19:00:50 2004 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Sat, 16 Oct 2004 17:00:50 -0600 Subject: [Wtr-general] API In-Reply-To: <72B2EAD0-1F92-11D9-9E94-0003939BC6F4@testing.com> Message-ID: <20041016230047.TKHO16133.priv-edtnes56.telusplanet.net@tintin> > I wonder if it would be wise to have an API (probably not the main one) > that looks very much like HTTPUnit. Ease the transition? That might be a good idea. I think a good start to ease the transition is using test::unit assertions. I like the WATIR approach to interact with objects on a web page, it is more intuitive than the previous approaches. If people can get a "green bar", I think they will be more inclined to use the tool. > I was hard-pressed to justify a Ruby approach a couple of nights ago. > Someone said that there was poorly-documented HTTPUnit support for > Javascript - but I didn't get to ask how complete - and I've always > thought of Javascript as a killer advantage for a COM approach(*). Off > the top of my head, I couldn't think of anything but the usefulness of > an interpreter and faster test-writing than in Java (once you've > learned Ruby). I've never seen HTTPUnit or JWebUnit handle JavaScript although I'm sure it's possible. One of the biggest reasons for me to use the COM approach is to test at a layer of the app that is close to what the end user interacts with, and the visibility of tests developed at this layer: http://www.kohl.ca/blog/archives/000033.html > Maybe a "Why WATIR?" document would be a good idea someday. (Maybe it > exists - I'm on a plane, can't check.) That's a good idea. I think there are several very good reasons for testing against a web browser vs. only testing at the HTTP layer. I think both have their pros and cons. > * My first tack would be to try testing the Javascript with jsunit and > hope I could ignore it in most through-GUI tests. Isn't a big point of > javascript testing browser configuration testing? Browser-configuration testing with JavaScript can be a good part of it, but it's usually the way the documents are displayed in the browser (well-formed HTML, CSS is compatible, etc.) that I run into the most when doing configuration testing. I haven't tried JSUnit yet, but worked with developers who gave up on it and HTMLUnit in favor of JUnit and a bit of HTTPUnit and they relied on me to automate at the browser level to verify JavaScript etc. The tools may have improved since then, and other developers might have had better results with the tools than they did. -Jonathan From jkohl at telusplanet.net Sat Oct 16 19:04:51 2004 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Sat, 16 Oct 2004 17:04:51 -0600 Subject: [Wtr-general] API In-Reply-To: <20041016230047.TKHO16133.priv-edtnes56.telusplanet.net@tintin> Message-ID: <20041016230448.TNEZ16133.priv-edtnes56.telusplanet.net@tintin> > One of the biggest reasons for me to use the COM approach is to test at a > layer of the app that is close to what the end user interacts with, and > the > visibility of tests developed at this layer: > http://www.kohl.ca/blog/archives/000033.html I forgot to mention that another big pro for me testing at the browser layer is in computer-assisted testing. I automate some steps or a particular task against the web application, and then I take over and do exploratory testing at that point, or automate something to track down a bug. Being able to watch the test play back on a web browser is a huge testing tool for me that really helps track down bugs more quickly. http://www.kohl.ca/blog/archives/000003.html Doing a hybrid approach of some automation and some manual exploratory testing is something I find very useful. -Jonathan From chrismo at clabs.org Mon Oct 18 10:20:14 2004 From: chrismo at clabs.org (Chris Morris) Date: Mon, 18 Oct 2004 09:20:14 -0500 Subject: [Wtr-general] API In-Reply-To: <72B2EAD0-1F92-11D9-9E94-0003939BC6F4@testing.com> References: <72B2EAD0-1F92-11D9-9E94-0003939BC6F4@testing.com> Message-ID: <4173D11E.4020503@clabs.org> Brian Marick wrote: > Maybe a "Why WATIR?" document would be a good idea someday. (Maybe it > exists - I'm on a plane, can't check.) There's some various ramblings on our wiki here: http://www.clabs.org/wtr/index.cgi?page=/WhatDistinguishesUs (btw, the link to the read-write cgi script is: http://www.clabs.org/wtr/clwiki.editor.cgi?page=/WhatDistinguishesUs) -- Chris http://clabs.org From paul.rogers at shaw.ca Mon Oct 18 15:16:22 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 18 Oct 2004 13:16:22 -0600 Subject: [Wtr-general] getting elements by index Message-ID: <206256204cb0.204cb0206256@shaw.ca> Ive checked in a new version of watir.rb and some unit tests This version allows: getting objects by index: ie.button(:index , 2).click # click the second button and an alternative way of handling frames. Ive started adding some documentation for the watir.rb file. Do we want a seperate api guide? There should be unit tests for all as well Paul From paul.rogers at shaw.ca Tue Oct 19 00:01:32 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 18 Oct 2004 22:01:32 -0600 Subject: [Wtr-general] API In-Reply-To: <72B2EAD0-1F92-11D9-9E94-0003939BC6F4@testing.com> Message-ID: <000701c4b590$544172f0$6400a8c0@NewDell> Ive checked in a versoin of watir that has rdoc comments. Depending on what version of ruby you have, you may need to do some hacking to make rdoc work. Ive also attached the rdocs here Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Brian Marick Sent: 16 October 2004 10:43 To: wtr-general at rubyforge.org Subject: [Wtr-general] API I wonder if it would be wise to have an API (probably not the main one) that looks very much like HTTPUnit. Ease the transition? I was hard-pressed to justify a Ruby approach a couple of nights ago. Someone said that there was poorly-documented HTTPUnit support for Javascript - but I didn't get to ask how complete - and I've always thought of Javascript as a killer advantage for a COM approach(*). Off the top of my head, I couldn't think of anything but the usefulness of an interpreter and faster test-writing than in Java (once you've learned Ruby). Maybe a "Why WATIR?" document would be a good idea someday. (Maybe it exists - I'm on a plane, can't check.) * My first tack would be to try testing the Javascript with jsunit and hope I could ignore it in most through-GUI tests. Isn't a big point of javascript testing browser configuration testing? ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant www.exampler.com, www.testing.com/cgi-bin/blog Book in progress: www.exampler.com/book _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- A non-text attachment was scrubbed... Name: doc.zip Type: application/x-zip-compressed Size: 106086 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20041018/458c79fa/attachment.bin From chris.mcmahon at verint.com Tue Oct 19 10:23:05 2004 From: chris.mcmahon at verint.com (McMahon, Chris) Date: Tue, 19 Oct 2004 08:23:05 -0600 Subject: [Wtr-general] I'll tell ya why Javascript support... Message-ID: Hi... A consistent way to drive client-side scripting in the browser is (as far as I'm concerned) the WATIR Killer App. As far as I know, this is not really possible (consistently, at least) in any other language-- I've tried it several ways in Perl with very little success. Apparently HTTPUnit is similarly patchy. Add in reasonable support for iFrames and I will be studying Ruby right now forthwith. =) The reason it's so interesting to me (and probably lots of other mostly-silent folk) is that I have an application that uses IE as the UI, *but does not use HTTP*(!). My IE front-end is a mass of iFrames and Javascript controlling custom RPC from the browser to various (black-box) servers. So HTTPUnit is useless to me, as is Perl's WWW::Mechanize, HTTP::Recorder, etc. My only access to the server(s) is by driving the client-side scripting (and subsequently parsing the result, also on the client.) I wish I had the programming chops to help make this happen, but at this point the best I can do is cheer on other folks. Go WATIR! (I'm going back to lurking now.) -Chris From paul.rogers at shaw.ca Tue Oct 19 15:23:48 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 19 Oct 2004 13:23:48 -0600 Subject: [Wtr-general] I'll tell ya why Javascript support... Message-ID: <2ad8772aada0.2aada02ad877@shaw.ca> ok, Ive checked in some files to demo testing pages with iframes. If this doesnt point you in the direction you need for testing your app, please let me know and I'll help if I can Paul ----- Original Message ----- From: "McMahon, Chris" Date: Tuesday, October 19, 2004 8:23 am Subject: [Wtr-general] I'll tell ya why Javascript support... > > Hi... > A consistent way to drive client-side scripting in the browser > is (as far as I'm concerned) the WATIR Killer App. As far as I know, > this is not really possible (consistently, at least) in any other > language-- I've tried it several ways in Perl with very little > success.Apparently HTTPUnit is similarly patchy. > Add in reasonable support for iFrames and I will be studying > Ruby right now forthwith. =) > The reason it's so interesting to me (and probably lots of other > mostly-silent folk) is that I have an application that uses IE as the > UI, *but does not use HTTP*(!). My IE front-end is a mass of iFrames > and Javascript controlling custom RPC from the browser to various > (black-box) servers. > So HTTPUnit is useless to me, as is Perl's WWW::Mechanize, > HTTP::Recorder, etc. My only access to the server(s) is by > driving the > client-side scripting (and subsequently parsing the result, also > on the > client.) > I wish I had the programming chops to help make this happen, but > at this point the best I can do is cheer on other folks. > Go WATIR! (I'm going back to lurking now.) > -Chris > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Wed Oct 20 01:00:13 2004 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 20 Oct 2004 00:00:13 -0500 Subject: [Wtr-general] AWTA 6 Message-ID: <5.1.0.14.2.20041019235400.027a4fe0@127.0.0.1> I'll be posting an official call for participation for the Sixth Austin Workshop on Test Automation shortly. It will be Jan 7-9 in Austin. It looks like we'll be focussing on WATIR and related web testing tools. Contrasting different approaches, learning how to effectively use WATIR and hopefully coming up with ideas for improving it and actually making some of those changes during the workshop. We'll probably be charging $100 for refreshments and facilities. I'm curious to know what level of interest there might be in this. Please reply to me only. Bret P.S. One of the reasons i've been quiet lately is that we're working on something at ThoughtWorks that i think may solve an important problem that has been discussed here recently. I can't say more, except to stay tuned for further announcements. _____________________ Bret Pettichord www.pettichord.com From jbarrett at finaplex.com Wed Oct 20 14:32:02 2004 From: jbarrett at finaplex.com (Jeff Barrett) Date: Wed, 20 Oct 2004 11:32:02 -0700 Subject: [Wtr-general] unit tests and debugging Message-ID: I've been playing around a bit w/ WATIR. Unfortunately all the unit tests have failures and/or errors. I have a sneaking suspicion I'm doing something wrong but I can't figure out what. I'm running windows XP Service Pack 1, ruby 1.8.1 (tried 1.8.2 as well). I'm simply running the unit tests on the command line like so: C:\eng\other-sw\wtr\watir\unittests>ruby frame_test.rb Loaded suite frame_test Started Getting a document in a frame - frameName is: missingFrame Getting a document in a frame - frameName is: buttonFrame2 F Finished in 28.125 seconds. 1) Failure: test_frame(TC_Buttons) [frame_test.rb:37]: UnknownObjectException supposed to be thrown. exception expected but was Class: Message: <"UnknownFrameException"> ---Backtrace--- ../watir.rb:344:in `getDocument' ../watir.rb:462:in `getObject' ../watir.rb:814:in `initialize' ../watir.rb:638:in `new' ../watir.rb:638:in `button' frame_test.rb:37:in `test_frame' frame_test.rb:37:in `assert_raise' frame_test.rb:37:in `test_frame' --------------- 1 tests, 2 assertions, 1 failures, 0 errors Thanks. From paul.rogers at shaw.ca Wed Oct 20 14:57:45 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 20 Oct 2004 12:57:45 -0600 Subject: [Wtr-general] unit tests and debugging Message-ID: <3f325b3ee6cd.3ee6cd3f325b@shaw.ca> Hi Jeff, Is this a recent checkout from cvs? Are there other unit tests that fail? Ive just ran them all successfully on win2000. I can try XP tonight. There is a problem with the waitForIE that Jonathan Kohl had, but it wasnt causing any failures on the unittests Thanks Paul G:\watir\watir\unittests>frame_test.rb Loaded suite G:/watir/watir/unittests/frame_test Started frame index: 0 name: buttonFrame frame index: 1 name: buttonFrame2 Getting a document in a frame - frameName is: missingFrame Getting a document in a frame - frameName is: buttonFrame2 Getting a document in a frame - frameName is: buttonFrame .Getting a document in a frame - frameName is: buttonFrame Getting a document in a frame - frameName is: buttonFrame . Finished in 4.031 seconds. 2 tests, 7 assertions, 0 failures, 0 errors G:\watir\watir\unittests> ----- Original Message ----- From: Jeff Barrett Date: Wednesday, October 20, 2004 12:32 pm Subject: [Wtr-general] unit tests and debugging > I've been playing around a bit w/ WATIR. Unfortunately all the > unit tests have failures and/or errors. I have a sneaking > suspicion I'm doing something wrong but I can't figure out what. > I'm running windows XP Service Pack 1, ruby 1.8.1 (tried 1.8.2 as > well). I'm simply running the unit tests on the command line like so: > > C:\eng\other-sw\wtr\watir\unittests>ruby frame_test.rb > Loaded suite frame_test > Started > Getting a document in a frame - frameName is: missingFrame > Getting a document in a frame - frameName is: buttonFrame2 > F > Finished in 28.125 seconds. > > 1) Failure: > test_frame(TC_Buttons) [frame_test.rb:37]: > UnknownObjectException supposed to be thrown. > exception expected but was > Class: > Message: <"UnknownFrameException"> > ---Backtrace--- > ../watir.rb:344:in `getDocument' > ../watir.rb:462:in `getObject' > ../watir.rb:814:in `initialize' > ../watir.rb:638:in `new' > ../watir.rb:638:in `button' > frame_test.rb:37:in `test_frame' > frame_test.rb:37:in `assert_raise' > frame_test.rb:37:in `test_frame' > --------------- > > 1 tests, 2 assertions, 1 failures, 0 errors > > Thanks. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bikertech at gmail.com Wed Oct 20 15:23:29 2004 From: bikertech at gmail.com (SKieu) Date: Wed, 20 Oct 2004 14:23:29 -0500 Subject: [Wtr-general] How to get started Message-ID: Hello, I am new to the group and to WTR as well. Please tell me how to get started using WTR or you could point me to where to start. Thank you. Stephan From jkohl at telusplanet.net Wed Oct 20 15:25:37 2004 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Wed, 20 Oct 2004 12:25:37 -0700 Subject: [Wtr-general] Re: WATIR and RubyForge In-Reply-To: <3f325b3ee6cd.3ee6cd3f325b@shaw.ca> References: <3f325b3ee6cd.3ee6cd3f325b@shaw.ca> Message-ID: <1098300337.4176bbb165a8f@webmail.telusplanet.net> Can we put a WATIR package on the Summary page in the "Latest File Releases" table, and as a Package on the Files page to go along with "iec" and "scripting101"? (Could change the "wtr" one to "watir" perhaps. I think it would be easier for people to find. Thanks; -Jonathan From jkohl at telusplanet.net Wed Oct 20 15:35:32 2004 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Wed, 20 Oct 2004 12:35:32 -0700 Subject: [Wtr-general] How to get started In-Reply-To: References: Message-ID: <1098300932.4176be0442034@webmail.telusplanet.net> > I am new to the group and to WTR as well. Please tell me how to get > started using WTR or you could point me to where to start. Thank you. The latest version is the WATIR library which you can download here: http://rubyforge.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/watir/?cvsroot=wtr (click download tarball) Once you have untarred the package, go to the unit tests directory and run the unit tests, and inpsect the code to see how objects on a web page are manipulated. To get a basicidea of how WATIR works against a real web application, you can copy this simple script below, save it in the unittests directory and run it to see a simple example testing against the Google page, (unforunately it won't work properly until the waitForIE bug is fixed): #-------------------------------------------------------------------------------------------------------------# # demo test for the WATIR controller # # Simple Google test written by Jonathan Kohl 10/10/04 # Purpose: to demonstrate the following WATIR functionality: # * entering text into a text field # * clicking a button # * checking to see if a page contains text. # * using a test::unit "assert" ( http://www.nunit.org/assertions.html ) # #------------------------------------------------------------------------------------------------------------ # #includes require '../watir.rb' # the controller #test::unit includes require 'test/unit' require 'test/unit/ui/console/testrunner' require 'testUnitAddons' #code to set your current path in Windows $myDir = File.dirname(__FILE__) $LOAD_PATH << $myDir class TC_google < Test::Unit::TestCase def test_google #variables testSite = 'http://www.google.com' #open the IE browser $ie = IE.new puts '## Beginning of test: google search' puts ' ' puts 'Step 1: go to the google site: www.google.com' $ie.goto(testSite) puts ' Action: entered ' + testSite + 'in the address bar.' puts 'Step 2: enter "pickaxe: in the search text field' $ie.textField(:name, "q").set("pickaxe") # q is the name of the search field - view the source to find the name puts ' Action: entered pickaxe in the search field' puts 'Step 3: click the "Google Search" button' $ie.button(:caption, "Google Search").click puts ' Action: clicked the Google Search button.' puts 'Expected Result: ' puts ' - a google page with results should be shown. "Pragmatic Programmers LLC" should be high on the list.' puts 'Actual Result: Check that the "The Pragmatic Programmers, LLC" link actually appears on the page by using an assertion' assert($ie.pageContainsText("The Pragmatic Programmers, LLC") ) puts ' ' puts '## End of test: google search' end end # -end of simple google search test ##### Hope this helps. I have more demo tests written that I'll release once the waitForIE issue has been dealt with. -Jonathan From paul.rogers at shaw.ca Wed Oct 20 15:32:16 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 20 Oct 2004 13:32:16 -0600 Subject: [Wtr-general] How to get started Message-ID: <3fc69b3fe3f2.3fe3f23fc69b@shaw.ca> assuming you have windows, zip, and ruby 1.8 you can download a tarball of the watir code from: http://rubyforge.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/watir/?cvsroot=wtr unzip it some place nice cd to that place cd to the unittests directory run the unit tests to see if it works, there may be a problem - some people have errors running the test - if so, send the problem to the list If no problems, use the unit test code as examples for testing your web application Have fun! Paul ----- Original Message ----- From: SKieu Date: Wednesday, October 20, 2004 1:23 pm Subject: [Wtr-general] How to get started > Hello, > > I am new to the group and to WTR as well. Please tell me how to get > started using WTR or you could point me to where to start. Thank you. > > Stephan > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From jbarrett at finaplex.com Wed Oct 20 16:42:31 2004 From: jbarrett at finaplex.com (Jeff Barrett) Date: Wed, 20 Oct 2004 13:42:31 -0700 Subject: [Wtr-general] unit tests and debugging Message-ID: Hi Paul, This is a recent checkout -- I did an update right before I ran the test. I haven't run all the tests lately but I did run them all about 1.5 weeks ago and they all had errors or failures. FWIW I'm also using IE 6.0.2800. Here are some other tests -- also note how long it's taking to run them: C:\eng\other-sw\wtr\watir\unittests>ruby textfields_test.rb Loaded suite textfields_test Started ---------------- To String test ------------- E Finished in 286.092 seconds. 1) Error: test_TextField_to_s(TC_Fields): UnknownObjectException: UnknownObjectException ../watir.rb:181:in `to_s' textfields_test.rb:85:in `test_TextField_to_s' 2) Failure: test_textField_Append(TC_Fields) [textfields_test.rb:98]: ObjectReadOnlyException was supposed to be thrown. exception expected but was Class: Message: <"UnknownObjectException"> ---Backtrace--- ../watir.rb:972:in `append' textfields_test.rb:98:in `test_textField_Append' textfields_test.rb:98:in `assert_raise' textfields_test.rb:98:in `test_textField_Append' --------------- 3) Failure: test_textField_Clear(TC_Fields) [textfields_test.rb:114]: ObjectReadOnlyException was supposed to be thrown. exception expected but was Class: Message: <"UnknownObjectException"> ---Backtrace--- ../watir.rb:972:in `append' textfields_test.rb:114:in `test_textField_Clear' textfields_test.rb:114:in `assert_raise' textfields_test.rb:114:in `test_textField_Clear' --------------- 4) Failure: test_textField_Exists(TC_Fields) [textfields_test.rb:31]: is not true. 5) Failure: test_textField_Set(TC_Fields) [textfields_test.rb:129]: ObjectReadOnlyException was supposed to be thrown. exception expected but was Class: Message: <"UnknownObjectException"> ---Backtrace--- ../watir.rb:972:in `append' textfields_test.rb:129:in `test_textField_Set' textfields_test.rb:129:in `assert_raise' textfields_test.rb:129:in `test_textField_Set' --------------- 6) Error: test_textField_VerifyContents(TC_Fields): UnknownObjectException: UnknownObjectException ../watir.rb:933:in `verify_contains' textfields_test.rb:41:in `test_textField_VerifyContents' 7) Error: test_textField_enabled(TC_Fields): UnknownObjectException: UnknownObjectException ../watir.rb:243:in `enabled?' textfields_test.rb:58:in `test_textField_enabled' 8) Error: test_textField_getContents(TC_Fields): UnknownObjectException: UnknownObjectException ../watir.rb:925:in `getContents' textfields_test.rb:76:in `test_textField_getContents' 9) Error: test_textField_readOnly(TC_Fields): UnknownObjectException: UnknownObjectException ../watir.rb:918:in `readOnly?' textfields_test.rb:66:in `test_textField_readOnly' 9 tests, 5 assertions, 4 failures, 5 errors -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Paul Rogers Sent: Wednesday, October 20, 2004 11:58 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] unit tests and debugging Hi Jeff, Is this a recent checkout from cvs? Are there other unit tests that fail? Ive just ran them all successfully on win2000. I can try XP tonight. There is a problem with the waitForIE that Jonathan Kohl had, but it wasnt causing any failures on the unittests Thanks Paul From paul.rogers at shaw.ca Wed Oct 20 18:29:09 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 20 Oct 2004 16:29:09 -0600 Subject: [Wtr-general] unit tests and debugging Message-ID: <442262446003.446003442262@shaw.ca> Are you running using cygwin? I just repeated the test under that and get the same failures you do. Try running under a windows dos prompt I can make it work under cygwin easy enough ( its only the url that gets broken because of the slashes and backslashes ) - but let me know first.... Paul ----- Original Message ----- From: Jeff Barrett Date: Wednesday, October 20, 2004 2:42 pm Subject: RE: [Wtr-general] unit tests and debugging > Hi Paul, > > This is a recent checkout -- I did an update right before I ran > the test. I haven't run all the tests lately but I did run them > all about 1.5 weeks ago and they all had errors or failures. FWIW > I'm also using IE 6.0.2800. Here are some other tests -- also > note how long it's taking to run them: > > C:\eng\other-sw\wtr\watir\unittests>ruby textfields_test.rb > Loaded suite textfields_test > Started > ---------------- To String test ------------- > E > Finished in 286.092 seconds. > > 1) Error: > test_TextField_to_s(TC_Fields): > UnknownObjectException: UnknownObjectException > ../watir.rb:181:in `to_s' > textfields_test.rb:85:in `test_TextField_to_s' > > 2) Failure: > test_textField_Append(TC_Fields) [textfields_test.rb:98]: > ObjectReadOnlyException was supposed to be thrown. > exception expected but was > Class: > Message: <"UnknownObjectException"> > ---Backtrace--- > ../watir.rb:972:in `append' > textfields_test.rb:98:in `test_textField_Append' > textfields_test.rb:98:in `assert_raise' > textfields_test.rb:98:in `test_textField_Append' > --------------- > > 3) Failure: > test_textField_Clear(TC_Fields) [textfields_test.rb:114]: > ObjectReadOnlyException was supposed to be thrown. > exception expected but was > Class: > Message: <"UnknownObjectException"> > ---Backtrace--- > ../watir.rb:972:in `append' > textfields_test.rb:114:in `test_textField_Clear' > textfields_test.rb:114:in `assert_raise' > textfields_test.rb:114:in `test_textField_Clear' > --------------- > > 4) Failure: > test_textField_Exists(TC_Fields) [textfields_test.rb:31]: > is not true. > > 5) Failure: > test_textField_Set(TC_Fields) [textfields_test.rb:129]: > ObjectReadOnlyException was supposed to be thrown. > exception expected but was > Class: > Message: <"UnknownObjectException"> > ---Backtrace--- > ../watir.rb:972:in `append' > textfields_test.rb:129:in `test_textField_Set' > textfields_test.rb:129:in `assert_raise' > textfields_test.rb:129:in `test_textField_Set' > --------------- > > 6) Error: > test_textField_VerifyContents(TC_Fields): > UnknownObjectException: UnknownObjectException > ../watir.rb:933:in `verify_contains' > textfields_test.rb:41:in `test_textField_VerifyContents' > > 7) Error: > test_textField_enabled(TC_Fields): > UnknownObjectException: UnknownObjectException > ../watir.rb:243:in `enabled?' > textfields_test.rb:58:in `test_textField_enabled' > > 8) Error: > test_textField_getContents(TC_Fields): > UnknownObjectException: UnknownObjectException > ../watir.rb:925:in `getContents' > textfields_test.rb:76:in `test_textField_getContents' > > 9) Error: > test_textField_readOnly(TC_Fields): > UnknownObjectException: UnknownObjectException > ../watir.rb:918:in `readOnly?' > textfields_test.rb:66:in `test_textField_readOnly' > > 9 tests, 5 assertions, 4 failures, 5 errors > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [wtr-general-bounces at rubyforge.org]On Behalf Of Paul Rogers > Sent: Wednesday, October 20, 2004 11:58 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] unit tests and debugging > > > > Hi Jeff, > > Is this a recent checkout from cvs? Are there other unit tests > that fail? > > Ive just ran them all successfully on win2000. I can try XP tonight. > > There is a problem with the waitForIE that Jonathan Kohl had, but > it wasnt causing any failures on the unittests > > Thanks > > Paul > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Wed Oct 20 18:34:14 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 20 Oct 2004 16:34:14 -0600 Subject: [Wtr-general] unit tests and debugging Message-ID: <445c88447793.447793445c88@shaw.ca> ok I have it figured ( you're not using cygwin - I can see from the traces you sent) try running like this: textfield_test.rb instead of ruby textfield_test.rb The problem is that the path to the html gets broken I'll fix this as soon as I can ----- Original Message ----- From: Jeff Barrett Date: Wednesday, October 20, 2004 2:42 pm Subject: RE: [Wtr-general] unit tests and debugging > Hi Paul, > > This is a recent checkout -- I did an update right before I ran > the test. I haven't run all the tests lately but I did run them > all about 1.5 weeks ago and they all had errors or failures. FWIW > I'm also using IE 6.0.2800. Here are some other tests -- also > note how long it's taking to run them: > > C:\eng\other-sw\wtr\watir\unittests>ruby textfields_test.rb > Loaded suite textfields_test > Started > ---------------- To String test ------------- > E > Finished in 286.092 seconds. > > 1) Error: > test_TextField_to_s(TC_Fields): > UnknownObjectException: UnknownObjectException > ../watir.rb:181:in `to_s' > textfields_test.rb:85:in `test_TextField_to_s' > > 2) Failure: > test_textField_Append(TC_Fields) [textfields_test.rb:98]: > ObjectReadOnlyException was supposed to be thrown. > exception expected but was > Class: > Message: <"UnknownObjectException"> > ---Backtrace--- > ../watir.rb:972:in `append' > textfields_test.rb:98:in `test_textField_Append' > textfields_test.rb:98:in `assert_raise' > textfields_test.rb:98:in `test_textField_Append' > --------------- > > 3) Failure: > test_textField_Clear(TC_Fields) [textfields_test.rb:114]: > ObjectReadOnlyException was supposed to be thrown. > exception expected but was > Class: > Message: <"UnknownObjectException"> > ---Backtrace--- > ../watir.rb:972:in `append' > textfields_test.rb:114:in `test_textField_Clear' > textfields_test.rb:114:in `assert_raise' > textfields_test.rb:114:in `test_textField_Clear' > --------------- > > 4) Failure: > test_textField_Exists(TC_Fields) [textfields_test.rb:31]: > is not true. > > 5) Failure: > test_textField_Set(TC_Fields) [textfields_test.rb:129]: > ObjectReadOnlyException was supposed to be thrown. > exception expected but was > Class: > Message: <"UnknownObjectException"> > ---Backtrace--- > ../watir.rb:972:in `append' > textfields_test.rb:129:in `test_textField_Set' > textfields_test.rb:129:in `assert_raise' > textfields_test.rb:129:in `test_textField_Set' > --------------- > > 6) Error: > test_textField_VerifyContents(TC_Fields): > UnknownObjectException: UnknownObjectException > ../watir.rb:933:in `verify_contains' > textfields_test.rb:41:in `test_textField_VerifyContents' > > 7) Error: > test_textField_enabled(TC_Fields): > UnknownObjectException: UnknownObjectException > ../watir.rb:243:in `enabled?' > textfields_test.rb:58:in `test_textField_enabled' > > 8) Error: > test_textField_getContents(TC_Fields): > UnknownObjectException: UnknownObjectException > ../watir.rb:925:in `getContents' > textfields_test.rb:76:in `test_textField_getContents' > > 9) Error: > test_textField_readOnly(TC_Fields): > UnknownObjectException: UnknownObjectException > ../watir.rb:918:in `readOnly?' > textfields_test.rb:66:in `test_textField_readOnly' > > 9 tests, 5 assertions, 4 failures, 5 errors > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [wtr-general-bounces at rubyforge.org]On Behalf Of Paul Rogers > Sent: Wednesday, October 20, 2004 11:58 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] unit tests and debugging > > > > Hi Jeff, > > Is this a recent checkout from cvs? Are there other unit tests > that fail? > > Ive just ran them all successfully on win2000. I can try XP tonight. > > There is a problem with the waitForIE that Jonathan Kohl had, but > it wasnt causing any failures on the unittests > > Thanks > > Paul > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Wed Oct 20 18:46:07 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 20 Oct 2004 16:46:07 -0600 Subject: [Wtr-general] unit tests and debugging Message-ID: <4493d84454cd.4454cd4493d8@shaw.ca> Ive checked in new unit tests that should solve the problem. They dont work on cygwin, but I'll fix that soon enough Paul ----- Original Message ----- From: Paul Rogers Date: Wednesday, October 20, 2004 4:34 pm Subject: Re: RE: [Wtr-general] unit tests and debugging > ok I have it figured ( you're not using cygwin - I can see from > the traces you sent) > > try running like this: > > textfield_test.rb > > instead of > > ruby textfield_test.rb > > The problem is that the path to the html gets broken > I'll fix this as soon as I can > > > > ----- Original Message ----- > From: Jeff Barrett > Date: Wednesday, October 20, 2004 2:42 pm > Subject: RE: [Wtr-general] unit tests and debugging > > > Hi Paul, > > > > This is a recent checkout -- I did an update right before I ran > > the test. I haven't run all the tests lately but I did run them > > all about 1.5 weeks ago and they all had errors or failures. > FWIW > > I'm also using IE 6.0.2800. Here are some other tests -- also > > note how long it's taking to run them: > > > > C:\eng\other-sw\wtr\watir\unittests>ruby textfields_test.rb > > Loaded suite textfields_test > > Started > > ---------------- To String test ------------- > > E > > Finished in 286.092 seconds. > > > > 1) Error: > > test_TextField_to_s(TC_Fields): > > UnknownObjectException: UnknownObjectException > > ../watir.rb:181:in `to_s' > > textfields_test.rb:85:in `test_TextField_to_s' > > > > 2) Failure: > > test_textField_Append(TC_Fields) [textfields_test.rb:98]: > > ObjectReadOnlyException was supposed to be thrown. > > exception expected but was > > Class: > > Message: <"UnknownObjectException"> > > ---Backtrace--- > > ../watir.rb:972:in `append' > > textfields_test.rb:98:in `test_textField_Append' > > textfields_test.rb:98:in `assert_raise' > > textfields_test.rb:98:in `test_textField_Append' > > --------------- > > > > 3) Failure: > > test_textField_Clear(TC_Fields) [textfields_test.rb:114]: > > ObjectReadOnlyException was supposed to be thrown. > > exception expected but was > > Class: > > Message: <"UnknownObjectException"> > > ---Backtrace--- > > ../watir.rb:972:in `append' > > textfields_test.rb:114:in `test_textField_Clear' > > textfields_test.rb:114:in `assert_raise' > > textfields_test.rb:114:in `test_textField_Clear' > > --------------- > > > > 4) Failure: > > test_textField_Exists(TC_Fields) [textfields_test.rb:31]: > > is not true. > > > > 5) Failure: > > test_textField_Set(TC_Fields) [textfields_test.rb:129]: > > ObjectReadOnlyException was supposed to be thrown. > > exception expected but was > > Class: > > Message: <"UnknownObjectException"> > > ---Backtrace--- > > ../watir.rb:972:in `append' > > textfields_test.rb:129:in `test_textField_Set' > > textfields_test.rb:129:in `assert_raise' > > textfields_test.rb:129:in `test_textField_Set' > > --------------- > > > > 6) Error: > > test_textField_VerifyContents(TC_Fields): > > UnknownObjectException: UnknownObjectException > > ../watir.rb:933:in `verify_contains' > > textfields_test.rb:41:in `test_textField_VerifyContents' > > > > 7) Error: > > test_textField_enabled(TC_Fields): > > UnknownObjectException: UnknownObjectException > > ../watir.rb:243:in `enabled?' > > textfields_test.rb:58:in `test_textField_enabled' > > > > 8) Error: > > test_textField_getContents(TC_Fields): > > UnknownObjectException: UnknownObjectException > > ../watir.rb:925:in `getContents' > > textfields_test.rb:76:in `test_textField_getContents' > > > > 9) Error: > > test_textField_readOnly(TC_Fields): > > UnknownObjectException: UnknownObjectException > > ../watir.rb:918:in `readOnly?' > > textfields_test.rb:66:in `test_textField_readOnly' > > > > 9 tests, 5 assertions, 4 failures, 5 errors > > > > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org > > [wtr-general-bounces at rubyforge.org]On Behalf Of Paul Rogers > > Sent: Wednesday, October 20, 2004 11:58 AM > > To: wtr-general at rubyforge.org > > Subject: Re: [Wtr-general] unit tests and debugging > > > > > > > > Hi Jeff, > > > > Is this a recent checkout from cvs? Are there other unit tests > > that fail? > > > > Ive just ran them all successfully on win2000. I can try XP tonight. > > > > There is a problem with the waitForIE that Jonathan Kohl had, > but > > it wasnt causing any failures on the unittests > > > > Thanks > > > > Paul > > > > _______________________________________________ > > 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 jbarrett at finaplex.com Wed Oct 20 20:58:51 2004 From: jbarrett at finaplex.com (Jeff Barrett) Date: Wed, 20 Oct 2004 17:58:51 -0700 Subject: [Wtr-general] unit tests and debugging Message-ID: I've tested all the unit tests and they all work for me now. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Paul Rogers Sent: Wednesday, October 20, 2004 3:46 PM To: wtr-general at rubyforge.org Subject: Re: RE: [Wtr-general] unit tests and debugging Ive checked in new unit tests that should solve the problem. They dont work on cygwin, but I'll fix that soon enough Paul ----- Original Message ----- From: Paul Rogers Date: Wednesday, October 20, 2004 4:34 pm Subject: Re: RE: [Wtr-general] unit tests and debugging > ok I have it figured ( you're not using cygwin - I can see from > the traces you sent) > > try running like this: > > textfield_test.rb > > instead of > > ruby textfield_test.rb > > The problem is that the path to the html gets broken > I'll fix this as soon as I can > > > > ----- Original Message ----- > From: Jeff Barrett > Date: Wednesday, October 20, 2004 2:42 pm > Subject: RE: [Wtr-general] unit tests and debugging > > > Hi Paul, > > > > This is a recent checkout -- I did an update right before I ran > > the test. I haven't run all the tests lately but I did run them > > all about 1.5 weeks ago and they all had errors or failures. > FWIW > > I'm also using IE 6.0.2800. Here are some other tests -- also > > note how long it's taking to run them: > > > > C:\eng\other-sw\wtr\watir\unittests>ruby textfields_test.rb > > Loaded suite textfields_test > > Started > > ---------------- To String test ------------- > > E > > Finished in 286.092 seconds. > > > > 1) Error: > > test_TextField_to_s(TC_Fields): > > UnknownObjectException: UnknownObjectException > > ../watir.rb:181:in `to_s' > > textfields_test.rb:85:in `test_TextField_to_s' > > > > 2) Failure: > > test_textField_Append(TC_Fields) [textfields_test.rb:98]: > > ObjectReadOnlyException was supposed to be thrown. > > exception expected but was > > Class: > > Message: <"UnknownObjectException"> > > ---Backtrace--- > > ../watir.rb:972:in `append' > > textfields_test.rb:98:in `test_textField_Append' > > textfields_test.rb:98:in `assert_raise' > > textfields_test.rb:98:in `test_textField_Append' > > --------------- > > > > 3) Failure: > > test_textField_Clear(TC_Fields) [textfields_test.rb:114]: > > ObjectReadOnlyException was supposed to be thrown. > > exception expected but was > > Class: > > Message: <"UnknownObjectException"> > > ---Backtrace--- > > ../watir.rb:972:in `append' > > textfields_test.rb:114:in `test_textField_Clear' > > textfields_test.rb:114:in `assert_raise' > > textfields_test.rb:114:in `test_textField_Clear' > > --------------- > > > > 4) Failure: > > test_textField_Exists(TC_Fields) [textfields_test.rb:31]: > > is not true. > > > > 5) Failure: > > test_textField_Set(TC_Fields) [textfields_test.rb:129]: > > ObjectReadOnlyException was supposed to be thrown. > > exception expected but was > > Class: > > Message: <"UnknownObjectException"> > > ---Backtrace--- > > ../watir.rb:972:in `append' > > textfields_test.rb:129:in `test_textField_Set' > > textfields_test.rb:129:in `assert_raise' > > textfields_test.rb:129:in `test_textField_Set' > > --------------- > > > > 6) Error: > > test_textField_VerifyContents(TC_Fields): > > UnknownObjectException: UnknownObjectException > > ../watir.rb:933:in `verify_contains' > > textfields_test.rb:41:in `test_textField_VerifyContents' > > > > 7) Error: > > test_textField_enabled(TC_Fields): > > UnknownObjectException: UnknownObjectException > > ../watir.rb:243:in `enabled?' > > textfields_test.rb:58:in `test_textField_enabled' > > > > 8) Error: > > test_textField_getContents(TC_Fields): > > UnknownObjectException: UnknownObjectException > > ../watir.rb:925:in `getContents' > > textfields_test.rb:76:in `test_textField_getContents' > > > > 9) Error: > > test_textField_readOnly(TC_Fields): > > UnknownObjectException: UnknownObjectException > > ../watir.rb:918:in `readOnly?' > > textfields_test.rb:66:in `test_textField_readOnly' > > > > 9 tests, 5 assertions, 4 failures, 5 errors > > > > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org > > [wtr-general-bounces at rubyforge.org]On Behalf Of Paul Rogers > > Sent: Wednesday, October 20, 2004 11:58 AM > > To: wtr-general at rubyforge.org > > Subject: Re: [Wtr-general] unit tests and debugging > > > > > > > > Hi Jeff, > > > > Is this a recent checkout from cvs? Are there other unit tests > > that fail? > > > > Ive just ran them all successfully on win2000. I can try XP tonight. > > > > There is a problem with the waitForIE that Jonathan Kohl had, > but > > it wasnt causing any failures on the unittests > > > > Thanks > > > > Paul > > > > _______________________________________________ > > 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 jbarrett at finaplex.com Wed Oct 20 21:01:54 2004 From: jbarrett at finaplex.com (Jeff Barrett) Date: Wed, 20 Oct 2004 18:01:54 -0700 Subject: [Wtr-general] line endings Message-ID: I have some interesting line endings for the files checked into WATIR. When opened in notepad or wordpad no problem. When opened in XEmacs for windows or Eclipse on windows, all files had extra carriage returns that made all files appear to be double-spaced. I'm not sure if this is true of all files but I it definitely was for a few of the unit tests. I fixed this by re-checking out the files and passing the "--lf" option to cvs. The files look fine in all 4 of the editors mentioned above. From paul.rogers at shaw.ca Wed Oct 20 22:20:42 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 20 Oct 2004 20:20:42 -0600 Subject: [Wtr-general] Bug fix and google test Message-ID: <000f01c4b714$90ef0930$6400a8c0@NewDell> Ive done the bug fix that caused the googletest to break. Ive also checked in Jonathans Google Tesst into the unitTests directory Paul From jkohl at telusplanet.net Wed Oct 20 22:53:12 2004 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Wed, 20 Oct 2004 20:53:12 -0600 Subject: [Wtr-general] Bug fix and google test In-Reply-To: <000f01c4b714$90ef0930$6400a8c0@NewDell> Message-ID: <20041021025301.MIUE23612.priv-edtnes40.telusplanet.net@tintin> Thanks Paul! -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of Paul Rogers > Sent: October 20, 2004 8:21 PM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] Bug fix and google test > > Ive done the bug fix that caused the googletest to break. > > Ive also checked in Jonathans Google Tesst into the unitTests directory > > Paul > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From jkohl at telusplanet.net Thu Oct 21 15:18:20 2004 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Thu, 21 Oct 2004 12:18:20 -0700 Subject: [Wtr-general] simple WATIR tests Message-ID: <1098386300.41780b7c59102@webmail.telusplanet.net> I have a zip file of three simple WATIR test files available here: http://www.kohl.ca/downloads/ I hope they demonstrate the WATIR functionality to date. To try them out, unzip them in your watir directory using the latest package from RubyForge. This will create an "examples" folder in your watir directory. These are very simple, basic tests, but should show how to use the WATIR functions against some real-world web applications. I'll continue to enhance these and add more examples. Thanks; -Jonathan From jkohl at telusplanet.net Thu Oct 21 20:05:49 2004 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Thu, 21 Oct 2004 18:05:49 -0600 Subject: [Wtr-general] simple WATIR tests In-Reply-To: <1098386300.41780b7c59102@webmail.telusplanet.net> Message-ID: <20041022000527.GQRJ3914.priv-edtnes57.telusplanet.net@tintin> If these tests run too quickly to catch what is going on, put some "sleep 1" or "sleep 2" statements between the steps in the test case. To run the test cases, open a command prompt and cd to the water/examples directory, and type in the name of the test at the prompt: C:\dev\WTR\Oct20\watir\examples>yahooCheckbox_test.rb -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of jkohl at telusplanet.net > Sent: October 21, 2004 1:18 PM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] simple WATIR tests > > I have a zip file of three simple WATIR test files available here: > http://www.kohl.ca/downloads/ > > I hope they demonstrate the WATIR functionality to date. To try them out, > unzip > them in your watir directory using the latest package from RubyForge. This > will > create an "examples" folder in your watir directory. > > These are very simple, basic tests, but should show how to use the WATIR > functions against some real-world web applications. I'll continue to > enhance > these and add more examples. > > Thanks; > > -Jonathan > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From JPappenheim at unicru.com Tue Oct 26 16:15:39 2004 From: JPappenheim at unicru.com (John Pappenheim) Date: Tue, 26 Oct 2004 13:15:39 -0700 Subject: [Wtr-general] Using the Window Handle in a Win32API call Message-ID: <768E27A4ED256D41BB195A1B5A23D7F602B6E10E@bvtmail01.corp.unicru.com> I am having trouble figuring out how to use a Window Handle in a Win32API call. In my sample Ruby program shown below, I am trying to call GetWindowRect by supplying what I think is the Window Handle of my instance of Internet Explorer. I keep getting the following error during run time: GetWindowRect.rbw:28:in `Call': cannot convert Win32API into Integer (TypeError) from GetWindowRect.rbw:28 Can you help me figure out what I'm doing wrong? Thanks, -John Here is the code of my sample program: require 'Win32API' require 'win32ole' getCursorPos = Win32API.new("user32", "GetCursorPos", ['P'], 'V') setCursorPos = Win32API.new("user32", "SetCursorPos", ['L','L'], 'L') getWindowRect = Win32API.new("user32", "GetWindowRect", ['L','P'] , 'L') myPoint = " " * 8 # store two LONGs myRect = " " * 16 # store four LONGs # Invoke IE ie = WIN32OLE.new('InternetExplorer.Application') ie.visible = true ie.gohome # Get a handle to the active window ??? hTheActiveWindow = Win32API.new("user32", "GetActiveWindow", [], 'I') puts hTheActiveWindow # Get screen position getCursorPos.Call(myPoint) screenX, screenY = myPoint.unpack("LL") # get the actual values print "Screen position: ", screenX, " ", screenY, "\n" # Convert to window position ### Here's where I get the error ### myWindowRect = getWindowRect.Call(hTheActiveWindow, myRect) ###################### winOrigX, winOrigY, junk, junk = myWindowRect.unpack("LLLL") # get the actual values windowX = winOrigX - screenX windowY = winOrigY - screenY print "Window position: ", windowX, " ", windowY, "\n" aPoint = Array.new aPoint[0] = windowX aPoint[1] = windowY myPoint = aPoint.pack("LL") # Convert back to screen position screenX = winOrigX + windowX screenY = winOrigY + windowY setCursorPos.Call(screenX,screenY) print "Screen position: ", screenX, " ", screenY, "\n" -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20041026/5bea6cad/attachment.html From paul.rogers at shaw.ca Tue Oct 26 16:54:35 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 26 Oct 2004 14:54:35 -0600 Subject: [Wtr-general] Using the Window Handle in a Win32API call Message-ID: ie.hWnd should get you the handle of the internet explorer you are using Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C4BB98.905402D5" ------_=_NextPart_001_01C4BB98.905402D5 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I am having trouble figuring out how to use a Window Handle in a Win32API call. =20 In my sample Ruby program shown below, I am trying to call GetWindowRect by supplying what I think is the Window Handle of my instance of Internet Explorer. =20 I keep getting the following error during run time: GetWindowRect.rbw:28:in `Call': cannot convert Win32API into Integer (TypeError) from GetWindowRect.rbw:28 =20 Can you help me figure out what I'm doing wrong? Thanks, -John =20 Here is the code of my sample program: =20 require 'Win32API' require 'win32ole' =20 getCursorPos =3D Win32API.new("user32", "GetCursorPos", ['P'], 'V') setCursorPos =3D Win32API.new("user32", "SetCursorPos", ['L','L'], = 'L') getWindowRect =3D Win32API.new("user32", "GetWindowRect", ['L','P'] , = 'L') =20 myPoint =3D " " * 8 # store two LONGs myRect =3D " " * 16 # store four LONGs =20 # Invoke IE ie =3D WIN32OLE.new('InternetExplorer.Application') ie.visible =3D true ie.gohome =20 # Get a handle to the active window ??? hTheActiveWindow =3D Win32API.new("user32", "GetActiveWindow", [], 'I') puts hTheActiveWindow =20 # Get screen position getCursorPos.Call(myPoint) screenX, screenY =3D myPoint.unpack("LL") # get the actual values print "Screen position: ", screenX, " ", screenY, "\n" =20 # Convert to window position ### Here's where I get the error ### myWindowRect =3D getWindowRect.Call(hTheActiveWindow, myRect) ###################### winOrigX, winOrigY, junk, junk =3D myWindowRect.unpack("LLLL") # get the actual values windowX =3D winOrigX - screenX windowY =3D winOrigY - screenY print "Window position: ", windowX, " ", windowY, "\n" aPoint =3D Array.new aPoint[0] =3D windowX aPoint[1] =3D windowY myPoint =3D aPoint.pack("LL") =20 # Convert back to screen position screenX =3D winOrigX + windowX screenY =3D winOrigY + windowY setCursorPos.Call(screenX,screenY) print "Screen position: ", screenX, " ", screenY, "\n" =20 =20 ------_=_NextPart_001_01C4BB98.905402D5 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I am = having trouble figuring out how to use a Window Handle in a Win32API = call.

 

In my = sample Ruby program shown below, I am trying to call GetWindowRect by supplying what = I think is the Window Handle of my instance of Internet = Explorer.

 

I = keep getting the following error during run time:

GetWindowRect.rbw:28:in `Call': cannot convert Win32API = into Integer (TypeError)

         &n= bsp;  =             from GetWindowRect.rbw:28

 

Can = you help me figure out what I’m doing wrong?

Thanks,

-John

 

Here = is the code of my sample program:

 

require 'Win32API'

require 'win32ole'

 

getCursorPos    =3D Win32API.new("user32", "GetCursorPos", ['P'], = 'V')

setCursorPos    =3D Win32API.new("user32", "SetCursorPos", = ['L','L'], 'L')

getWindowRect =3D Win32API.new("user32", "GetWindowRect", = ['L','P'] , 'L')

 

myPoint =3D " " * 8    # store two LONGs

myRect =3D " " * 16    # store four = LONGs

 

# = Invoke IE

ie = =3D WIN32OLE.new('InternetExplorer.Application')

ie.visible =3D true

ie.gohome

 

# Get = a handle to the active window ???

hTheActiveWindow =3D Win32API.new("user32", "GetActiveWindow", [], = 'I')

puts hTheActiveWindow

 

# Get = screen position

getCursorPos.Call(myPoint)

screenX, screenY =3D myPoint.unpack("LL") # get the actual = values

print "Screen position: ", screenX, " ", screenY, = "\n"

 

# = Convert to window position

         &n= bsp;  ### Here’s where I get the error ###

myWindowRect =3D getWindowRect.Call(hTheActiveWindow, myRect)

         &n= bsp;  ######################

winOrigX, winOrigY, junk, junk =3D myWindowRect.unpack("LLLL") # get the = actual values

windowX =3D winOrigX - screenX

windowY =3D winOrigY - screenY

print "Window position: ", windowX, " ", windowY, = "\n"

aPoint =3D Array.new

aPoint[0] =3D windowX

aPoint[1] =3D windowY

myPoint =3D aPoint.pack("LL")

 

# = Convert back to screen position

screenX =3D winOrigX + windowX

screenY =3D winOrigY + windowY

setCursorPos.Call(screenX,screenY)

print "Screen position: ", screenX, " ", screenY, = "\n"

 

 

------_=_NextPart_001_01C4BB98.905402D5-- -------------- next part -------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Tue Oct 26 16:56:22 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 26 Oct 2004 14:56:22 -0600 Subject: [Wtr-general] Using the Window Handle in a Win32API call Message-ID: of if you want to get the handle using getActiveWindow , I think you are missing the .call for hTheActiveWindow = Win32API.new("user32", "GetActiveWindow", [], 'I') ie the above line should be hWnd = hTheActiveWindow.call Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C4BB98.905402D5" ------_=_NextPart_001_01C4BB98.905402D5 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I am having trouble figuring out how to use a Window Handle in a Win32API call. =20 In my sample Ruby program shown below, I am trying to call GetWindowRect by supplying what I think is the Window Handle of my instance of Internet Explorer. =20 I keep getting the following error during run time: GetWindowRect.rbw:28:in `Call': cannot convert Win32API into Integer (TypeError) from GetWindowRect.rbw:28 =20 Can you help me figure out what I'm doing wrong? Thanks, -John =20 Here is the code of my sample program: =20 require 'Win32API' require 'win32ole' =20 getCursorPos =3D Win32API.new("user32", "GetCursorPos", ['P'], 'V') setCursorPos =3D Win32API.new("user32", "SetCursorPos", ['L','L'], = 'L') getWindowRect =3D Win32API.new("user32", "GetWindowRect", ['L','P'] , = 'L') =20 myPoint =3D " " * 8 # store two LONGs myRect =3D " " * 16 # store four LONGs =20 # Invoke IE ie =3D WIN32OLE.new('InternetExplorer.Application') ie.visible =3D true ie.gohome =20 # Get a handle to the active window ??? hTheActiveWindow =3D Win32API.new("user32", "GetActiveWindow", [], 'I') puts hTheActiveWindow =20 # Get screen position getCursorPos.Call(myPoint) screenX, screenY =3D myPoint.unpack("LL") # get the actual values print "Screen position: ", screenX, " ", screenY, "\n" =20 # Convert to window position ### Here's where I get the error ### myWindowRect =3D getWindowRect.Call(hTheActiveWindow, myRect) ###################### winOrigX, winOrigY, junk, junk =3D myWindowRect.unpack("LLLL") # get the actual values windowX =3D winOrigX - screenX windowY =3D winOrigY - screenY print "Window position: ", windowX, " ", windowY, "\n" aPoint =3D Array.new aPoint[0] =3D windowX aPoint[1] =3D windowY myPoint =3D aPoint.pack("LL") =20 # Convert back to screen position screenX =3D winOrigX + windowX screenY =3D winOrigY + windowY setCursorPos.Call(screenX,screenY) print "Screen position: ", screenX, " ", screenY, "\n" =20 =20 ------_=_NextPart_001_01C4BB98.905402D5 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I am = having trouble figuring out how to use a Window Handle in a Win32API = call.

 

In my = sample Ruby program shown below, I am trying to call GetWindowRect by supplying what = I think is the Window Handle of my instance of Internet = Explorer.

 

I = keep getting the following error during run time:

GetWindowRect.rbw:28:in `Call': cannot convert Win32API = into Integer (TypeError)

         &n= bsp;  =             from GetWindowRect.rbw:28

 

Can = you help me figure out what I’m doing wrong?

Thanks,

-John

 

Here = is the code of my sample program:

 

require 'Win32API'

require 'win32ole'

 

getCursorPos    =3D Win32API.new("user32", "GetCursorPos", ['P'], = 'V')

setCursorPos    =3D Win32API.new("user32", "SetCursorPos", = ['L','L'], 'L')

getWindowRect =3D Win32API.new("user32", "GetWindowRect", = ['L','P'] , 'L')

 

myPoint =3D " " * 8    # store two LONGs

myRect =3D " " * 16    # store four = LONGs

 

# = Invoke IE

ie = =3D WIN32OLE.new('InternetExplorer.Application')

ie.visible =3D true

ie.gohome

 

# Get = a handle to the active window ???

hTheActiveWindow =3D Win32API.new("user32", "GetActiveWindow", [], = 'I')

puts hTheActiveWindow

 

# Get = screen position

getCursorPos.Call(myPoint)

screenX, screenY =3D myPoint.unpack("LL") # get the actual = values

print "Screen position: ", screenX, " ", screenY, = "\n"

 

# = Convert to window position

         &n= bsp;  ### Here’s where I get the error ###

myWindowRect =3D getWindowRect.Call(hTheActiveWindow, myRect)

         &n= bsp;  ######################

winOrigX, winOrigY, junk, junk =3D myWindowRect.unpack("LLLL") # get the = actual values

windowX =3D winOrigX - screenX

windowY =3D winOrigY - screenY

print "Window position: ", windowX, " ", windowY, = "\n"

aPoint =3D Array.new

aPoint[0] =3D windowX

aPoint[1] =3D windowY

myPoint =3D aPoint.pack("LL")

 

# = Convert back to screen position

screenX =3D winOrigX + windowX

screenY =3D winOrigY + windowY

setCursorPos.Call(screenX,screenY)

print "Screen position: ", screenX, " ", screenY, = "\n"

 

 

------_=_NextPart_001_01C4BB98.905402D5-- -------------- next part -------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From chrismo at clabs.org Thu Oct 28 00:55:13 2004 From: chrismo at clabs.org (Chris Morris) Date: Wed, 27 Oct 2004 23:55:13 -0500 Subject: [Wtr-general] watir Message-ID: <41807BB1.4090501@clabs.org> Hey, all. I had a chance yesterday to pull the latest CVS and browse around the new code Paul's been committing. If possible, was wondering if some of y'all could update the Wiki with information about watir. The editor cgi link is this: http://www.clabs.org/wtr/clwiki.editor.cgi?page=/FrontPage. This is purely security through obscurity at the moment, to fend of wiki hacks without causing us login hassles, so please only keep this editor link here on the mail list. Half the reason I ask for the update is just to stay current and if watir gets a release, a place to send an end-user to explain the distinctions between watir and iec so far. The other half is to remind me about how we got here with the separate code stuffs. I remember enough that I'm not against it in anyway, just needing to bring my own self back up to speed. I even think there'd been talk of merging watir and iec at a lower level, so that those that wanted to continue on with the watir interface could, but we'd have some merging of efforts under the covers to help avoid duplicate work. Now some specific code questions. I noticed the watir.rb waitForIE method has a 'sleep 3' in it, which makes the unit tests run quite slowly. I tinkered a little with removing this, and the tests I spot checked seemed to still run fine without it, and much, much faster. Does this need to be in there? Many of the unit tests I looked at have an abundance of extra, blank lines. Is this intentional? If I'm ever in one, anyone opposed to me cleaning some of those out? -- Chris http://clabs.org/blogki From chrismo at clabs.org Thu Oct 28 01:00:28 2004 From: chrismo at clabs.org (Chris Morris) Date: Thu, 28 Oct 2004 00:00:28 -0500 Subject: [Wtr-general] watir In-Reply-To: <41807BB1.4090501@clabs.org> References: <41807BB1.4090501@clabs.org> Message-ID: <41807CEC.7070907@clabs.org> Chris Morris wrote: > Half the reason I ask for the update is just to stay current and if > watir gets a release, a place to send an end-user to explain the > distinctions between watir and iec so far. The other half is to remind > me about how we got here with the separate code stuffs. I remember > enough that I'm not against it in anyway, just needing to bring my own > self back up to speed. I even think there'd been talk of merging watir > and iec at a lower level, so that those that wanted to continue on > with the watir interface could, but we'd have some merging of efforts > under the covers to help avoid duplicate work. Well, I'm a dope. Only after posting this, did I start searching through the mail list to remember Bret's post on his blog back in August. I'll do a little copy/pasting in the WTR wiki myself right now. -- Chris http://clabs.org/blogki From chrismo at clabs.org Thu Oct 28 01:17:58 2004 From: chrismo at clabs.org (Chris Morris) Date: Thu, 28 Oct 2004 00:17:58 -0500 Subject: [Wtr-general] watir In-Reply-To: <41807BB1.4090501@clabs.org> References: <41807BB1.4090501@clabs.org> Message-ID: <41808106.8010500@clabs.org> Chris Morris wrote: > Now some specific code questions. I noticed the watir.rb waitForIE > method has a 'sleep 3' in it, which makes the unit tests run quite > slowly. I tinkered a little with removing this, and the tests I spot > checked seemed to still run fine without it, and much, much faster. > Does this need to be in there? Is this related to this: http://www.clabs.org/wtr/clwiki.editor.cgi?page=/ClIEController/AddSleepCallToHelpWithRecreateBug -- Chris http://clabs.org/blogki From chrismo at clabs.org Thu Oct 28 10:10:03 2004 From: chrismo at clabs.org (Chris Morris) Date: Thu, 28 Oct 2004 09:10:03 -0500 Subject: [Wtr-general] Selenium Message-ID: <4180FDBB.8070004@clabs.org> Very cool - saw Bret's post this morning about Selenium. It's really nice seeing further developments in this arena :-) However you're contributing behind the ThoughtWorks veil, keep it up! http://www.io.com/~wazmo/blog/archives/2004_10.html#000224 http://selenium.thoughtworks.com/index.html -- Chris http://clabs.org From paul.rogers at shaw.ca Thu Oct 28 10:41:37 2004 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 28 Oct 2004 08:41:37 -0600 Subject: [Wtr-general] watir In-Reply-To: <41808106.8010500@clabs.org> Message-ID: <000001c4bcfc$3b525b10$6400a8c0@NewDell> Maybe ;-) The sleep 3 was something we put in as a work around for some pages being acessed too quickly. The bug was that I forgot the call to waitforie() in some places. Ive fixed the bug and now that sleep line should be removed. http://www.clabs.org/wtr/clwiki.editor.cgi?page=/ClIEController/AddSleep CallToHelpWithRecreateBug I think we should put the same mechanism that this page describes into watir ( a new IE being created immediatle after one closes causes various errors - I think I saw an rpc error) Im currently working on a version that will let me do: Frames("mainframe").form("form1").button(:name , "button1").click As we probably need the frames stuff for the timeclock tests Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris Morris Sent: 27 October 2004 23:18 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] watir Chris Morris wrote: > Now some specific code questions. I noticed the watir.rb waitForIE > method has a 'sleep 3' in it, which makes the unit tests run quite > slowly. I tinkered a little with removing this, and the tests I spot > checked seemed to still run fine without it, and much, much faster. > Does this need to be in there? Is this related to this: http://www.clabs.org/wtr/clwiki.editor.cgi?page=/ClIEController/AddSleep CallToHelpWithRecreateBug -- Chris http://clabs.org/blogki _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Fri Oct 29 00:54:14 2004 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 28 Oct 2004 23:54:14 -0500 Subject: [Wtr-general] Selenium In-Reply-To: <4180FDBB.8070004@clabs.org> Message-ID: <5.1.0.14.2.20041028234734.0338dde8@127.0.0.1> At 09:10 AM 10/28/2004, Chris Morris wrote: >Very cool - saw Bret's post this morning about Selenium. It's really nice >seeing further developments in this arena :-) However you're contributing >behind the ThoughtWorks veil, keep it up! > >http://www.io.com/~wazmo/blog/archives/2004_10.html#000224 >http://selenium.thoughtworks.com/index.html As i said on my blog, we are working to make the core selenium technology -- demonstrated here with Fit-style tests -- accessible from languages like ruby. I believe that joining WATIR and Selenium will give me a test tool that will be good enough to use as basis for a book on test scripting patterns. It'll also run on a Mac, which means i'll be able to get Brian to read it. Bret _____________________ Bret Pettichord www.pettichord.com