From tuyet.ctn at mscibarra.com Wed Jun 1 18:08:43 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Wed, 1 Jun 2005 15:08:43 -0700 Subject: [Wtr-general] Access is denied (some good news and some questions) Message-ID: After reading the document you suggested "About Cross-Frame Scripting and Security" on the msdn site, I talked to the developer and she did modify the domain.document to expand the range of permissible access for the Login page that I am automating with Watir. But I still get "Access is denied" issue just like before. Do I need to do anything on my end to make it work? How can I see what the domain.document value is? On the good news front: I tried a different route by downloading Watir and Ruby on the same server machine that the Login page resides and I was able to get the script to work! Very impressive and easy once I got rid of the "Access is denied" issue. However, this brings up the question that my manager will ask: Does this mean that all Watir scripts can only be run on the same server domain where the application resides? No cross-domain is possible? That may be an issue in my company since we have to be able to start automation scripts from different domains. We are currently using SilkTest and have no problem doing that. I must say that after coding Watir and seeing how it works, I don't want to go back to using SilkTest again! Yikes, all those declarations and methods and changes that constantly need to be maintained. It's really great to see the difference. Thanks! I'd like your input though on the "Access is denied" issue as I am sure this is experienced by many users of Watir. Thanks again! -----Original Message----- From: wtr-general-request at rubyforge.org [mailto:wtr-general-request at rubyforge.org] Sent: Tuesday, May 31, 2005 2:18 PM To: wtr-general at rubyforge.org Subject: Wtr-general Digest, Vol 18, Issue 50 Send Wtr-general mailing list submissions to wtr-general at rubyforge.org To subscribe or unsubscribe via the World Wide Web, visit http://rubyforge.org/mailman/listinfo/wtr-general or, via email, send a message with subject or body 'help' to wtr-general-request at rubyforge.org You can reach the person managing the list at wtr-general-owner at rubyforge.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Wtr-general digest..." Today's Topics: 1. Re: checkboxes inside span inside table cell (Shao Kang Tat) 2. RE: checkboxes inside span inside table cell (Zeljko Filipin) 3. RE: checkboxes inside span inside table cell (Paul Rogers) 4. physical tab (Shao Kang Tat) 5. RE: physical tab (Paul Rogers) 6. Re: physical tab (John Lloyd-Jones) 7. Re: physical tab (Shao Kang Tat) 8. Re: physical tab (jkohl at telusplanet.net) ---------------------------------------------------------------------- Message: 1 Date: Tue, 31 May 2005 11:46:45 -0400 From: Shao Kang Tat Subject: Re: [Wtr-general] checkboxes inside span inside table cell To: wtr-general at rubyforge.org Message-ID: <593b9ae80505310846377fe65e at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 ahoy hoy, I'm using winCVS but when I login I get this: cvs -d ":pserver:anonymous at rubyforge.org:/var/cvs/wtr login" login Logging in to :pserver:anonymous at rubyforge.org:2401:/var/cvs/wtr login cvs [login aborted]: /var/cvs/wtr login: no such repository Any tips on using WinCVS to do this properly? Shao On 5/31/05, Paul Rogers wrote: > This is fixed in cvs. > Im sure there was a unittest for it but maybe not as it wasn't failing. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 30 May 2005 10:30 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] checkboxes inside span inside table cell > > > Hello all, > > when I have a checkbox that is disabled, that is wrapped inside a span > that has no id, that exists in some table cell, how do I get WATIR to > click on that span? Here is the code for the cell: > > > > id='ApprovedDI_USMPG_376' value='true' disabled > > > > > what happens is that if the user clicks on this disabled checkbox, a > modal dialog box appears. Clicking on this checkbox through watir > produces an error, obviously, since the checkbox is disabled. I have > tried the following, to no avail: > > t[some_row][some_column].span(:id, //).click > t[some_row][some_column].span(:id, /.*/).click > > both which produce: > > NoMethodError: undefined method `activeObjectHighLightColor' for > # ell:0x2ac92d8> > > on the other hand if I were to do > > t[some_row][some_column].checkbox(:id, //).set > > I get: > > Watir::Exception::ObjectDisabledException: object id and (?-mix:) is > disabled > > which is expected...so why is it that I can access the checkbox inside > the span but not the span itself? > > Thanks > > Shao > > _______________________________________________ > 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 > ------------------------------ Message: 2 Date: Tue, 31 May 2005 18:03:21 +0200 From: "Zeljko Filipin" Subject: RE: [Wtr-general] checkboxes inside span inside table cell To: Message-ID: <429c8a9f.6b661ebc.61de.132d at mx.gmail.com> Content-Type: text/plain; charset="us-ascii" I do not know about winCVS, but if you just want the latest of Watir, point your favourite browser to http://rubyforge.org/cgi-bin/viewcvs.cgi/?cvsroot=wtr and click Download tarball. Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: Tuesday, May 31, 2005 5:47 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] checkboxes inside span inside table cell ahoy hoy, I'm using winCVS but when I login I get this: cvs -d ":pserver:anonymous at rubyforge.org:/var/cvs/wtr login" login Logging in to :pserver:anonymous at rubyforge.org:2401:/var/cvs/wtr login cvs [login aborted]: /var/cvs/wtr login: no such repository Any tips on using WinCVS to do this properly? Shao On 5/31/05, Paul Rogers wrote: > This is fixed in cvs. > Im sure there was a unittest for it but maybe not as it wasn't failing. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 30 May 2005 10:30 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] checkboxes inside span inside table cell > > > Hello all, > > when I have a checkbox that is disabled, that is wrapped inside a span > that has no id, that exists in some table cell, how do I get WATIR to > click on that span? Here is the code for the cell: > > > > id='ApprovedDI_USMPG_376' value='true' disabled > > > > > what happens is that if the user clicks on this disabled checkbox, a > modal dialog box appears. Clicking on this checkbox through watir > produces an error, obviously, since the checkbox is disabled. I have > tried the following, to no avail: > > t[some_row][some_column].span(:id, //).click > t[some_row][some_column].span(:id, /.*/).click > > both which produce: > > NoMethodError: undefined method `activeObjectHighLightColor' for > # ell:0x2ac92d8> > > on the other hand if I were to do > > t[some_row][some_column].checkbox(:id, //).set > > I get: > > Watir::Exception::ObjectDisabledException: object id and (?-mix:) is > disabled > > which is expected...so why is it that I can access the checkbox inside > the span but not the span itself? > > Thanks > > Shao > > _______________________________________________ > 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 ------------------------------ Message: 3 Date: Tue, 31 May 2005 10:12:40 -0600 From: Paul Rogers Subject: RE: [Wtr-general] checkboxes inside span inside table cell To: wtr-general at rubyforge.org Message-ID: <003501c565fb$916eedd0$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii Make sure you don't download the 'in development 2.0' stream, it may not work properly right now. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: 31 May 2005 10:03 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] checkboxes inside span inside table cell I do not know about winCVS, but if you just want the latest of Watir, point your favourite browser to http://rubyforge.org/cgi-bin/viewcvs.cgi/?cvsroot=wtr and click Download tarball. Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: Tuesday, May 31, 2005 5:47 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] checkboxes inside span inside table cell ahoy hoy, I'm using winCVS but when I login I get this: cvs -d ":pserver:anonymous at rubyforge.org:/var/cvs/wtr login" login Logging in to :pserver:anonymous at rubyforge.org:2401:/var/cvs/wtr login cvs [login aborted]: /var/cvs/wtr login: no such repository Any tips on using WinCVS to do this properly? Shao On 5/31/05, Paul Rogers wrote: > This is fixed in cvs. > Im sure there was a unittest for it but maybe not as it wasn't > failing. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 30 May 2005 10:30 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] checkboxes inside span inside table cell > > > Hello all, > > when I have a checkbox that is disabled, that is wrapped inside a span > that has no id, that exists in some table cell, how do I get WATIR to > click on that span? Here is the code for the cell: > > > > id='ApprovedDI_USMPG_376' value='true' disabled > > > > > what happens is that if the user clicks on this disabled checkbox, a > modal dialog box appears. Clicking on this checkbox through watir > produces an error, obviously, since the checkbox is disabled. I have > tried the following, to no avail: > > t[some_row][some_column].span(:id, //).click > t[some_row][some_column].span(:id, /.*/).click > > both which produce: > > NoMethodError: undefined method `activeObjectHighLightColor' for > # > > on the other hand if I were to do > > t[some_row][some_column].checkbox(:id, //).set > > I get: > > Watir::Exception::ObjectDisabledException: object id and (?-mix:) is > disabled > > which is expected...so why is it that I can access the checkbox inside > the span but not the span itself? > > Thanks > > Shao > > _______________________________________________ > 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 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------ Message: 4 Date: Tue, 31 May 2005 14:42:09 -0400 From: Shao Kang Tat Subject: [Wtr-general] physical tab To: wtr-general at rubyforge.org Message-ID: <593b9ae80505311142284bad03 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 is there a way that watir can send a physical tab after entering some text into a text_field? I've tried: ie.text_field(:id, "blah").set("test test \t") ie.text_field(:id, "blah").set("test test" + 9.chr) both just put the # of spaces that is equivalent to a tab instead of actually sending a tab...the webpage I'm testing now works in a strange way such that pressing enter does nothing and the only way I can get it to do the right thing is by pressing tab... Thanks Shao ------------------------------ Message: 5 Date: Tue, 31 May 2005 12:58:27 -0600 From: Paul Rogers Subject: RE: [Wtr-general] physical tab To: wtr-general at rubyforge.org Message-ID: <004201c56612$bab78140$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii Watir installs AutoIt to do this type of stuff. Heres an example of how to do it ( I havent tried it......) require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') autoit.Send "{ENTER}" You can look at the autoit user manual, Start Button -> All Programs->Watir->AutoIt Reference There will be details on how to use the cursor keys and tab -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 31 May 2005 12:42 To: wtr-general at rubyforge.org Subject: [Wtr-general] physical tab is there a way that watir can send a physical tab after entering some text into a text_field? I've tried: ie.text_field(:id, "blah").set("test test \t") ie.text_field(:id, "blah").set("test test" + 9.chr) both just put the # of spaces that is equivalent to a tab instead of actually sending a tab...the webpage I'm testing now works in a strange way such that pressing enter does nothing and the only way I can get it to do the right thing is by pressing tab... Thanks Shao _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------ Message: 6 Date: Tue, 31 May 2005 13:37:49 -0700 From: John Lloyd-Jones Subject: Re: [Wtr-general] physical tab To: wtr-general at rubyforge.org Message-ID: <6fcd26f10505311337394390a7 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Shao I'm not quite sure exactly what your page requires, but I believe your situation may be similar to one I encountered: users enter some text in a field, the page parses (and validates) the input when the user leaves the field (e.g. by tabbing to the next field). If this is your situation, you can explicitly trigger the onblur event: $ie.textField(:id, "classStart").set(testData['classStart']) $ie.textField(:id, "classStart").fireEvent("onBlur"); # trigger parsing John On 5/31/05, Shao Kang Tat wrote: > is there a way that watir can send a physical tab after entering some > text into a text_field? > > I've tried: > > ie.text_field(:id, "blah").set("test test \t") > ie.text_field(:id, "blah").set("test test" + 9.chr) > > both just put the # of spaces that is equivalent to a tab instead of > actually sending a tab...the webpage I'm testing now works in a > strange way such that pressing enter does nothing and the only way I > can get it to do the right thing is by pressing tab... > > Thanks > > Shao > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > ------------------------------ Message: 7 Date: Tue, 31 May 2005 17:13:52 -0400 From: Shao Kang Tat Subject: Re: [Wtr-general] physical tab To: wtr-general at rubyforge.org Message-ID: <593b9ae805053114134eeca70d at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Hey thanks! Actually, it is something similar because I know there is an onBlur for that field. I will try that tomorrow at work. Autoit is working for me with the tab as well. This is actually in relation to my earlier post about Watir being able to getAllContents for a select_list that is generated by javascript but not actually being able to select one of those options it "sees". Maybe I'll post the HTML that does it tomorrow as it is an interesting case..probably not worthwhile to look too much into it cuz it's probably a rare case (this site I'm testing has many many many rules and ways of doing things) Shao On 5/31/05, John Lloyd-Jones wrote: > Shao > I'm not quite sure exactly what your page requires, but I believe your > situation may be similar to one I encountered: users enter some text > in a field, the page parses (and validates) the input when the user > leaves the field (e.g. by tabbing to the next field). If this is your > situation, you can explicitly trigger the onblur event: > > $ie.textField(:id, "classStart").set(testData['classStart']) > $ie.textField(:id, "classStart").fireEvent("onBlur"); # trigger parsing > > John > > > On 5/31/05, Shao Kang Tat wrote: > > is there a way that watir can send a physical tab after entering some > > text into a text_field? > > > > I've tried: > > > > ie.text_field(:id, "blah").set("test test \t") > > ie.text_field(:id, "blah").set("test test" + 9.chr) > > > > both just put the # of spaces that is equivalent to a tab instead of > > actually sending a tab...the webpage I'm testing now works in a > > strange way such that pressing enter does nothing and the only way I > > can get it to do the right thing is by pressing tab... > > > > Thanks > > > > Shao > > > > _______________________________________________ > > 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 > ------------------------------ Message: 8 Date: Tue, 31 May 2005 14:25:12 -0700 From: jkohl at telusplanet.net Subject: Re: [Wtr-general] physical tab To: wtr-general at rubyforge.org Message-ID: <1117574712.429cd638e1536 at webmail.telusplanet.net> Content-Type: text/plain; charset=ISO-8859-1 > Actually, it is something similar because I know there is an onBlur > for that field. I will try that tomorrow at work. Autoit is working > for me with the tab as well. > This is actually in relation to my earlier post about Watir being able > to getAllContents for a select_list that is generated by javascript > but not actually being able to select one of those options it "sees". A lot of those things might be driven by JavaScript events in the page. Check out "js_events_test.rb" in the unittests directory for some simple fire_event examples. The "fire_event" method can be useful since many text_fields have all sorts of events tied to them. > Maybe I'll post the HTML that does it tomorrow as it is an interesting > case..probably not worthwhile to look too much into it cuz it's > probably a rare case (this site I'm testing has many many many rules > and ways of doing things) It would be worthwhile - at the very least it makes it easier to suggest things to try. -Jonathan > On 5/31/05, John Lloyd-Jones wrote: > > Shao > > I'm not quite sure exactly what your page requires, but I believe your > > situation may be similar to one I encountered: users enter some text > > in a field, the page parses (and validates) the input when the user > > leaves the field (e.g. by tabbing to the next field). If this is your > > situation, you can explicitly trigger the onblur event: > > > > $ie.textField(:id, "classStart").set(testData['classStart']) > > $ie.textField(:id, "classStart").fireEvent("onBlur"); # trigger parsing > > > > John > > > > > > On 5/31/05, Shao Kang Tat wrote: > > > is there a way that watir can send a physical tab after entering some > > > text into a text_field? > > > > > > I've tried: > > > > > > ie.text_field(:id, "blah").set("test test \t") > > > ie.text_field(:id, "blah").set("test test" + 9.chr) > > > > > > both just put the # of spaces that is equivalent to a tab instead of > > > actually sending a tab...the webpage I'm testing now works in a > > > strange way such that pressing enter does nothing and the only way I > > > can get it to do the right thing is by pressing tab... > > > > > > Thanks > > > > > > Shao > > > > > > _______________________________________________ > > > 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 > ------------------------------ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general End of Wtr-general Digest, Vol 18, Issue 50 ******************************************* From irushton at olysoftit.com Wed Jun 1 18:47:58 2005 From: irushton at olysoftit.com (Ian Rushton) Date: Wed, 1 Jun 2005 18:47:58 -0400 Subject: [Wtr-general] Access is denied (some good news and some questions) In-Reply-To: Message-ID: <200506012240.j51MexdS026311@rubyforge.org> Tuyet, I solved all my cross domain logins by using a direct goto the cross domain URL. So in my script I invoke the frameset that that has both frames one cross domain and one not. Then I invoke a the cross domain URL directly using a goto URL. The only downside to this is that you have to maintain the cross domain URL. There is probably a way you could extract the URL using the .text method into a variable then invoke it with a goto to avoid the maintenance. Ian Rushton -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Tuyet Cong-Ton-Nu Sent: Wednesday, June 01, 2005 6:09 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] Access is denied (some good news and some questions) After reading the document you suggested "About Cross-Frame Scripting and Security" on the msdn site, I talked to the developer and she did modify the domain.document to expand the range of permissible access for the Login page that I am automating with Watir. But I still get "Access is denied" issue just like before. Do I need to do anything on my end to make it work? How can I see what the domain.document value is? On the good news front: I tried a different route by downloading Watir and Ruby on the same server machine that the Login page resides and I was able to get the script to work! Very impressive and easy once I got rid of the "Access is denied" issue. However, this brings up the question that my manager will ask: Does this mean that all Watir scripts can only be run on the same server domain where the application resides? No cross-domain is possible? That may be an issue in my company since we have to be able to start automation scripts from different domains. We are currently using SilkTest and have no problem doing that. I must say that after coding Watir and seeing how it works, I don't want to go back to using SilkTest again! Yikes, all those declarations and methods and changes that constantly need to be maintained. It's really great to see the difference. Thanks! I'd like your input though on the "Access is denied" issue as I am sure this is experienced by many users of Watir. Thanks again! -----Original Message----- From: wtr-general-request at rubyforge.org [mailto:wtr-general-request at rubyforge.org] Sent: Tuesday, May 31, 2005 2:18 PM To: wtr-general at rubyforge.org Subject: Wtr-general Digest, Vol 18, Issue 50 Send Wtr-general mailing list submissions to wtr-general at rubyforge.org To subscribe or unsubscribe via the World Wide Web, visit http://rubyforge.org/mailman/listinfo/wtr-general or, via email, send a message with subject or body 'help' to wtr-general-request at rubyforge.org You can reach the person managing the list at wtr-general-owner at rubyforge.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Wtr-general digest..." Today's Topics: 1. Re: checkboxes inside span inside table cell (Shao Kang Tat) 2. RE: checkboxes inside span inside table cell (Zeljko Filipin) 3. RE: checkboxes inside span inside table cell (Paul Rogers) 4. physical tab (Shao Kang Tat) 5. RE: physical tab (Paul Rogers) 6. Re: physical tab (John Lloyd-Jones) 7. Re: physical tab (Shao Kang Tat) 8. Re: physical tab (jkohl at telusplanet.net) ---------------------------------------------------------------------- Message: 1 Date: Tue, 31 May 2005 11:46:45 -0400 From: Shao Kang Tat Subject: Re: [Wtr-general] checkboxes inside span inside table cell To: wtr-general at rubyforge.org Message-ID: <593b9ae80505310846377fe65e at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 ahoy hoy, I'm using winCVS but when I login I get this: cvs -d ":pserver:anonymous at rubyforge.org:/var/cvs/wtr login" login Logging in to :pserver:anonymous at rubyforge.org:2401:/var/cvs/wtr login cvs [login aborted]: /var/cvs/wtr login: no such repository Any tips on using WinCVS to do this properly? Shao On 5/31/05, Paul Rogers wrote: > This is fixed in cvs. > Im sure there was a unittest for it but maybe not as it wasn't failing. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 30 May 2005 10:30 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] checkboxes inside span inside table cell > > > Hello all, > > when I have a checkbox that is disabled, that is wrapped inside a span > that has no id, that exists in some table cell, how do I get WATIR to > click on that span? Here is the code for the cell: > > > > id='ApprovedDI_USMPG_376' value='true' disabled > > > > > what happens is that if the user clicks on this disabled checkbox, a > modal dialog box appears. Clicking on this checkbox through watir > produces an error, obviously, since the checkbox is disabled. I have > tried the following, to no avail: > > t[some_row][some_column].span(:id, //).click > t[some_row][some_column].span(:id, /.*/).click > > both which produce: > > NoMethodError: undefined method `activeObjectHighLightColor' for > # ell:0x2ac92d8> > > on the other hand if I were to do > > t[some_row][some_column].checkbox(:id, //).set > > I get: > > Watir::Exception::ObjectDisabledException: object id and (?-mix:) is > disabled > > which is expected...so why is it that I can access the checkbox inside > the span but not the span itself? > > Thanks > > Shao > > _______________________________________________ > 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 > ------------------------------ Message: 2 Date: Tue, 31 May 2005 18:03:21 +0200 From: "Zeljko Filipin" Subject: RE: [Wtr-general] checkboxes inside span inside table cell To: Message-ID: <429c8a9f.6b661ebc.61de.132d at mx.gmail.com> Content-Type: text/plain; charset="us-ascii" I do not know about winCVS, but if you just want the latest of Watir, point your favourite browser to http://rubyforge.org/cgi-bin/viewcvs.cgi/?cvsroot=wtr and click Download tarball. Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: Tuesday, May 31, 2005 5:47 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] checkboxes inside span inside table cell ahoy hoy, I'm using winCVS but when I login I get this: cvs -d ":pserver:anonymous at rubyforge.org:/var/cvs/wtr login" login Logging in to :pserver:anonymous at rubyforge.org:2401:/var/cvs/wtr login cvs [login aborted]: /var/cvs/wtr login: no such repository Any tips on using WinCVS to do this properly? Shao On 5/31/05, Paul Rogers wrote: > This is fixed in cvs. > Im sure there was a unittest for it but maybe not as it wasn't failing. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 30 May 2005 10:30 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] checkboxes inside span inside table cell > > > Hello all, > > when I have a checkbox that is disabled, that is wrapped inside a span > that has no id, that exists in some table cell, how do I get WATIR to > click on that span? Here is the code for the cell: > > > > id='ApprovedDI_USMPG_376' value='true' disabled > > > > > what happens is that if the user clicks on this disabled checkbox, a > modal dialog box appears. Clicking on this checkbox through watir > produces an error, obviously, since the checkbox is disabled. I have > tried the following, to no avail: > > t[some_row][some_column].span(:id, //).click > t[some_row][some_column].span(:id, /.*/).click > > both which produce: > > NoMethodError: undefined method `activeObjectHighLightColor' for > # ell:0x2ac92d8> > > on the other hand if I were to do > > t[some_row][some_column].checkbox(:id, //).set > > I get: > > Watir::Exception::ObjectDisabledException: object id and (?-mix:) is > disabled > > which is expected...so why is it that I can access the checkbox inside > the span but not the span itself? > > Thanks > > Shao > > _______________________________________________ > 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 ------------------------------ Message: 3 Date: Tue, 31 May 2005 10:12:40 -0600 From: Paul Rogers Subject: RE: [Wtr-general] checkboxes inside span inside table cell To: wtr-general at rubyforge.org Message-ID: <003501c565fb$916eedd0$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii Make sure you don't download the 'in development 2.0' stream, it may not work properly right now. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: 31 May 2005 10:03 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] checkboxes inside span inside table cell I do not know about winCVS, but if you just want the latest of Watir, point your favourite browser to http://rubyforge.org/cgi-bin/viewcvs.cgi/?cvsroot=wtr and click Download tarball. Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: Tuesday, May 31, 2005 5:47 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] checkboxes inside span inside table cell ahoy hoy, I'm using winCVS but when I login I get this: cvs -d ":pserver:anonymous at rubyforge.org:/var/cvs/wtr login" login Logging in to :pserver:anonymous at rubyforge.org:2401:/var/cvs/wtr login cvs [login aborted]: /var/cvs/wtr login: no such repository Any tips on using WinCVS to do this properly? Shao On 5/31/05, Paul Rogers wrote: > This is fixed in cvs. > Im sure there was a unittest for it but maybe not as it wasn't > failing. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 30 May 2005 10:30 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] checkboxes inside span inside table cell > > > Hello all, > > when I have a checkbox that is disabled, that is wrapped inside a span > that has no id, that exists in some table cell, how do I get WATIR to > click on that span? Here is the code for the cell: > > > > id='ApprovedDI_USMPG_376' value='true' disabled > > > > > what happens is that if the user clicks on this disabled checkbox, a > modal dialog box appears. Clicking on this checkbox through watir > produces an error, obviously, since the checkbox is disabled. I have > tried the following, to no avail: > > t[some_row][some_column].span(:id, //).click > t[some_row][some_column].span(:id, /.*/).click > > both which produce: > > NoMethodError: undefined method `activeObjectHighLightColor' for > # > > on the other hand if I were to do > > t[some_row][some_column].checkbox(:id, //).set > > I get: > > Watir::Exception::ObjectDisabledException: object id and (?-mix:) is > disabled > > which is expected...so why is it that I can access the checkbox inside > the span but not the span itself? > > Thanks > > Shao > > _______________________________________________ > 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 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------ Message: 4 Date: Tue, 31 May 2005 14:42:09 -0400 From: Shao Kang Tat Subject: [Wtr-general] physical tab To: wtr-general at rubyforge.org Message-ID: <593b9ae80505311142284bad03 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 is there a way that watir can send a physical tab after entering some text into a text_field? I've tried: ie.text_field(:id, "blah").set("test test \t") ie.text_field(:id, "blah").set("test test" + 9.chr) both just put the # of spaces that is equivalent to a tab instead of actually sending a tab...the webpage I'm testing now works in a strange way such that pressing enter does nothing and the only way I can get it to do the right thing is by pressing tab... Thanks Shao ------------------------------ Message: 5 Date: Tue, 31 May 2005 12:58:27 -0600 From: Paul Rogers Subject: RE: [Wtr-general] physical tab To: wtr-general at rubyforge.org Message-ID: <004201c56612$bab78140$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii Watir installs AutoIt to do this type of stuff. Heres an example of how to do it ( I havent tried it......) require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') autoit.Send "{ENTER}" You can look at the autoit user manual, Start Button -> All Programs->Watir->AutoIt Reference There will be details on how to use the cursor keys and tab -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 31 May 2005 12:42 To: wtr-general at rubyforge.org Subject: [Wtr-general] physical tab is there a way that watir can send a physical tab after entering some text into a text_field? I've tried: ie.text_field(:id, "blah").set("test test \t") ie.text_field(:id, "blah").set("test test" + 9.chr) both just put the # of spaces that is equivalent to a tab instead of actually sending a tab...the webpage I'm testing now works in a strange way such that pressing enter does nothing and the only way I can get it to do the right thing is by pressing tab... Thanks Shao _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------ Message: 6 Date: Tue, 31 May 2005 13:37:49 -0700 From: John Lloyd-Jones Subject: Re: [Wtr-general] physical tab To: wtr-general at rubyforge.org Message-ID: <6fcd26f10505311337394390a7 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Shao I'm not quite sure exactly what your page requires, but I believe your situation may be similar to one I encountered: users enter some text in a field, the page parses (and validates) the input when the user leaves the field (e.g. by tabbing to the next field). If this is your situation, you can explicitly trigger the onblur event: $ie.textField(:id, "classStart").set(testData['classStart']) $ie.textField(:id, "classStart").fireEvent("onBlur"); # trigger parsing John On 5/31/05, Shao Kang Tat wrote: > is there a way that watir can send a physical tab after entering some > text into a text_field? > > I've tried: > > ie.text_field(:id, "blah").set("test test \t") > ie.text_field(:id, "blah").set("test test" + 9.chr) > > both just put the # of spaces that is equivalent to a tab instead of > actually sending a tab...the webpage I'm testing now works in a > strange way such that pressing enter does nothing and the only way I > can get it to do the right thing is by pressing tab... > > Thanks > > Shao > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > ------------------------------ Message: 7 Date: Tue, 31 May 2005 17:13:52 -0400 From: Shao Kang Tat Subject: Re: [Wtr-general] physical tab To: wtr-general at rubyforge.org Message-ID: <593b9ae805053114134eeca70d at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Hey thanks! Actually, it is something similar because I know there is an onBlur for that field. I will try that tomorrow at work. Autoit is working for me with the tab as well. This is actually in relation to my earlier post about Watir being able to getAllContents for a select_list that is generated by javascript but not actually being able to select one of those options it "sees". Maybe I'll post the HTML that does it tomorrow as it is an interesting case..probably not worthwhile to look too much into it cuz it's probably a rare case (this site I'm testing has many many many rules and ways of doing things) Shao On 5/31/05, John Lloyd-Jones wrote: > Shao > I'm not quite sure exactly what your page requires, but I believe your > situation may be similar to one I encountered: users enter some text > in a field, the page parses (and validates) the input when the user > leaves the field (e.g. by tabbing to the next field). If this is your > situation, you can explicitly trigger the onblur event: > > $ie.textField(:id, "classStart").set(testData['classStart']) > $ie.textField(:id, "classStart").fireEvent("onBlur"); # trigger parsing > > John > > > On 5/31/05, Shao Kang Tat wrote: > > is there a way that watir can send a physical tab after entering some > > text into a text_field? > > > > I've tried: > > > > ie.text_field(:id, "blah").set("test test \t") > > ie.text_field(:id, "blah").set("test test" + 9.chr) > > > > both just put the # of spaces that is equivalent to a tab instead of > > actually sending a tab...the webpage I'm testing now works in a > > strange way such that pressing enter does nothing and the only way I > > can get it to do the right thing is by pressing tab... > > > > Thanks > > > > Shao > > > > _______________________________________________ > > 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 > ------------------------------ Message: 8 Date: Tue, 31 May 2005 14:25:12 -0700 From: jkohl at telusplanet.net Subject: Re: [Wtr-general] physical tab To: wtr-general at rubyforge.org Message-ID: <1117574712.429cd638e1536 at webmail.telusplanet.net> Content-Type: text/plain; charset=ISO-8859-1 > Actually, it is something similar because I know there is an onBlur > for that field. I will try that tomorrow at work. Autoit is working > for me with the tab as well. > This is actually in relation to my earlier post about Watir being able > to getAllContents for a select_list that is generated by javascript > but not actually being able to select one of those options it "sees". A lot of those things might be driven by JavaScript events in the page. Check out "js_events_test.rb" in the unittests directory for some simple fire_event examples. The "fire_event" method can be useful since many text_fields have all sorts of events tied to them. > Maybe I'll post the HTML that does it tomorrow as it is an interesting > case..probably not worthwhile to look too much into it cuz it's > probably a rare case (this site I'm testing has many many many rules > and ways of doing things) It would be worthwhile - at the very least it makes it easier to suggest things to try. -Jonathan > On 5/31/05, John Lloyd-Jones wrote: > > Shao > > I'm not quite sure exactly what your page requires, but I believe your > > situation may be similar to one I encountered: users enter some text > > in a field, the page parses (and validates) the input when the user > > leaves the field (e.g. by tabbing to the next field). If this is your > > situation, you can explicitly trigger the onblur event: > > > > $ie.textField(:id, "classStart").set(testData['classStart']) > > $ie.textField(:id, "classStart").fireEvent("onBlur"); # trigger parsing > > > > John > > > > > > On 5/31/05, Shao Kang Tat wrote: > > > is there a way that watir can send a physical tab after entering some > > > text into a text_field? > > > > > > I've tried: > > > > > > ie.text_field(:id, "blah").set("test test \t") > > > ie.text_field(:id, "blah").set("test test" + 9.chr) > > > > > > both just put the # of spaces that is equivalent to a tab instead of > > > actually sending a tab...the webpage I'm testing now works in a > > > strange way such that pressing enter does nothing and the only way I > > > can get it to do the right thing is by pressing tab... > > > > > > Thanks > > > > > > Shao > > > > > > _______________________________________________ > > > 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 > ------------------------------ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general End of Wtr-general Digest, Vol 18, Issue 50 ******************************************* _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From tuyet.ctn at mscibarra.com Wed Jun 1 19:44:27 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Wed, 1 Jun 2005 16:44:27 -0700 Subject: [Wtr-general] Access is denied Message-ID: Hi Ian, Thanks for your reply. Would you mind sending me a snippet of your code so I can see what you are referring to? I do use goto as you see below and it didn't solve my problems, but maybe I need to do something else as well. irb(main):002:0> ie = Watir::IE.new => #], @logger=#, @shift_size=nil>>, @typingspeed=0.08, @activeObjectHighLightColor="yellow" , @enable_spinner=false, @url_list=[], @form=nil, @ie=#> irb(main):003:0> ie.goto("http://padma-nt.barra.com/araneae/app?") W, [01-Jun-2005 16:38:32#2216] WARN -- : frame error in waitdocument OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `method_missing' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `upto' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1332:in `goto' (irb):3:in `irb_binding' C:/ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' C:/ruby/lib/ruby/1.8/irb/workspace.rb:52 W, [01-Jun-2005 16:38:32#2216] WARN -- : runtime error in wait => 0.343 irb(main):005:0> ie.show_all_objects -----------Objects in page ------------- id= src=/include/top.js HTML Document name=relay id=relay src=/include/blank.htm l HTML Document name=main id=main src=/araneae/login => nil irb(main):006:0> ie.show_frames there are 2 frames frame index: 0 --Access Denied-- frame index: 1 --Access Denied-- => 0..1 From paul.rogers at shaw.ca Wed Jun 1 22:33:20 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 01 Jun 2005 20:33:20 -0600 Subject: [Wtr-general] Selenium and Watir 2.0 In-Reply-To: <20050531234144.62804.qmail@web32213.mail.mud.yahoo.com> Message-ID: <001001c5671b$70c3df70$72d39044@NewDell> The watir 1.x stream will be maintained at least until a 2.0 release, and possibly longer if there are any compatablity problems that arent easily fixed I would suggest you go ahead and start using the 1.3.? Release. I'll be doing a new one sometime soon, but it wont have any major changes Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Scott Pack Sent: 31 May 2005 17:42 To: wtr-general at rubyforge.org Subject: [Wtr-general] Selenium and Watir 2.0 It would be very helpful to understand your intentions with regard to Selenium. What does 'Watir 2.0 will use Selenium' mean? I've evaluated a dozen tools some commercial, most open source and have chosen Watir. I'm about to begin automation development for a very complex webapp. If you are intending to fundamentally change the behavior/stucture/function of Watir, I would really like to know before I invest my time going down this path. I cannot afford a false start. Thanks. Scott __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bhavna.kumar at gmail.com Thu Jun 2 01:32:46 2005 From: bhavna.kumar at gmail.com (Bhavna Kumar) Date: Thu, 2 Jun 2005 11:02:46 +0530 Subject: [Wtr-general] How do I test numeric field validations in watir? In-Reply-To: References: <5ace0a505052622253208a5c2@mail.gmail.com> Message-ID: <5ace0a5050601223256a4917d@mail.gmail.com> I tried putting the additional fireEvent after the set, but I still see the same behavior. The test "passes" but the invalid data remains on screen and causes subsequent tests to fail. I end up having to do an ie.reset(:index, 1).click in order to proceed. # Test 2: Put alphabetic data for number of bags ie.text_field(:name, "bag_no").set(INVALID_BAG_INPUT) ie.text_field(:name , "bag_no").fireEvent("onChange") # Check to see if numeric validation exists for number of bags if ie.contains_text(INVALID_BAG_INPUT) puts "Failed: test to check numeric validation for number of bags." else puts "Passed: test to check numeric validation for number of bags." end # Test 3: Put alphabetic data for number of parcels ie.text_field(:name, "parcel_no").set(INVALID_PARCEL_INPUT) ie.text_field(:name , "parcel_no").fireEvent("onChange") # Check to see if numeric validation exists for number of parcels if ie.contains_text(INVALID_PARCEL_INPUT) puts "Failed: test to check numeric validation for number of parcels." else puts "Passed: test to check numeric validation for number of parcels." end Also, is there a way to search the archives across months? Thanks, Bhavna On 5/27/05, Atilla Ozgur wrote: > Watir normally set text_field's contents then fires javascript event. Most > probably your javascript validation code uses a event like on_key_up . To > simulate human behaviour you can use this. > > ie.text_field(:name , 'userid1').set('foo') > ie.text_field(:name , 'userid1').fireEvent('onChange') > > Search the mail archives about onchange and fire event, you will get more > information. > > > > > On 5/27/05, Bhavna Kumar wrote: > > > > I am using watir to test an IE based application. > > > > I have data entry fields that only allow numeric data to be entered. > > When I manually try to enter text data in the field, I am not allowed > > to do so. If I click on any alpha key, nothing is displayed in the > > text box. > > > > But when I try it through watir, text data gets entered and the > > contains text doesn't spot it. However, the next test fails. > > > > # Put alphabetic data for number of bags > > ie.text_field(:name, "bag_no").set("hello world") > > > > # Check to see if numeric validation exists for number of bags > > if ie.contains_text("hello world") > > puts "Failed: test to check numeric validation for number of bags." > > else > > puts "Passed: test to check numeric validation for number of bags." > > end > > > > I get the "Passed" message. > > > > The next text in the sequence fails, because the text box has "hello > world" > > > > How do I deal with this? > > > > Regards, > > Bhavna > > > > _______________________________________________ > > 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 zeljko.filipin at gmail.com Thu Jun 2 01:49:44 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Thu, 2 Jun 2005 07:49:44 +0200 Subject: [Wtr-general] How do I test numeric field validations in watir? In-Reply-To: <5ace0a5050601223256a4917d@mail.gmail.com> Message-ID: <429e9dce.3cd02c18.0b74.7e56@mx.gmail.com> Go to http://rubyforge.org/pipermail/wtr-general/ -----Original Message----- Also, is there a way to search the archives across months? From bret at pettichord.com Thu Jun 2 00:14:32 2005 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 01 Jun 2005 23:14:32 -0500 Subject: [Wtr-general] Access is denied (some good news and some questions) In-Reply-To: <200506012240.j51MexdS026311@rubyforge.org> References: Message-ID: <5.1.0.14.2.20050601231412.029d5048@127.0.0.1> At 05:47 PM 6/1/2005, Ian Rushton wrote: >There is probably a way you could extract the URL >using the .text method into a variable then invoke it with a goto to avoid >the maintenance. If someone gets this to work, we should add it to watir. Bret _____________________ Bret Pettichord www.pettichord.com From shaorobics at gmail.com Thu Jun 2 09:39:57 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Thu, 2 Jun 2005 09:39:57 -0400 Subject: [Wtr-general] global variables in a new process Message-ID: <593b9ae805060206391e82699f@mail.gmail.com> hi, My web app currently has modal dialog boxes which I'm getting rid of through a function I wrote which mimicks winClicker. I'm searching for a specific title so that autoit can activate the popup. I look 10 times, afterwhich I decide the pop up cannot be found and I set: $modalFound = false otherwise, if it does manage to find the window, it closes it and I set: $modalFound = true back in the main test I do a check: puts $modalFound I get "nil" . any insight as to why I can't access this global variable? also, I find that autoIt sometimes is able to find the pop up but doesn't actually close it. 90% of the time it does and it's the same test...strange wshShell.SendKeys("%{F4}", true) Shao From paul.rogers at shaw.ca Thu Jun 2 10:31:45 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 02 Jun 2005 08:31:45 -0600 Subject: [Wtr-general] How do I test numeric field validations in watir? In-Reply-To: <5ace0a5050601223256a4917d@mail.gmail.com> Message-ID: <000e01c5677f$cda7a230$72d39044@NewDell> The check could be fired by any number of different events - onblur, onchange etc Can you post the html ? The set method already fires the onchange - this was the most used event for validation which is why it was added. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar Sent: 01 June 2005 23:33 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How do I test numeric field validations in watir? I tried putting the additional fireEvent after the set, but I still see the same behavior. The test "passes" but the invalid data remains on screen and causes subsequent tests to fail. I end up having to do an ie.reset(:index, 1).click in order to proceed. # Test 2: Put alphabetic data for number of bags ie.text_field(:name, "bag_no").set(INVALID_BAG_INPUT) ie.text_field(:name , "bag_no").fireEvent("onChange") # Check to see if numeric validation exists for number of bags if ie.contains_text(INVALID_BAG_INPUT) puts "Failed: test to check numeric validation for number of bags." else puts "Passed: test to check numeric validation for number of bags." end # Test 3: Put alphabetic data for number of parcels ie.text_field(:name, "parcel_no").set(INVALID_PARCEL_INPUT) ie.text_field(:name , "parcel_no").fireEvent("onChange") # Check to see if numeric validation exists for number of parcels if ie.contains_text(INVALID_PARCEL_INPUT) puts "Failed: test to check numeric validation for number of parcels." else puts "Passed: test to check numeric validation for number of parcels." end Also, is there a way to search the archives across months? Thanks, Bhavna On 5/27/05, Atilla Ozgur wrote: > Watir normally set text_field's contents then fires javascript event. Most > probably your javascript validation code uses a event like on_key_up . To > simulate human behaviour you can use this. > > ie.text_field(:name , 'userid1').set('foo') > ie.text_field(:name , 'userid1').fireEvent('onChange') > > Search the mail archives about onchange and fire event, you will get more > information. > > > > > On 5/27/05, Bhavna Kumar wrote: > > > > I am using watir to test an IE based application. > > > > I have data entry fields that only allow numeric data to be entered. > > When I manually try to enter text data in the field, I am not allowed > > to do so. If I click on any alpha key, nothing is displayed in the > > text box. > > > > But when I try it through watir, text data gets entered and the > > contains text doesn't spot it. However, the next test fails. > > > > # Put alphabetic data for number of bags > > ie.text_field(:name, "bag_no").set("hello world") > > > > # Check to see if numeric validation exists for number of bags > > if ie.contains_text("hello world") > > puts "Failed: test to check numeric validation for number of bags." > > else > > puts "Passed: test to check numeric validation for number of bags." > > end > > > > I get the "Passed" message. > > > > The next text in the sequence fails, because the text box has "hello > world" > > > > How do I deal with this? > > > > Regards, > > Bhavna > > > > _______________________________________________ > > 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 Thu Jun 2 10:32:51 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 02 Jun 2005 08:32:51 -0600 Subject: [Wtr-general] global variables in a new process In-Reply-To: <593b9ae805060206391e82699f@mail.gmail.com> Message-ID: <000f01c5677f$f5163cf0$72d39044@NewDell> If its in a new process, the gloabal var will belong to that process, - it doesn't exist in every process. You may have to write to a file or use drb Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 02 June 2005 07:40 To: wtr-general at rubyforge.org Subject: [Wtr-general] global variables in a new process hi, My web app currently has modal dialog boxes which I'm getting rid of through a function I wrote which mimicks winClicker. I'm searching for a specific title so that autoit can activate the popup. I look 10 times, afterwhich I decide the pop up cannot be found and I set: $modalFound = false otherwise, if it does manage to find the window, it closes it and I set: $modalFound = true back in the main test I do a check: puts $modalFound I get "nil" . any insight as to why I can't access this global variable? also, I find that autoIt sometimes is able to find the pop up but doesn't actually close it. 90% of the time it does and it's the same test...strange wshShell.SendKeys("%{F4}", true) Shao _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Thu Jun 2 14:31:23 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 2 Jun 2005 12:31:23 -0600 Subject: [Wtr-general] WATIR-like framework in C# just announced Message-ID: <72799cd70506021131571b98f9@mail.gmail.com> http://sourceforge.net/projects/ietest http://ietest.sourceforge.net/ Seems like WATIR has much better control of the DOM, but IETest seems to have a good handle on alerts and popups. BTW, they cite WATIR in their introduction. -Chris From Jan.Montano at thomson.com Thu Jun 2 21:50:40 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Fri, 3 Jun 2005 09:50:40 +0800 Subject: [Wtr-general] Japanese encoding/decoding Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE1B@tfphmanilmul01.ERF.THOMSON.COM> Hi! I'm trying to use the iconv lib but i'm getting errors. It say's can't load the library. I have sample codes but it doesn't work. I loaded the absolute path of the iconv file but it still generates errors. Could someone point me in the right direction pls. I'm lost. I'm stuck with this one. Thank you and God Bless. From Jan.Montano at thomson.com Thu Jun 2 23:37:55 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Fri, 3 Jun 2005 11:37:55 +0800 Subject: [Wtr-general] Japanese characters Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE1C@tfphmanilmul01.ERF.THOMSON.COM> ok. I'll try it yasushi. Thank you very much for your help! -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Yasushi Ohtsuka Sent: Monday, May 30, 2005 10:51 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Japanese characters Hello Jan. I just tested watir googleSearch.rb sample with Japanese character in different encodings. Google site is UTF-8, however... UTF-8 googleSearch.rb worked, but characters displayed in text field were totally invalid. (Of course, I changed the script to use TextField#value instead of TextField#set) SHIFT-JIS googleSearch.rb worked just fine. So, as far as I tested, SHIFT-JIS is the choice for watir with Japanese characters. Hope this helps. 2005/5/30, Jan.Montano at thomson.com : > Hi! I'm still having setting those text fields with japanese characters. I saved the text file as UTF-8, and japanese characters are clearly displayed in the editor. But when I compile. A different error occurs: > > utf8.rb:1: Invalid char `\377' in expression > utf8.rb:1: Invalid char `\376' in expression > > It seems that watir has a different way in expressing unicode characters. I believe those invalid characters are '#' and '-' in my code which are technically, valid characters. Thank you. And hoping for your reply. > > _______________________________________________ > 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 jkohl at telusplanet.net Thu Jun 2 23:47:46 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Thu, 2 Jun 2005 21:47:46 -0600 Subject: [Wtr-general] Japanese encoding/decoding In-Reply-To: <71EA7CA4B789864F9B3AC722A7F016B68DBE1B@tfphmanilmul01.ERF.THOMSON.COM> Message-ID: <20050603034728.NVO22570.priv-edtnes57.telusplanet.net@tintin> Have you tried posting on comp.lang.ruby (ruby talk)? I post via Google groups myself. I see that iconv was written by Hiroshi Nakamura. I had a question last year about soap4r, and he was very helpful. I'm sure there are a lot of people there who could help. -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of Jan.Montano at thomson.com > Sent: June 2, 2005 7:51 PM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] Japanese encoding/decoding > > Hi! I'm trying to use the iconv lib but i'm getting errors. It say's can't > load the library. I have sample codes but it doesn't work. I loaded the > absolute path of the iconv file but it still generates errors. Could > someone point me in the right direction pls. I'm lost. I'm stuck with this > one. Thank you and God Bless. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From bhavna.kumar at gmail.com Fri Jun 3 02:05:42 2005 From: bhavna.kumar at gmail.com (Bhavna Kumar) Date: Fri, 3 Jun 2005 11:35:42 +0530 Subject: [Wtr-general] How do I test numeric field validations in watir? In-Reply-To: <000e01c5677f$cda7a230$72d39044@NewDell> References: <5ace0a5050601223256a4917d@mail.gmail.com> <000e01c5677f$cda7a230$72d39044@NewDell> Message-ID: <5ace0a50506022305aaa0be5@mail.gmail.com> Here is the HTML for the test cases. Bhavna On 6/2/05, Paul Rogers wrote: > The check could be fired by any number of different events - onblur, > onchange etc > Can you post the html ? > > The set method already fires the onchange - this was the most used event > for validation which is why it was added. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar > Sent: 01 June 2005 23:33 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] How do I test numeric field validations in > watir? > > > I tried putting the additional fireEvent after the set, but I still > see the same behavior. The test "passes" but the invalid data remains > on screen and causes subsequent tests to fail. I end up having to do > an ie.reset(:index, 1).click in order to proceed. > > # Test 2: Put alphabetic data for number of bags > ie.text_field(:name, "bag_no").set(INVALID_BAG_INPUT) > ie.text_field(:name , "bag_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of bags > if ie.contains_text(INVALID_BAG_INPUT) > puts "Failed: test to check numeric validation for number of > bags." > else > puts "Passed: test to check numeric validation for number of > bags." > end > > # Test 3: Put alphabetic data for number of parcels > ie.text_field(:name, "parcel_no").set(INVALID_PARCEL_INPUT) > ie.text_field(:name , "parcel_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of parcels > if ie.contains_text(INVALID_PARCEL_INPUT) > puts "Failed: test to check numeric validation for number of > parcels." > else > puts "Passed: test to check numeric validation for number of > parcels." > end > > Also, is there a way to search the archives across months? > > Thanks, > Bhavna > On 5/27/05, Atilla Ozgur wrote: > > Watir normally set text_field's contents then fires javascript event. > Most > > probably your javascript validation code uses a event like on_key_up > . To > > simulate human behaviour you can use this. > > > > ie.text_field(:name , 'userid1').set('foo') > > ie.text_field(:name , 'userid1').fireEvent('onChange') > > > > Search the mail archives about onchange and fire event, you will get > more > > information. > > > > > > > > > > On 5/27/05, Bhavna Kumar wrote: > > > > > > I am using watir to test an IE based application. > > > > > > I have data entry fields that only allow numeric data to be entered. > > > When I manually try to enter text data in the field, I am not > allowed > > > to do so. If I click on any alpha key, nothing is displayed in the > > > text box. > > > > > > But when I try it through watir, text data gets entered and the > > > contains text doesn't spot it. However, the next test fails. > > > > > > # Put alphabetic data for number of bags > > > ie.text_field(:name, "bag_no").set("hello world") > > > > > > # Check to see if numeric validation exists for number of bags > > > if ie.contains_text("hello world") > > > puts "Failed: test to check numeric validation for number of > bags." > > > else > > > puts "Passed: test to check numeric validation for number of > bags." > > > end > > > > > > I get the "Passed" message. > > > > > > The next text in the sequence fails, because the text box has "hello > > world" > > > > > > How do I deal with this? > > > > > > Regards, > > > Bhavna > > > > > > _______________________________________________ > > > 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 > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: html_code_for_testing.txt Url: http://rubyforge.org/pipermail/wtr-general/attachments/20050603/75a41c96/attachment.txt From Jan.Montano at thomson.com Fri Jun 3 02:51:58 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Fri, 3 Jun 2005 14:51:58 +0800 Subject: [Wtr-general] Japanese characters Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE1D@tfphmanilmul01.ERF.THOMSON.COM> OK. One at a time. Here's a sample code... what am I doing wrong? I'm using SciTE as my editor. I want to convert that 'arigato' to japanese. Please don't laugh. hehehe. Is it possible? What is displayed in the q text field is the word 'arigato' def test_google_jap() $ie.goto('http://www.google.com') converted_text = Iconv.new('SJIS','utf-8').iconv('arigato') $ie.text_field(:name,'q').value = converted_text end * I also couldn't compile yet my prog with japanese characters embedded. it's of invalid char error. I tried to remove the first 3 bytes using a hex editor and then run it with no luck. T_T -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Yasushi Ohtsuka Sent: Monday, May 30, 2005 10:51 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Japanese characters Hello Jan. I just tested watir googleSearch.rb sample with Japanese character in different encodings. Google site is UTF-8, however... UTF-8 googleSearch.rb worked, but characters displayed in text field were totally invalid. (Of course, I changed the script to use TextField#value instead of TextField#set) SHIFT-JIS googleSearch.rb worked just fine. So, as far as I tested, SHIFT-JIS is the choice for watir with Japanese characters. Hope this helps. 2005/5/30, Jan.Montano at thomson.com : > Hi! I'm still having setting those text fields with japanese characters. I saved the text file as UTF-8, and japanese characters are clearly displayed in the editor. But when I compile. A different error occurs: > > utf8.rb:1: Invalid char `\377' in expression > utf8.rb:1: Invalid char `\376' in expression > > It seems that watir has a different way in expressing unicode characters. I believe those invalid characters are '#' and '-' in my code which are technically, valid characters. Thank you. And hoping for your reply. > > _______________________________________________ > 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 DBoyt at anteon.com Fri Jun 3 09:48:58 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Fri, 3 Jun 2005 09:48:58 -0400 Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property or method `document' Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC867309B@HQ-EXVS02.anteon.com> Okay, I am officially frustrated! I'm testing a commercial Learning Management System (LMS) that's been customized for our customer (not by us) and I keep getting the following error when accessing the "production" server: W, [03-Jun-2005 08:34:00#1076] WARN -- : runtime error in wait c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1568:in `method_missing': Unknown proper ty or method `document' (WIN32OLERuntimeError) HRESULT error code:0x80010108 The object invoked has disconnected from its clients. from c:/ruby/lib /ruby/site_ruby/1.8/watir.rb:1568:in `document' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2667:in `get_table' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2652:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:263:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:263:in `table' from C:/ruby/watir/RoleManagementDomainRestrictions.rb:149 from C:/ruby/watir/RoleManagementDomainRestrictions.rb:50:in `upto' from C:/ruby/watir/RoleManagementDomainRestrictions.rb:50 The frustrating thing is that I ran the same script against the "test" server and it ran just fine. Could this possibly be caused by a difference in server settings? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama From paul.rogers at shaw.ca Fri Jun 3 11:17:30 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 03 Jun 2005 09:17:30 -0600 Subject: [Wtr-general] How do I test numeric field validations in watir? In-Reply-To: <5ace0a50506022305aaa0be5@mail.gmail.com> Message-ID: <001901c5684f$5c513c60$72d39044@NewDell> The html uses the onkeypress which watir is also doing. I'll take a look into this now and get back to you. It could be that watirs event is in the wrong place Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar Sent: 03 June 2005 00:06 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How do I test numeric field validations in watir? Here is the HTML for the test cases. Bhavna On 6/2/05, Paul Rogers wrote: > The check could be fired by any number of different events - onblur, > onchange etc Can you post the html ? > > The set method already fires the onchange - this was the most used > event for validation which is why it was added. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar > Sent: 01 June 2005 23:33 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] How do I test numeric field validations in > watir? > > > I tried putting the additional fireEvent after the set, but I still > see the same behavior. The test "passes" but the invalid data remains > on screen and causes subsequent tests to fail. I end up having to do > an ie.reset(:index, 1).click in order to proceed. > > # Test 2: Put alphabetic data for number of bags ie.text_field(:name, > "bag_no").set(INVALID_BAG_INPUT) ie.text_field(:name , > "bag_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of bags if > ie.contains_text(INVALID_BAG_INPUT) > puts "Failed: test to check numeric validation for number of > bags." > else > puts "Passed: test to check numeric validation for number of > bags." end > > # Test 3: Put alphabetic data for number of parcels > ie.text_field(:name, "parcel_no").set(INVALID_PARCEL_INPUT) > ie.text_field(:name , "parcel_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of parcels if > ie.contains_text(INVALID_PARCEL_INPUT) > puts "Failed: test to check numeric validation for number of > parcels." > else > puts "Passed: test to check numeric validation for number of > parcels." end > > Also, is there a way to search the archives across months? > > Thanks, > Bhavna > On 5/27/05, Atilla Ozgur wrote: > > Watir normally set text_field's contents then fires javascript > > event. > Most > > probably your javascript validation code uses a event like > > on_key_up > . To > > simulate human behaviour you can use this. > > > > ie.text_field(:name , 'userid1').set('foo') ie.text_field(:name , > > 'userid1').fireEvent('onChange') > > > > Search the mail archives about onchange and fire event, you will get > more > > information. > > > > > > > > > > On 5/27/05, Bhavna Kumar wrote: > > > > > > I am using watir to test an IE based application. > > > > > > I have data entry fields that only allow numeric data to be > > > entered. When I manually try to enter text data in the field, I am > > > not > allowed > > > to do so. If I click on any alpha key, nothing is displayed in the > > > text box. > > > > > > But when I try it through watir, text data gets entered and the > > > contains text doesn't spot it. However, the next test fails. > > > > > > # Put alphabetic data for number of bags ie.text_field(:name, > > > "bag_no").set("hello world") > > > > > > # Check to see if numeric validation exists for number of bags if > > > ie.contains_text("hello world") > > > puts "Failed: test to check numeric validation for number of > bags." > > > else > > > puts "Passed: test to check numeric validation for number of > bags." > > > end > > > > > > I get the "Passed" message. > > > > > > The next text in the sequence fails, because the text box has > > > "hello > > world" > > > > > > How do I deal with this? > > > > > > Regards, > > > Bhavna > > > > > > _______________________________________________ > > > 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 > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Fri Jun 3 11:19:09 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 03 Jun 2005 09:19:09 -0600 Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC867309B@HQ-EXVS02.anteon.com> Message-ID: <001a01c5684f$97216360$72d39044@NewDell> This error is usually caused by IE being closed before watir has finished with it - Im assuming that's not happening here though. Is this a frames application? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 03 June 2005 07:49 To: wtr-general at rubyforge.org Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' Okay, I am officially frustrated! I'm testing a commercial Learning Management System (LMS) that's been customized for our customer (not by us) and I keep getting the following error when accessing the "production" server: W, [03-Jun-2005 08:34:00#1076] WARN -- : runtime error in wait c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1568:in `method_missing': Unknown proper ty or method `document' (WIN32OLERuntimeError) HRESULT error code:0x80010108 The object invoked has disconnected from its clients. from c:/ruby/lib /ruby/site_ruby/1.8/watir.rb:1568:in `document' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2667:in `get_table' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2652:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:263:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:263:in `table' from C:/ruby/watir/RoleManagementDomainRestrictions.rb:149 from C:/ruby/watir/RoleManagementDomainRestrictions.rb:50:in `upto' from C:/ruby/watir/RoleManagementDomainRestrictions.rb:50 The frustrating thing is that I ran the same script against the "test" server and it ran just fine. Could this possibly be caused by a difference in server settings? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Fri Jun 3 10:51:08 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 03 Jun 2005 09:51:08 -0500 Subject: [Wtr-general] How do I test numeric field validations in watir? In-Reply-To: <000e01c5677f$cda7a230$72d39044@NewDell> References: <5ace0a5050601223256a4917d@mail.gmail.com> Message-ID: <5.1.0.14.2.20050603094854.01146c50@127.0.0.1> At 09:31 AM 6/2/2005, Paul Rogers wrote: >The set method already fires the onchange - this was the most used event >for validation which is why it was added. Paul, I would think that ideally we'd want to trigger all the events that get triggers by a manual user. Are you trying to minimize the number of events we trigger? Why not add onBlur? Bret _____________________ Bret Pettichord www.pettichord.com From paul.rogers at shaw.ca Fri Jun 3 11:45:55 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 03 Jun 2005 09:45:55 -0600 Subject: [Wtr-general] How do I test numeric field validations in watir? In-Reply-To: <5ace0a50506022305aaa0be5@mail.gmail.com> Message-ID: <002001c56853$54a45fc0$72d39044@NewDell> The javascript in the validate function uses the global event object to determine which key was pressed. Watir does not set this object. I think I tried once before to make something like this work but with no luck. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar Sent: 03 June 2005 00:06 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How do I test numeric field validations in watir? Here is the HTML for the test cases. Bhavna On 6/2/05, Paul Rogers wrote: > The check could be fired by any number of different events - onblur, > onchange etc Can you post the html ? > > The set method already fires the onchange - this was the most used > event for validation which is why it was added. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar > Sent: 01 June 2005 23:33 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] How do I test numeric field validations in > watir? > > > I tried putting the additional fireEvent after the set, but I still > see the same behavior. The test "passes" but the invalid data remains > on screen and causes subsequent tests to fail. I end up having to do > an ie.reset(:index, 1).click in order to proceed. > > # Test 2: Put alphabetic data for number of bags ie.text_field(:name, > "bag_no").set(INVALID_BAG_INPUT) ie.text_field(:name , > "bag_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of bags if > ie.contains_text(INVALID_BAG_INPUT) > puts "Failed: test to check numeric validation for number of > bags." > else > puts "Passed: test to check numeric validation for number of > bags." end > > # Test 3: Put alphabetic data for number of parcels > ie.text_field(:name, "parcel_no").set(INVALID_PARCEL_INPUT) > ie.text_field(:name , "parcel_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of parcels if > ie.contains_text(INVALID_PARCEL_INPUT) > puts "Failed: test to check numeric validation for number of > parcels." > else > puts "Passed: test to check numeric validation for number of > parcels." end > > Also, is there a way to search the archives across months? > > Thanks, > Bhavna > On 5/27/05, Atilla Ozgur wrote: > > Watir normally set text_field's contents then fires javascript > > event. > Most > > probably your javascript validation code uses a event like > > on_key_up > . To > > simulate human behaviour you can use this. > > > > ie.text_field(:name , 'userid1').set('foo') ie.text_field(:name , > > 'userid1').fireEvent('onChange') > > > > Search the mail archives about onchange and fire event, you will get > more > > information. > > > > > > > > > > On 5/27/05, Bhavna Kumar wrote: > > > > > > I am using watir to test an IE based application. > > > > > > I have data entry fields that only allow numeric data to be > > > entered. When I manually try to enter text data in the field, I am > > > not > allowed > > > to do so. If I click on any alpha key, nothing is displayed in the > > > text box. > > > > > > But when I try it through watir, text data gets entered and the > > > contains text doesn't spot it. However, the next test fails. > > > > > > # Put alphabetic data for number of bags ie.text_field(:name, > > > "bag_no").set("hello world") > > > > > > # Check to see if numeric validation exists for number of bags if > > > ie.contains_text("hello world") > > > puts "Failed: test to check numeric validation for number of > bags." > > > else > > > puts "Passed: test to check numeric validation for number of > bags." > > > end > > > > > > I get the "Passed" message. > > > > > > The next text in the sequence fails, because the text box has > > > "hello > > world" > > > > > > How do I deal with this? > > > > > > Regards, > > > Bhavna > > > > > > _______________________________________________ > > > 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 > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Fri Jun 3 11:55:16 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 03 Jun 2005 09:55:16 -0600 Subject: [Wtr-general] How do I test numeric field validations in watir? In-Reply-To: <5.1.0.14.2.20050603094854.01146c50@127.0.0.1> Message-ID: <002301c56854$a2856580$72d39044@NewDell> I will eventually, I need to make the javascript to have useful tests first though. I think it makes sense, as you said in an earlier mail, to have set do all events and value= be no events. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 03 June 2005 08:51 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] How do I test numeric field validations in watir? At 09:31 AM 6/2/2005, Paul Rogers wrote: >The set method already fires the onchange - this was the most used >event for validation which is why it was added. Paul, I would think that ideally we'd want to trigger all the events that get triggers by a manual user. Are you trying to minimize the number of events we trigger? Why not add onBlur? Bret _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From DBoyt at anteon.com Fri Jun 3 12:34:15 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Fri, 3 Jun 2005 12:34:15 -0400 Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC867313C@HQ-EXVS02.anteon.com> Paul, Yes, this is a frames app. I'm looping through a table with links in one of the frames, opening the links in a second browser window. $ie2.goto($ie1.frame("mainFrame").table(:index, 6)[x][3].link(:text, /View/).href()) I kind of figured IE's being closed before my script's done, but I'm running it from the command line with the "-b" option so I'm not sure how it's being closed. Thanks, Darrel -----Original Message----- From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri Jun 3 11:13:17 2005 Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC867309B at HQ-EXVS02.anteon.com> Message-ID: <001a01c5684f$97216360$72d39044 at NewDell> This error is usually caused by IE being closed before watir has finished with it - Im assuming that's not happening here though. Is this a frames application? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 03 June 2005 07:49 To: wtr-general at rubyforge.org Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' Okay, I am officially frustrated! I'm testing a commercial Learning Management System (LMS) that's been customized for our customer (not by us) and I keep getting the following error when accessing the "production" server: W, [03-Jun-2005 08:34:00#1076] WARN -- : runtime error in wait c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1568:in `method_missing': Unknown proper ty or method `document' (WIN32OLERuntimeError) HRESULT error code:0x80010108 The object invoked has disconnected from its clients. from c:/ruby/lib /ruby/site_ruby/1.8/watir.rb:1568:in `document' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2667:in `get_table' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2652:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:263:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:263:in `table' from C:/ruby/watir/RoleManagementDomainRestrictions.rb:149 from C:/ruby/watir/RoleManagementDomainRestrictions.rb:50:in `upto' from C:/ruby/watir/RoleManagementDomainRestrictions.rb:50 The frustrating thing is that I ran the same script against the "test" server and it ran just fine. Could this possibly be caused by a difference in server settings? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama From paul.rogers at shaw.ca Fri Jun 3 12:54:50 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 03 Jun 2005 10:54:50 -0600 Subject: [Wtr-general] How do I test numeric field validations in watir? In-Reply-To: <002001c56853$54a45fc0$72d39044@NewDell> Message-ID: <002c01c5685c$f4dd9750$72d39044@NewDell> So I looked at this, and again I cant make it work. Here is the code Ive been using, and the appropriate links. http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/create eventobject.asp http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_ev ent.asp http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/create eventobject.asp http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/fireev ent.asp This code always causes the event to have a keycode of 0, which "...The property's value is 0 if no key caused the event..' def fire_key_events(c=nil) ev = @ieController.document.createEventObject puts c ev.keyCode= c @o.fireEvent("onKeyDown" , ev) @o.fireEvent("onKeyPress" , ev) @o.fireEvent("onKeyUp" , ev) end # This method is used internally by setText and appendText # It should not be used externally. # * value - string - The string to enter into the text field def doKeyPress( value ) begin maxLength = @o.maxLength if value.length > maxLength value = suppliedValue[0 .. maxLength ] @ieController.log " Supplied string is #{suppliedValue.length} chars, which exceeds the max length (#{maxLength}) of the field. Using value: #{value}" end rescue # probably a text area - so it doesnt have a max Length maxLength = -1 end for i in 0 .. value.length-1 sleep @ieController.typingspeed # typing speed c = value[i,1] puts c #@ieController.log " adding c.chr " + c #.chr.to_s @o.value = @o.value.to_s + c #c.chr fire_key_events(c[0]) end end -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: 03 June 2005 09:46 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] How do I test numeric field validations in watir? The javascript in the validate function uses the global event object to determine which key was pressed. Watir does not set this object. I think I tried once before to make something like this work but with no luck. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar Sent: 03 June 2005 00:06 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How do I test numeric field validations in watir? Here is the HTML for the test cases. Bhavna On 6/2/05, Paul Rogers wrote: > The check could be fired by any number of different events - onblur, > onchange etc Can you post the html ? > > The set method already fires the onchange - this was the most used > event for validation which is why it was added. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar > Sent: 01 June 2005 23:33 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] How do I test numeric field validations in > watir? > > > I tried putting the additional fireEvent after the set, but I still > see the same behavior. The test "passes" but the invalid data remains > on screen and causes subsequent tests to fail. I end up having to do > an ie.reset(:index, 1).click in order to proceed. > > # Test 2: Put alphabetic data for number of bags ie.text_field(:name, > "bag_no").set(INVALID_BAG_INPUT) ie.text_field(:name , > "bag_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of bags if > ie.contains_text(INVALID_BAG_INPUT) > puts "Failed: test to check numeric validation for number of > bags." > else > puts "Passed: test to check numeric validation for number of > bags." end > > # Test 3: Put alphabetic data for number of parcels > ie.text_field(:name, "parcel_no").set(INVALID_PARCEL_INPUT) > ie.text_field(:name , "parcel_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of parcels if > ie.contains_text(INVALID_PARCEL_INPUT) > puts "Failed: test to check numeric validation for number of > parcels." > else > puts "Passed: test to check numeric validation for number of > parcels." end > > Also, is there a way to search the archives across months? > > Thanks, > Bhavna > On 5/27/05, Atilla Ozgur wrote: > > Watir normally set text_field's contents then fires javascript > > event. > Most > > probably your javascript validation code uses a event like > > on_key_up > . To > > simulate human behaviour you can use this. > > > > ie.text_field(:name , 'userid1').set('foo') ie.text_field(:name , > > 'userid1').fireEvent('onChange') > > > > Search the mail archives about onchange and fire event, you will get > more > > information. > > > > > > > > > > On 5/27/05, Bhavna Kumar wrote: > > > > > > I am using watir to test an IE based application. > > > > > > I have data entry fields that only allow numeric data to be > > > entered. When I manually try to enter text data in the field, I am > > > not > allowed > > > to do so. If I click on any alpha key, nothing is displayed in the > > > text box. > > > > > > But when I try it through watir, text data gets entered and the > > > contains text doesn't spot it. However, the next test fails. > > > > > > # Put alphabetic data for number of bags ie.text_field(:name, > > > "bag_no").set("hello world") > > > > > > # Check to see if numeric validation exists for number of bags if > > > ie.contains_text("hello world") > > > puts "Failed: test to check numeric validation for number of > bags." > > > else > > > puts "Passed: test to check numeric validation for number of > bags." > > > end > > > > > > I get the "Passed" message. > > > > > > The next text in the sequence fails, because the text box has > > > "hello > > world" > > > > > > How do I deal with this? > > > > > > Regards, > > > Bhavna > > > > > > _______________________________________________ > > > 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 > > _______________________________________________ > 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 Jun 3 12:56:44 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 03 Jun 2005 10:56:44 -0600 Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property ormethod`document' In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC867313C@HQ-EXVS02.anteon.com> Message-ID: <002d01c5685d$38b413a0$72d39044@NewDell> Is it possible to tell wether it's the original window or the newly opened one that is the problem? Its always a good idea to run tests on the test server anyway ;-) -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 03 June 2005 10:34 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] WIN32OLERuntimeError - Unknown property ormethod`document' Paul, Yes, this is a frames app. I'm looping through a table with links in one of the frames, opening the links in a second browser window. $ie2.goto($ie1.frame("mainFrame").table(:index, 6)[x][3].link(:text, /View/).href()) I kind of figured IE's being closed before my script's done, but I'm running it from the command line with the "-b" option so I'm not sure how it's being closed. Thanks, Darrel -----Original Message----- From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri Jun 3 11:13:17 2005 Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC867309B at HQ-EXVS02.anteon.com> Message-ID: <001a01c5684f$97216360$72d39044 at NewDell> This error is usually caused by IE being closed before watir has finished with it - Im assuming that's not happening here though. Is this a frames application? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 03 June 2005 07:49 To: wtr-general at rubyforge.org Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' Okay, I am officially frustrated! I'm testing a commercial Learning Management System (LMS) that's been customized for our customer (not by us) and I keep getting the following error when accessing the "production" server: W, [03-Jun-2005 08:34:00#1076] WARN -- : runtime error in wait c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1568:in `method_missing': Unknown proper ty or method `document' (WIN32OLERuntimeError) HRESULT error code:0x80010108 The object invoked has disconnected from its clients. from c:/ruby/lib /ruby/site_ruby/1.8/watir.rb:1568:in `document' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2667:in `get_table' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2652:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:263:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:263:in `table' from C:/ruby/watir/RoleManagementDomainRestrictions.rb:149 from C:/ruby/watir/RoleManagementDomainRestrictions.rb:50:in `upto' from C:/ruby/watir/RoleManagementDomainRestrictions.rb:50 The frustrating thing is that I ran the same script against the "test" server and it ran just fine. Could this possibly be caused by a difference in server settings? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Peter.Ch at NETeller.com Fri Jun 3 15:11:53 2005 From: Peter.Ch at NETeller.com (Peter Chau) Date: Fri, 3 Jun 2005 13:11:53 -0600 Subject: [Wtr-general] Japanese characters Message-ID: I'm testing an SJIS site using Ruby on a windows box. Ruby/Watir can work with Japanese but requires Windows to be configured: - East Asian Language package needs to be installed (you can do this in Control Panel > Regional and language options > Languages) - Language for non-Unicode programs needs to set to Japanese (Control Panel > Regional and language options > Advance) When everything is set up correctly, you should be able to copy something from a Japanese site, paste it into the prompt and view it correctly. I used Textpad to write my scripts and Arial Unicode MS font with Japanese script option. The files are saved as ANSI. The scripts look something like this $ie.goto('http://www.google.jp') $ie.text_field(:name, 'q').value = ?????????? # (this shows up as Japanese in the text editor) puts $ie.text_field(:name, 'q').value # (this shows up as Japanese in the command prompt) Peter From DBoyt at anteon.com Fri Jun 3 15:24:13 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Fri, 3 Jun 2005 15:24:13 -0400 Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC86731C7@HQ-EXVS02.anteon.com> All indications are that it's the first window where it's dying. I agree it's better to run tests on the test server, but ... I need to validate changes were made to the production server. Well, I kicked off the script again and I'm trying to stay off my system as much as possible to keep from accidentally killing it. It's been running for a couple hours now, so I'm keeping my fingers crossed that it'll finish this time... Darrel -----Original Message----- From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri Jun 3 12:49:46 2005 Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property ormethod`document' In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC867313C at HQ-EXVS02.anteon.com> Message-ID: <002d01c5685d$38b413a0$72d39044 at NewDell> Is it possible to tell wether it's the original window or the newly opened one that is the problem? Its always a good idea to run tests on the test server anyway ;-) -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 03 June 2005 10:34 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] WIN32OLERuntimeError - Unknown property ormethod`document' Paul, Yes, this is a frames app. I'm looping through a table with links in one of the frames, opening the links in a second browser window. $ie2.goto($ie1.frame("mainFrame").table(:index, 6)[x][3].link(:text, /View/).href()) I kind of figured IE's being closed before my script's done, but I'm running it from the command line with the "-b" option so I'm not sure how it's being closed. Thanks, Darrel From tuyet.ctn at mscibarra.com Fri Jun 3 18:57:26 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Fri, 3 Jun 2005 15:57:26 -0700 Subject: [Wtr-general] FRAME Class Message-ID: The result of the following command shows some FRAME classes such as FRAME class=headerFrame name=header FRAME class=contextFrame name=context_bar Would you tell me how I can get to all the objects in the header or context_bar Frames? irb(main):014:0> ie.frame("main").getHTML => "" -----Original Message----- From: wtr-general-request at rubyforge.org [mailto:wtr-general-request at rubyforge.org] Sent: Friday, June 03, 2005 9:48 AM To: wtr-general at rubyforge.org Subject: Wtr-general Digest, Vol 19, Issue 4 Send Wtr-general mailing list submissions to wtr-general at rubyforge.org To subscribe or unsubscribe via the World Wide Web, visit http://rubyforge.org/mailman/listinfo/wtr-general or, via email, send a message with subject or body 'help' to wtr-general-request at rubyforge.org You can reach the person managing the list at wtr-general-owner at rubyforge.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Wtr-general digest..." Today's Topics: 1. RE: How do I test numeric field validations in watir? (Paul Rogers) 2. RE: WIN32OLERuntimeError - Unknown property or method`document' (Paul Rogers) 3. RE: How do I test numeric field validations in watir? (Bret Pettichord) 4. RE: How do I test numeric field validations in watir? (Paul Rogers) 5. RE: How do I test numeric field validations in watir? (Paul Rogers) 6. Re: WIN32OLERuntimeError - Unknown property or method`document' (Boyt, Darrel) 7. RE: How do I test numeric field validations in watir? (Paul Rogers) ---------------------------------------------------------------------- Message: 1 Date: Fri, 03 Jun 2005 09:17:30 -0600 From: Paul Rogers Subject: RE: [Wtr-general] How do I test numeric field validations in watir? To: wtr-general at rubyforge.org Message-ID: <001901c5684f$5c513c60$72d39044 at NewDell> Content-Type: text/plain; charset=US-ASCII The html uses the onkeypress which watir is also doing. I'll take a look into this now and get back to you. It could be that watirs event is in the wrong place Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar Sent: 03 June 2005 00:06 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How do I test numeric field validations in watir? Here is the HTML for the test cases. Bhavna On 6/2/05, Paul Rogers wrote: > The check could be fired by any number of different events - onblur, > onchange etc Can you post the html ? > > The set method already fires the onchange - this was the most used > event for validation which is why it was added. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar > Sent: 01 June 2005 23:33 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] How do I test numeric field validations in > watir? > > > I tried putting the additional fireEvent after the set, but I still > see the same behavior. The test "passes" but the invalid data remains > on screen and causes subsequent tests to fail. I end up having to do > an ie.reset(:index, 1).click in order to proceed. > > # Test 2: Put alphabetic data for number of bags ie.text_field(:name, > "bag_no").set(INVALID_BAG_INPUT) ie.text_field(:name , > "bag_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of bags if > ie.contains_text(INVALID_BAG_INPUT) > puts "Failed: test to check numeric validation for number of > bags." > else > puts "Passed: test to check numeric validation for number of > bags." end > > # Test 3: Put alphabetic data for number of parcels > ie.text_field(:name, "parcel_no").set(INVALID_PARCEL_INPUT) > ie.text_field(:name , "parcel_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of parcels if > ie.contains_text(INVALID_PARCEL_INPUT) > puts "Failed: test to check numeric validation for number of > parcels." > else > puts "Passed: test to check numeric validation for number of > parcels." end > > Also, is there a way to search the archives across months? > > Thanks, > Bhavna > On 5/27/05, Atilla Ozgur wrote: > > Watir normally set text_field's contents then fires javascript > > event. > Most > > probably your javascript validation code uses a event like > > on_key_up > . To > > simulate human behaviour you can use this. > > > > ie.text_field(:name , 'userid1').set('foo') ie.text_field(:name , > > 'userid1').fireEvent('onChange') > > > > Search the mail archives about onchange and fire event, you will get > more > > information. > > > > > > > > > > On 5/27/05, Bhavna Kumar wrote: > > > > > > I am using watir to test an IE based application. > > > > > > I have data entry fields that only allow numeric data to be > > > entered. When I manually try to enter text data in the field, I am > > > not > allowed > > > to do so. If I click on any alpha key, nothing is displayed in the > > > text box. > > > > > > But when I try it through watir, text data gets entered and the > > > contains text doesn't spot it. However, the next test fails. > > > > > > # Put alphabetic data for number of bags ie.text_field(:name, > > > "bag_no").set("hello world") > > > > > > # Check to see if numeric validation exists for number of bags if > > > ie.contains_text("hello world") > > > puts "Failed: test to check numeric validation for number of > bags." > > > else > > > puts "Passed: test to check numeric validation for number of > bags." > > > end > > > > > > I get the "Passed" message. > > > > > > The next text in the sequence fails, because the text box has > > > "hello > > world" > > > > > > How do I deal with this? > > > > > > Regards, > > > Bhavna > > > > > > _______________________________________________ > > > 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 > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > ------------------------------ Message: 2 Date: Fri, 03 Jun 2005 09:19:09 -0600 From: Paul Rogers Subject: RE: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' To: wtr-general at rubyforge.org Message-ID: <001a01c5684f$97216360$72d39044 at NewDell> Content-Type: text/plain; charset=US-ASCII This error is usually caused by IE being closed before watir has finished with it - Im assuming that's not happening here though. Is this a frames application? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 03 June 2005 07:49 To: wtr-general at rubyforge.org Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' Okay, I am officially frustrated! I'm testing a commercial Learning Management System (LMS) that's been customized for our customer (not by us) and I keep getting the following error when accessing the "production" server: W, [03-Jun-2005 08:34:00#1076] WARN -- : runtime error in wait c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1568:in `method_missing': Unknown proper ty or method `document' (WIN32OLERuntimeError) HRESULT error code:0x80010108 The object invoked has disconnected from its clients. from c:/ruby/lib /ruby/site_ruby/1.8/watir.rb:1568:in `document' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2667:in `get_table' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2652:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:263:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:263:in `table' from C:/ruby/watir/RoleManagementDomainRestrictions.rb:149 from C:/ruby/watir/RoleManagementDomainRestrictions.rb:50:in `upto' from C:/ruby/watir/RoleManagementDomainRestrictions.rb:50 The frustrating thing is that I ran the same script against the "test" server and it ran just fine. Could this possibly be caused by a difference in server settings? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------ Message: 3 Date: Fri, 03 Jun 2005 09:51:08 -0500 From: Bret Pettichord Subject: RE: [Wtr-general] How do I test numeric field validations in watir? To: wtr-general at rubyforge.org Message-ID: <5.1.0.14.2.20050603094854.01146c50 at 127.0.0.1> Content-Type: text/plain; charset="us-ascii"; format=flowed At 09:31 AM 6/2/2005, Paul Rogers wrote: >The set method already fires the onchange - this was the most used event >for validation which is why it was added. Paul, I would think that ideally we'd want to trigger all the events that get triggers by a manual user. Are you trying to minimize the number of events we trigger? Why not add onBlur? Bret _____________________ Bret Pettichord www.pettichord.com ------------------------------ Message: 4 Date: Fri, 03 Jun 2005 09:45:55 -0600 From: Paul Rogers Subject: RE: [Wtr-general] How do I test numeric field validations in watir? To: wtr-general at rubyforge.org Message-ID: <002001c56853$54a45fc0$72d39044 at NewDell> Content-Type: text/plain; charset=US-ASCII The javascript in the validate function uses the global event object to determine which key was pressed. Watir does not set this object. I think I tried once before to make something like this work but with no luck. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar Sent: 03 June 2005 00:06 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How do I test numeric field validations in watir? Here is the HTML for the test cases. Bhavna On 6/2/05, Paul Rogers wrote: > The check could be fired by any number of different events - onblur, > onchange etc Can you post the html ? > > The set method already fires the onchange - this was the most used > event for validation which is why it was added. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar > Sent: 01 June 2005 23:33 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] How do I test numeric field validations in > watir? > > > I tried putting the additional fireEvent after the set, but I still > see the same behavior. The test "passes" but the invalid data remains > on screen and causes subsequent tests to fail. I end up having to do > an ie.reset(:index, 1).click in order to proceed. > > # Test 2: Put alphabetic data for number of bags ie.text_field(:name, > "bag_no").set(INVALID_BAG_INPUT) ie.text_field(:name , > "bag_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of bags if > ie.contains_text(INVALID_BAG_INPUT) > puts "Failed: test to check numeric validation for number of > bags." > else > puts "Passed: test to check numeric validation for number of > bags." end > > # Test 3: Put alphabetic data for number of parcels > ie.text_field(:name, "parcel_no").set(INVALID_PARCEL_INPUT) > ie.text_field(:name , "parcel_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of parcels if > ie.contains_text(INVALID_PARCEL_INPUT) > puts "Failed: test to check numeric validation for number of > parcels." > else > puts "Passed: test to check numeric validation for number of > parcels." end > > Also, is there a way to search the archives across months? > > Thanks, > Bhavna > On 5/27/05, Atilla Ozgur wrote: > > Watir normally set text_field's contents then fires javascript > > event. > Most > > probably your javascript validation code uses a event like > > on_key_up > . To > > simulate human behaviour you can use this. > > > > ie.text_field(:name , 'userid1').set('foo') ie.text_field(:name , > > 'userid1').fireEvent('onChange') > > > > Search the mail archives about onchange and fire event, you will get > more > > information. > > > > > > > > > > On 5/27/05, Bhavna Kumar wrote: > > > > > > I am using watir to test an IE based application. > > > > > > I have data entry fields that only allow numeric data to be > > > entered. When I manually try to enter text data in the field, I am > > > not > allowed > > > to do so. If I click on any alpha key, nothing is displayed in the > > > text box. > > > > > > But when I try it through watir, text data gets entered and the > > > contains text doesn't spot it. However, the next test fails. > > > > > > # Put alphabetic data for number of bags ie.text_field(:name, > > > "bag_no").set("hello world") > > > > > > # Check to see if numeric validation exists for number of bags if > > > ie.contains_text("hello world") > > > puts "Failed: test to check numeric validation for number of > bags." > > > else > > > puts "Passed: test to check numeric validation for number of > bags." > > > end > > > > > > I get the "Passed" message. > > > > > > The next text in the sequence fails, because the text box has > > > "hello > > world" > > > > > > How do I deal with this? > > > > > > Regards, > > > Bhavna > > > > > > _______________________________________________ > > > 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 > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > ------------------------------ Message: 5 Date: Fri, 03 Jun 2005 09:55:16 -0600 From: Paul Rogers Subject: RE: [Wtr-general] How do I test numeric field validations in watir? To: wtr-general at rubyforge.org Message-ID: <002301c56854$a2856580$72d39044 at NewDell> Content-Type: text/plain; charset=US-ASCII I will eventually, I need to make the javascript to have useful tests first though. I think it makes sense, as you said in an earlier mail, to have set do all events and value= be no events. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 03 June 2005 08:51 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] How do I test numeric field validations in watir? At 09:31 AM 6/2/2005, Paul Rogers wrote: >The set method already fires the onchange - this was the most used >event for validation which is why it was added. Paul, I would think that ideally we'd want to trigger all the events that get triggers by a manual user. Are you trying to minimize the number of events we trigger? Why not add onBlur? Bret _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------ Message: 6 Date: Fri, 3 Jun 2005 12:34:15 -0400 From: "Boyt, Darrel" Subject: Re: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' To: Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC867313C at HQ-EXVS02.anteon.com> Content-Type: text/plain; charset="us-ascii" Paul, Yes, this is a frames app. I'm looping through a table with links in one of the frames, opening the links in a second browser window. $ie2.goto($ie1.frame("mainFrame").table(:index, 6)[x][3].link(:text, /View/).href()) I kind of figured IE's being closed before my script's done, but I'm running it from the command line with the "-b" option so I'm not sure how it's being closed. Thanks, Darrel -----Original Message----- From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri Jun 3 11:13:17 2005 Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC867309B at HQ-EXVS02.anteon.com> Message-ID: <001a01c5684f$97216360$72d39044 at NewDell> This error is usually caused by IE being closed before watir has finished with it - Im assuming that's not happening here though. Is this a frames application? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 03 June 2005 07:49 To: wtr-general at rubyforge.org Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' Okay, I am officially frustrated! I'm testing a commercial Learning Management System (LMS) that's been customized for our customer (not by us) and I keep getting the following error when accessing the "production" server: W, [03-Jun-2005 08:34:00#1076] WARN -- : runtime error in wait c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1568:in `method_missing': Unknown proper ty or method `document' (WIN32OLERuntimeError) HRESULT error code:0x80010108 The object invoked has disconnected from its clients. from c:/ruby/lib /ruby/site_ruby/1.8/watir.rb:1568:in `document' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2667:in `get_table' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2652:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:263:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:263:in `table' from C:/ruby/watir/RoleManagementDomainRestrictions.rb:149 from C:/ruby/watir/RoleManagementDomainRestrictions.rb:50:in `upto' from C:/ruby/watir/RoleManagementDomainRestrictions.rb:50 The frustrating thing is that I ran the same script against the "test" server and it ran just fine. Could this possibly be caused by a difference in server settings? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama ------------------------------ Message: 7 Date: Fri, 03 Jun 2005 10:54:50 -0600 From: Paul Rogers Subject: RE: [Wtr-general] How do I test numeric field validations in watir? To: wtr-general at rubyforge.org Message-ID: <002c01c5685c$f4dd9750$72d39044 at NewDell> Content-Type: text/plain; charset=US-ASCII So I looked at this, and again I cant make it work. Here is the code Ive been using, and the appropriate links. http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/create eventobject.asp http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_ev ent.asp http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/create eventobject.asp http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/fireev ent.asp This code always causes the event to have a keycode of 0, which "...The property's value is 0 if no key caused the event..' def fire_key_events(c=nil) ev = @ieController.document.createEventObject puts c ev.keyCode= c @o.fireEvent("onKeyDown" , ev) @o.fireEvent("onKeyPress" , ev) @o.fireEvent("onKeyUp" , ev) end # This method is used internally by setText and appendText # It should not be used externally. # * value - string - The string to enter into the text field def doKeyPress( value ) begin maxLength = @o.maxLength if value.length > maxLength value = suppliedValue[0 .. maxLength ] @ieController.log " Supplied string is #{suppliedValue.length} chars, which exceeds the max length (#{maxLength}) of the field. Using value: #{value}" end rescue # probably a text area - so it doesnt have a max Length maxLength = -1 end for i in 0 .. value.length-1 sleep @ieController.typingspeed # typing speed c = value[i,1] puts c #@ieController.log " adding c.chr " + c #.chr.to_s @o.value = @o.value.to_s + c #c.chr fire_key_events(c[0]) end end -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: 03 June 2005 09:46 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] How do I test numeric field validations in watir? The javascript in the validate function uses the global event object to determine which key was pressed. Watir does not set this object. I think I tried once before to make something like this work but with no luck. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar Sent: 03 June 2005 00:06 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How do I test numeric field validations in watir? Here is the HTML for the test cases. Bhavna On 6/2/05, Paul Rogers wrote: > The check could be fired by any number of different events - onblur, > onchange etc Can you post the html ? > > The set method already fires the onchange - this was the most used > event for validation which is why it was added. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar > Sent: 01 June 2005 23:33 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] How do I test numeric field validations in > watir? > > > I tried putting the additional fireEvent after the set, but I still > see the same behavior. The test "passes" but the invalid data remains > on screen and causes subsequent tests to fail. I end up having to do > an ie.reset(:index, 1).click in order to proceed. > > # Test 2: Put alphabetic data for number of bags ie.text_field(:name, > "bag_no").set(INVALID_BAG_INPUT) ie.text_field(:name , > "bag_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of bags if > ie.contains_text(INVALID_BAG_INPUT) > puts "Failed: test to check numeric validation for number of > bags." > else > puts "Passed: test to check numeric validation for number of > bags." end > > # Test 3: Put alphabetic data for number of parcels > ie.text_field(:name, "parcel_no").set(INVALID_PARCEL_INPUT) > ie.text_field(:name , "parcel_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of parcels if > ie.contains_text(INVALID_PARCEL_INPUT) > puts "Failed: test to check numeric validation for number of > parcels." > else > puts "Passed: test to check numeric validation for number of > parcels." end > > Also, is there a way to search the archives across months? > > Thanks, > Bhavna > On 5/27/05, Atilla Ozgur wrote: > > Watir normally set text_field's contents then fires javascript > > event. > Most > > probably your javascript validation code uses a event like > > on_key_up > . To > > simulate human behaviour you can use this. > > > > ie.text_field(:name , 'userid1').set('foo') ie.text_field(:name , > > 'userid1').fireEvent('onChange') > > > > Search the mail archives about onchange and fire event, you will get > more > > information. > > > > > > > > > > On 5/27/05, Bhavna Kumar wrote: > > > > > > I am using watir to test an IE based application. > > > > > > I have data entry fields that only allow numeric data to be > > > entered. When I manually try to enter text data in the field, I am > > > not > allowed > > > to do so. If I click on any alpha key, nothing is displayed in the > > > text box. > > > > > > But when I try it through watir, text data gets entered and the > > > contains text doesn't spot it. However, the next test fails. > > > > > > # Put alphabetic data for number of bags ie.text_field(:name, > > > "bag_no").set("hello world") > > > > > > # Check to see if numeric validation exists for number of bags if > > > ie.contains_text("hello world") > > > puts "Failed: test to check numeric validation for number of > bags." > > > else > > > puts "Passed: test to check numeric validation for number of > bags." > > > end > > > > > > I get the "Passed" message. > > > > > > The next text in the sequence fails, because the text box has > > > "hello > > world" > > > > > > How do I deal with this? > > > > > > Regards, > > > Bhavna > > > > > > _______________________________________________ > > > 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 > > _______________________________________________ > 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 End of Wtr-general Digest, Vol 19, Issue 4 ****************************************** From paul.rogers at shaw.ca Fri Jun 3 19:29:00 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 03 Jun 2005 17:29:00 -0600 Subject: [Wtr-general] FRAME Class In-Reply-To: Message-ID: <004301c56894$05750210$72d39044@NewDell> You can access items in a frame like the code below. Im assuming your context_bar frame has a button at index 1 ie.frame(:name , 'context_frame').button(:index,1).click There are not methods to access attributes of the frame at the moment Look at frame_test.rb in the unittests directory Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Tuyet Cong-Ton-Nu Sent: 03 June 2005 16:57 To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] FRAME Class The result of the following command shows some FRAME classes such as FRAME class=headerFrame name=header FRAME class=contextFrame name=context_bar Would you tell me how I can get to all the objects in the header or context_bar Frames? irb(main):014:0> ie.frame("main").getHTML => "" -----Original Message----- From: wtr-general-request at rubyforge.org [mailto:wtr-general-request at rubyforge.org] Sent: Friday, June 03, 2005 9:48 AM To: wtr-general at rubyforge.org Subject: Wtr-general Digest, Vol 19, Issue 4 Send Wtr-general mailing list submissions to wtr-general at rubyforge.org To subscribe or unsubscribe via the World Wide Web, visit http://rubyforge.org/mailman/listinfo/wtr-general or, via email, send a message with subject or body 'help' to wtr-general-request at rubyforge.org You can reach the person managing the list at wtr-general-owner at rubyforge.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Wtr-general digest..." Today's Topics: 1. RE: How do I test numeric field validations in watir? (Paul Rogers) 2. RE: WIN32OLERuntimeError - Unknown property or method`document' (Paul Rogers) 3. RE: How do I test numeric field validations in watir? (Bret Pettichord) 4. RE: How do I test numeric field validations in watir? (Paul Rogers) 5. RE: How do I test numeric field validations in watir? (Paul Rogers) 6. Re: WIN32OLERuntimeError - Unknown property or method`document' (Boyt, Darrel) 7. RE: How do I test numeric field validations in watir? (Paul Rogers) ---------------------------------------------------------------------- Message: 1 Date: Fri, 03 Jun 2005 09:17:30 -0600 From: Paul Rogers Subject: RE: [Wtr-general] How do I test numeric field validations in watir? To: wtr-general at rubyforge.org Message-ID: <001901c5684f$5c513c60$72d39044 at NewDell> Content-Type: text/plain; charset=US-ASCII The html uses the onkeypress which watir is also doing. I'll take a look into this now and get back to you. It could be that watirs event is in the wrong place Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar Sent: 03 June 2005 00:06 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How do I test numeric field validations in watir? Here is the HTML for the test cases. Bhavna On 6/2/05, Paul Rogers wrote: > The check could be fired by any number of different events - onblur, > onchange etc Can you post the html ? > > The set method already fires the onchange - this was the most used > event for validation which is why it was added. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar > Sent: 01 June 2005 23:33 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] How do I test numeric field validations in > watir? > > > I tried putting the additional fireEvent after the set, but I still > see the same behavior. The test "passes" but the invalid data remains > on screen and causes subsequent tests to fail. I end up having to do > an ie.reset(:index, 1).click in order to proceed. > > # Test 2: Put alphabetic data for number of bags ie.text_field(:name, > "bag_no").set(INVALID_BAG_INPUT) ie.text_field(:name , > "bag_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of bags if > ie.contains_text(INVALID_BAG_INPUT) > puts "Failed: test to check numeric validation for number of > bags." > else > puts "Passed: test to check numeric validation for number of > bags." end > > # Test 3: Put alphabetic data for number of parcels > ie.text_field(:name, "parcel_no").set(INVALID_PARCEL_INPUT) > ie.text_field(:name , "parcel_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of parcels if > ie.contains_text(INVALID_PARCEL_INPUT) > puts "Failed: test to check numeric validation for number of > parcels." > else > puts "Passed: test to check numeric validation for number of > parcels." end > > Also, is there a way to search the archives across months? > > Thanks, > Bhavna > On 5/27/05, Atilla Ozgur wrote: > > Watir normally set text_field's contents then fires javascript > > event. > Most > > probably your javascript validation code uses a event like > > on_key_up > . To > > simulate human behaviour you can use this. > > > > ie.text_field(:name , 'userid1').set('foo') ie.text_field(:name , > > 'userid1').fireEvent('onChange') > > > > Search the mail archives about onchange and fire event, you will get > more > > information. > > > > > > > > > > On 5/27/05, Bhavna Kumar wrote: > > > > > > I am using watir to test an IE based application. > > > > > > I have data entry fields that only allow numeric data to be > > > entered. When I manually try to enter text data in the field, I am > > > not > allowed > > > to do so. If I click on any alpha key, nothing is displayed in the > > > text box. > > > > > > But when I try it through watir, text data gets entered and the > > > contains text doesn't spot it. However, the next test fails. > > > > > > # Put alphabetic data for number of bags ie.text_field(:name, > > > "bag_no").set("hello world") > > > > > > # Check to see if numeric validation exists for number of bags if > > > ie.contains_text("hello world") > > > puts "Failed: test to check numeric validation for number of > bags." > > > else > > > puts "Passed: test to check numeric validation for number of > bags." > > > end > > > > > > I get the "Passed" message. > > > > > > The next text in the sequence fails, because the text box has > > > "hello > > world" > > > > > > How do I deal with this? > > > > > > Regards, > > > Bhavna > > > > > > _______________________________________________ > > > 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 > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > ------------------------------ Message: 2 Date: Fri, 03 Jun 2005 09:19:09 -0600 From: Paul Rogers Subject: RE: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' To: wtr-general at rubyforge.org Message-ID: <001a01c5684f$97216360$72d39044 at NewDell> Content-Type: text/plain; charset=US-ASCII This error is usually caused by IE being closed before watir has finished with it - Im assuming that's not happening here though. Is this a frames application? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 03 June 2005 07:49 To: wtr-general at rubyforge.org Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' Okay, I am officially frustrated! I'm testing a commercial Learning Management System (LMS) that's been customized for our customer (not by us) and I keep getting the following error when accessing the "production" server: W, [03-Jun-2005 08:34:00#1076] WARN -- : runtime error in wait c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1568:in `method_missing': Unknown proper ty or method `document' (WIN32OLERuntimeError) HRESULT error code:0x80010108 The object invoked has disconnected from its clients. from c:/ruby/lib /ruby/site_ruby/1.8/watir.rb:1568:in `document' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2667:in `get_table' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2652:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:263:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:263:in `table' from C:/ruby/watir/RoleManagementDomainRestrictions.rb:149 from C:/ruby/watir/RoleManagementDomainRestrictions.rb:50:in `upto' from C:/ruby/watir/RoleManagementDomainRestrictions.rb:50 The frustrating thing is that I ran the same script against the "test" server and it ran just fine. Could this possibly be caused by a difference in server settings? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------ Message: 3 Date: Fri, 03 Jun 2005 09:51:08 -0500 From: Bret Pettichord Subject: RE: [Wtr-general] How do I test numeric field validations in watir? To: wtr-general at rubyforge.org Message-ID: <5.1.0.14.2.20050603094854.01146c50 at 127.0.0.1> Content-Type: text/plain; charset="us-ascii"; format=flowed At 09:31 AM 6/2/2005, Paul Rogers wrote: >The set method already fires the onchange - this was the most used event >for validation which is why it was added. Paul, I would think that ideally we'd want to trigger all the events that get triggers by a manual user. Are you trying to minimize the number of events we trigger? Why not add onBlur? Bret _____________________ Bret Pettichord www.pettichord.com ------------------------------ Message: 4 Date: Fri, 03 Jun 2005 09:45:55 -0600 From: Paul Rogers Subject: RE: [Wtr-general] How do I test numeric field validations in watir? To: wtr-general at rubyforge.org Message-ID: <002001c56853$54a45fc0$72d39044 at NewDell> Content-Type: text/plain; charset=US-ASCII The javascript in the validate function uses the global event object to determine which key was pressed. Watir does not set this object. I think I tried once before to make something like this work but with no luck. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar Sent: 03 June 2005 00:06 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How do I test numeric field validations in watir? Here is the HTML for the test cases. Bhavna On 6/2/05, Paul Rogers wrote: > The check could be fired by any number of different events - onblur, > onchange etc Can you post the html ? > > The set method already fires the onchange - this was the most used > event for validation which is why it was added. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar > Sent: 01 June 2005 23:33 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] How do I test numeric field validations in > watir? > > > I tried putting the additional fireEvent after the set, but I still > see the same behavior. The test "passes" but the invalid data remains > on screen and causes subsequent tests to fail. I end up having to do > an ie.reset(:index, 1).click in order to proceed. > > # Test 2: Put alphabetic data for number of bags ie.text_field(:name, > "bag_no").set(INVALID_BAG_INPUT) ie.text_field(:name , > "bag_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of bags if > ie.contains_text(INVALID_BAG_INPUT) > puts "Failed: test to check numeric validation for number of > bags." > else > puts "Passed: test to check numeric validation for number of > bags." end > > # Test 3: Put alphabetic data for number of parcels > ie.text_field(:name, "parcel_no").set(INVALID_PARCEL_INPUT) > ie.text_field(:name , "parcel_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of parcels if > ie.contains_text(INVALID_PARCEL_INPUT) > puts "Failed: test to check numeric validation for number of > parcels." > else > puts "Passed: test to check numeric validation for number of > parcels." end > > Also, is there a way to search the archives across months? > > Thanks, > Bhavna > On 5/27/05, Atilla Ozgur wrote: > > Watir normally set text_field's contents then fires javascript > > event. > Most > > probably your javascript validation code uses a event like > > on_key_up > . To > > simulate human behaviour you can use this. > > > > ie.text_field(:name , 'userid1').set('foo') ie.text_field(:name , > > 'userid1').fireEvent('onChange') > > > > Search the mail archives about onchange and fire event, you will get > more > > information. > > > > > > > > > > On 5/27/05, Bhavna Kumar wrote: > > > > > > I am using watir to test an IE based application. > > > > > > I have data entry fields that only allow numeric data to be > > > entered. When I manually try to enter text data in the field, I am > > > not > allowed > > > to do so. If I click on any alpha key, nothing is displayed in the > > > text box. > > > > > > But when I try it through watir, text data gets entered and the > > > contains text doesn't spot it. However, the next test fails. > > > > > > # Put alphabetic data for number of bags ie.text_field(:name, > > > "bag_no").set("hello world") > > > > > > # Check to see if numeric validation exists for number of bags if > > > ie.contains_text("hello world") > > > puts "Failed: test to check numeric validation for number of > bags." > > > else > > > puts "Passed: test to check numeric validation for number of > bags." > > > end > > > > > > I get the "Passed" message. > > > > > > The next text in the sequence fails, because the text box has > > > "hello > > world" > > > > > > How do I deal with this? > > > > > > Regards, > > > Bhavna > > > > > > _______________________________________________ > > > 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 > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > ------------------------------ Message: 5 Date: Fri, 03 Jun 2005 09:55:16 -0600 From: Paul Rogers Subject: RE: [Wtr-general] How do I test numeric field validations in watir? To: wtr-general at rubyforge.org Message-ID: <002301c56854$a2856580$72d39044 at NewDell> Content-Type: text/plain; charset=US-ASCII I will eventually, I need to make the javascript to have useful tests first though. I think it makes sense, as you said in an earlier mail, to have set do all events and value= be no events. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 03 June 2005 08:51 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] How do I test numeric field validations in watir? At 09:31 AM 6/2/2005, Paul Rogers wrote: >The set method already fires the onchange - this was the most used >event for validation which is why it was added. Paul, I would think that ideally we'd want to trigger all the events that get triggers by a manual user. Are you trying to minimize the number of events we trigger? Why not add onBlur? Bret _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------ Message: 6 Date: Fri, 3 Jun 2005 12:34:15 -0400 From: "Boyt, Darrel" Subject: Re: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' To: Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC867313C at HQ-EXVS02.anteon.com> Content-Type: text/plain; charset="us-ascii" Paul, Yes, this is a frames app. I'm looping through a table with links in one of the frames, opening the links in a second browser window. $ie2.goto($ie1.frame("mainFrame").table(:index, 6)[x][3].link(:text, /View/).href()) I kind of figured IE's being closed before my script's done, but I'm running it from the command line with the "-b" option so I'm not sure how it's being closed. Thanks, Darrel -----Original Message----- From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri Jun 3 11:13:17 2005 Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC867309B at HQ-EXVS02.anteon.com> Message-ID: <001a01c5684f$97216360$72d39044 at NewDell> This error is usually caused by IE being closed before watir has finished with it - Im assuming that's not happening here though. Is this a frames application? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 03 June 2005 07:49 To: wtr-general at rubyforge.org Subject: [Wtr-general] WIN32OLERuntimeError - Unknown property or method`document' Okay, I am officially frustrated! I'm testing a commercial Learning Management System (LMS) that's been customized for our customer (not by us) and I keep getting the following error when accessing the "production" server: W, [03-Jun-2005 08:34:00#1076] WARN -- : runtime error in wait c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1568:in `method_missing': Unknown proper ty or method `document' (WIN32OLERuntimeError) HRESULT error code:0x80010108 The object invoked has disconnected from its clients. from c:/ruby/lib /ruby/site_ruby/1.8/watir.rb:1568:in `document' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2667:in `get_table' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2652:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:263:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:263:in `table' from C:/ruby/watir/RoleManagementDomainRestrictions.rb:149 from C:/ruby/watir/RoleManagementDomainRestrictions.rb:50:in `upto' from C:/ruby/watir/RoleManagementDomainRestrictions.rb:50 The frustrating thing is that I ran the same script against the "test" server and it ran just fine. Could this possibly be caused by a difference in server settings? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama ------------------------------ Message: 7 Date: Fri, 03 Jun 2005 10:54:50 -0600 From: Paul Rogers Subject: RE: [Wtr-general] How do I test numeric field validations in watir? To: wtr-general at rubyforge.org Message-ID: <002c01c5685c$f4dd9750$72d39044 at NewDell> Content-Type: text/plain; charset=US-ASCII So I looked at this, and again I cant make it work. Here is the code Ive been using, and the appropriate links. http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/create eventobject.asp http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_ev ent.asp http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/create eventobject.asp http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/fireev ent.asp This code always causes the event to have a keycode of 0, which "...The property's value is 0 if no key caused the event..' def fire_key_events(c=nil) ev = @ieController.document.createEventObject puts c ev.keyCode= c @o.fireEvent("onKeyDown" , ev) @o.fireEvent("onKeyPress" , ev) @o.fireEvent("onKeyUp" , ev) end # This method is used internally by setText and appendText # It should not be used externally. # * value - string - The string to enter into the text field def doKeyPress( value ) begin maxLength = @o.maxLength if value.length > maxLength value = suppliedValue[0 .. maxLength ] @ieController.log " Supplied string is #{suppliedValue.length} chars, which exceeds the max length (#{maxLength}) of the field. Using value: #{value}" end rescue # probably a text area - so it doesnt have a max Length maxLength = -1 end for i in 0 .. value.length-1 sleep @ieController.typingspeed # typing speed c = value[i,1] puts c #@ieController.log " adding c.chr " + c #.chr.to_s @o.value = @o.value.to_s + c #c.chr fire_key_events(c[0]) end end -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: 03 June 2005 09:46 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] How do I test numeric field validations in watir? The javascript in the validate function uses the global event object to determine which key was pressed. Watir does not set this object. I think I tried once before to make something like this work but with no luck. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar Sent: 03 June 2005 00:06 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] How do I test numeric field validations in watir? Here is the HTML for the test cases. Bhavna On 6/2/05, Paul Rogers wrote: > The check could be fired by any number of different events - onblur, > onchange etc Can you post the html ? > > The set method already fires the onchange - this was the most used > event for validation which is why it was added. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bhavna Kumar > Sent: 01 June 2005 23:33 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] How do I test numeric field validations in > watir? > > > I tried putting the additional fireEvent after the set, but I still > see the same behavior. The test "passes" but the invalid data remains > on screen and causes subsequent tests to fail. I end up having to do > an ie.reset(:index, 1).click in order to proceed. > > # Test 2: Put alphabetic data for number of bags ie.text_field(:name, > "bag_no").set(INVALID_BAG_INPUT) ie.text_field(:name , > "bag_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of bags if > ie.contains_text(INVALID_BAG_INPUT) > puts "Failed: test to check numeric validation for number of > bags." > else > puts "Passed: test to check numeric validation for number of > bags." end > > # Test 3: Put alphabetic data for number of parcels > ie.text_field(:name, "parcel_no").set(INVALID_PARCEL_INPUT) > ie.text_field(:name , "parcel_no").fireEvent("onChange") > > # Check to see if numeric validation exists for number of parcels if > ie.contains_text(INVALID_PARCEL_INPUT) > puts "Failed: test to check numeric validation for number of > parcels." > else > puts "Passed: test to check numeric validation for number of > parcels." end > > Also, is there a way to search the archives across months? > > Thanks, > Bhavna > On 5/27/05, Atilla Ozgur wrote: > > Watir normally set text_field's contents then fires javascript > > event. > Most > > probably your javascript validation code uses a event like > > on_key_up > . To > > simulate human behaviour you can use this. > > > > ie.text_field(:name , 'userid1').set('foo') ie.text_field(:name , > > 'userid1').fireEvent('onChange') > > > > Search the mail archives about onchange and fire event, you will get > more > > information. > > > > > > > > > > On 5/27/05, Bhavna Kumar wrote: > > > > > > I am using watir to test an IE based application. > > > > > > I have data entry fields that only allow numeric data to be > > > entered. When I manually try to enter text data in the field, I am > > > not > allowed > > > to do so. If I click on any alpha key, nothing is displayed in the > > > text box. > > > > > > But when I try it through watir, text data gets entered and the > > > contains text doesn't spot it. However, the next test fails. > > > > > > # Put alphabetic data for number of bags ie.text_field(:name, > > > "bag_no").set("hello world") > > > > > > # Check to see if numeric validation exists for number of bags if > > > ie.contains_text("hello world") > > > puts "Failed: test to check numeric validation for number of > bags." > > > else > > > puts "Passed: test to check numeric validation for number of > bags." > > > end > > > > > > I get the "Passed" message. > > > > > > The next text in the sequence fails, because the text box has > > > "hello > > world" > > > > > > How do I deal with this? > > > > > > Regards, > > > Bhavna > > > > > > _______________________________________________ > > > 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 > > _______________________________________________ > 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 End of Wtr-general Digest, Vol 19, Issue 4 ****************************************** _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From tuyet.ctn at mscibarra.com Fri Jun 3 21:07:25 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Fri, 3 Jun 2005 18:07:25 -0700 Subject: [Wtr-general] FRAME class Message-ID: Thanks Paul for the info. I did look at the frame_test.rb but couldn't find anything that has the same hierarchy as mine. The page I am working on has a "main" frame and within it, there are several other frames as displayed in the last email (header, context_bar, body). This page also has several tabs at the top (Home, Analysis, Portfolio Admin, Data Admin, Strategies, Import/Export (this is the active tab), and Accounts). My challenge is to be able to click on any other tab from the current active tab (Import/Export). >From the result of the getHTML below, I can see several "href" that corresponds to the tabs (for example: href=\"javascript:switchToTab('/araneae/PortfolioAdmin/home?notfound=home&am p;common.sessionId=HXKwDoE8p3P3wT_eSNt3Yg99', 2);\" target=_p arent>Portfolio Admin ie.frame("main").frame(:name, "header").link(:text, "PORTFOLIO ADMIN").click Watir::Exception::UnknownObjectException: Unable to locate object, using text and PORTFOLIO ADMIN irb(main):018:0> ie.frame("main").frame("header").getHTML href=\"javascript:switchToTab(' /araneae/Home?notfound=home&common.sessionId=HXKwDoE8p3P3wT_eSNt3Yg99', 0);\ " target=_parent>      Home   &nb sp ;  \r\n\r\n \r\n     Analysis &nb sp;  \r\n\r\n\r\n Portfolio Admin\r\n\r\n\ r\n    Data Admin  & nbsp;\r\n Message-ID: <5.1.0.14.2.20050604123634.02abc9c0@127.0.0.1> It looks like you have a case problem. Try: ie.frame("main").frame(:name, "header").link(:text, "Portfolio Admin").click If you don't like to worry about case, you can also do: ie.frame("main").frame(:name, "header").link(:text, /PORTFOLIO ADMIN/i).click Bret At 08:07 PM 6/3/2005, Tuyet Cong-Ton-Nu wrote: >Thanks Paul for the info. > >I did look at the frame_test.rb but couldn't find anything that has the same >hierarchy as mine. > >The page I am working on has a "main" frame and within it, there are several >other frames as displayed in the last email (header, context_bar, body). > >This page also has several tabs at the top (Home, Analysis, Portfolio Admin, >Data Admin, Strategies, Import/Export (this is the active tab), and >Accounts). > >My challenge is to be able to click on any other tab from the current active >tab (Import/Export). > > >From the result of the getHTML below, I can see several "href" that >corresponds to the tabs >(for example: >href=\"javascript:switchToTab('/araneae/PortfolioAdmin/home?notfound=home&am >p;common.sessionId=HXKwDoE8p3P3wT_eSNt3Yg99', 2);\" target=_p >arent>Portfolio Admin >So I'd like to figure out how to click on one of those href (which is one of >the tabs). > >What I want is something like this: >ie.frame("main").frame(:name, "header").link(:text, "PORTFOLIO ADMIN").click >(but of course this doesn't work -- I got back an error > >irb(main):037:0> ie.frame("main").frame(:name, "header").link(:text, >"PORTFOLIO >ADMIN").click >Watir::Exception::UnknownObjectException: Unable to locate object, using >text and PORTFOLIO ADMIN > > >irb(main):018:0> ie.frame("main").frame("header").getHTML >href=\"javascript:switchToTab(' >/araneae/Home?notfound=home&common.sessionId=HXKwDoE8p3P3wT_eSNt3Yg99', >0);\ >" >target=_parent>      Home   &nb >sp >;  \r\nclass=tabCornerI >mage src=\"/images/tab_corner_white_rt.gif\">\r\nclass=headerTabCorner> >src=\"/images/tab_corner_white_lt.gif\">\r\nlass=headerTab> onmouseover=\"window.status='   >;  Analysis    '; return true\" >href=\"javascript: >switchToTab('/araneae/Analysis/home?notfound=home&common.sessionId=HXKwD >oE8p >3P3wT_eSNt3Yg99', 1);\" >target=_parent>    Analysis &nb >sp;  \r\nclass=tabCorne >rImage src=\"/images/tab_corner_white_rt.gif\">\r\nclass=headerTabCorne >r>src=\"/images/tab_corner_white_lt.gif\">\r\n class=headerTab> onmouseover=\"window.status='Portfolio > Admin'; return true\" >href=\"javascript:switchToTab('/araneae/PortfolioAdmin/ho >me?notfound=home&common.sessionId=HXKwDoE8p3P3wT_eSNt3Yg99', 2);\" >target=_p >arent>Portfolio Admin\r\nclass=ta >bCornerImage src=\"/images/tab_corner_white_rt.gif\">\r\nclass=headerTa >bCorner>src=\"/images/tab_corner_white_lt.gif\">\ >r\n onmouseover=\"window.status='&nb >sp;  Data Admin   '; return true\" >href=\"javascript:sw >itchToTab('/araneae/AssetAdmin/home?notfound=home&common.sessionId=HXKwD >oE8p >3P3wT_eSNt3Yg99', 3);\" target=_parent>   Data >Admin  & >nbsp;\r\nsrc > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From Jan.Montano at thomson.com Mon Jun 6 02:43:11 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Mon, 6 Jun 2005 14:43:11 +0800 Subject: [Wtr-general] popups Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE1E@tfphmanilmul01.ERF.THOMSON.COM> Hi! Lately, Iv had prolems with popups. It was working well then. But right now, the automated handling of popups doesn't work anymore. Even when running the popups_test.rb. I have to manually click the popup for the script to continue. Have you encounted this kind of thing? Any suggestions? From ashetty at velozglobal.com Mon Jun 6 05:37:04 2005 From: ashetty at velozglobal.com (Amita Shetty) Date: Mon, 6 Jun 2005 04:37:04 -0500 Subject: [Wtr-general] Links not getting clicked Message-ID: <48966054EF494649A988314F1C8307731CA9C0@DC1Mail01> Hi, I am using Watir to automate the test cases.But I am not able to click on the links using: "ie.link(:text, "NewNodeInfo").click" The following is the HTML code:   NewNodeInfo Is there any other way to do it? Regards, Amitha Shetty From zeljko.filipin at gmail.com Mon Jun 6 06:03:58 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Mon, 6 Jun 2005 12:03:58 +0200 Subject: [Wtr-general] Links not getting clicked In-Reply-To: <48966054EF494649A988314F1C8307731CA9C0@DC1Mail01> Message-ID: <42a41f64.1eac7bee.6a69.2cff@mx.gmail.com> I think in this case you should use ie.link(:text, " NewNodeInfo").click (there is a space in front of link text). Line break (in this case after opening "a" tag and before link text) is translated to one space in html. But there is several ways of manipulating objects in watir, see http://wtr.rubyforge.org/watir_user_guide.html, http://wtr.rubyforge.org/rdoc/ , watir.rb... >From watir.rb: # The ways that are available to identify an html object depend upon the object type, but include # :id used for an object that has an ID attribute -- this is the best way! # :name used for an object that has a name attribute. # :value value of text fields, captions of buttons # :index finds the nth object of the specified type - eg button(:index , 2) finds the second button. This is 1 based.
# :beforeText finds the object immeditaley before the specified text. Doesnt work if the text is in a table cell # :afterText finds the object immeditaley after the specified text. Doesnt work if the text is in a table cell -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Amita Shetty Sent: Monday, June 06, 2005 11:37 AM To: Wtr-general at rubyforge.org Subject: [Wtr-general] Links not getting clicked Hi, I am using Watir to automate the test cases.But I am not able to click on the links using: "ie.link(:text, "NewNodeInfo").click" The following is the HTML code:   NewNodeInfo Is there any other way to do it? Regards, Amitha Shetty _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From david.a.boyd at gmail.com Mon Jun 6 09:01:45 2005 From: david.a.boyd at gmail.com (David Boyd) Date: Mon, 6 Jun 2005 09:01:45 -0400 Subject: [Wtr-general] IE Visibility Message-ID: Hi, I want to control browser visibility during testing. I've tried IE#ie.visibility=true|false and setting @visibility and neither seems to work. Can you help? Thanks, Dave Boyd From ati.ozgur at gmail.com Mon Jun 6 09:09:03 2005 From: ati.ozgur at gmail.com (Atilla Ozgur) Date: Mon, 6 Jun 2005 16:09:03 +0300 Subject: [Wtr-general] IE Visibility In-Reply-To: References: Message-ID: >From user guide. Tips and Tricks Running Tests With the Browser Not Visible Run the tests with a "-b" option if you don't want the browser to be visible. ex. myTest.rb -b On 6/6/05, David Boyd wrote: > Hi, > > I want to control browser visibility during testing. I've tried > IE#ie.visibility=true|false > and setting @visibility and neither seems to work. Can you help? > > Thanks, > > Dave Boyd > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From ati.ozgur at gmail.com Mon Jun 6 09:10:42 2005 From: ati.ozgur at gmail.com (Atilla Ozgur) Date: Mon, 6 Jun 2005 16:10:42 +0300 Subject: [Wtr-general] Links not getting clicked In-Reply-To: <42a41f64.1eac7bee.6a69.2cff@mx.gmail.com> References: <48966054EF494649A988314F1C8307731CA9C0@DC1Mail01> <42a41f64.1eac7bee.6a69.2cff@mx.gmail.com> Message-ID: I think regular expression syntax is better suited. You would not bother with whitespaces in this way. ie.link(:text, /NewNodeInfo/).click On 6/6/05, Zeljko Filipin wrote: > I think in this case you should use > > ie.link(:text, " NewNodeInfo").click > > (there is a space in front of link text). Line break (in this case after > opening "a" tag and before link text) is translated to one space in html. > > But there is several ways of manipulating objects in watir, see > http://wtr.rubyforge.org/watir_user_guide.html, > http://wtr.rubyforge.org/rdoc/ , watir.rb... > > >From watir.rb: > > # The ways that are available to identify an html object depend upon the > object type, but include > # :id used for an object that has an ID attribute -- this is the > best way! > # :name used for an object that has a name attribute. > # :value value of text fields, captions of buttons > # :index finds the nth object of the specified type - eg > button(:index , 2) finds the second button. This is 1 based.
> # :beforeText finds the object immeditaley before the specified text. > Doesnt work if the text is in a table cell > # :afterText finds the object immeditaley after the specified text. > Doesnt work if the text is in a table cell > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Amita Shetty > Sent: Monday, June 06, 2005 11:37 AM > To: Wtr-general at rubyforge.org > Subject: [Wtr-general] Links not getting clicked > > Hi, > I am using Watir to automate the test cases.But I am not able to click on > the links using: > "ie.link(:text, "NewNodeInfo").click" > > The following is the HTML code: > > >   > NewNodeInfo > > > Is there any other way to do it? > Regards, > Amitha Shetty > > > _______________________________________________ > 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 Jun 6 13:18:34 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 06 Jun 2005 12:18:34 -0500 Subject: [Wtr-general] IE Visibility In-Reply-To: Message-ID: <5.1.0.14.2.20050606121715.02b08fb0@127.0.0.1> It's: IE#ie.visible=true|false At 08:01 AM 6/6/2005, David Boyd wrote: >Hi, > >I want to control browser visibility during testing. I've tried >IE#ie.visibility=true|false >and setting @visibility and neither seems to work. Can you help? > >Thanks, > >Dave Boyd > >_______________________________________________ >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 Mon Jun 6 13:37:57 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 06 Jun 2005 11:37:57 -0600 Subject: [Wtr-general] IE Visibility In-Reply-To: <5.1.0.14.2.20050606121715.02b08fb0@127.0.0.1> Message-ID: <000a01c56abe$7a993a80$72d39044@NewDell> Ive had problems with visible in the past. According to http://msdn.microsoft.com/workshop/browser/webbrowser/reference/properti es/visible.asp?frame=true It may become visible after using the navigate method "..When the Microsoft Internet Explorer application is first created, it is hidden. It becomes visible after using the Navigate or GoSearch method..." Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 06 June 2005 11:19 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] IE Visibility It's: IE#ie.visible=true|false At 08:01 AM 6/6/2005, David Boyd wrote: >Hi, > >I want to control browser visibility during testing. I've tried >IE#ie.visibility=true|false and setting @visibility and neither seems >to work. Can you help? > >Thanks, > >Dave Boyd > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Mon Jun 6 18:01:54 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 06 Jun 2005 17:01:54 -0500 Subject: [Wtr-general] IE Visibility In-Reply-To: <000a01c56abe$7a993a80$72d39044@NewDell> References: <5.1.0.14.2.20050606121715.02b08fb0@127.0.0.1> Message-ID: <5.1.0.14.2.20050606170031.02b2a390@127.0.0.1> At 12:37 PM 6/6/2005, Paul Rogers wrote: >Ive had problems with visible in the past. I'm curious about the problems you've seen. I regularly run my tests invisible and have not seen such problems. (There are problems with popups, but that is something else entirely.) Bret _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Mon Jun 6 18:18:41 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 06 Jun 2005 17:18:41 -0500 Subject: [Wtr-general] popups In-Reply-To: <71EA7CA4B789864F9B3AC722A7F016B68DBE1E@tfphmanilmul01.ERF. THOMSON.COM> Message-ID: <5.1.0.14.2.20050606171811.02b17c18@127.0.0.1> At 01:43 AM 6/6/2005, Jan.Montano at thomson.com wrote: >Hi! Lately, Iv had prolems with popups. It was working well then. But >right now, the automated handling of popups doesn't work anymore. Even >when running the popups_test.rb. I have to manually click the popup for >the script to continue. Have you encounted this kind of thing? Any suggestions? What version are you using now? What version worked? _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Mon Jun 6 18:21:41 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 06 Jun 2005 17:21:41 -0500 Subject: [Wtr-general] Links not getting clicked In-Reply-To: <42a41f64.1eac7bee.6a69.2cff@mx.gmail.com> References: <48966054EF494649A988314F1C8307731CA9C0@DC1Mail01> Message-ID: <5.1.0.14.2.20050606171958.02afdf38@127.0.0.1> At 05:03 AM 6/6/2005, Zeljko Filipin wrote: >I think in this case you should use > >ie.link(:text, " NewNodeInfo").click In my opinion, this should be logged as a bug. We should be "stripping" the text for comparison -- we do this in several other cases. (Ideally we'd refactor the code so that one change would be consistent for accessing the :text of any object that supports it.) Bret _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Mon Jun 6 18:25:44 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 06 Jun 2005 17:25:44 -0500 Subject: [Wtr-general] collaborative decisions Message-ID: <5.1.0.14.2.20050606172146.02afe3f8@127.0.0.1> We've had various discussions recently about how Watir should work and whether something is a bug or not. Sometimes, i've had a hard time telling whether someone is expressing a concern that they don't want to be forgotten or is actually speaking against a particular idea. Many open source projects encourage people to say +1 when they are voting in favor of a position and -1 when they are oppossed. I suggest that we start doing this here. Everyone on the list has a vote. _____________________ Bret Pettichord www.pettichord.com From jkohl at telusplanet.net Mon Jun 6 19:27:30 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Mon, 6 Jun 2005 16:27:30 -0700 Subject: [Wtr-general] collaborative decisions In-Reply-To: <5.1.0.14.2.20050606172146.02afe3f8@127.0.0.1> References: <5.1.0.14.2.20050606172146.02afe3f8@127.0.0.1> Message-ID: <1118100450.42a4dbe2f2840@webmail.telusplanet.net> +1 Quoting Bret Pettichord : > We've had various discussions recently about how Watir should work and > whether something is a bug or not. > > Sometimes, i've had a hard time telling whether someone is expressing a > concern that they don't want to be forgotten or is actually speaking > against a particular idea. > > Many open source projects encourage people to say +1 when they are voting > in favor of a position and -1 when they are oppossed. > > I suggest that we start doing this here. Everyone on the list has a vote. > > > _____________________ > 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 Jun 6 19:29:13 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Mon, 6 Jun 2005 16:29:13 -0700 Subject: [Wtr-general] popups In-Reply-To: <5.1.0.14.2.20050606171811.02b17c18@127.0.0.1> References: <5.1.0.14.2.20050606171811.02b17c18@127.0.0.1> Message-ID: <1118100553.42a4dc4959810@webmail.telusplanet.net> I have had this happen with JavaScript popups/alerts etc. when IE is minimized on the task bar. AutoIT can't "see" the popup, so it hangs. If IE is not minimized when the popup occurs, it works fine. I haven't seen it with anything else though. -Jonathan > At 01:43 AM 6/6/2005, Jan.Montano at thomson.com wrote: > >Hi! Lately, Iv had prolems with popups. It was working well then. But > >right now, the automated handling of popups doesn't work anymore. Even > >when running the popups_test.rb. I have to manually click the popup for > >the script to continue. Have you encounted this kind of thing? Any > suggestions? > > What version are you using now? What version worked? > > _____________________ > 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 Jun 6 20:00:52 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 06 Jun 2005 18:00:52 -0600 Subject: [Wtr-general] IE Visibility In-Reply-To: <5.1.0.14.2.20050606170031.02b2a390@127.0.0.1> Message-ID: <000d01c56af3$f84f2220$72d39044@NewDell> I think it was something to do with starting IE maximised ( or regular size) and then going to minimised later in the test. It wasn't watir, but one of its predecessors, although the code is the same Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 06 June 2005 16:02 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] IE Visibility At 12:37 PM 6/6/2005, Paul Rogers wrote: >Ive had problems with visible in the past. I'm curious about the problems you've seen. I regularly run my tests invisible and have not seen such problems. (There are problems with popups, but that is something else entirely.) Bret _____________________ 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 Jun 6 20:02:12 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 06 Jun 2005 18:02:12 -0600 Subject: [Wtr-general] Links not getting clicked In-Reply-To: <5.1.0.14.2.20050606171958.02afdf38@127.0.0.1> Message-ID: <000e01c56af4$28305db0$72d39044@NewDell> It would also be good if we were intelligent enough to know that: 'some text' Is really the same as 'somenbsp;text' Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 06 June 2005 16:22 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Links not getting clicked At 05:03 AM 6/6/2005, Zeljko Filipin wrote: >I think in this case you should use > >ie.link(:text, " NewNodeInfo").click In my opinion, this should be logged as a bug. We should be "stripping" the text for comparison -- we do this in several other cases. (Ideally we'd refactor the code so that one change would be consistent for accessing the :text of any object that supports it.) Bret _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From tuyet.ctn at mscibarra.com Mon Jun 6 21:42:20 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Mon, 6 Jun 2005 18:42:20 -0700 Subject: [Wtr-general] FRAME Class Message-ID: Thanks Bret. Both of your suggestions work just fine :-) I am getting further into the application! Yahoo! From Jan.Montano at thomson.com Mon Jun 6 21:46:01 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Tue, 7 Jun 2005 09:46:01 +0800 Subject: [Wtr-general] popups Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE22@tfphmanilmul01.ERF.THOMSON.COM> This was the same version as before, and this same version worked before. I don't remember installing a new one. I've been using ruby-1.8.2-i386-mswin32. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Tuesday, June 07, 2005 6:19 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] popups At 01:43 AM 6/6/2005, Jan.Montano at thomson.com wrote: >Hi! Lately, Iv had prolems with popups. It was working well then. But >right now, the automated handling of popups doesn't work anymore. Even >when running the popups_test.rb. I have to manually click the popup for >the script to continue. Have you encounted this kind of thing? Any suggestions? What version are you using now? What version worked? _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Jan.Montano at thomson.com Mon Jun 6 21:48:29 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Tue, 7 Jun 2005 09:48:29 +0800 Subject: [Wtr-general] popups Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE23@tfphmanilmul01.ERF.THOMSON.COM> Hi. Unfortunately, my IE is not minimized during run. Last resort, I could try reinstalling ruby. But I do want to find out first what's causing this problem. Thanks. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of jkohl at telusplanet.net Sent: Tuesday, June 07, 2005 7:29 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] popups I have had this happen with JavaScript popups/alerts etc. when IE is minimized on the task bar. AutoIT can't "see" the popup, so it hangs. If IE is not minimized when the popup occurs, it works fine. I haven't seen it with anything else though. -Jonathan > At 01:43 AM 6/6/2005, Jan.Montano at thomson.com wrote: > >Hi! Lately, Iv had prolems with popups. It was working well then. But > >right now, the automated handling of popups doesn't work anymore. Even > >when running the popups_test.rb. I have to manually click the popup for > >the script to continue. Have you encounted this kind of thing? Any > suggestions? > > What version are you using now? What version worked? > > _____________________ > Bret Pettichord > www.pettichord.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Mon Jun 6 21:56:39 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 06 Jun 2005 19:56:39 -0600 Subject: [Wtr-general] popups In-Reply-To: <71EA7CA4B789864F9B3AC722A7F016B68DBE23@tfphmanilmul01.ERF.THOMSON.COM> Message-ID: <000f01c56b04$25801780$72d39044@NewDell> Somebody else had a similar problem when the path contained a space. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jan.Montano at thomson.com Sent: 06 June 2005 19:48 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] popups Hi. Unfortunately, my IE is not minimized during run. Last resort, I could try reinstalling ruby. But I do want to find out first what's causing this problem. Thanks. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of jkohl at telusplanet.net Sent: Tuesday, June 07, 2005 7:29 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] popups I have had this happen with JavaScript popups/alerts etc. when IE is minimized on the task bar. AutoIT can't "see" the popup, so it hangs. If IE is not minimized when the popup occurs, it works fine. I haven't seen it with anything else though. -Jonathan > At 01:43 AM 6/6/2005, Jan.Montano at thomson.com wrote: > >Hi! Lately, Iv had prolems with popups. It was working well then. But > >right now, the automated handling of popups doesn't work anymore. Even > >when running the popups_test.rb. I have to manually click the popup for > >the script to continue. Have you encounted this kind of thing? Any > suggestions? > > What version are you using now? What version worked? > > _____________________ > Bret Pettichord > www.pettichord.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Mon Jun 6 22:13:34 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 06 Jun 2005 21:13:34 -0500 Subject: [Wtr-general] popups In-Reply-To: <71EA7CA4B789864F9B3AC722A7F016B68DBE22@tfphmanilmul01.ERF. THOMSON.COM> Message-ID: <5.1.0.14.2.20050606211249.02b4ed30@127.0.0.1> At 08:46 PM 6/6/2005, Jan.Montano at thomson.com wrote: >This was the same version as before, and this same version worked before. >I don't remember installing a new one. I've been using ruby-1.8.2-i386-mswin32. What version of Watir? Some people have reported problems with the AutoIt library that Watir uses. Reinstalling that seemed to fix their problems. Bret _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Tue Jun 7 00:13:13 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 06 Jun 2005 23:13:13 -0500 Subject: [Wtr-general] Links not getting clicked In-Reply-To: <000e01c56af4$28305db0$72d39044@NewDell> References: <5.1.0.14.2.20050606171958.02afdf38@127.0.0.1> Message-ID: <5.1.0.14.2.20050606231116.02b0be80@127.0.0.1> Uh. We are: irb(main):006:0> ie.goto('d:/workspace/watir/unittests/html/div.html') => 0.191 irb(main):007:0> ie.div(:id, 'text_fields1').text => "Text1: Text2: Text3:" irb(main):008:0> ie.div(:id, 'text_fields1').html => "\r\n
Text1:    &nbs p; Text2:      Text3:
" At 07:02 PM 6/6/2005, Paul Rogers wrote: >It would also be good if we were intelligent enough to know that: > >'some text' >Is really the same as >'somenbsp;text' > >Paul _____________________ Bret Pettichord www.pettichord.com From shaorobics at gmail.com Tue Jun 7 10:25:40 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Tue, 7 Jun 2005 10:25:40 -0400 Subject: [Wtr-general] default values for parameters Message-ID: <593b9ae80506070725760503b1@mail.gmail.com> Hey all if I have a function: def A(param1 = "1", param2 = "2", param3 = "3", param4 = "4") and I want to call this function but pass it values for param2 and 4 only while leaving param1 & 3 at the default, how can I do this? Thanks Shao From zeljko.filipin at gmail.com Tue Jun 7 10:52:00 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 7 Jun 2005 16:52:00 +0200 Subject: [Wtr-general] default values for parameters In-Reply-To: <593b9ae80506070725760503b1@mail.gmail.com> Message-ID: <42a5b465.1c4c3b89.7c76.7d34@mx.gmail.com> 1. What do you need it for? 2. All I can think of is to change function to def a( param2 = "2", param4 = "4", param1 = "1", param3 = "3" ) puts param1, param2, param3, param4 end and then call it with a( 'a', 'b' ) 3. Another way would be to use a hash or object as method/function parameter (I prefer objects). class Parameter attr_accessor :param1, :param2, :param3, :param4 def initialize( param1 = "1", param2 = "2", param3 = "3", param4 = "4" ) @param1, @param2, @param3, @param4 = param1, param2, param3, param4 end def a puts @param1, @param2, @param3, @param4 end end parameter = Parameter.new parameter.param2 = 'x' parameter.param4 = 'y' parameter.a -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: Tuesday, June 07, 2005 4:26 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] default values for parameters Hey all if I have a function: def A(param1 = "1", param2 = "2", param3 = "3", param4 = "4") and I want to call this function but pass it values for param2 and 4 only while leaving param1 & 3 at the default, how can I do this? Thanks Shao _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From zeljko.filipin at gmail.com Tue Jun 7 11:18:20 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 7 Jun 2005 17:18:20 +0200 Subject: [Wtr-general] default values for parameters In-Reply-To: <593b9ae80506070725760503b1@mail.gmail.com> Message-ID: <42a5ba91.40f64d21.728c.1dc5@mx.gmail.com> And this just came up (I had a walk)... :) def a( param1 = "1", param2 = "2", param3 = "3", param4 = "4" ) param1 = "1" if param1 == nil param3 = "3" if param3 == nil puts param1, param2, param3, param4 end a( nil, 'x', nil, 'y' ) -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: Tuesday, June 07, 2005 4:26 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] default values for parameters Hey all if I have a function: def A(param1 = "1", param2 = "2", param3 = "3", param4 = "4") and I want to call this function but pass it values for param2 and 4 only while leaving param1 & 3 at the default, how can I do this? Thanks Shao _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Tue Jun 7 11:24:27 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 07 Jun 2005 09:24:27 -0600 Subject: [Wtr-general] Links not getting clicked In-Reply-To: <5.1.0.14.2.20050606231116.02b0be80@127.0.0.1> Message-ID: <002f01c56b74$fea6f4a0$72d39044@NewDell> Hmm, badly phrased on my part: I would like to see this ie.contains_text('some text') Or this ie.contains_text('somenbsp;text') Find text that either had the nbsp; between the words or had a space -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 06 June 2005 22:13 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Links not getting clicked Uh. We are: irb(main):006:0> ie.goto('d:/workspace/watir/unittests/html/div.html') => 0.191 irb(main):007:0> ie.div(:id, 'text_fields1').text => "Text1: Text2: Text3:" irb(main):008:0> ie.div(:id, 'text_fields1').html => "\r\n
Text1:    &nbs p; Text2:      Text3:
" At 07:02 PM 6/6/2005, Paul Rogers wrote: >It would also be good if we were intelligent enough to know that: > >'some text' >Is really the same as >'somenbsp;text' > >Paul _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From shaorobics at gmail.com Tue Jun 7 11:41:57 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Tue, 7 Jun 2005 11:41:57 -0400 Subject: [Wtr-general] default values for parameters In-Reply-To: <42a5ba91.40f64d21.728c.1dc5@mx.gmail.com> References: <593b9ae80506070725760503b1@mail.gmail.com> <42a5ba91.40f64d21.728c.1dc5@mx.gmail.com> Message-ID: <593b9ae805060708415f506eb3@mail.gmail.com> What I need it for..well, to give a far out example, say I have def Combo1(drink = "Coke", Burger="Cheeseburger", side="Fries", size="Large") say I'm a hungry person who wants combo1 and this nice fast food restaurant allows us to mix and match food items. I want all the default items in combo1 except I want a chicken burger instead, and super sized instead of large, my friend on the other hand wants combo1 as well but wants onion rings instead of fries but everything else the same... I basically have a function where, under certain circumstances, I call it with certain values - but there's no telling which parameters need to be non-default ahead of time. I've been told that in Perl, for example you could do Combo1(Burger:="Chicken") and it will leave all the others defaulted. So I was wondering if it was possible in Ruby :) But the nil idea works fine! Thanks! :) Shao On 6/7/05, Zeljko Filipin wrote: > And this just came up (I had a walk)... :) > > def a( param1 = "1", param2 = "2", param3 = "3", param4 = "4" ) > param1 = "1" if param1 == nil > param3 = "3" if param3 == nil > puts param1, param2, param3, param4 > end > > a( nil, 'x', nil, 'y' ) > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: Tuesday, June 07, 2005 4:26 PM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] default values for parameters > > Hey all > > if I have a function: > > def A(param1 = "1", param2 = "2", param3 = "3", param4 = "4") > > and I want to call this function but pass it values for param2 and 4 > only while leaving param1 & 3 at the default, how can I do this? > > Thanks > > Shao > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Tue Jun 7 14:26:50 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 07 Jun 2005 13:26:50 -0500 Subject: [Wtr-general] Links not getting clicked In-Reply-To: <002f01c56b74$fea6f4a0$72d39044@NewDell> References: <5.1.0.14.2.20050606231116.02b0be80@127.0.0.1> Message-ID: <5.1.0.14.2.20050607132558.01147c90@127.0.0.1> Since contains_text just calls text internally, i would think it would work. Can you give a specific example? Bret At 10:24 AM 6/7/2005, Paul Rogers wrote: >Hmm, badly phrased on my part: > >I would like to see this > >ie.contains_text('some text') > >Or this > >ie.contains_text('somenbsp;text') > > >Find text that either had the nbsp; between the words or had a space > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord >Sent: 06 June 2005 22:13 >To: wtr-general at rubyforge.org >Subject: RE: [Wtr-general] Links not getting clicked > > >Uh. We are: > >irb(main):006:0> ie.goto('d:/workspace/watir/unittests/html/div.html') >=> 0.191 >irb(main):007:0> ie.div(:id, 'text_fields1').text >=> "Text1: Text2: Text3:" >irb(main):008:0> ie.div(:id, 'text_fields1').html >=> "\r\n
Text1: name=div_text1>   &nbs >p; Text2:      Text3: name=div_ >text3>
" > >At 07:02 PM 6/6/2005, Paul Rogers wrote: > >It would also be good if we were intelligent enough to know that: > > > >'some text' > >Is really the same as > >'somenbsp;text' > > > >Paul > >_____________________ > Bret Pettichord > www.pettichord.com > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From tuyet.ctn at mscibarra.com Tue Jun 7 19:46:53 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Tue, 7 Jun 2005 16:46:53 -0700 Subject: [Wtr-general] How to redirect result of puts to a file? Message-ID: The result for the command below is so big that I cannot see it all on the console, how can I redirect it to an output file like > output.txt? I tried that but got a syntax error. Any help is appreciated. irb(main):050:0> puts ie.frame("main").frame("body").frame("tabContent").getHTML From hitesh.jain at investmet.com Tue Jun 7 19:56:30 2005 From: hitesh.jain at investmet.com (hitesh.jain at investmet.com) Date: Tue, 7 Jun 2005 16:56:30 -0700 Subject: [Wtr-general] How to redirect result of puts to a file? In-Reply-To: Message-ID: goto to command prompt and type the following : c:\dir where ruby file resides\ > ruby xyz.rb -> output.txt thats it.... done !!! "Tuyet Cong-Ton-Nu" om> cc: Sent by: Subject: [Wtr-general] How to redirect result of puts to a file? wtr-general-bounces at ru byforge.org 06/07/2005 04:46 PM Please respond to wtr-general The result for the command below is so big that I cannot see it all on the console, how can I redirect it to an output file like > output.txt? I tried that but got a syntax error. Any help is appreciated. irb(main):050:0> puts ie.frame("main").frame("body").frame("tabContent").getHTML _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general The information contained in this message may be CONFIDENTIAL and is for the intended addressee only. Any unauthorized use, dissemination of the information, or copying of this message is prohibited. If you are not the intended addressee, please notify the sender immediately and delete this message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050607/c69a518b/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: graycol.gif Type: image/gif Size: 105 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050607/c69a518b/attachment.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 45 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050607/c69a518b/attachment-0001.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: pic02661.gif Type: image/gif Size: 1255 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050607/c69a518b/attachment-0002.gif From tuyet.ctn at mscibarra.com Tue Jun 7 21:09:11 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Tue, 7 Jun 2005 18:09:11 -0700 Subject: [Wtr-general] FW: How to redirect result of puts to a file? Message-ID: I got an answer to my question above from someone hitesh.jain at investmet.com, but it contained these gifs which are kind of puzzling. Can you tell me what they mean? Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: graycol.gif Type: image/gif Size: 105 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050607/c69a518b/gra ycol-0001.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 45 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050607/c69a518b/ecb lank-0001.gif From Jan.Montano at thomson.com Tue Jun 7 21:19:42 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Wed, 8 Jun 2005 09:19:42 +0800 Subject: [Wtr-general] popups Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE28@tfphmanilmul01.ERF.THOMSON.COM> I've reinstalled the whole package. Fortunately, it runs well now. Thanks a lot. Have a nice day! -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Bret Pettichord Sent: Tuesday, June 07, 2005 10:14 AM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] popups At 08:46 PM 6/6/2005, Jan.Montano at thomson.com wrote: >This was the same version as before, and this same version worked before. >I don't remember installing a new one. I've been using ruby-1.8.2-i386-mswin32. What version of Watir? Some people have reported problems with the AutoIt library that Watir uses. Reinstalling that seemed to fix their problems. Bret _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Tue Jun 7 22:40:37 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 07 Jun 2005 21:40:37 -0500 Subject: [Wtr-general] How to redirect result of puts to a file? In-Reply-To: Message-ID: <5.1.0.14.2.20050607213901.02cd4f18@127.0.0.1> f = File.open ('output.txt', 'w') f.puts ie.frame("main").frame("body").frame("tabContent").html At 06:46 PM 6/7/2005, Tuyet Cong-Ton-Nu wrote: >The result for the command below is so big that I cannot see it all on the >console, how can I redirect it to an output file like > output.txt? >I tried that but got a syntax error. Any help is appreciated. > >irb(main):050:0> puts >ie.frame("main").frame("body").frame("tabContent").getHTML >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From christopher.mcmahon at gmail.com Wed Jun 8 10:14:00 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 8 Jun 2005 08:14:00 -0600 Subject: [Wtr-general] limit of 59 instances of IE? Message-ID: <72799cd705060807146abd6861@mail.gmail.com> Hi... I'm running a set of 75 tests. I find that if I leave the IE windows open for each test, I get 59 instances of IE, and the 60th attempt to start IE yields this error WIN32OLERuntimeError: Failed to create WIN32OLE object from `InternetExplorer.Ap plication' HRESULT error code:0x80004002 No such interface supported and a stack trace. If I put "ie.close" into the tests, I can run all 75 tests with no problem. Has anyone else been stopped at the 60th instance of IE? -Chris From hitesh.jain at investmet.com Wed Jun 8 12:25:43 2005 From: hitesh.jain at investmet.com (hitesh.jain at investmet.com) Date: Wed, 8 Jun 2005 09:25:43 -0700 Subject: [Wtr-general] FW: How to redirect result of puts to a file? In-Reply-To: Message-ID: Here is one simple line on the command prompt .... c : \ dir where ruby file resides> ruby xyz.rb -> output.txt thats it.....n u r done !!! Hitesh Jain "Tuyet Cong-Ton-Nu" om> cc: Sent by: Subject: [Wtr-general] FW: How to redirect result of puts to a file? wtr-general-bounces at ru byforge.org 06/07/2005 06:09 PM Please respond to wtr-general I got an answer to my question above from someone hitesh.jain at investmet.com, but it contained these gifs which are kind of puzzling. Can you tell me what they mean? Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: graycol.gif Type: image/gif Size: 105 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050607/c69a518b/gra ycol-0001.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 45 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050607/c69a518b/ecb lank-0001.gif _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general The information contained in this message may be CONFIDENTIAL and is for the intended addressee only. Any unauthorized use, dissemination of the information, or copying of this message is prohibited. If you are not the intended addressee, please notify the sender immediately and delete this message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050608/60562ce4/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: graycol.gif Type: image/gif Size: 105 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050608/60562ce4/attachment.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 45 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050608/60562ce4/attachment-0001.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: pic03879.gif Type: image/gif Size: 1255 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050608/60562ce4/attachment-0002.gif From hitesh.jain at investmet.com Wed Jun 8 12:29:07 2005 From: hitesh.jain at investmet.com (hitesh.jain at investmet.com) Date: Wed, 8 Jun 2005 09:29:07 -0700 Subject: [Wtr-general] How to redirect result of puts to a file? In-Reply-To: <5.1.0.14.2.20050607213901.02cd4f18@127.0.0.1> Message-ID: Hey Bret this will add more code n make things complex to read.... here is the simple solution to this one......hope everyone likes it..... c :\ dir where ruby file resides>ruby xyz.rb -> output.txt this comes from the unix world.........hope this helps..... commments welcome.... Hitesh Jain "Bret Pettichord" To: wtr-general at rubyforge.org Sent by: cc: wtr-general-bounces at ru Subject: Re: [Wtr-general] How to redirect result of puts to a file? byforge.org 06/07/2005 07:40 PM Please respond to wtr-general f = File.open ('output.txt', 'w') f.puts ie.frame("main").frame("body").frame("tabContent").html At 06:46 PM 6/7/2005, Tuyet Cong-Ton-Nu wrote: >The result for the command below is so big that I cannot see it all on the >console, how can I redirect it to an output file like > output.txt? >I tried that but got a syntax error. Any help is appreciated. > >irb(main):050:0> puts >ie.frame("main").frame("body").frame("tabContent").getHTML >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general The information contained in this message may be CONFIDENTIAL and is for the intended addressee only. Any unauthorized use, dissemination of the information, or copying of this message is prohibited. If you are not the intended addressee, please notify the sender immediately and delete this message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050608/5ec25cc8/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: graycol.gif Type: image/gif Size: 105 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050608/5ec25cc8/attachment.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 45 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050608/5ec25cc8/attachment-0001.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: pic02913.gif Type: image/gif Size: 1255 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050608/5ec25cc8/attachment-0002.gif From jkohl at telusplanet.net Wed Jun 8 20:48:52 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Wed, 8 Jun 2005 18:48:52 -0600 Subject: [Wtr-general] limit of 59 instances of IE? In-Reply-To: <72799cd705060807146abd6861@mail.gmail.com> Message-ID: <20050609004819.CJOP23899.priv-edtnes51.telusplanet.net@tintin> It does that at 67 with me. I'm betting there aren't enough OS resources to create another one at some point: irb(main):007:0> 67.times {ie = Watir::IE.new} WIN32OLERuntimeError: Fail to create WIN32OLE object from `InternetExplorer.Application' HRESULT error code:0x80004005 Unspecified error from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1250:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1250:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1250:in `create_browser_window' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1162:in `initialize' from (irb):7:in `new' from (irb):7 from (irb):7:in `times' from (irb):7 > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of Chris McMahon > Sent: June 8, 2005 8:14 AM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] limit of 59 instances of IE? > > Hi... > I'm running a set of 75 tests. I find that if I leave the IE > windows open for each test, I get 59 instances of IE, and the 60th > attempt to start IE yields this error > > WIN32OLERuntimeError: Failed to create WIN32OLE object from > `InternetExplorer.Ap > plication' HRESULT error code:0x80004002 > No such interface supported > > and a stack trace. > > If I put "ie.close" into the tests, I can run all 75 tests with no > problem. > > Has anyone else been stopped at the 60th instance of IE? > -Chris > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From Jan.Montano at thomson.com Thu Jun 9 02:53:59 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Thu, 9 Jun 2005 14:53:59 +0800 Subject: [Wtr-general] IE.attach Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE2C@tfphmanilmul01.ERF.THOMSON.COM> Please walk me through. I have this call... $ie.link(:url,'javascript:GoLookUp(document.Form1.txtCompany.value,document.Form1.hKeyC.value,document.Form1.companySearchType.value)') It creates a seperate (new) window, and my $ie is not referenced to that new window but instead is referenced to the prior window. I want a reference to that page so that I would be able to control objects within.... I tried, attach but can't get it to work. --- here's the javascript for my call. function GoLookUp(param1,param2,searchtype) { var strUrl=""; var strTitle1=""; var strTitle2=""; var windowleft,windowtop; windowleft= new String((window.screen.availWidth-700)/2); windowtop= new String((window.screen.availHeight-300)/2); if((param2=="COM") || (param2=="SYM")) strTitle1=StringToUnicode("????"); if((param2=="IND") || (param2=="IND_JP")) strTitle1="%e8%a9%b2%e5%bd%93%e6%a5%ad%e7%a8%ae"; if((param2=="BRO"))strTitle1="????"; strTitle2="%e9%81%b8%e6%8a%9e%e3%81%97%e3%81%9f%e6%9d%a1%e4%bb%b6"; var meStr = StringToUnicode("??????"); //strUrl= "../LookUp/LookUp.aspx?key=" + param2 + "&value="+ StringToUnicode(param1)+ "&searchtype=" + searchtype +"&title1=" + strTitle1 + "&title2=" + strTitle2; strUrl= "../LookUp/LookUp.aspx?key=" + param2 + "&searchtype=" + searchtype +"&title1=" + strTitle1 + "&title2=" + strTitle2; // alert(strUrl); addUniverse = window.open("about:blank" ,"Newadd","height=275,width=640,left="+ windowleft +",top=" + windowtop + ",channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0"); document.Form2.Value.value = param1; document.Form2.action = strUrl; document.Form2.method = "post"; document.Form2.target = "Newadd"; document.Form2.submit(); //addUniverse = window.open(strUrl ,"Newadd","height=275,width=640,left="+ windowleft +",top=" + windowtop + ",channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0"); } From paul.rogers at shaw.ca Thu Jun 9 12:48:34 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 09 Jun 2005 10:48:34 -0600 Subject: [Wtr-general] IE.attach In-Reply-To: <71EA7CA4B789864F9B3AC722A7F016B68DBE2C@tfphmanilmul01.ERF.THOMSON.COM> Message-ID: <000a01c56d13$1376b4c0$72d39044@NewDell> You would use attach like this ie2=ie.attach(:title, 'My New Window') or ie2=ie.attach(:url, /newpage.aspx/) I think the title of your window is never the same, making it harder to find, but it looks like you may be able to use the url like this: ie2=ie.attch(:url , /LookUp\/LookUp.aspx\?key /) # note the \ to escape the / Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jan.Montano at thomson.com Sent: 09 June 2005 00:54 To: wtr-general at rubyforge.org Subject: [Wtr-general] IE.attach Please walk me through. I have this call... $ie.link(:url,'javascript:GoLookUp(document.Form1.txtCompany.value,docum ent.Form1.hKeyC.value,document.Form1.companySearchType.value)') It creates a seperate (new) window, and my $ie is not referenced to that new window but instead is referenced to the prior window. I want a reference to that page so that I would be able to control objects within.... I tried, attach but can't get it to work. --- here's the javascript for my call. function GoLookUp(param1,param2,searchtype) { var strUrl=""; var strTitle1=""; var strTitle2=""; var windowleft,windowtop; windowleft= new String((window.screen.availWidth-700)/2); windowtop= new String((window.screen.availHeight-300)/2); if((param2=="COM") || (param2=="SYM")) strTitle1=StringToUnicode("????"); if((param2=="IND") || (param2=="IND_JP")) strTitle1="%e8%a9%b2%e5%bd%93%e6%a5%ad%e7%a8%ae"; if((param2=="BRO"))strTitle1="????"; strTitle2="%e9%81%b8%e6%8a%9e%e3%81%97%e3%81%9f%e6%9d%a1%e4%bb%b6"; var meStr = StringToUnicode("??????"); //strUrl= "../LookUp/LookUp.aspx?key=" + param2 + "&value="+ StringToUnicode(param1)+ "&searchtype=" + searchtype +"&title1=" + strTitle1 + "&title2=" + strTitle2; strUrl= "../LookUp/LookUp.aspx?key=" + param2 + "&searchtype=" + searchtype +"&title1=" + strTitle1 + "&title2=" + strTitle2; // alert(strUrl); addUniverse = window.open("about:blank" ,"Newadd","height=275,width=640,left="+ windowleft +",top=" + windowtop + ",channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menuba r=0,resizable=0,scrollbars=0,status=0,toolbar=0"); document.Form2.Value.value = param1; document.Form2.action = strUrl; document.Form2.method = "post"; document.Form2.target = "Newadd"; document.Form2.submit(); //addUniverse = window.open(strUrl ,"Newadd","height=275,width=640,left="+ windowleft +",top=" + windowtop + ",channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menuba r=0,resizable=0,scrollbars=0,status=0,toolbar=0"); } _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From alex at verk.info Thu Jun 9 14:49:12 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Thu, 09 Jun 2005 14:49:12 -0400 Subject: [Wtr-general] limit of 59 instances of IE? In-Reply-To: <20050609004819.CJOP23899.priv-edtnes51.telusplanet.net@tintin> References: <20050609004819.CJOP23899.priv-edtnes51.telusplanet.net@tintin> Message-ID: <42A88F28.3060800@verk.info> Jonathan Kohl wrote: >It does that at 67 with me. I'm betting there aren't enough OS resources to >create another one at some point: > I was trying to use Watir for some multiple users simulation, and found two limitations that materialized even sooner: 1. A normal P-IV PC has enough CPU time to handle somewhere around 5-10 Internet Explorers simultaneously (dynamic content, relatively slow web server, no simulated think time). Which is enough to simulate loads of about 10-20 pages/sec. 2. If a server sets a persisted cookie, all vusers concurrently running on the same box share it. [2] Was a killer for my attempt. Best regards, Alexey Verkhovsky From jbradway at softhome.net Thu Jun 9 16:22:12 2005 From: jbradway at softhome.net (John) Date: Thu, 09 Jun 2005 16:22:12 -0400 Subject: [Wtr-general] automating dynamic javascript pages? In-Reply-To: <42A88F28.3060800@verk.info> References: <20050609004819.CJOP23899.priv-edtnes51.telusplanet.net@tintin> <42A88F28.3060800@verk.info> Message-ID: <42A8A4F4.8020301@softhome.net> Seem to be having trouble tracking done a simple answer to whether Watir supports javascript pages? I leaning toward 'no'. Any confirmation? Thanks. John irb(main):023:0> ie.show_all_objects -----------Objects in page ------------- id= src= text/javascript id= src=/myprimavera/js/JSHashMap.js text/javascript id= src=/myprimavera/js/JSArrayList.js text/javascript id= src=/myprimavera/js/JSStack.js text/javascript id= src=/myprimavera/js/JSSessionManager.js id= src= text/javascript id= src=/myprimavera/js/PVPopupWindow.js text/javascript id= src=/myprimavera/js/PVBookmark.js text/javascript id= src=/myprimavera/js/PVUrl.js text/javascript id= src=/myprimavera/js/pv_api.js text/javascript id= src=/myprimavera/js/PVSessionManager.js text/javascript id= src=/myprimavera/js/PVFramesManager.js text/javascript id= src=/myprimavera/js/PVFrame.js text/javascript id= src=/myprimavera/js/PVMenuManager.js text/javascript id= src=/myprimavera/js/PVMenuSection.js text/css id=globalstylesCSS text/css id=skinCSS text/javascript id= src= HTML Document name=topnav id=topnav src=/myprimavera/common/topFrame?U=1118346748242 HTML Document name=breadcrumb id=breadcrumb src=/myprimavera/common/breadCrumb?U=1118346748242 HTML Document name=leftnav_frameset id=leftnav_frameset src=/myprimavera/common/leftNavSet?U=1118346748242 HTML Document name=content_frameset id=content_frameset src=/myprimavera/common/rightFrameSet?U=1118346748242 From irushton at olysoftit.com Thu Jun 9 17:03:10 2005 From: irushton at olysoftit.com (Ian Rushton) Date: Thu, 9 Jun 2005 17:03:10 -0400 Subject: [Wtr-general] automating dynamic javascript pages? In-Reply-To: <42A8A4F4.8020301@softhome.net> Message-ID: <200506092059.j59Kx5cR022970@rubyforge.org> John, What do you mean by support? You can click on page objects and fire JavaScript events based on page objects, but you can't see or manipulate JavaScript objects. I have used Watir on heavy JavaScript built menus with success. Ian Rushton -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of John Sent: Thursday, June 09, 2005 4:22 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] automating dynamic javascript pages? Seem to be having trouble tracking done a simple answer to whether Watir supports javascript pages? I leaning toward 'no'. Any confirmation? Thanks. John irb(main):023:0> ie.show_all_objects -----------Objects in page ------------- id= src= text/javascript id= src=/myprimavera/js/JSHashMap.js text/javascript id= src=/myprimavera/js/JSArrayList.js text/javascript id= src=/myprimavera/js/JSStack.js text/javascript id= src=/myprimavera/js/JSSessionManager.js id= src= text/javascript id= src=/myprimavera/js/PVPopupWindow.js text/javascript id= src=/myprimavera/js/PVBookmark.js text/javascript id= src=/myprimavera/js/PVUrl.js text/javascript id= src=/myprimavera/js/pv_api.js text/javascript id= src=/myprimavera/js/PVSessionManager.js text/javascript id= src=/myprimavera/js/PVFramesManager.js text/javascript id= src=/myprimavera/js/PVFrame.js text/javascript id= src=/myprimavera/js/PVMenuManager.js text/javascript id= src=/myprimavera/js/PVMenuSection.js text/css id=globalstylesCSS text/css id=skinCSS text/javascript id= src= HTML Document name=topnav id=topnav src=/myprimavera/common/topFrame?U=1118346748242 HTML Document name=breadcrumb id=breadcrumb src=/myprimavera/common/breadCrumb?U=1118346748242 HTML Document name=leftnav_frameset id=leftnav_frameset src=/myprimavera/common/leftNavSet?U=1118346748242 HTML Document name=content_frameset id=content_frameset src=/myprimavera/common/rightFrameSet?U=1118346748242 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Thu Jun 9 17:50:01 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 9 Jun 2005 15:50:01 -0600 Subject: [Wtr-general] Not quite WATIR: open a file in Ruby without absolute pathname? Message-ID: <72799cd705060914504eed6fec@mail.gmail.com> Hi... No WATIR content, but if I have a Ruby script for instance "c:\watir\demo\script.rb" that opens a file in the local directory workbook = excel.Workbooks.Open('c:\watir\demo\FILE.xls') Is there any way to do this without the absolute pathname, like workbook = excel.Workbooks.Open('FILE.xls') ? Replies off the list would be OK, and sorry for the spam-like substance... -Chris From christopher.mcmahon at gmail.com Thu Jun 9 17:59:01 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 9 Jun 2005 15:59:01 -0600 Subject: [Wtr-general] Pickaxe! Not quite WATIR: open a file in Ruby without absolute pathname? In-Reply-To: <72799cd705060914504eed6fec@mail.gmail.com> References: <72799cd705060914504eed6fec@mail.gmail.com> Message-ID: <72799cd705060914591b4421ca@mail.gmail.com> File.expand_path does it: path = File.expand_path("FILE.xls") workbook = excel.Workbooks.Open("#{path}") Again, sorry for the spam... -C Hi... No WATIR content, but if I have a Ruby script for instance "c:\watir\demo\script.rb" that opens a file in the local directory workbook = excel.Workbooks.Open('c:\watir\demo\FILE.xls') Is there any way to do this without the absolute pathname, like workbook = excel.Workbooks.Open('FILE.xls') ? Replies off the list would be OK, and sorry for the spam-like substance... -Chris From cafedelamar at yahoo.com Thu Jun 9 18:00:50 2005 From: cafedelamar at yahoo.com (L de la Mar) Date: Thu, 9 Jun 2005 15:00:50 -0700 (PDT) Subject: [Wtr-general] Trying to download file from link, need to simulate right-click Message-ID: <20050609220051.3562.qmail@web53804.mail.yahoo.com> Hello, First, has anybody done this before? Is it possible to simulate the right-click on a link? Do I need to switch to straight OLE methods? Background: I'm just getting started with Watir and have successfully scripted logging in and navigating through frames etc. Next I need to right-click, rename and save a file. I have previously used Perl with Win32-GuiTest, but I was looking for a good reason to get into Ruby! Thanks, Loren __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From paul.rogers at shaw.ca Thu Jun 9 18:30:45 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 09 Jun 2005 16:30:45 -0600 Subject: [Wtr-general] limit of 59 instances of IE? In-Reply-To: <42A88F28.3060800@verk.info> Message-ID: <000f01c56d42$e0fc7e00$72d39044@NewDell> As for 2 - here is my solution. Untested, but it sounds promising. Theres a mail from earlier ( 3 months back maybe that explains it too) 1. cretae lots of html pages called 1.html, 2.html. Have html like this 1</tile></head> <head><title>2</tile></head> Etc 2. use ie=[] 10.times do |i| start("iexplorer #{i}.html") ie[i] = IE.attach(:title, i.to_s) end You now have ie processes that arent sharing cookies Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alexey Verkhovsky Sent: 09 June 2005 12:49 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] limit of 59 instances of IE? Jonathan Kohl wrote: >It does that at 67 with me. I'm betting there aren't enough OS >resources to create another one at some point: > I was trying to use Watir for some multiple users simulation, and found two limitations that materialized even sooner: 1. A normal P-IV PC has enough CPU time to handle somewhere around 5-10 Internet Explorers simultaneously (dynamic content, relatively slow web server, no simulated think time). Which is enough to simulate loads of about 10-20 pages/sec. 2. If a server sets a persisted cookie, all vusers concurrently running on the same box share it. [2] Was a killer for my attempt. Best regards, Alexey Verkhovsky _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Thu Jun 9 18:38:43 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 9 Jun 2005 16:38:43 -0600 Subject: [Wtr-general] Found a bug, I think Message-ID: <72799cd705060915381369ec7@mail.gmail.com> ie.html seems to fail on the page that results from an ie.attach. testSite = "http://foo" ie = IE.new ie.goto(testSite) ie.image(:src,"http://newwindow.gif").click ie2 = IE.attach(:title , /newwindow/ ) teststring = "some text" assert_match(teststring,ie2.html.to_s) From christopher.mcmahon at gmail.com Thu Jun 9 18:40:52 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 9 Jun 2005 16:40:52 -0600 Subject: [Wtr-general] Found a bug, I think In-Reply-To: <72799cd705060915381369ec7@mail.gmail.com> References: <72799cd705060915381369ec7@mail.gmail.com> Message-ID: <72799cd70506091540bdef8d0@mail.gmail.com> Sorry, premature send... ie.html seems to fail on the page that results from an ie.attach. testSite = "http://foo" ie = IE.new ie.goto(testSite) ie.image(:src,"http://newwindow.gif").click ie2 = IE.attach(:title , /newwindow/ ) teststring = "some text" assert_match(teststring,ie2.html.to_s) The "assert_match" command generates this error: NoMethodError: undefined method `innerHTML' for nil:NilClass c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1489:in `html' I'll see if I can cook up some HTML for this tomorrow. From jkohl at telusplanet.net Thu Jun 9 23:41:14 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Thu, 9 Jun 2005 21:41:14 -0600 Subject: [Wtr-general] limit of 59 instances of IE? In-Reply-To: <42A88F28.3060800@verk.info> Message-ID: <20050610034120.YCSD7952.priv-edtnes46.telusplanet.net@tintin> Interesting findings. I think there is a good reason(s) why load testing tools tend to use the HTTP layer and not user a web browser. Concurrent users have worked well for me with test data generation, but "real" concurrency testing is something I haven't tried through a tool like Watir. -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of Alexey Verkhovsky > Sent: June 9, 2005 12:49 PM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] limit of 59 instances of IE? > > Jonathan Kohl wrote: > > >It does that at 67 with me. I'm betting there aren't enough OS resources > to > >create another one at some point: > > > > I was trying to use Watir for some multiple users simulation, and found > two limitations that materialized even sooner: > > 1. A normal P-IV PC has enough CPU time to handle somewhere around 5-10 > Internet Explorers simultaneously (dynamic content, relatively slow web > server, no simulated think time). Which is enough to simulate loads of > about 10-20 pages/sec. > > 2. If a server sets a persisted cookie, all vusers concurrently running > on the same box share it. > > [2] Was a killer for my attempt. > > Best regards, > Alexey Verkhovsky > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From shaorobics at gmail.com Fri Jun 10 00:49:50 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Fri, 10 Jun 2005 00:49:50 -0400 Subject: [Wtr-general] different type of log Message-ID: <593b9ae8050609214924332a2e@mail.gmail.com> Hey all, there has been a recent thread about outputting things to a file. I have, in my spare time written my own HTML friendly log which is very very easy to use. I put up a simple sample on : http://fallpro.com/Shao/temp/Log/ which sorta explains how the log works These logs are autogenerated by test scripts. For example, instead of doing puts "someVar = " + someVar.to_s which would put it to the screen you'd replace that line above with: comments("someVar = " + someVar.to_s) ....which also puts it to the screen so you can see the output as it logs it This doesn't really change your test scripts at all, just a change in function call Of course, besides writing comments, it does other stuff too, like log passes, failures, errors...all of which are toggle enabled so that you can highlight a specific case you are interested in. I don't know if anyone else would find this HTMLLogger to be of any help...but I think it's easy on the eyes and convenient since it allows you to: 1. view the chronological order of your test flow if you click on the Large Orange Text 2. isolate the tests that passed by pressing the button 3. isolate the tests that failed by pressing the button 4. isolate the comments by pressing the button 5. isolate the error that occured by pressing the button What do you guys think? Shao From Mark_Cain at rl.gov Fri Jun 10 09:56:47 2005 From: Mark_Cain at rl.gov (Cain, Mark) Date: Fri, 10 Jun 2005 06:56:47 -0700 Subject: [Wtr-general] Pickaxe! Not quite WATIR: open a file in Ruby withoutabsolute pathname? Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D26F@EX5V.rl.gov> For what it is worth, this is just the kind of content that I subscribe to this forum for! It may not be 'specifically WATIR' but I'll bet you big money I'll use it somewhere in my WATIR scripts. Thanks for the info! --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: Thursday, June 09, 2005 2:59 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Pickaxe! Not quite WATIR: open a file in Ruby withoutabsolute pathname? File.expand_path does it: path = File.expand_path("FILE.xls") workbook = excel.Workbooks.Open("#{path}") Again, sorry for the spam... -C Hi... No WATIR content, but if I have a Ruby script for instance "c:\watir\demo\script.rb" that opens a file in the local directory workbook = excel.Workbooks.Open('c:\watir\demo\FILE.xls') Is there any way to do this without the absolute pathname, like workbook = excel.Workbooks.Open('FILE.xls') ? Replies off the list would be OK, and sorry for the spam-like substance... -Chris _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Mark_Cain at rl.gov Fri Jun 10 10:03:58 2005 From: Mark_Cain at rl.gov (Cain, Mark) Date: Fri, 10 Jun 2005 07:03:58 -0700 Subject: [Wtr-general] different type of log Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D270@EX5V.rl.gov> That's very cool Shao. Are you going to make it available for others to use? Thanks, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: Thursday, June 09, 2005 9:50 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] different type of log Hey all, there has been a recent thread about outputting things to a file. I have, in my spare time written my own HTML friendly log which is very very easy to use. I put up a simple sample on : http://fallpro.com/Shao/temp/Log/ which sorta explains how the log works These logs are autogenerated by test scripts. For example, instead of doing puts "someVar = " + someVar.to_s which would put it to the screen you'd replace that line above with: comments("someVar = " + someVar.to_s) ....which also puts it to the screen so you can see the output as it logs it This doesn't really change your test scripts at all, just a change in function call Of course, besides writing comments, it does other stuff too, like log passes, failures, errors...all of which are toggle enabled so that you can highlight a specific case you are interested in. I don't know if anyone else would find this HTMLLogger to be of any help...but I think it's easy on the eyes and convenient since it allows you to: 1. view the chronological order of your test flow if you click on the Large Orange Text 2. isolate the tests that passed by pressing the button 3. isolate the tests that failed by pressing the button 4. isolate the comments by pressing the button 5. isolate the error that occured by pressing the button What do you guys think? Shao _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From shaorobics at gmail.com Fri Jun 10 10:52:37 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Fri, 10 Jun 2005 10:52:37 -0400 Subject: [Wtr-general] different type of log In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D270@EX5V.rl.gov> References: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D270@EX5V.rl.gov> Message-ID: <593b9ae80506100752754dff15@mail.gmail.com> Yeah I'd definately want to make it available for others to use but not quite sure how I'd do that...not only will it benefit others who like it, I'm sure someone will think of some other useful things to add to it. I guess it's up to the Watir ppl if they would like the addition of this log to their Watir libraries. Shao On 6/10/05, Cain, Mark <Mark_Cain at rl.gov> wrote: > That's very cool Shao. Are you going to make it available for others to > use? > > Thanks, > > --Mark > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: Thursday, June 09, 2005 9:50 PM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] different type of log > > Hey all, > > there has been a recent thread about outputting things to a file. I > have, in my spare time written my own HTML friendly log which is very > very easy to use. > > I put up a simple sample on : > > http://fallpro.com/Shao/temp/Log/ > > which sorta explains how the log works > > These logs are autogenerated by test scripts. For example, instead of > doing > > puts "someVar = " + someVar.to_s > > which would put it to the screen you'd replace that line above with: > > comments("someVar = " + someVar.to_s) > ....which also puts it to the screen so you can see the output as it > logs it > > > This doesn't really change your test scripts at all, just a change in > function call > > Of course, besides writing comments, it does other stuff too, like log > passes, failures, errors...all of which are toggle enabled so that you > can highlight a specific case you are interested in. I don't know if > anyone else would find this HTMLLogger to be of any help...but I think > it's easy on the eyes and convenient since it allows you to: > > 1. view the chronological order of your test flow if you click on the > Large Orange Text > 2. isolate the tests that passed by pressing the button > 3. isolate the tests that failed by pressing the button > 4. isolate the comments by pressing the button > 5. isolate the error that occured by pressing the button > > What do you guys think? > > Shao > > _______________________________________________ > 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 Fri Jun 10 11:06:06 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Jun 2005 10:06:06 -0500 Subject: [Wtr-general] Pickaxe! Not quite WATIR: open a file in Ruby withoutabsolute pathname? In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D26F@EX5V.rl.gov> Message-ID: <5.1.0.14.2.20050610100427.011488c0@127.0.0.1> Questions about how to use Ruby effectively in your test scripts are welcome on this list. The majority of the people on this are pretty new to Ruby, and would benefit from sharing tips. Bret At 08:56 AM 6/10/2005, Cain, Mark wrote: >For what it is worth, this is just the kind of content that I subscribe >to this forum for! It may not be 'specifically WATIR' but I'll bet you >big money I'll use it somewhere in my WATIR scripts. _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Fri Jun 10 11:03:14 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Jun 2005 10:03:14 -0500 Subject: [Wtr-general] automating dynamic javascript pages? In-Reply-To: <42A8A4F4.8020301@softhome.net> References: <42A88F28.3060800@verk.info> <20050609004819.CJOP23899.priv-edtnes51.telusplanet.net@tintin> <42A88F28.3060800@verk.info> Message-ID: <5.1.0.14.2.20050610100243.02da19e0@127.0.0.1> Watir should work with your pages. The complication seems to be frames, rather than javascript per se. Bret At 03:22 PM 6/9/2005, John wrote: >Seem to be having trouble tracking done a simple answer to whether Watir >supports javascript pages? I leaning toward 'no'. Any confirmation? > >Thanks. > >John > >irb(main):023:0> ie.show_all_objects >-----------Objects in page ------------- > id= src= >text/javascript id= src=/myprimavera/js/JSHashMap.js >text/javascript id= src=/myprimavera/js/JSArrayList.js >text/javascript id= src=/myprimavera/js/JSStack.js >text/javascript id= >src=/myprimavera/js/JSSessionManager.js > id= src= >text/javascript id= src=/myprimavera/js/PVPopupWindow.js >text/javascript id= src=/myprimavera/js/PVBookmark.js >text/javascript id= src=/myprimavera/js/PVUrl.js >text/javascript id= src=/myprimavera/js/pv_api.js >text/javascript id= >src=/myprimavera/js/PVSessionManager.js >text/javascript id= src=/myprimavera/js/PVFramesManager.js >text/javascript id= src=/myprimavera/js/PVFrame.js >text/javascript id= src=/myprimavera/js/PVMenuManager.js >text/javascript id= src=/myprimavera/js/PVMenuSection.js >text/css id=globalstylesCSS >text/css id=skinCSS >text/javascript id= src= >HTML Document name=topnav id=topnav >src=/myprimavera/common/topFrame?U=1118346748242 >HTML Document name=breadcrumb id=breadcrumb >src=/myprimavera/common/breadCrumb?U=1118346748242 >HTML Document name=leftnav_frameset id=leftnav_frameset >src=/myprimavera/common/leftNavSet?U=1118346748242 >HTML Document name=content_frameset id=content_frameset >src=/myprimavera/common/rightFrameSet?U=1118346748242 >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Fri Jun 10 11:10:17 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Jun 2005 10:10:17 -0500 Subject: [Wtr-general] Updating the FAQ In-Reply-To: <000f01c56d42$e0fc7e00$72d39044@NewDell> References: <42A88F28.3060800@verk.info> Message-ID: <5.1.0.14.2.20050610100634.02da0848@127.0.0.1> I think Paul and i are both too busy working on Watir to keep our FAQ up to date. Any volunteers? This topic is actually on the FAQ, but the Question doesn't actually mention the cookie angle. http://wtr.rubyforge.org/wiki/wiki.pl?FrequentQuestions At 05:30 PM 6/9/2005, Paul Rogers wrote: >As for 2 - here is my solution. Untested, but it sounds promising. > >Theres a mail from earlier ( 3 months back maybe that explains it too) > >1. cretae lots of html pages called 1.html, 2.html. Have html like this ><head><title>1</tile></head> ><head><title>2</tile></head> >Etc > >2. use >ie=[] >10.times do |i| > start("iexplorer #{i}.html") > ie[i] = IE.attach(:title, i.to_s) >end > >You now have ie processes that arent sharing cookies > >Paul > > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alexey >Verkhovsky >Sent: 09 June 2005 12:49 >To: wtr-general at rubyforge.org >Subject: Re: [Wtr-general] limit of 59 instances of IE? > > >Jonathan Kohl wrote: > > >It does that at 67 with me. I'm betting there aren't enough OS > >resources to create another one at some point: > > > >I was trying to use Watir for some multiple users simulation, and found >two limitations that materialized even sooner: > >1. A normal P-IV PC has enough CPU time to handle somewhere around 5-10 >Internet Explorers simultaneously (dynamic content, relatively slow web >server, no simulated think time). Which is enough to simulate loads of >about 10-20 pages/sec. > >2. If a server sets a persisted cookie, all vusers concurrently running >on the same box share it. > >[2] Was a killer for my attempt. > >Best regards, >Alexey Verkhovsky > >_______________________________________________ >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 _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Fri Jun 10 11:17:16 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Jun 2005 10:17:16 -0500 Subject: [Wtr-general] Found a bug, I think In-Reply-To: <72799cd70506091540bdef8d0@mail.gmail.com> References: <72799cd705060915381369ec7@mail.gmail.com> <72799cd705060915381369ec7@mail.gmail.com> Message-ID: <5.1.0.14.2.20050610101312.02dc98e8@127.0.0.1> This error message indicates that there is no document in the ie2. This could happen for two reasons that i can think of: 1. The attach method actually doesn't check to make sure that it attaches to an IE object -- it could attach to a different window. This is itself a bug. The obvious fix, to check for "Internet Explorer" in the title would not work on non-English UI's. Perhaps we should just make sure that we get something that has a document... Anyway, you may want to play with the arguments to attach to make sure you are getting the right window. 2. Maybe a timing problem, where the document isn't yet available. You can check this by adding a couple sleeps to your script and see if it works any better. Bret At 05:40 PM 6/9/2005, Chris McMahon wrote: >Sorry, premature send... > >ie.html seems to fail on the page that results from an ie.attach. > >testSite = "http://foo" > ie = IE.new > ie.goto(testSite) > ie.image(:src,"http://newwindow.gif").click > ie2 = IE.attach(:title , /newwindow/ ) > teststring = "some text" > assert_match(teststring,ie2.html.to_s) > >The "assert_match" command generates this error: > >NoMethodError: undefined method `innerHTML' for nil:NilClass > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1489:in `html' > >I'll see if I can cook up some HTML for this tomorrow. > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From christopher.mcmahon at gmail.com Fri Jun 10 11:28:21 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 10 Jun 2005 09:28:21 -0600 Subject: [Wtr-general] Found a bug, I think In-Reply-To: <5.1.0.14.2.20050610101312.02dc98e8@127.0.0.1> References: <72799cd705060915381369ec7@mail.gmail.com> <72799cd70506091540bdef8d0@mail.gmail.com> <5.1.0.14.2.20050610101312.02dc98e8@127.0.0.1> Message-ID: <72799cd70506100828345e4a27@mail.gmail.com> > 2. Maybe a timing problem, where the document isn't yet available. You can > check this by adding a couple sleeps to your script and see if it works any > better. Bingo. Added a sleep, and the assert_match succeeds. Thanks! -Chris From bret at pettichord.com Fri Jun 10 15:12:47 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Jun 2005 14:12:47 -0500 Subject: [Wtr-general] Found a bug, I think In-Reply-To: <72799cd70506100828345e4a27@mail.gmail.com> References: <5.1.0.14.2.20050610101312.02dc98e8@127.0.0.1> <72799cd705060915381369ec7@mail.gmail.com> <72799cd70506091540bdef8d0@mail.gmail.com> <5.1.0.14.2.20050610101312.02dc98e8@127.0.0.1> Message-ID: <5.1.0.14.2.20050610141151.02bb9ad0@127.0.0.1> At 10:28 AM 6/10/2005, Chris McMahon wrote: >Bingo. Added a sleep, and the assert_match succeeds. Thanks! i've committed a fix. until our next release, the best workaround would be to explicitly call ie.wait before your call to assert_match. Bret _____________________ Bret Pettichord www.pettichord.com From tuyet.ctn at mscibarra.com Fri Jun 10 17:29:06 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Fri, 10 Jun 2005 14:29:06 -0700 Subject: [Wtr-general] WATIR for Production Use? Message-ID: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3CE0@iris.win.barra.com> I have to give my manager an evaluation on WATIR as to whether we should jump in and adopt it for our QA group to use for Production testing of our Web applications. I really like the tool and think it adds value. However, I have several concerns that I'd like to put out there to get your feedback: 1) How "permanent" will the development and support be for WATIR going forward? My fear is that if we adopt WATIR for our QA group and invest time and training to learn it, that somehow in the future it will NOT be supported anymore because the core group has moved on, the tool is no longer developed or supported. 2) Will new releases be backward compatible? I've been reading about WATIR 2.0 and understand that there will be some "shims" provided to make sure the 1.3 scripts will work with 2.0 Going forward, will that always be the "standard". Our nightmare currently is that some scripts we wrote are broken whenever our vendor releases a new version. We want to make sure we don't spend too much time upgrading our scripts with each new release. 3) Will there be more "formal" support? The forum is a great place to post questions, but some time it takes a day or two to get an answer, a workable solution. What if we have a mission critical problem where a WATIR script is not working and we really need an immediate answer. Who do we "call" for these emergencies? 4) How "young" is the tool? How much more work do you anticipate to make it even more "robust" feature-wise? My manager will ask me these questions, so I am asking you. I noticed that the first forum's posting was in October 2003, was that when it got started? It has been greatly enhanced each year to support new functionalities. Can you tell us what your plans are for this tool in the near-term and long-term? 5) Are there plans to charge for the tool in the future? I appreciate your feedback and answers. I'd like to recommend that we use WATIR, but I'd like to make sure I understand what the pros and cons are. Thank you for offering the community this useful tool. From drew.cox at gmail.com Fri Jun 10 17:39:08 2005 From: drew.cox at gmail.com (Andrew Cox) Date: Fri, 10 Jun 2005 17:39:08 -0400 Subject: [Wtr-general] Comparisons to competitors? (TestComplete, Selenium, others?) Message-ID: <252308cf0506101439237a4e02@mail.gmail.com> I'm researching testing tools right now and spent all day yesterday trying out a few simple tests with Watir. So far, I think it's great. I just have some basic web site tests set up with logging to an XML file (using Builder), but I love the fact that it's written in Ruby. I've showed it to the decision-makers here and they're impressed with what it can do, but want me to explore other options as well. Personally, I would love to write tests in Ruby, but that is actually seen as a negative value for them since none of them have ever touched Ruby. I've downloaded the trial for TestComplete, but have not made it very far in it yet. Does anyone have experience with it? We don't want to spend a lot of money, but TestComplete would probably be in our budget. Right now all we're looking for is some automated testing that we can manipulate through the DOM (so that minor changes to sites don't cause us to rewrite all of our tests). Maintainability is a big concern, but so is creating the initial tests. I imagine that once we get some basic helper classes set up for our web app, it should be a breeze to create additional tests with Watir. But what about TestComplete, Selenium or others? Are they as easy to use and maintain as Watir? Or is Watir's main "selling" poinit that it's written in Ruby? Drew Cox From chrismo at clabs.org Fri Jun 10 17:54:18 2005 From: chrismo at clabs.org (Chris Morris) Date: Fri, 10 Jun 2005 16:54:18 -0500 Subject: [Wtr-general] Comparisons to competitors? (TestComplete, Selenium, others?) In-Reply-To: <252308cf0506101439237a4e02@mail.gmail.com> References: <252308cf0506101439237a4e02@mail.gmail.com> Message-ID: <42AA0C0A.1040105@clabs.org> Andrew Cox wrote: >I've downloaded the trial for TestComplete, but have not made it very >far in it yet. Does anyone have experience with it? > A little. My current shop uses it -- I've worked a little with it, but we're still a shop with a thick wall 'tween QA and development, and I ain't in QA. That said, personally, I think I'd try to stick with Watir. TestComplete comes with GUI and other bells and whistles, but when I get down to it, I'm coding in DelphiScript or JavaScript ... I'd rather have the power of Ruby behind me. TestComplete currently has this Object <something> Testing, which is a GUI way to create re-usable objects ... but the persistence of these objects is not in script, it's in a separate .ini file. Having duped persistence for some of my test things vs. others to me is not a good approach. -- Chris http://clabs.org/blogki From bret at pettichord.com Fri Jun 10 18:21:35 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Jun 2005 17:21:35 -0500 Subject: [Wtr-general] Website update Message-ID: <5.1.0.14.2.20050610171328.02e11e00@127.0.0.1> I've updated the website: http://wtr.rubyforge.org/ Mostly adding links and reducing verbiage. Plus: testimonials. We had the web pages duplicated between "watir/doc" and "web". I've removed the copies in "web". I think i got the most recent versions. (Let me know if i didn't.) There is one bug in the index.html that would/will show up if you built a new release. The link to rdoc is ./rdoc on the website, but needs to be ../rdoc when installed. I can't think of a good way to fix this. Install the rdoc in a different location? Actually, i'd like to only install one doc link (desktop, menu) now (to this index) with the installer. It has links to all the other files. I made some changes to the formatting, partly by changing the style.css but also by 'hard coding' some font changes. I know this is ugly. Sorry, Jonathan. Bret _____________________ Bret Pettichord www.pettichord.com From chrismo at clabs.org Fri Jun 10 18:26:39 2005 From: chrismo at clabs.org (Chris Morris) Date: Fri, 10 Jun 2005 17:26:39 -0500 Subject: [Wtr-general] Website update In-Reply-To: <5.1.0.14.2.20050610171328.02e11e00@127.0.0.1> References: <5.1.0.14.2.20050610171328.02e11e00@127.0.0.1> Message-ID: <42AA139F.5080301@clabs.org> Bret Pettichord wrote: > I've updated the website: http://wtr.rubyforge.org/ You guys still need the old wiki on clabs.org? No problem to leave it up, but if/when it's not needed, lemme know so I don't have to concern myself with it. -- Chris http://clabs.org/blogki From tuyet.ctn at mscibarra.com Fri Jun 10 21:22:10 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Fri, 10 Jun 2005 18:22:10 -0700 Subject: [Wtr-general] Security Alert window, does not click on "YES" Message-ID: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3CE9@iris.win.barra.com> I think the code below is supposed to handle the pop-up Security Alert window, but in my case, the "YES" box doesn't get clicked. I checked to make sure that winHelper_security.rb is in the right path. Is there a way I can test this out via irb so I can see it step by step? Do you have any suggestions on why it may not work? Thanks. require 'watir' include Watir require 'watir/windowhelper' t = Thread.new(){ puts "Started thread for win helper" system('winHelper_security.rb') } ie=IE.new() m = Thread.new(ie) { ie.goto("https://154.210.2.19") } m.join t.join From bret at pettichord.com Fri Jun 10 23:13:10 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Jun 2005 22:13:10 -0500 Subject: [Wtr-general] Website update In-Reply-To: <42AA139F.5080301@clabs.org> References: <5.1.0.14.2.20050610171328.02e11e00@127.0.0.1> <5.1.0.14.2.20050610171328.02e11e00@127.0.0.1> Message-ID: <5.1.0.14.2.20050610221213.02e39c58@127.0.0.1> At 05:26 PM 6/10/2005, Chris Morris wrote: >Bret Pettichord wrote: > >>I've updated the website: http://wtr.rubyforge.org/ > >You guys still need the old wiki on clabs.org? No problem to leave it up, >but if/when it's not needed, lemme know so I don't have to concern myself >with it. I think the only thing that we are really using on it is the list of alternative tools. If we migrate that to the rubyforge wiki, i'd be content to see it fade away. Bret _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Fri Jun 10 23:35:17 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Jun 2005 22:35:17 -0500 Subject: [Wtr-general] WATIR for Production Use? In-Reply-To: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3CE0@iris.win.barra.co m> Message-ID: <5.1.0.14.2.20050610221324.02e3aad0@127.0.0.1> At 04:29 PM 6/10/2005, Tuyet Cong-Ton-Nu wrote: >1) How "permanent" will the development and support be for WATIR going >forward? >My fear is that if we adopt WATIR for our QA group and invest time and >training to learn it, that somehow in the future it will NOT be supported >anymore because the core group has moved on, the tool is no longer developed >or supported. Right now it is supported by volunteers. The real question is how many projects are actually depending on Watir. The more there are, the more people there are with an interest in maintaining it. We need to collect a list of projects who are depending on Watir. That's what you should show your manager. I think we have three ongoing projects using Watir right now at ThoughtWorks. Maybe more. >2) Will new releases be backward compatible? >I've been reading about WATIR 2.0 and understand that there will be some >"shims" provided to make sure the 1.3 scripts will work with 2.0 >Going forward, will that always be the "standard". Our nightmare currently >is that some scripts we wrote are broken whenever our vendor releases a new >version. We want to make sure we don't spend too much time upgrading our >scripts with each new release. First of all, we can't force you to move to a new version. If we make a new version that breaks backwards compatability, a bunch of people may stay with the old version and keep maintaining that. We really need to have a longer discussion on the list about compatability and commitments, and we will handle this. As a community we are not really able to answer this question right now, since we have different ideas about this. And remember, unlike commercial tools, you will never be dependent on us for the maintenance of Watir. If something needs fixing, you can always learn some Ruby -- or hire someone who does -- and go in and fix it yourself. This puts you a much more advantageous position than if you were using a commecial tool. (I have horror stories to tell along this line, but maybe someone else can chime in with their own.) >3) Will there be more "formal" support? >The forum is a great place to post questions, but some time it takes a day >or two to get an answer, a workable solution. What if we have a mission >critical problem where a WATIR script is not working and we really need an >immediate answer. Who do we "call" for these emergencies? The real question is whether any Watir experts would be willing to sell support contracts. At my company, ThoughtWorks, we've discussed doing this for our clients, but not as a general offering. A QA group might have to pay WinRunner $500 a month for maintenance and support (whether they call or not). Would you be willing to pay this kind of money? Oh yeah, and with them you'll probably wait more than a day or two for an answer. A reasonable arrangement with an independent consultant might include some upfront training and consulting, an ongoing retainer for not more than one or two calls a month and then additional fees for help beyond that. If you want support, you should budget the kind of money you might spend on a commercial tool, either to hire consultants or in-house staff to work on the tool. What you really get is flexibility and control, rather than simple cost savings. >4) How "young" is the tool? How much more work do you anticipate to make it >even more "robust" feature-wise? >My manager will ask me these questions, so I am asking you. I noticed that >the first forum's posting was in October 2003, was that when it got started? >It has been greatly enhanced each year to support new functionalities. Can >you tell us what your plans are for this tool in the near-term and >long-term? We have had many discussions about the long-term vision for the tool, but i don't think this should be interpreted as "plans" per se. In fact, i've been thinking of creating a new list just to discuss new ideas, because they seem to be quickly mis-interpreted here as plans. Watir 1.0 was released in Jan 2005. The Web Testing for Ruby project has, as you noted, been going on since Oct 2003. In a way, the tool was based on Samie, which has an even older pedigree. >5) Are there plans to charge for the tool in the future? No. _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Fri Jun 10 23:37:57 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Jun 2005 22:37:57 -0500 Subject: [Wtr-general] Another Endorsement Message-ID: <5.1.0.14.2.20050610223647.02e3b038@127.0.0.1> From Ward Cunningham on the Agile Testing list: >Elisabeth -- Could you give me a slide or two worth of bullet points >and examples that I could add to our acceptance testing tutorial? I >was asked to talk about Fit, but think that Watir is the most >compelling alternative for filling the automated acceptance testing >need. Thanks -- Ward _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Sat Jun 11 00:06:05 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Jun 2005 23:06:05 -0500 Subject: [Wtr-general] Calling All Watir Users Message-ID: <5.1.0.14.2.20050610230041.02e54d58@127.0.0.1> Are you using Watir? Has your team investing in creating Watir-based test suites? If so, please respond to this email or add a row to this wiki page: http://wtr.rubyforge.org/wiki/wiki.pl?WatirUsers I know there are a lot of projects using Watir. We need to let new users know this as well. The nature of open-source tools is that the more users there are, the less risk there is that the tool won't continue to be supported. Bret _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Fri Jun 10 23:49:41 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Jun 2005 22:49:41 -0500 Subject: [Wtr-general] Website update In-Reply-To: <5.1.0.14.2.20050610221213.02e39c58@127.0.0.1> References: <42AA139F.5080301@clabs.org> <5.1.0.14.2.20050610171328.02e11e00@127.0.0.1> <5.1.0.14.2.20050610171328.02e11e00@127.0.0.1> Message-ID: <5.1.0.14.2.20050610224900.02e4afb8@127.0.0.1> At 10:13 PM 6/10/2005, Bret Pettichord wrote: >I think the only thing that we are really using on it is the list of >alternative tools. If we migrate that to the rubyforge wiki, i'd be >content to see it fade away. We also need to migrate the coding conventions. Actually these need to be spelled out in more detail, as well as adding a general guide for how to contribute code to Watir or join us. Bret _____________________ Bret Pettichord www.pettichord.com From paul.rogers at shaw.ca Sat Jun 11 12:05:00 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sat, 11 Jun 2005 10:05:00 -0600 Subject: [Wtr-general] Security Alert window, does not click on "YES" In-Reply-To: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3CE9@iris.win.barra.com> Message-ID: <000601c56e9f$523249d0$72d39044@NewDell> I think the easiest way to test is: 1. open a browser and manually goto to the page with the security pop up 2. in a dos prompt run the winHelper_security file - does the window go away - if so, the problem is in your main app - if not, the problem is in win_helper Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Tuyet Cong-Ton-Nu Sent: 10 June 2005 19:22 To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] Security Alert window, does not click on "YES" I think the code below is supposed to handle the pop-up Security Alert window, but in my case, the "YES" box doesn't get clicked. I checked to make sure that winHelper_security.rb is in the right path. Is there a way I can test this out via irb so I can see it step by step? Do you have any suggestions on why it may not work? Thanks. require 'watir' include Watir require 'watir/windowhelper' t = Thread.new(){ puts "Started thread for win helper" system('winHelper_security.rb') } ie=IE.new() m = Thread.new(ie) { ie.goto("https://154.210.2.19") } m.join t.join _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From chrismo at clabs.org Sat Jun 11 19:52:43 2005 From: chrismo at clabs.org (Chris Morris) Date: Sat, 11 Jun 2005 18:52:43 -0500 Subject: [Wtr-general] Another Endorsement In-Reply-To: <5.1.0.14.2.20050610223647.02e3b038@127.0.0.1> References: <5.1.0.14.2.20050610223647.02e3b038@127.0.0.1> Message-ID: <42AB794B.6040707@clabs.org> Bret Pettichord wrote: > From Ward Cunningham on the Agile Testing list: > >> Elisabeth -- Could you give me a slide or two worth of bullet points >> and examples that I could add to our acceptance testing tutorial? I >> was asked to talk about Fit, but think that Watir is the most >> compelling alternative for filling the automated acceptance testing >> need. Thanks -- Ward > That is a nice tip o' the hat. :-) Thx for sharing that. -- Chris http://clabs.org/blogki From christopher.mcmahon at gmail.com Sun Jun 12 11:10:33 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Sun, 12 Jun 2005 09:10:33 -0600 Subject: [Wtr-general] WATIR for Production Use? In-Reply-To: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3CE0@iris.win.barra.com> References: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3CE0@iris.win.barra.com> Message-ID: <72799cd7050612081055a2f2d3@mail.gmail.com> > 1) How "permanent" will the development and support be for WATIR going > forward? > 2) Will new releases be backward compatible? > 3) Will there be more "formal" support? > 4) How "young" is the tool? How much more work do you anticipate to make it > even more "robust" feature-wise? > 5) Are there plans to charge for the tool in the future? What would you like the answers to be? What steps would you, personally, take to create the answers you want? -Chris From christopher.mcmahon at gmail.com Sun Jun 12 11:14:31 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Sun, 12 Jun 2005 09:14:31 -0600 Subject: [Wtr-general] Re: [agile-testing] Digest Number 883 In-Reply-To: <1118576033.3440.94819.m18@yahoogroups.com> References: <1118576033.3440.94819.m18@yahoogroups.com> Message-ID: <72799cd70506120814674169c3@mail.gmail.com> > The application I'm testing uses hidden fields when data is read only: > > <INPUT TYPE=HIDDEN NAME=myfield VALUE="something hidden" > > > I can't remember if Watir handles hidden fields out of the box or if > this was a place where I made a small change in Watir to make it work. > Either way, I get the values from hidden fields whenever possible. Cross-posted to the WATIR list... I put this on the WATIR enhancement list some time ago: the ability to manipulate hidden and not-hidden fields independently. -Chris From dan_sdan at hotmail.com Sun Jun 12 12:34:23 2005 From: dan_sdan at hotmail.com (Dan Smith) Date: Sun, 12 Jun 2005 16:34:23 +0000 Subject: [Wtr-general] need to subscribe before posting? Message-ID: <BAY105-F3287BFF0C8C8B24E778096E3F10@phx.gbl> I previously tried posting to the forum without first subscribing and I couldn't find my post in the archives. So I am assuming that we need to subscribe before our questions get posted? Dan Smith (QA Analyst from Vancouver BC) From chrismo at clabs.org Sun Jun 12 16:45:41 2005 From: chrismo at clabs.org (Chris Morris) Date: Sun, 12 Jun 2005 15:45:41 -0500 Subject: [Wtr-general] need to subscribe before posting? In-Reply-To: <BAY105-F3287BFF0C8C8B24E778096E3F10@phx.gbl> References: <BAY105-F3287BFF0C8C8B24E778096E3F10@phx.gbl> Message-ID: <42AC9EF5.4040402@clabs.org> Dan Smith wrote: > I previously tried posting to the forum without first subscribing and > I couldn't find my post in the archives. So I am assuming that we > need to subscribe before our questions get posted? That's correct. There was a little mix-up on administrating the list, I thought there were others setup as admin, but I was the only one and I let a few of these slip through the cracks. Sorry about that. I'm glad you found your way here anyway. -- Chris http://clabs.org/blogki From bhavna.kumar at gmail.com Mon Jun 13 00:48:32 2005 From: bhavna.kumar at gmail.com (Bhavna Kumar) Date: Mon, 13 Jun 2005 10:18:32 +0530 Subject: [Wtr-general] Calling All Watir Users In-Reply-To: <5.1.0.14.2.20050610230041.02e54d58@127.0.0.1> References: <5.1.0.14.2.20050610230041.02e54d58@127.0.0.1> Message-ID: <5ace0a5050612214822b5aeaf@mail.gmail.com> Hi, We have just begun using Watir in order to test a product that our company is building. Our company is a small one -- the testing team size is currently two. We are located in Bangalore India. We started using Watir in June 2005. Contact Person: Bhavna Kumar (bhavna.kumar at gmail.com) We are using Watir to automate testing from the UI, which is web based. Regards, Bhavna On 6/11/05, Bret Pettichord <bret at pettichord.com> wrote: > Are you using Watir? Has your team investing in creating Watir-based test > suites? > > If so, please respond to this email or add a row to this wiki page: > http://wtr.rubyforge.org/wiki/wiki.pl?WatirUsers > > I know there are a lot of projects using Watir. We need to let new users > know this as well. The nature of open-source tools is that the more users > there are, the less risk there is that the tool won't continue to be supported. > > Bret > > > _____________________ > Bret Pettichord > www.pettichord.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From dan_sdan at hotmail.com Mon Jun 13 08:15:54 2005 From: dan_sdan at hotmail.com (Dan Smith) Date: Mon, 13 Jun 2005 12:15:54 +0000 Subject: [Wtr-general] outputs Message-ID: <BAY105-F35E8EA77B82C937C86A574E3F00@phx.gbl> Hi I just started using Watir a little while ago and I am looking to output my tests to a file. I know about about piping the puts to an output.txt file or something but I read the post about the HTML log at http://fallpro.com/Shao/temp/Log/ I would like to know how to get a hold of this? Cheers Dan Smith From shaorobics at gmail.com Mon Jun 13 12:19:07 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Mon, 13 Jun 2005 12:19:07 -0400 Subject: [Wtr-general] IE.new Message-ID: <593b9ae8050613091916d68bf4@mail.gmail.com> Hi I'm trying to keep two IE's open. IE1 will be logged in as admin and IE2 will be logged in as some other user. Even though I'm doing a IE1 = IE.new() IE2 - IE.new() when I log in with IE2, IE1 gets logged out, because those browsers are linked...any way to make watir recognize that they should be independent processes? Thanks Shao From christopher.mcmahon at gmail.com Mon Jun 13 15:12:05 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 13 Jun 2005 13:12:05 -0600 Subject: [Wtr-general] assert_arrayEquals: good practice, or not? Message-ID: <72799cd705061312121dfd1a11@mail.gmail.com> Hi... I just hit a situation where I want to use assert_arrayEquals from the WATIR unittests/setup library. In order to do this, I either have to specify the full pathname to it: require 'c://watir/unittests/setup' or else copy setup.rb to C:\ruby\lib\ruby\1.8 and use "require 'setup'". Both of these make me a little uncomfortable. Would it be unreasonable to have WATIR put setup.rb into the standard Ruby path at install time? Or is it better to manage the WATIR-specific assert methods separately? -Chris From tuyet.ctn at mscibarra.com Mon Jun 13 15:31:21 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Mon, 13 Jun 2005 12:31:21 -0700 Subject: [Wtr-general] Security Alert window, does not click on "YES" Message-ID: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3CED@iris.win.barra.com> Thanks, Paul for the test. I did as you suggested and the window does NOT go away. I do have AutoItX3.dll in my \watir directory. Do I need to register it somehow? Is there some other piece of code I should have besides: WindowHelper.rb winHelper_security.rb From Ashish.Desai at fmr.com Mon Jun 13 16:15:29 2005 From: Ashish.Desai at fmr.com (Desai, Ashish) Date: Mon, 13 Jun 2005 16:15:29 -0400 Subject: [Wtr-general] Solution to dealing with cookies Message-ID: <6A8FB8B99E66D44D972247E6C4BD0216462777@MSGBOSCLA2WIN.DMN1.FMR.COM> Hi all, A while back people were asking how do get IE cookies, one trick mentioned was to get them via the on disk cookie file. Here I present a trick using inline javascript through ruby to do the same. The advantage is it gives you the persistent and non-persistent (session based) cookies. I am leaving setting new cookies/deleting routines as a user excerise, unless someone want to buy me some chocolate ;-) Ashish Desai Fidelity E-Business Info Security # #===Cut here=== # def scookies(ie) ie.goto("javascript:document.cookie") cookies = ie.html ie.back cookies = cookies.sub("\r\n<BODY>", "") # Only for Internet Explorer hack cookies = cookies.sub("</BODY>", "") return cookies end def findcookie(ie, cookieName) cookies = scookies(ie) puts "\n\nCookie list is #{cookies}" puts "\n\nSearching for cookie:#{cookieName}\nCookie value is:" cookies.split(";").each { | cookie | name, value = cookie.split("=") name.gsub!("\s",'') if cookieName == name return value end } return nil end require 'watir' include Watir ie = Watir::IE.start("http://www.fidelity.com") ie.goto("https://scs.fidelity.com/research/alerts/alerts_frame.shtml?bar =c") puts findcookie(ie, "MC") puts findcookie(ie, "FASESSIONID") ie.goto("http://www.cnn.com") puts findcookie(ie,"CNNid") ie.close From christopher.mcmahon at gmail.com Mon Jun 13 16:37:05 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 13 Jun 2005 14:37:05 -0600 Subject: [Wtr-general] Another style question: treat numeric input as text Message-ID: <72799cd705061313375cbd4c67@mail.gmail.com> Say I read in text for a test input like "1009". Ruby, left to its own devices, turns this into a float 1009.0, which makes all the assert methods fail when matching HTML values of "1009". I can get Ruby to do the right thing by telling it "foo.to_i.to_s" for specific numeric input, but I wonder if there is a more elegant way to tell Ruby: "if this value came from source X, treat it as text." -Chris From bret at pettichord.com Mon Jun 13 17:24:54 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 13 Jun 2005 16:24:54 -0500 Subject: [Wtr-general] assert_arrayEquals: good practice, or not? In-Reply-To: <72799cd705061312121dfd1a11@mail.gmail.com> Message-ID: <5.1.0.14.2.20050613161830.0326bb48@127.0.0.1> Essentially, assert_arrayEquals is not a supported part of Watir, so that is why it isn't installed the way you suggest. It's part of our test suite, not part of the tool itself. The original assert stuff is really part of Test::Unit, so the right way forward would be to suggest these as patches to that project. And that would require being more consistent with its existing interfaces. In the meantime, if you can tolerate a little slop, i'd suggest that you manually copy setup.rb to c:\ruby\lib\ruby\1.8\watir and then do "require 'watir/setup'". But like i said, this isn't supported and may be changed at a future date. Bret At 02:12 PM 6/13/2005, Chris McMahon wrote: >Hi... > I just hit a situation where I want to use assert_arrayEquals from >the WATIR unittests/setup library. In order to do this, I either have >to specify the full pathname to it: > >require 'c://watir/unittests/setup' > >or else copy setup.rb to C:\ruby\lib\ruby\1.8 and use "require >'setup'". Both of these make me a little uncomfortable. > >Would it be unreasonable to have WATIR put setup.rb into the standard >Ruby path at install time? Or is it better to manage the >WATIR-specific assert methods separately? >-Chris > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From christopher.mcmahon at gmail.com Mon Jun 13 17:33:10 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 13 Jun 2005 15:33:10 -0600 Subject: [Wtr-general] assert_arrayEquals: good practice, or not? In-Reply-To: <5.1.0.14.2.20050613161830.0326bb48@127.0.0.1> References: <72799cd705061312121dfd1a11@mail.gmail.com> <5.1.0.14.2.20050613161830.0326bb48@127.0.0.1> Message-ID: <72799cd705061314333c255dd5@mail.gmail.com> > The original assert stuff is really part of Test::Unit, so the right way > forward would be to suggest these as patches to that project. > > And that would require being more consistent with its existing interfaces. Do we know anyone with entree to that project? If we don't, I wouldn't mind being the one to start that conversation. > In the meantime, if you can tolerate a little slop, Hey, "slop" is my middle name! =) It's fine, we're still just spiking frameworks and doing proof-of-concepts here, so a little slop is acceptable, at least for now. -Chris From bret at pettichord.com Mon Jun 13 18:33:31 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 13 Jun 2005 17:33:31 -0500 Subject: [Wtr-general] assert_arrayEquals: good practice, or not? In-Reply-To: <72799cd705061314333c255dd5@mail.gmail.com> References: <5.1.0.14.2.20050613161830.0326bb48@127.0.0.1> <72799cd705061312121dfd1a11@mail.gmail.com> <5.1.0.14.2.20050613161830.0326bb48@127.0.0.1> Message-ID: <5.1.0.14.2.20050613173227.03292bf0@127.0.0.1> At 04:33 PM 6/13/2005, Chris McMahon wrote: >Do we know anyone with entree to that project? If we don't, I >wouldn't mind being the one to start that conversation. That project is run by Nathanial Talbot, who i know. Alexei has submitted patches before. Bret _____________________ Bret Pettichord www.pettichord.com From tuyet.ctn at mscibarra.com Mon Jun 13 18:37:36 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Mon, 13 Jun 2005 15:37:36 -0700 Subject: [Wtr-general] WATIR for Production Use? Message-ID: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3CF4@iris.win.barra.com> Thanks, Bret for your comments. Jonathan has also sent me some valuable feedback on the benefits of "open source" tool, one of which, as you also mentioned is that we can fix and add on to the code ourselve since we have the source. I am ready to give my manager a demo of what I've done so far. I think he will be pleased. If there are any concerns that arise from the demo, I will post them on the forum for feedback. Thanks again! From christopher.mcmahon at gmail.com Mon Jun 13 18:49:59 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 13 Jun 2005 16:49:59 -0600 Subject: Better solution? Re: [Wtr-general] assert_arrayEquals: good practice, or not? In-Reply-To: <5.1.0.14.2.20050613161830.0326bb48@127.0.0.1> References: <72799cd705061312121dfd1a11@mail.gmail.com> <5.1.0.14.2.20050613161830.0326bb48@127.0.0.1> Message-ID: <72799cd705061315497e600694@mail.gmail.com> > In the meantime, if you can tolerate a little slop, i'd suggest that you > manually copy setup.rb to c:\ruby\lib\ruby\1.8\watir and then do "require > 'watir/setup'". I was surfing the Pickaxe and found that there's a Array#eql? method. So something like assert(array1.eql?(array2)) would probably work. The only weirdness seems to be that ["a", "b", "c"] is not equal to ["b", "a", "c"], but that's probably a feature. I'll poke at this tomorrow. If it does the right thing, it might be worth getting rid of the WATIR assert_arrayEqual in favor of using Array#eql? -Chris From bret at pettichord.com Mon Jun 13 22:56:12 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 13 Jun 2005 21:56:12 -0500 Subject: Better solution? Re: [Wtr-general] assert_arrayEquals: good practice, or not? In-Reply-To: <72799cd705061315497e600694@mail.gmail.com> References: <5.1.0.14.2.20050613161830.0326bb48@127.0.0.1> <72799cd705061312121dfd1a11@mail.gmail.com> <5.1.0.14.2.20050613161830.0326bb48@127.0.0.1> Message-ID: <5.1.0.14.2.20050613215455.03272ed8@127.0.0.1> At 05:49 PM 6/13/2005, Chris McMahon wrote: >I'll poke at this tomorrow. If it does the right thing, it might be >worth getting rid of the WATIR assert_arrayEqual in favor of using >Array#eql? Whenever you wrap assert around another call, a failure will be reported as "expected value: <true>, actual value: <false>" which is isn't very informative. That's what watir's version does -- add's more info when it fails. _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Mon Jun 13 23:05:22 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 13 Jun 2005 22:05:22 -0500 Subject: [Wtr-general] Security Alert window, does not click on "YES" In-Reply-To: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3CED@iris.win.barra.co m> Message-ID: <5.1.0.14.2.20050613220436.032a6730@127.0.0.1> At 02:31 PM 6/13/2005, Tuyet Cong-Ton-Nu wrote: >Do I need to register it somehow? yes. it needs to be in the window's registry. the install script does this automatically. or you can do it manually. _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Mon Jun 13 23:08:27 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 13 Jun 2005 22:08:27 -0500 Subject: [Wtr-general] Another style question: treat numeric input as text In-Reply-To: <72799cd705061313375cbd4c67@mail.gmail.com> Message-ID: <5.1.0.14.2.20050613220754.032af210@127.0.0.1> At 03:37 PM 6/13/2005, Chris McMahon wrote: >Say I read in text for a test input like "1009". > >Ruby, left to its own devices, turns this into a float 1009.0 huh? explain exactly what you are doing. show us the code that reads the text. _____________________ Bret Pettichord www.pettichord.com From christopher.mcmahon at gmail.com Mon Jun 13 23:17:17 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 13 Jun 2005 22:17:17 -0500 Subject: Better solution? Re: [Wtr-general] assert_arrayEquals: good practice, or not? In-Reply-To: <5.1.0.14.2.20050613215455.03272ed8@127.0.0.1> References: <72799cd705061312121dfd1a11@mail.gmail.com> <5.1.0.14.2.20050613161830.0326bb48@127.0.0.1> <72799cd705061315497e600694@mail.gmail.com> <5.1.0.14.2.20050613215455.03272ed8@127.0.0.1> Message-ID: <72799cd705061320172ad76f44@mail.gmail.com> Yeah, but in the "rescue" clause, you can say puts "Error" + $! which saves your exception details. More Perlism, I know, but highly pragmatic. -C On 6/13/05, Bret Pettichord <bret at pettichord.com> wrote: > At 05:49 PM 6/13/2005, Chris McMahon wrote: > >I'll poke at this tomorrow. If it does the right thing, it might be > >worth getting rid of the WATIR assert_arrayEqual in favor of using > >Array#eql? > > Whenever you wrap assert around another call, a failure will be reported as > "expected value: <true>, actual value: <false>" which is isn't very > informative. That's what watir's version does -- add's more info when it fails. > From paul.rogers at shaw.ca Mon Jun 13 23:22:24 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 13 Jun 2005 21:22:24 -0600 Subject: Better solution? Re: [Wtr-general] assert_arrayEquals: goodpractice, or not? In-Reply-To: <72799cd705061320172ad76f44@mail.gmail.com> Message-ID: <001601c57090$486fb890$72d39044@NewDell> One of the contributoes used this in their test: Assert_equal( [1,2,3] , some_array) So we probably don't need the assert_array_equal at all Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: 13 June 2005 21:17 To: wtr-general at rubyforge.org Subject: Re: Better solution? Re: [Wtr-general] assert_arrayEquals: goodpractice, or not? Yeah, but in the "rescue" clause, you can say puts "Error" + $! which saves your exception details. More Perlism, I know, but highly pragmatic. -C On 6/13/05, Bret Pettichord <bret at pettichord.com> wrote: > At 05:49 PM 6/13/2005, Chris McMahon wrote: > >I'll poke at this tomorrow. If it does the right thing, it might be > >worth getting rid of the WATIR assert_arrayEqual in favor of using > >Array#eql? > > Whenever you wrap assert around another call, a failure will be > reported as "expected value: <true>, actual value: <false>" which is > isn't very informative. That's what watir's version does -- add's more > info when it fails. > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Mon Jun 13 23:27:04 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 13 Jun 2005 21:27:04 -0600 Subject: [Wtr-general] Watir bugs and enhancements Message-ID: <001701c57090$ef545490$72d39044@NewDell> 1. checkbox#clear , if used twice, causes an extra fireEvent to be done. The clear method should become def clear assert_exists assert_enabled if @o.checked == false @o.checked = false @o.fireEvent("onClick") @ieController.wait end end Ie, if the box is already cleared, don't fire the click event ( as it gets a click event but its state doesn't change) This probably also applies to set Im not sure what the behaviour should be for radios, as you could get a click event fired with no state change 2. The exception on ie.frame(:index,4) when the frame doesn't exist incorrectly reports that @how is name. It should be index 3. Similar to 2, but when certain objects cant be found, the exception shows #{what} ( or something like that) - looks like there is a missing # , @ or { in the string Enhancements Add a show_p method ( or p.show ) Allow p, div, span to be found using :style ( or is it :class ) Paul From paul.rogers at shaw.ca Tue Jun 14 00:00:07 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 13 Jun 2005 22:00:07 -0600 Subject: [Wtr-general] IE.new In-Reply-To: <593b9ae8050613091916d68bf4@mail.gmail.com> Message-ID: <002a01c57095$8d6dd2b0$72d39044@NewDell> You can try this. I think this is also on th wiki Theres a mail from earlier ( 3 months back maybe that explains it too) 1. cretae lots of html pages called 1.html, 2.html. Have html like this <head><title>1</tile></head> <head><title>2</tile></head> Etc 2. use ie=[] 10.times do |i| start("iexplorer #{i}.html") ie[i] = IE.attach(:title, i.to_s) end You now have ie processes that arent sharing cookies -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 13 June 2005 10:19 To: wtr-general at rubyforge.org Subject: [Wtr-general] IE.new Hi I'm trying to keep two IE's open. IE1 will be logged in as admin and IE2 will be logged in as some other user. Even though I'm doing a IE1 = IE.new() IE2 - IE.new() when I log in with IE2, IE1 gets logged out, because those browsers are linked...any way to make watir recognize that they should be independent processes? Thanks Shao _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Tue Jun 14 00:00:56 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 13 Jun 2005 22:00:56 -0600 Subject: [Wtr-general] Another style question: treat numeric input as text In-Reply-To: <72799cd705061313375cbd4c67@mail.gmail.com> Message-ID: <002b01c57095$aa7094b0$72d39044@NewDell> Ive had this with Excel. I never found a good solution. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: 13 June 2005 14:37 To: wtr-general at rubyforge.org Subject: [Wtr-general] Another style question: treat numeric input as text Say I read in text for a test input like "1009". Ruby, left to its own devices, turns this into a float 1009.0, which makes all the assert methods fail when matching HTML values of "1009". I can get Ruby to do the right thing by telling it "foo.to_i.to_s" for specific numeric input, but I wonder if there is a more elegant way to tell Ruby: "if this value came from source X, treat it as text." -Chris _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Tue Jun 14 01:23:34 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 14 Jun 2005 00:23:34 -0500 Subject: [Wtr-general] different type of log In-Reply-To: <593b9ae80506100752754dff15@mail.gmail.com> References: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D270@EX5V.rl.gov> <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D270@EX5V.rl.gov> Message-ID: <5.1.0.14.2.20050614001457.032ba198@127.0.0.1> At 09:52 AM 6/10/2005, Shao Kang Tat wrote: >Yeah I'd definately want to make it available for others to use but >not quite sure how I'd do that...not only will it benefit others who >like it, I'm sure someone will think of some other useful things to >add to it. I guess it's up to the Watir ppl if they would like the >addition of this log to their Watir libraries. I think there are a lot of people that would like to use your code and see how you wrote it and i encourage you to share it. There are lots of different logging packages available. For debugging purposes, Watir uses a logging library that is packaged with Ruby itself. The timeclock application includes a logging package that Brian Marick wrote, before the standard logger was made available. And Alexey has written test::reporter, another package for collecting and presenting results. I think it would be helpful for someone to create a wiki page in our wiki with descriptions and links to these various logging packages -- some hook into test::unit, some don't. If you wanted to you could go ahead and make your package another project on rubyforge. At some point, if it was common practice for Watir users to also use a logging package that already supported as an open source project, then i would want to consider packaging it with Watir. But i would really want to know a lot more about this package first -- take a look at the code, hear comments from others -- before i thought about including it with Watir. My goal is mostly to keep Watir slim so that we can support it. In fact, i think we've been very open minded about contributions in the past, often allowing people to contribute different approaches for common problems, as a way of building community and sharing knowledge. But a downside of this is that the quality of the code in Watir is uneven, and there are parts that are really experiments, and not things that people should be counting on as anything more than examples. Bret _____________________ Bret Pettichord www.pettichord.com From zeljko.filipin at gmail.com Tue Jun 14 02:24:51 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 14 Jun 2005 08:24:51 +0200 Subject: [Wtr-general] IE.new In-Reply-To: <593b9ae8050613091916d68bf4@mail.gmail.com> Message-ID: <42ae7806.793bbf30.5bc8.ffffad77@mx.gmail.com> Maybe this could help: Windows Exploreru (not Internet Explorer):Tools > Folder Options > View > Advanced settings > Launch folder windows in a separate process > check checkbox Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: Monday, June 13, 2005 6:19 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] IE.new Hi I'm trying to keep two IE's open. IE1 will be logged in as admin and IE2 will be logged in as some other user. Even though I'm doing a IE1 = IE.new() IE2 - IE.new() when I log in with IE2, IE1 gets logged out, because those browsers are linked...any way to make watir recognize that they should be independent processes? Thanks Shao _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Jan.Montano at thomson.com Tue Jun 14 02:42:18 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Tue, 14 Jun 2005 14:42:18 +0800 Subject: [Wtr-general] Links Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE35@tfphmanilmul01.ERF.THOMSON.COM> Hi, here's what I want to do. I want to retrieve all the links in a page, and get it's url for processing. linkArray = $ie.links for i in 0..linkArray.length puts linkArray[i].value #puts linkArray[i].href end This produces an error. What's the right way of doing so. I want to read all links... From zeljko.filipin at gmail.com Tue Jun 14 02:55:44 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 14 Jun 2005 08:55:44 +0200 Subject: [Wtr-general] Links In-Reply-To: <71EA7CA4B789864F9B3AC722A7F016B68DBE35@tfphmanilmul01.ERF.THOMSON.COM> Message-ID: <42ae7f43.43fd5f88.5eea.ffffadcc@mx.gmail.com> I am using this: irb require 'watir' include Watir ie = IE.attach(:title, //) ie.links.each do |link| puts link end Instead of 'puts link' you can use 'puts link.href' or whatever you need. Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jan.Montano at thomson.com Sent: Tuesday, June 14, 2005 8:42 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Links Hi, here's what I want to do. I want to retrieve all the links in a page, and get it's url for processing. linkArray = $ie.links for i in 0..linkArray.length puts linkArray[i].value #puts linkArray[i].href end This produces an error. What's the right way of doing so. I want to read all links... _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Jan.Montano at thomson.com Tue Jun 14 03:01:04 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Tue, 14 Jun 2005 15:01:04 +0800 Subject: [Wtr-general] Links Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE36@tfphmanilmul01.ERF.THOMSON.COM> Alright! THanks a lot for your help! :) It's working now. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Zeljko Filipin Sent: Tuesday, June 14, 2005 2:56 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Links I am using this: irb require 'watir' include Watir ie = IE.attach(:title, //) ie.links.each do |link| puts link end Instead of 'puts link' you can use 'puts link.href' or whatever you need. Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jan.Montano at thomson.com Sent: Tuesday, June 14, 2005 8:42 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Links Hi, here's what I want to do. I want to retrieve all the links in a page, and get it's url for processing. linkArray = $ie.links for i in 0..linkArray.length puts linkArray[i].value #puts linkArray[i].href end This produces an error. What's the right way of doing so. I want to read all links... _______________________________________________ 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 zeljko.filipin at gmail.com Tue Jun 14 03:05:17 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 14 Jun 2005 09:05:17 +0200 Subject: [Wtr-general] Links In-Reply-To: <71EA7CA4B789864F9B3AC722A7F016B68DBE36@tfphmanilmul01.ERF.THOMSON.COM> Message-ID: <42ae8180.3fae8da9.76fe.2830@mx.gmail.com> I found it at this list some time ago... :) Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jan.Montano at thomson.com Sent: Tuesday, June 14, 2005 9:01 AM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Links Alright! THanks a lot for your help! :) It's working now. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Zeljko Filipin Sent: Tuesday, June 14, 2005 2:56 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Links I am using this: irb require 'watir' include Watir ie = IE.attach(:title, //) ie.links.each do |link| puts link end Instead of 'puts link' you can use 'puts link.href' or whatever you need. Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jan.Montano at thomson.com Sent: Tuesday, June 14, 2005 8:42 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Links Hi, here's what I want to do. I want to retrieve all the links in a page, and get it's url for processing. linkArray = $ie.links for i in 0..linkArray.length puts linkArray[i].value #puts linkArray[i].href end This produces an error. What's the right way of doing so. I want to read all links... _______________________________________________ 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 shaorobics at gmail.com Tue Jun 14 09:33:32 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Tue, 14 Jun 2005 09:33:32 -0400 Subject: [Wtr-general] IE.new In-Reply-To: <42ae7806.793bbf30.5bc8.ffffad77@mx.gmail.com> References: <593b9ae8050613091916d68bf4@mail.gmail.com> <42ae7806.793bbf30.5bc8.ffffad77@mx.gmail.com> Message-ID: <593b9ae8050614063377a87272@mail.gmail.com> Hi I tried Paul's way, creating some HTML pages and attaching them, they open separately, I direct each one to go to the page I'm testing and login with diff info. As soon as the 2nd one logs in, the first one still gets logged out. So I'm not sure what's happening there :) I'm just a little curious...when I launch IE manually, by double clicking the shortcut on the desktop, logging in twice with diff accounts has no problems. So I'm wondering how Watir handles opening two IE's. Does it mimic the process or does it check for one existing IE and just make a new browser from it? Also, I'm not sure where to find the Windows Exploreru :) Thanks! Shao P.S. in case you're interested why I need to have 2 separate accounts logged in at the same time, it's because I"m doing a test where changes in one account affect settings in another account which I need to verify. I want to avoid having to log in and out after every change, as locating the items in question take a while :) On 6/14/05, Zeljko Filipin <zeljko.filipin at gmail.com> wrote: > Maybe this could help: > > Windows Exploreru (not Internet Explorer):Tools > Folder Options > View > > Advanced settings > Launch folder windows in a separate process > check > checkbox > > Zeljko > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: Monday, June 13, 2005 6:19 PM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] IE.new > > Hi > > I'm trying to keep two IE's open. IE1 will be logged in as admin and > IE2 will be logged in as some other user. > > Even though I'm doing a > > IE1 = IE.new() > IE2 - IE.new() > > > when I log in with IE2, IE1 gets logged out, because those browsers > are linked...any way to make watir recognize that they should be > independent processes? > > Thanks > > Shao > > _______________________________________________ > 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 zeljko.filipin at gmail.com Tue Jun 14 09:40:34 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 14 Jun 2005 15:40:34 +0200 Subject: [Wtr-general] IE.new In-Reply-To: <593b9ae8050614063377a87272@mail.gmail.com> Message-ID: <42aede24.0c8d111d.5ae1.3d0e@mx.gmail.com> start > My Documents (but I am not shure if it would help...) -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Also, I'm not sure where to find the Windows Exploreru :) From christopher.mcmahon at gmail.com Tue Jun 14 10:59:18 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 14 Jun 2005 08:59:18 -0600 Subject: [Wtr-general] refactor testUnitAddons.rb? Message-ID: <72799cd70506140759471f0b52@mail.gmail.com> Hi... The WATIR-specific assert_arrayEquals(array1,array2) is equivalent to the standard begin assert(array1.eql?(array2)) rescue => e puts "Error: " + $! end My own opinion is that I would prefer the standard Array#eql? in unittests/selectbox_test.rb, rather than go down the path of tracking down what goes on in unittests/setup.rb and testUnitAddons.rb. But I don't hold that opinion very strongly-- I just wanted to point out that the unittests are pointers to the users about how to use WATIR, and with selectbox_test.rb, it's a long way to go to do something that's not standard. It's a little smelly. -Chris From paul.rogers at shaw.ca Tue Jun 14 12:35:32 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 14 Jun 2005 10:35:32 -0600 Subject: [Wtr-general] IE.new In-Reply-To: <593b9ae8050614063377a87272@mail.gmail.com> Message-ID: <001a01c570ff$1577eec0$72d39044@NewDell> That's unfortunate that it didn't work. I have no way of testing it, but it seemed like it would work. There are some settings that someone else has pointed out that look promising though. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 14 June 2005 07:34 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] IE.new Hi I tried Paul's way, creating some HTML pages and attaching them, they open separately, I direct each one to go to the page I'm testing and login with diff info. As soon as the 2nd one logs in, the first one still gets logged out. So I'm not sure what's happening there :) I'm just a little curious...when I launch IE manually, by double clicking the shortcut on the desktop, logging in twice with diff accounts has no problems. So I'm wondering how Watir handles opening two IE's. Does it mimic the process or does it check for one existing IE and just make a new browser from it? Also, I'm not sure where to find the Windows Exploreru :) Thanks! Shao P.S. in case you're interested why I need to have 2 separate accounts logged in at the same time, it's because I"m doing a test where changes in one account affect settings in another account which I need to verify. I want to avoid having to log in and out after every change, as locating the items in question take a while :) On 6/14/05, Zeljko Filipin <zeljko.filipin at gmail.com> wrote: > Maybe this could help: > > Windows Exploreru (not Internet Explorer):Tools > Folder Options > > View > Advanced settings > Launch folder windows in a separate process > > check checkbox > > Zeljko > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: Monday, June 13, 2005 6:19 PM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] IE.new > > Hi > > I'm trying to keep two IE's open. IE1 will be logged in as admin and > IE2 will be logged in as some other user. > > Even though I'm doing a > > IE1 = IE.new() > IE2 - IE.new() > > > when I log in with IE2, IE1 gets logged out, because those browsers > are linked...any way to make watir recognize that they should be > independent processes? > > Thanks > > Shao > > _______________________________________________ > 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 Tue Jun 14 13:11:09 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 14 Jun 2005 11:11:09 -0600 Subject: [Wtr-general] IE.new In-Reply-To: <001a01c570ff$1577eec0$72d39044@NewDell> Message-ID: <002201c57104$0eca8b50$72d39044@NewDell> Yoou could use 2 ruby scripts, one for admin and one for the regular user and have the 2 scripts communicate using drb Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: 14 June 2005 10:36 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] IE.new That's unfortunate that it didn't work. I have no way of testing it, but it seemed like it would work. There are some settings that someone else has pointed out that look promising though. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 14 June 2005 07:34 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] IE.new Hi I tried Paul's way, creating some HTML pages and attaching them, they open separately, I direct each one to go to the page I'm testing and login with diff info. As soon as the 2nd one logs in, the first one still gets logged out. So I'm not sure what's happening there :) I'm just a little curious...when I launch IE manually, by double clicking the shortcut on the desktop, logging in twice with diff accounts has no problems. So I'm wondering how Watir handles opening two IE's. Does it mimic the process or does it check for one existing IE and just make a new browser from it? Also, I'm not sure where to find the Windows Exploreru :) Thanks! Shao P.S. in case you're interested why I need to have 2 separate accounts logged in at the same time, it's because I"m doing a test where changes in one account affect settings in another account which I need to verify. I want to avoid having to log in and out after every change, as locating the items in question take a while :) On 6/14/05, Zeljko Filipin <zeljko.filipin at gmail.com> wrote: > Maybe this could help: > > Windows Exploreru (not Internet Explorer):Tools > Folder Options > > View > Advanced settings > Launch folder windows in a separate process > > check checkbox > > Zeljko > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: Monday, June 13, 2005 6:19 PM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] IE.new > > Hi > > I'm trying to keep two IE's open. IE1 will be logged in as admin and > IE2 will be logged in as some other user. > > Even though I'm doing a > > IE1 = IE.new() > IE2 - IE.new() > > > when I log in with IE2, IE1 gets logged out, because those browsers > are linked...any way to make watir recognize that they should be > independent processes? > > Thanks > > Shao > > _______________________________________________ > 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 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Tue Jun 14 14:24:12 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 14 Jun 2005 13:24:12 -0500 Subject: [Wtr-general] refactor testUnitAddons.rb? In-Reply-To: <72799cd70506140759471f0b52@mail.gmail.com> Message-ID: <5.1.0.14.2.20050614132350.021bc980@127.0.0.1> At 09:59 AM 6/14/2005, Chris McMahon wrote: > My own opinion is that I would prefer the standard Array#eql? in >unittests/selectbox_test.rb, rather than go down the path of tracking >down what goes on in unittests/setup.rb and testUnitAddons.rb. > But I don't hold that opinion very strongly-- I just wanted to >point out that the unittests are pointers to the users about how to >use WATIR, and with selectbox_test.rb, it's a long way to go to do >something that's not standard. It's a little smelly. +1. Do you want to fix it? _____________________ Bret Pettichord www.pettichord.com From christopher.mcmahon at gmail.com Tue Jun 14 14:30:34 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 14 Jun 2005 12:30:34 -0600 Subject: [Wtr-general] refactor testUnitAddons.rb? In-Reply-To: <5.1.0.14.2.20050614132350.021bc980@127.0.0.1> References: <72799cd70506140759471f0b52@mail.gmail.com> <5.1.0.14.2.20050614132350.021bc980@127.0.0.1> Message-ID: <72799cd705061411302161a468@mail.gmail.com> On 6/14/05, Bret Pettichord <bret at pettichord.com> wrote: > At 09:59 AM 6/14/2005, Chris McMahon wrote: > > My own opinion is that I would prefer the standard Array#eql? in > >unittests/selectbox_test.rb, rather than go down the path of tracking > >down what goes on in unittests/setup.rb and testUnitAddons.rb. > > But I don't hold that opinion very strongly-- I just wanted to > >point out that the unittests are pointers to the users about how to > >use WATIR, and with selectbox_test.rb, it's a long way to go to do > >something that's not standard. It's a little smelly. > > +1. Do you want to fix it? > Depends. I wouldn't mind doing the work, but it's going to take me some time, and will probably require a code review or two. If there were a more accomplished Rubyist interested in tackling this, I would be happy to defer to that person... -Chris From bret at pettichord.com Tue Jun 14 17:05:19 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 14 Jun 2005 16:05:19 -0500 Subject: [Wtr-general] Watir bugs and enhancements In-Reply-To: <001701c57090$ef545490$72d39044@NewDell> Message-ID: <5.1.0.14.2.20050614160428.03231e90@127.0.0.1> At 10:27 PM 6/13/2005, Paul Rogers wrote: >Allow p, div, span to be found using :style ( or is it :class ) I suspect you want :class. Classes have names. I think styles are simply collections of formatting attributes. _____________________ Bret Pettichord www.pettichord.com From christopher.mcmahon at gmail.com Tue Jun 14 17:53:04 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 14 Jun 2005 15:53:04 -0600 Subject: [Wtr-general] access textfield in span in table by id? Message-ID: <72799cd70506141453390289e1@mail.gmail.com> Hi... It seems that this should work, but it's not. I have a textfield that is in a span in a table: ############################# <table> <tr> <td colspan="2" class="tableHeader">The submitted values are:</td> </tr> <tr> <td class="fieldLabel">Key:</td> <td class="fieldLabel"><span id="ctl00_ContentPage_KeyLabel" class="fieldLabel" style="width:100px;">foo</span></td> </tr> </table> ######################################## but I can't seem to grab its value. I've tried ie.text_field(:id,"ctl00_ContentPage_KeyLabel").value and ie.span(:id,"ctl00_ContentPage_KeyLabel").text_field(:index,1).value but no dice. Anyone see a way to grab the value "foo" of that textfield in that span in that table? -Chris From shaorobics at gmail.com Tue Jun 14 18:03:10 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Tue, 14 Jun 2005 18:03:10 -0400 Subject: [Wtr-general] access textfield in span in table by id? In-Reply-To: <72799cd70506141453390289e1@mail.gmail.com> References: <72799cd70506141453390289e1@mail.gmail.com> Message-ID: <593b9ae8050614150365b28a7b@mail.gmail.com> Hi Chris I have many pages that I test with text fields, checkboxes etc inside tables. To get to them there are 2 ways. If you have the ID/name of the table that would be great (see example 1). If not, see example 2 1. t = ie.table(:id, blah) row = whatever row it's in col = whatever col it's in # get the text field object from this cell tf = t[row][col].text_field(:id, "whatever") # now do whatever you want such as puts tf.value tf.set("new text") tf.clear etc.. 2. if you don't have the ID of the table, which in my case, developers seem to like leaving out, you can do it a "hacky" way such as: ie.tables.each do|t| if t[1][1].text.strip == "The submitted values are" # I'm assuming it's in [1][1] for you #now find the row & column like in eg1 and get the tf object out end end Lemme know if this works since I'm just writing it off the top of my head. I have in many cases used something like #2 when developers didn't give me ID's to work with Shao On 6/14/05, Chris McMahon <christopher.mcmahon at gmail.com> wrote: > Hi... > It seems that this should work, but it's not. I have a textfield > that is in a span in a table: > ############################# > <table> > <tr> > <td colspan="2" class="tableHeader">The submitted values are:</td> > </tr> > <tr> > <td class="fieldLabel">Key:</td> > <td class="fieldLabel"><span id="ctl00_ContentPage_KeyLabel" > class="fieldLabel" style="width:100px;">foo</span></td> > </tr> > </table> > ######################################## > > but I can't seem to grab its value. I've tried > > ie.text_field(:id,"ctl00_ContentPage_KeyLabel").value and > ie.span(:id,"ctl00_ContentPage_KeyLabel").text_field(:index,1).value > > but no dice. > > Anyone see a way to grab the value "foo" of that textfield in that > span in that table? > -Chris > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From christopher.mcmahon at gmail.com Tue Jun 14 18:18:45 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 14 Jun 2005 16:18:45 -0600 Subject: [Wtr-general] access textfield in span in table by id? In-Reply-To: <593b9ae8050614150365b28a7b@mail.gmail.com> References: <72799cd70506141453390289e1@mail.gmail.com> <593b9ae8050614150365b28a7b@mail.gmail.com> Message-ID: <72799cd705061415186720a20b@mail.gmail.com> Actually, I just now figured it out (with a little help from irb and show_spans), it's ie.span(:id,"ctl00_ContentPage_KeyLabel").text I was trying too hard... =) -Chris From shaorobics at gmail.com Tue Jun 14 19:07:03 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Tue, 14 Jun 2005 19:07:03 -0400 Subject: [Wtr-general] access textfield in span in table by id? In-Reply-To: <72799cd705061415186720a20b@mail.gmail.com> References: <72799cd70506141453390289e1@mail.gmail.com> <593b9ae8050614150365b28a7b@mail.gmail.com> <72799cd705061415186720a20b@mail.gmail.com> Message-ID: <593b9ae80506141607464377af@mail.gmail.com> Ah, heh heh, what I was telling you, actually was when you have a table with many rows, each row having a text field somewhere and you trying to access that textfield on a specific row. I didn't realize it was only one textfield :) my bad. I should learn to read better :) Shao On 6/14/05, Chris McMahon <christopher.mcmahon at gmail.com> wrote: > Actually, I just now figured it out (with a little help from irb and > show_spans), it's > > ie.span(:id,"ctl00_ContentPage_KeyLabel").text > > I was trying too hard... =) > -Chris > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From cafedelamar at yahoo.com Tue Jun 14 20:19:39 2005 From: cafedelamar at yahoo.com (L de la Mar) Date: Tue, 14 Jun 2005 17:19:39 -0700 (PDT) Subject: [Wtr-general] Unable to click IE dialog buttons Message-ID: <20050615001939.24271.qmail@web53805.mail.yahoo.com> I am still unsuccessful reaching my goal of downloading a file. I can navigate all the way to the link. The ".click" works and IE's "File Download" window appears, but I haven't found any way to get a handle on the dialog window. FYI, it shows as a separate program/button on the Start bar if that means anything special. Any help is greatly appreciated! - Loren Code: # TODO: test if link exists first. ie.frame(view).link(:text, /#{link_text}/).click au3 = WIN32OLE.new("AutoItX3.Control") au3.WinWaitActive "File Download" au3.Send("{ALT}S") au3.Send("{ALT}N") au3.Send(file_name) au3.Send("{ALT}S") puts "Exiting!" exit __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From paul.rogers at shaw.ca Tue Jun 14 21:05:42 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 14 Jun 2005 19:05:42 -0600 Subject: [Wtr-general] Watir bugs and enhancements In-Reply-To: <5.1.0.14.2.20050614160428.03231e90@127.0.0.1> Message-ID: <003501c57146$5a15e180$72d39044@NewDell> Yes, you're right ( I checked the ms docs ). But It looks like I messed up - the spandivcommon class uses .style to return the classname of the span or div We should probably alias that as .class and deprecate .style. Ah, but then that will override the ruby .class ( that returns the ruby class name) - do we care about that? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 14 June 2005 15:05 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Watir bugs and enhancements At 10:27 PM 6/13/2005, Paul Rogers wrote: >Allow p, div, span to be found using :style ( or is it :class ) I suspect you want :class. Classes have names. I think styles are simply collections of formatting attributes. _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Wed Jun 15 00:33:44 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 14 Jun 2005 23:33:44 -0500 Subject: [Wtr-general] Watir bugs and enhancements In-Reply-To: <003501c57146$5a15e180$72d39044@NewDell> References: <5.1.0.14.2.20050614160428.03231e90@127.0.0.1> Message-ID: <5.1.0.14.2.20050614233158.03254228@127.0.0.1> At 08:05 PM 6/14/2005, Paul Rogers wrote: >Yes, you're right ( I checked the ms docs ). But It looks like I messed >up - the spandivcommon class uses .style to return the classname of the >span or div > >We should probably alias that as .class and deprecate .style. Ah, but >then that will override the ruby .class ( that returns the ruby class >name) - do we care about that? i say remove .style and instead use .dhtml_class or something like that to avoid the collision with Ruby's class. _____________________ Bret Pettichord www.pettichord.com From deborahliu at novusoft.com.cn Wed Jun 15 04:50:49 2005 From: deborahliu at novusoft.com.cn (Deborah Liu) Date: Wed, 15 Jun 2005 16:50:49 +0800 Subject: [Wtr-general] assert failures between begin and rescue Message-ID: <001001c57187$564a9820$800101df@Deborah> Hi all, I noticed the assert failures between begin and rescue don't display in std out, but looks like I have to put assert inside begin and rescue in order to get the test to go on running in case of assert failure. Any way to make the assert failures appear in the std out, meanwhile to make the tests go on running as well? Please advise. Thanks, Deborah -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050615/c3e3422c/attachment.html From tuyet.ctn at mscibarra.com Mon Jun 13 18:45:50 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Mon, 13 Jun 2005 15:45:50 -0700 Subject: [Wtr-general] How to handle "Choose File" directory window? Message-ID: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3CF5@iris.win.barra.com> In my application, there is a "browse" button that brings up the File Directory Windows where you can enter a file name or navigate to the directory that you want. I can't see the source for this window (can't do View Source). How do I set a value for the File Name text field in that window? From irushton at olysoftit.com Wed Jun 15 07:54:28 2005 From: irushton at olysoftit.com (Ian Rushton) Date: Wed, 15 Jun 2005 07:54:28 -0400 Subject: [Wtr-general] How to handle "Choose File" directory window? In-Reply-To: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3CF5@iris.win.barra.com> Message-ID: <200506151150.j5FBoFcR031043@rubyforge.org> It would be best to use autoit for what you are trying to do. I am not familiar with the Watir/autoit interface for popups but that would be the place to look. Ian Rushton -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Tuyet Cong-Ton-Nu Sent: Monday, June 13, 2005 6:46 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] How to handle "Choose File" directory window? In my application, there is a "browse" button that brings up the File Directory Windows where you can enter a file name or navigate to the directory that you want. I can't see the source for this window (can't do View Source). How do I set a value for the File Name text field in that window? _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Wed Jun 15 09:59:42 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 15 Jun 2005 07:59:42 -0600 Subject: [Wtr-general] assert failures between begin and rescue In-Reply-To: <001001c57187$564a9820$800101df@Deborah> References: <001001c57187$564a9820$800101df@Deborah> Message-ID: <72799cd7050615065949c02306@mail.gmail.com> Hi Deborah... > Any way to make the assert failures appear in the std out, meanwhile to make > the > tests go on running as well? Please advise. Yep, try this: begin assert(thing) rescue => e puts "Error: " + $! #break end Just like in Perl, there are a number of special variables in Ruby that start with "$". "$!" holds the last exception message generated by the script, so you can print that somewhere useful if your assert fails. From christopher.mcmahon at gmail.com Wed Jun 15 12:24:24 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 15 Jun 2005 10:24:24 -0600 Subject: Done! Re: [Wtr-general] refactor testUnitAddons.rb? In-Reply-To: <72799cd705061411302161a468@mail.gmail.com> References: <72799cd70506140759471f0b52@mail.gmail.com> <5.1.0.14.2.20050614132350.021bc980@127.0.0.1> <72799cd705061411302161a468@mail.gmail.com> Message-ID: <72799cd70506150924324df566@mail.gmail.com> > > >point out that the unittests are pointers to the users about how to > > >use WATIR, and with selectbox_test.rb, it's a long way to go to do > > >something that's not standard. It's a little smelly. > > > > +1. Do you want to fix it? > > Turned out not to be too tough. I don't have commit access to CVS, and rather than spam the list with attachments, the code for selectbox_test.rb, table_test.rb, and testUnitAddons.rb is copy-n-pasted below. ##############selectbox_test.rb################ # feature tests for Select Boxes # revision: $Revision: 1.28 $ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ require 'unittests/setup' class TC_SelectList < Test::Unit::TestCase include Watir def setup() $ie.goto($htmlRoot + "selectboxes1.html") end def test_SelectList_exists assert($ie.select_list(:name, "sel1").exists?) assert_false($ie.select_list(:name, "missing").exists?) assert_false($ie.select_list(:id, "missing").exists?) end def test_SelectList_enabled assert($ie.select_list(:name, "sel1").enabled?) assert_raises(UnknownObjectException) { $ie.selectBox(:name, "NoName").enabled? } assert_false($ie.select_list(:id, 'selectbox_4').enabled?) end def test_Option_text_select assert_raises(UnknownObjectException) { $ie.select_list(:name, "sel1").option(:text, "missing item").select } assert_raises(UnknownObjectException) { $ie.select_list(:name, "sel1").option(:text, /missing/).select } assert_raises(MissingWayOfFindingObjectException) { $ie.select_list(:name, "sel1").option(:missing, "Option 1").select } # the select method keeps any currently selected items - use the clear selection method first $ie.select_list( :name , "sel1").clearSelection $ie.select_list( :name , "sel1").option(:text, "Option 1").select assert( ["Option 1" ].eql?($ie.select_list(:name, "sel1").getSelectedItems)) end end # Tests for the old interface class TC_Selectbox < Test::Unit::TestCase include Watir def setup() $ie.goto($htmlRoot + "selectboxes1.html") end def test_default_attribute_for_all $ie.default_attribute = :id assert_equal(:id , $ie.default_attribute) assert_raises(UnknownObjectException ) { $ie.select_list('missing_id').id } assert_equal("o1" , $ie.select_list('selectbox_4').value ) $ie.default_attribute = nil end def test_default_attribute_for_select_list $ie.set_default_attribute_for_element(:select_list , :id ) assert_equal('id' , $ie.get_default_attribute_for( :select_list) ) assert_equal("o1" , $ie.select_list('selectbox_4').value ) $ie.set_default_attribute_for_element( :select_list , :name ) assert_equal('name' , $ie.get_default_attribute_for(:select_list) ) assert_raises(UnknownObjectException ) { $ie.select_list('missing_name').value } assert_equal("o3" , $ie.select_list('sel1').value) # make sure that setting the default for a select_list directly, overrides the all setting # we are still using the name attribute, set a few lines up $ie.default_attribute = :id assert_equal("o3" , $ie.select_list('sel1').value) #'sel1' is a name # delete the select_list type $ie.set_default_attribute_for_element( :select_list , nil) # make sure the global attribute (id) is used assert_equal("o1" , $ie.select_list('selectbox_4').value ) # selectbox_4 is an id # clear the global attribute $ie.default_attribute = nil end def test_selectBox_Exists assert($ie.selectBox(:name, "sel1").exists?) assert_false($ie.selectBox(:name, "missing").exists?) assert_false($ie.selectBox(:id, "missing").exists?) end def test_selectBox_enabled assert($ie.selectBox(:name, "sel1").enabled?) assert_raises(UnknownObjectException) { $ie.selectBox(:name, "NoName").enabled? } end def test_selectBox_getAllContents assert_raises(UnknownObjectException) { $ie.selectBox(:name, "NoName").getAllContents } assert( ["Option 1" ,"Option 2" , "Option 3" , "Option 4"] .eql?($ie.selectBox(:name, "sel1").getAllContents)) end def test_selectBox_getSelectedItems assert_raises(UnknownObjectException) { $ie.selectBox(:name, "NoName").getSelectedItems } assert(["Option 3" ] .eql?($ie.selectBox(:name, "sel1").getSelectedItems)) assert(["Option 3" , "Option 6" ] .eql?($ie.selectBox(:name, "sel2").getSelectedItems)) end def test_clearSelection assert_raises(UnknownObjectException) { $ie.selectBox(:name, "NoName").clearSelection } $ie.selectBox( :name , "sel1").clearSelection # the box sel1 has no ability to have a de-selected item assert(["Option 3" ].eql?($ie.selectBox(:name, "sel1").getSelectedItems)) $ie.selectBox( :name , "sel2").clearSelection assert([].eql?($ie.selectBox(:name, "sel2").getSelectedItems)) end def test_selectBox_select assert_raises(NoValueFoundException) { $ie.selectBox(:name, "sel1").select("missing item") } assert_raises(NoValueFoundException) { $ie.selectBox(:name, "sel1").select(/missing/) } # the select method keeps any currently selected items - use the clear selectcion method first $ie.selectBox( :name , "sel1").clearSelection $ie.selectBox( :name , "sel1").select("Option 1") assert( ["Option 1" ].eql?($ie.selectBox(:name, "sel1").getSelectedItems)) $ie.selectBox( :name , "sel1").clearSelection $ie.selectBox( :name , "sel1").select(/2/) assert( ["Option 2" ].eql?($ie.selectBox(:name, "sel1").getSelectedItems)) $ie.selectBox( :name , "sel2").clearSelection $ie.selectBox( :name , "sel2").select(/2/) $ie.selectBox( :name , "sel2").select(/4/) assert(["Option 2" , "Option 4" ].eql?($ie.selectBox(:name, "sel2").getSelectedItems)) # these are to test the onchange event # the event shouldnt get fired, as this is the selected item $ie.selectBox( :name , "sel3").select( /3/ ) assert_false($ie.contains_text("Pass") ) end def test_selectBox_select2 # the event should get fired $ie.selectBox( :name , "sel3").select( /2/ ) assert($ie.contains_text("PASS") ) end def test_selectBox_select_using_value assert_raises(UnknownObjectException) { $ie.select_list(:name, "NoName").getSelectedItems } assert_raises(NoValueFoundException) { $ie.select_list(:name, "sel1").select_value("missing item") } assert_raises(NoValueFoundException) { $ie.select_list(:name, "sel1").select_value(/missing/) } # the select method keeps any currently selected items - use the clear selectcion method first $ie.select_list( :name , "sel1").clearSelection $ie.select_list( :name , "sel1").select_value("o1") assert(["Option 1" ].eql?($ie.select_list(:name, "sel1").getSelectedItems)) $ie.select_list( :name , "sel1").clearSelection $ie.select_list( :name , "sel1").select_value(/2/) assert(["Option 2" ].eql?($ie.select_list(:name, "sel1").getSelectedItems)) $ie.select_list( :name , "sel2").clearSelection $ie.select_list( :name , "sel2").select_value(/4/) $ie.select_list( :name , "sel2").select_value(/2/) assert( ["Option 2" , "Option 4" ].eql?($ie.select_list(:name, "sel2").getSelectedItems)) # these are to test the onchange event # the event shouldnt get fired, as this is the selected item $ie.select_list( :name , "sel3").select_value( /3/ ) assert_false($ie.contains_text("Pass") ) end def test_select_list_select_using_value2 # the event should get fired $ie.select_list( :name , "sel3").select_value( /2/ ) assert($ie.contains_text("PASS") ) end def test_select_list_properties assert_raises(UnknownObjectException) { $ie.select_list(:index, 199).value } assert_raises(UnknownObjectException) { $ie.select_list(:index, 199).name } assert_raises(UnknownObjectException) { $ie.select_list(:index, 199).id } assert_raises(UnknownObjectException) { $ie.select_list(:index, 199).disabled } assert_raises(UnknownObjectException) { $ie.select_list(:index, 199).type } assert_equal("o3" , $ie.select_list(:index, 1).value) assert_equal("sel1" , $ie.select_list(:index, 1).name ) assert_equal("" , $ie.select_list(:index, 1).id ) assert_equal("select-one", $ie.select_list(:index, 1).type ) assert_equal("select-multiple", $ie.select_list(:index, 2).type ) $ie.select_list(:index,1).select(/1/) assert_equal("o1" , $ie.select_list(:index, 1).value) assert_false( $ie.select_list(:index, 1).disabled ) assert( $ie.select_list(:index, 4).disabled ) assert( $ie.select_list(:id, 'selectbox_4').disabled ) end def test_select_list_iterator assert_equal(4, $ie.select_lists.length) assert_equal("o3" , $ie.select_lists[1].value) assert_equal("sel1" , $ie.select_lists[1].name ) assert_equal("select-one", $ie.select_lists[1].type ) assert_equal("select-multiple" , $ie.select_lists[2].type ) index=1 $ie.select_lists.each do |l| assert_equal( $ie.select_list(:index, index).name , l.name ) assert_equal( $ie.select_list(:index, index).id , l.id ) assert_equal( $ie.select_list(:index, index).type , l.type ) assert_equal( $ie.select_list(:index, index).value , l.value ) index+=1 end assert_equal( index-1, $ie.select_lists.length) end end class TC_Select_Options < Test::Unit::TestCase include Watir def setup() $ie.goto($htmlRoot + "select_tealeaf.html") end def test_options_text $ie.select_list(:name, 'op_numhits').option(:text, '>=').select assert($ie.select_list(:name, 'op_numhits').option(:text, '>=').selected) end end #################table_test.rb############### # feature tests for Tables # revision: $Revision: 1.28 $ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ require 'unittests/setup' class TC_Tables < Test::Unit::TestCase include Watir def setup gotoTablePage end def gotoTablePage() $ie.goto($htmlRoot + "table1.html") end def test_Table_Exists assert_false($ie.table(:id , 'missingTable').exists? ) assert_false($ie.table(:index, 33).exists? ) assert($ie.table(:id, 't1').exists? ) assert($ie.table(:index, 1).exists? ) assert($ie.table(:index, 2).exists? ) end def test_rows assert_raises( UnknownTableException ){ $ie.table(:id , 'missingTable').row_count } assert_raises( UnknownTableException ){ $ie.table(:index , 66).row_count } assert_equal( 2 , $ie.table(:index , 1).row_count) assert_equal( 5 , $ie.table(:id, 't1').row_count) # 4 rows and a header assert_equal( 5 , $ie.table(:index, 2).row_count) # same table as above, just accessed by index # test the each iterator on rows - ie, go through each cell row = $ie.table(:index, 2)[2] count=1 row.each do |cell| # cell.flash # this line commented out to speed up the test if count == 1 assert_equal('Row 1 Col1' , cell.to_s.strip ) elsif count==2 assert_equal('Row 1 Col2' , cell.to_s.strip ) end count+=1 end assert_equal(2, count -1) assert_equal(2, $ie.table(:index, 2)[2].column_count) end def test_dynamic_tables t = $ie.table(:id, 't1') assert_equal( 5, t.row_count) $ie.button(:value , 'add row').click assert_equal( 6, t.row_count) end def test_columns assert_raises( UnknownTableException ){ $ie.table(:id , 'missingTable').column_count } assert_raises( UnknownTableException ){ $ie.table(:index , 77).column_count } assert_equal( 2 , $ie.table(:index , 1).column_count) assert_equal( 1 , $ie.table(:id, 't1').column_count) # row one has 1 cell with a colspan of 2 end def test_to_a table1Expected = [ ["Row 1 Col1" , "Row 1 Col2"] ,[ "Row 2 Col1" , "Row 2 Col2"] ] assert(table1Expected.eql?($ie.table(:index , 1).to_a )) end def test_simple_table_access $ie.goto($htmlRoot + "simple_table.html") table = $ie.table(:index,1) assert_equal("Row 3 Col1",table[3][1].text.strip) assert_equal("Row 1 Col1",table[1][1].text.strip) assert_equal("Row 3 Col2",table[3][2].text.strip) assert_equal(2,table.column_count) end def test_simple_table_buttons $ie.goto($htmlRoot + "simple_table_buttons.html") table = $ie.table(:index,1) table[1][1].button(:index,1).click assert($ie.textField(:name,"confirmtext").verify_contains(/CLICK1/i)) table[2][1].button(:index,1).click assert($ie.textField(:name,"confirmtext").verify_contains(/CLICK2/i)) table[1][1].button(:id,'b1').click assert($ie.textField(:name,"confirmtext").verify_contains(/CLICK1/i)) assert_raises(UnknownObjectException ) { table[1][1].button(:id,'b_missing').click } table[3][1].button(:index,2).click assert($ie.textField(:name,"confirmtext").verify_contains(/TOO/i)) table[3][1].button(:value ,"Click too").click assert($ie.textField(:name,"confirmtext").verify_contains(/TOO/i)) $ie.table(:index,1)[4][1].text_field(:index,1).set("123") assert($ie.text_field(:index,2).verify_contains("123")) # check when a cell contains 2 objects # if there were 2 different html objects in the same cell, some weird things happened ( button caption could change for example) assert_equal( 'Click ->' , $ie.table(:index,1)[5][1].text_field(:index,1).value ) $ie.table(:index,1)[5][1].text_field(:index,1).click assert_equal( 'Click ->' , $ie.table(:index,1)[5][1].text_field(:index,1).value ) $ie.table(:index,1)[5][1].button(:index,1).click assert_equal( '' , $ie.table(:index,1)[5][1].text_field(:index,1).value ) end def test_simple_table_gif $ie.goto($htmlRoot + "simple_table_buttons.html") table = $ie.table(:index,2) assert_match( /1\.gif/ , table[1][1].image( :index,1).src ) assert_match( /2\.gif/ , table[1][2].image( :index ,1).src ) assert_match( /3\.gif/ , table[1][3].image( :index ,1).src ) assert_match( /1\.gif/ , table[3][1].image( :index ,1).src ) assert_match( /2\.gif/ , table[3][2].image( :index ,1).src ) assert_match( /3\.gif/ , table[3][3].image( :index ,1).src ) table = $ie.table(:index,3) assert_match( /1\.gif/ , table[1][1].image( :index ,1).src ) assert_match( /2\.gif/ , table[1][1].image( :index ,2).src ) assert_match( /3\.gif/ , table[1][1].image( :index ,3).src ) assert_match( /1\.gif/ , table[3][1].image( :index ,1).src ) assert_match( /2\.gif/ , table[3][1].image( :index ,2).src ) assert_match( /3\.gif/ , table[3][1].image( :index ,3).src ) end def test_table_with_hidden_or_visible_rows $ie.goto($htmlRoot + "simple_table_buttons.html") t = $ie.table(:id , 'show_hide') # expand the table t.each do |r| r[1].image(:src, /plus/).click if r[1].image(:src, /plus/).exists? end # shrink rows 1,2,3 count=1 t.each do |r| r[1].image(:src, /minus/).click if r[1].image(:src, /minus/).exists? and (1..3) === count count=2 end end def test_links_and_images_in_table table = $ie.table(:id, 'pic_table') image = table[1][2].image(:index,1) assert_equal("106", image.width) link = table[1][4].link(:index,1) assert_equal("Google", link.innerText) end def test_table_from_element $ie.goto($htmlRoot + "simple_table_buttons.html") button = $ie.button(:id,"b1") table = Table.create_from_element($ie,button) table[2][1].button(:index,1).click assert($ie.textField(:name,"confirmtext").verify_contains(/CLICK2/i)) end def test_complex_table_access $ie.goto($htmlRoot + "complex_table.html") table = $ie.table(:index,1) assert_equal("subtable1 Row 1 Col1",table[1][1].table(:index,1)[1][1].text.strip) assert_equal("subtable1 Row 1 Col2",table[1][1].table(:index,1)[1][2].text.strip) assert_equal("subtable2 Row 1 Col2",table[2][1].table(:index,1)[1][2].text.strip) assert_equal("subtable2 Row 1 Col1",table[2][1].table(:index,1)[1][1].text.strip) end def test_cell_directly assert( $ie.cell(:id, 'cell1').exists? ) assert_false( $ie.cell(:id, 'no_exist').exists? ) assert_equal( "Row 1 Col1", $ie.cell(:id, 'cell1').to_s.strip ) # not really cell directly, but just to show another way of geting the cell assert_equal( "Row 1 Col1", $ie.table(:index,1)[1][1].to_s.strip ) end def test_row_directly assert( $ie.row(:id, 'row1').exists? ) assert_false( $ie.row(:id, 'no_exist').exists? ) assert_equal('Row 2 Col1' , $ie.row(:id, 'row1')[1].to_s.strip ) end def test_row_iterator t = $ie.table(:index,1) count =1 t.each do |row| if count==1 assert( "Row 1 Col1" , row[1].text ) assert( "Row 1 Col2" , row[2].text ) elsif count==2 assert( "Row 2 Col1" , row[1].text ) assert( "Row 2 Col2" , row[2].text ) end end end def test_table_body assert_equal( 1, $ie.table(:index,1).bodies.length ) assert_equal( 3, $ie.table(:id, 'body_test' ).bodies.length ) count = 1 $ie.table(:id, 'body_test' ).bodies.each do |n| # do something better here! # n.flash # this line commented out to speed up the test case count when 1 compare_text = "This text is in the FRST TBODY." when 2 compare_text = "This text is in the SECOND TBODY." when 3 compare_text = "This text is in the THIRD TBODY." end assert_equal( compare_text , n[1][1].to_s.strip ) # this is the 1st cell of the first row of this particular body count +=1 end assert_equal( count-1, $ie.table(:id, 'body_test' ).bodies.length ) assert_equal( "This text is in the THIRD TBODY." ,$ie.table(:id, 'body_test' ).body(:index,3)[1][1].to_s.strip ) # iterate through all the rows in a table body count = 1 $ie.table(:id, 'body_test' ).body(:index,2).each do | row | # row.flash # this line commented out, to speed up the tests if count == 1 assert_equal('This text is in the SECOND TBODY.' , row[1].text.strip ) elsif count == 1 assert_equal('This text is also in the SECOND TBODY.' , row[1].text.strip ) end count+=1 end end def test_get_columnvalues_single_column $ie.goto($htmlRoot + "simple_table_columns.html") assert_equal(["R1C1", "R2C1", "R3C1"], $ie.table(:index, 1).column_values(1)) end def test_get_columnvalues_multiple_column $ie.goto($htmlRoot + "simple_table_columns.html") assert_equal(["R1C1", "R2C1", "R3C1"], $ie.table(:index, 2).column_values(1)) assert_equal(["R1C3", "R2C3", "R3C3"], $ie.table(:index, 2).column_values(3)) end def test_get_columnvalues_with_colspan $ie.goto($htmlRoot + "simple_table_columns.html") assert_equal(["R1C1", "R2C1", "R3C1", "R4C1", "R5C1", "R6C2"], $ie.table(:index, 3).column_values(1)) (2..4).each{|x|assert_raises(UnknownCellException){$ie.table(:index, 3).column_values(x)}} end def test_get_rowvalues_full_row $ie.goto($htmlRoot + "simple_table_columns.html") assert_equal(["R1C1", "R1C2", "R1C3"], $ie.table(:index, 3).row_values(1)) end def test_get_rowvalues_with_colspan $ie.goto($htmlRoot + "simple_table_columns.html") assert_equal(["R2C1", "R2C2"], $ie.table(:index, 3).row_values(2)) end def test_getrowvalues_with_rowspan $ie.goto($htmlRoot + "simple_table_columns.html") assert_equal(["R5C1", "R5C2", "R5C3"], $ie.table(:index, 3).row_values(5)) assert_equal(["R6C2", "R6C3"], $ie.table(:index, 3).row_values(6)) end end #############testUnitAddons.rb####################### module Test::Unit::Assertions def assert_false(boolean, message=nil) _wrap_assertion do assert_block("assert should not be called with a block.") { !block_given? } assert_block(build_message(message, "<?> is not false.", boolean)) { !boolean } end end def compareArrays( expectArray, actualArray) result = true expectArray.each_with_index do |element,i| #puts "Comparing #{element} #{element.class} with #{actualArray[i]} #{actualArray[i].class} " if element != actualArray[i] result = false break end end return result end def assert_arrayEqualsx(expectArray, actualArray, message = nil ) _wrap_assertion do assert_block("assert should not be called with a block.") { !block_given? } assert_equal(expectArray.length, actualArray.length, "Lengths did not match") assert_block("contents are different." ){ compareArrays( expectArray, actualArray) } end #_wrap end #def def assert_arrayContains(array, string , message =nil) _wrap_assertion do assert_block("assert should not be called with a block.") { !block_given? } assert(array.kind_of?(Array) , "Must have an array") assert(array.include?(string) , message) end end end # module test From kay at utahkay.iserver.net Wed Jun 15 13:06:58 2005 From: kay at utahkay.iserver.net (Kay Johansen) Date: Wed, 15 Jun 2005 17:06:58 +0000 (GMT) Subject: [Wtr-general] How to shut down IE after tests? Message-ID: <20050615165118.J26574@utahkay.iserver.net> Hi all, I just downloaded watir and have been getting a feel for how it works. I'm having trouble closing IE properly. After my tests run, I still have an IE process running and consuming 99% of my CPU. As you can imagine, performance of everything else on my machine suffers. I'm calling ie.close() in the teardown, which works as long as I only have one test. As soon as I have more than one test, I run into this problem of IE running away. What should I be doing to close down IE? I'm brand new to watir so I am a blank slate for your suggestions... Thanks in advance, -Kay Here is my test script: require 'watir' # the watir controller include Watir require 'test/unit' require 'test/unit/ui/console/testrunner' require 'watir/testUnitAddons' class TC_myTest < Test::Unit::TestCase def setup test_site = 'http://localhost' @ie = IE.new @ie.goto(test_site) end def teardown @ie.close end def test_HomePage text = 'This is a link' assert(@ie.contains_text(text), "Failed to find text #{text}") end def test_ClickLink @ie.link(:text, "link").click text = 'This is a test page' assert(@ie.contains_text(text), "Failed to find text #{text}") end end From tuyet.ctn at mscibarra.com Tue Jun 14 14:39:05 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Tue, 14 Jun 2005 11:39:05 -0700 Subject: [Wtr-general] How to handle "Choose File" directory window? Message-ID: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3CFA@iris.win.barra.com> > In my application, there is a "browse" button that brings up the File > Directory Windows where you can enter a file name or navigate to the > directory that you want. I can't see the source for this window (View > Source). How do I set a value for the File Name text field in that > window? From kay at utahkay.iserver.net Wed Jun 15 13:31:28 2005 From: kay at utahkay.iserver.net (Kay Johansen) Date: Wed, 15 Jun 2005 17:31:28 +0000 (GMT) Subject: [Wtr-general] Tree controls Message-ID: <20050615172410.H26574@utahkay.iserver.net> I'm new to Watir and thought I'd see if I could use it to automate tests for our application. We use the dTree javascript tree control. I'm wondering just how to expand and collapse nodes. Should I try clicking on widgets, or should I try somehow accessing the tree "object" itself? I found this email in the archives of this list talking about scripting tests for Joust. I wondered, how did you know to call "flash"? what does "flash" do? is that something defined in Joust, or in Watir? Thanks, -Kay Another popular treeview is Joust ( http://www.ivanpeters.com/ ) This can be accessed easily: ie.goto('http://www.ivanpeters.com/') irb(main):039:0> ie.show_frames there are 4 frames frame index: 0 name: title frame index: 1 name: menu frame index: 2 name: menuCntrl frame index: 3 name: text ie.frame("menu").link(:text , /Wel/).flash Because of the images used, its easier to iterate through the links collection or use :index Paul From jkohl at telusplanet.net Wed Jun 15 14:35:54 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Wed, 15 Jun 2005 11:35:54 -0700 Subject: [Wtr-general] Tree controls In-Reply-To: <20050615172410.H26574@utahkay.iserver.net> References: <20050615172410.H26574@utahkay.iserver.net> Message-ID: <1118860554.42b0750ac0e49@webmail.telusplanet.net> Hi Kay; You would click the widgets in the tree control. I haven't looked at this in a while; maybe Paul or someone else will chime in with more details. "Flash" is a method we use to see if we have the right object or not. This article: http://www.kohl.ca/articles/watir_works.pdf describes using flash among other things. There is some info here: http://wtr.rubyforge.org/s101/doc/ with the Watir Cheat Sheet: http://wtr.rubyforge.org/s101/doc/Watir-cheat- sheet.doc that you might find helpful. -Jonathan Quoting Kay Johansen <kay at utahkay.iserver.net>: > I'm new to Watir and thought I'd see if I could use it to automate tests > for our application. We use the dTree javascript tree control. I'm > wondering just how to expand and collapse nodes. Should I try clicking on > widgets, or should I try somehow accessing the tree "object" itself? > > I found this email in the archives of this list talking about scripting > tests for Joust. I wondered, how did you know to call "flash"? what does > "flash" do? is that something defined in Joust, or in Watir? > > Thanks, > -Kay > > Another popular treeview is Joust ( http://www.ivanpeters.com/ ) > This can be accessed easily: > ie.goto('http://www.ivanpeters.com/') > irb(main):039:0> ie.show_frames > there are 4 frames > frame index: 0 name: title > frame index: 1 name: menu > frame index: 2 name: menuCntrl > frame index: 3 name: text > > ie.frame("menu").link(:text , /Wel/).flash > > Because of the images used, its easier to iterate through the links > collection or use :index > > Paul > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From jkohl at telusplanet.net Wed Jun 15 14:42:04 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Wed, 15 Jun 2005 11:42:04 -0700 Subject: [Wtr-general] How to shut down IE after tests? In-Reply-To: <20050615165118.J26574@utahkay.iserver.net> References: <20050615165118.J26574@utahkay.iserver.net> Message-ID: <1118860924.42b0767c86836@webmail.telusplanet.net> When you say you have more than one test, do you mean as you have below, more than one test case in the same class? I tried the code below and can't reproduce the problem, however, setup and teardown will get called for each test, so test_clicklink won't be at "localhost" unless it is your home page. Maybe the process is getting hung up because of the assertion error? I'm not sure. I'll try it at home tonight with a more recent version of Watir. I'd try it without "teardown" and see what happens. -Jonathan Quoting Kay Johansen <kay at utahkay.iserver.net>: > Hi all, > > I just downloaded watir and have been getting a feel for how it works. I'm > having trouble closing IE properly. After my tests run, I still have an IE > process running and consuming 99% of my CPU. As you can imagine, > performance of everything else on my machine suffers. > > I'm calling ie.close() in the teardown, which works as long as I only have > one test. As soon as I have more than one test, I run into this problem of > IE running away. > > What should I be doing to close down IE? I'm brand new to watir so I am a > blank slate for your suggestions... > > Thanks in advance, > -Kay > > Here is my test script: > > require 'watir' # the watir controller > include Watir > require 'test/unit' > require 'test/unit/ui/console/testrunner' > require 'watir/testUnitAddons' > > class TC_myTest < Test::Unit::TestCase > def setup > test_site = 'http://localhost' > @ie = IE.new > @ie.goto(test_site) > end > > def teardown > @ie.close > end > > def test_HomePage > text = 'This is a link' > assert(@ie.contains_text(text), "Failed to find text #{text}") > end > > def test_ClickLink > @ie.link(:text, "link").click > text = 'This is a test page' > assert(@ie.contains_text(text), "Failed to find text #{text}") > end > end > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From kay at utahkay.iserver.net Wed Jun 15 15:41:22 2005 From: kay at utahkay.iserver.net (Kay Johansen) Date: Wed, 15 Jun 2005 19:41:22 +0000 (GMT) Subject: [Wtr-general] How to shut down IE after tests? In-Reply-To: <1118860924.42b0767c86836@webmail.telusplanet.net> References: <20050615165118.J26574@utahkay.iserver.net> <1118860924.42b0767c86836@webmail.telusplanet.net> Message-ID: <20050615193527.X26574@utahkay.iserver.net> Jonathan, I saw from the unit tests how to call ie.close() only once, at the end of everything, so I got rid of teardown and now it's working fine. END {$ie.close} I wonder if, by closing ie in teardown and opening it in setup, opening was happening so soon after closing that it caused IE to go into a bad state. Weird. Anyway to answer your questions, although further discussion is probably moot at this point, Yes I meant more than one test case in the same class. If setup is called for each test then I expected each test to be at "localhost" because I goto that url in setup. That did work. IE exhibited the same problem whether the tests passed or failed. Thanks Jonathan. -Kay On Wed, 15 Jun 2005 jkohl at telusplanet.net wrote: > When you say you have more than one test, do you mean as you have below, more > than one test case in the same class? I tried the code below and can't > reproduce the problem, however, setup and teardown will get called for each > test, so test_clicklink won't be at "localhost" unless it is your home page. > Maybe the process is getting hung up because of the assertion error? I'm not > sure. I'll try it at home tonight with a more recent version of Watir. I'd try > it without "teardown" and see what happens. > > -Jonathan > > Quoting Kay Johansen <kay at utahkay.iserver.net>: > >> Hi all, >> >> I just downloaded watir and have been getting a feel for how it works. I'm >> having trouble closing IE properly. After my tests run, I still have an IE >> process running and consuming 99% of my CPU. As you can imagine, >> performance of everything else on my machine suffers. >> >> I'm calling ie.close() in the teardown, which works as long as I only have >> one test. As soon as I have more than one test, I run into this problem of >> IE running away. >> >> What should I be doing to close down IE? I'm brand new to watir so I am a >> blank slate for your suggestions... >> >> Thanks in advance, >> -Kay >> >> Here is my test script: >> >> require 'watir' # the watir controller >> include Watir >> require 'test/unit' >> require 'test/unit/ui/console/testrunner' >> require 'watir/testUnitAddons' >> >> class TC_myTest < Test::Unit::TestCase >> def setup >> test_site = 'http://localhost' >> @ie = IE.new >> @ie.goto(test_site) >> end >> >> def teardown >> @ie.close >> end >> >> def test_HomePage >> text = 'This is a link' >> assert(@ie.contains_text(text), "Failed to find text #{text}") >> end >> >> def test_ClickLink >> @ie.link(:text, "link").click >> text = 'This is a test page' >> assert(@ie.contains_text(text), "Failed to find text #{text}") >> end >> end >> >> _______________________________________________ >> 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 kay at utahkay.iserver.net Wed Jun 15 15:58:01 2005 From: kay at utahkay.iserver.net (Kay Johansen) Date: Wed, 15 Jun 2005 19:58:01 +0000 (GMT) Subject: [Wtr-general] Tree controls In-Reply-To: <1118860554.42b0750ac0e49@webmail.telusplanet.net> References: <20050615172410.H26574@utahkay.iserver.net> <1118860554.42b0750ac0e49@webmail.telusplanet.net> Message-ID: <20050615195107.B26574@utahkay.iserver.net> Thanks, flash is cool. Hmm, now I need to figure out what the widgets are. With dTree all I can see with "view source" is the javascript code used to construct the widgets. So I have no idea what they're called or how I can access them. Where can I find out more about how watir supports Joust? Maybe that would help me figure out how to make it work for dTree. I don't suppose there's a way I can call javascript methods or access javascript objects from my tests? Thanks, -Kay On Wed, 15 Jun 2005 jkohl at telusplanet.net wrote: > Hi Kay; > > You would click the widgets in the tree control. I haven't looked at this in a > while; maybe Paul or someone else will chime in with more details. > > "Flash" is a method we use to see if we have the right object or not. This > article: http://www.kohl.ca/articles/watir_works.pdf describes using flash > among other things. There is some info here: http://wtr.rubyforge.org/s101/doc/ > with the Watir Cheat Sheet: http://wtr.rubyforge.org/s101/doc/Watir-cheat- > sheet.doc that you might find helpful. > > -Jonathan > > > Quoting Kay Johansen <kay at utahkay.iserver.net>: > >> I'm new to Watir and thought I'd see if I could use it to automate tests >> for our application. We use the dTree javascript tree control. I'm >> wondering just how to expand and collapse nodes. Should I try clicking on >> widgets, or should I try somehow accessing the tree "object" itself? >> >> I found this email in the archives of this list talking about scripting >> tests for Joust. I wondered, how did you know to call "flash"? what does >> "flash" do? is that something defined in Joust, or in Watir? >> >> Thanks, >> -Kay >> >> Another popular treeview is Joust ( http://www.ivanpeters.com/ ) >> This can be accessed easily: >> ie.goto('http://www.ivanpeters.com/') >> irb(main):039:0> ie.show_frames >> there are 4 frames >> frame index: 0 name: title >> frame index: 1 name: menu >> frame index: 2 name: menuCntrl >> frame index: 3 name: text >> >> ie.frame("menu").link(:text , /Wel/).flash >> >> Because of the images used, its easier to iterate through the links >> collection or use :index >> >> 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 tuyet.ctn at mscibarra.com Tue Jun 14 21:56:24 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Tue, 14 Jun 2005 18:56:24 -0700 Subject: [Wtr-general] How to handle "Choose File" directory window? Message-ID: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D0A@iris.win.barra.com> I used the filefield_test.rb example in the unittests directory and was hoping this would work but alas, I am not understanding something. The first statement works just fine. The click brings up the file directory windows. In the second statement, I was attempting to set the value of the "File name" textfield, but this doesn't work. I can see the file in the directory window, but can't figure out how to set it. I don't know what the :name should be. I don't think it's "file1", that's just from the example. Hmm! Any hint where I might look next? ie.frame("main").frame(:name, "body").frame(:name, "tabContent").button(:name, "btnAddFile").click ie.fileField(:name,"file1").set("bo_imp_import_02SHORTSampleUSPEData.csv") Also, I ran the filefield_test.rb in irb to see what each statement does, and at the end, the file directory window disappears. Is there a way to keep it up, so I can see what the final value is in the "File name" textfield. Thanks. From shaorobics at gmail.com Wed Jun 15 16:21:57 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Wed, 15 Jun 2005 16:21:57 -0400 Subject: [Wtr-general] How to shut down IE after tests? In-Reply-To: <20050615193527.X26574@utahkay.iserver.net> References: <20050615165118.J26574@utahkay.iserver.net> <1118860924.42b0767c86836@webmail.telusplanet.net> <20050615193527.X26574@utahkay.iserver.net> Message-ID: <593b9ae805061513214373ef2@mail.gmail.com> Like you, I have many test cases in the same class. I do have setupCase to open up ie's and do other stuff and an endCase to close the current ie. I think I know the problem you have since I have experienced something like that. I remedied it with a sleep(3) or sleep(4) in the setup before doing an IE.new(). Shao On 6/15/05, Kay Johansen <kay at utahkay.iserver.net> wrote: > Jonathan, > > I saw from the unit tests how to call ie.close() only once, at the end of > everything, so I got rid of teardown and now it's working fine. > > END {$ie.close} > > I wonder if, by closing ie in teardown and opening it in setup, opening > was happening so soon after closing that it caused IE to go into a bad > state. Weird. > > Anyway to answer your questions, although further discussion is probably > moot at this point, > > Yes I meant more than one test case in the same class. > > If setup is called for each test then I expected each test to be at > "localhost" because I goto that url in setup. That did work. > > IE exhibited the same problem whether the tests passed or failed. > > Thanks Jonathan. > > -Kay > > On Wed, 15 Jun 2005 jkohl at telusplanet.net wrote: > > > When you say you have more than one test, do you mean as you have below, more > > than one test case in the same class? I tried the code below and can't > > reproduce the problem, however, setup and teardown will get called for each > > test, so test_clicklink won't be at "localhost" unless it is your home page. > > Maybe the process is getting hung up because of the assertion error? I'm not > > sure. I'll try it at home tonight with a more recent version of Watir. I'd try > > it without "teardown" and see what happens. > > > > -Jonathan > > > > Quoting Kay Johansen <kay at utahkay.iserver.net>: > > > >> Hi all, > >> > >> I just downloaded watir and have been getting a feel for how it works. I'm > >> having trouble closing IE properly. After my tests run, I still have an IE > >> process running and consuming 99% of my CPU. As you can imagine, > >> performance of everything else on my machine suffers. > >> > >> I'm calling ie.close() in the teardown, which works as long as I only have > >> one test. As soon as I have more than one test, I run into this problem of > >> IE running away. > >> > >> What should I be doing to close down IE? I'm brand new to watir so I am a > >> blank slate for your suggestions... > >> > >> Thanks in advance, > >> -Kay > >> > >> Here is my test script: > >> > >> require 'watir' # the watir controller > >> include Watir > >> require 'test/unit' > >> require 'test/unit/ui/console/testrunner' > >> require 'watir/testUnitAddons' > >> > >> class TC_myTest < Test::Unit::TestCase > >> def setup > >> test_site = 'http://localhost' > >> @ie = IE.new > >> @ie.goto(test_site) > >> end > >> > >> def teardown > >> @ie.close > >> end > >> > >> def test_HomePage > >> text = 'This is a link' > >> assert(@ie.contains_text(text), "Failed to find text #{text}") > >> end > >> > >> def test_ClickLink > >> @ie.link(:text, "link").click > >> text = 'This is a test page' > >> assert(@ie.contains_text(text), "Failed to find text #{text}") > >> end > >> end > >> > >> _______________________________________________ > >> 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 tuyet.ctn at mscibarra.com Wed Jun 15 17:54:10 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Wed, 15 Jun 2005 14:54:10 -0700 Subject: [Wtr-general] Anyone has used AutoIT to deal with Windows Explorer "Choose File "? Message-ID: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D17@iris.win.barra.com> I'd like to be able to do a couple of things on the "Choose File" windows: 1) Navigate to the right path 2) Select the file that I need 3) Click on Open OR 1) Enter a filename in the "File name" textfield of the "Choose File" interface 2) Click on Open I would appreciate some examples if you have already done this in WATIR. Thanks! From christopher.mcmahon at gmail.com Wed Jun 15 18:57:26 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 15 Jun 2005 16:57:26 -0600 Subject: Done! Re: [Wtr-general] refactor testUnitAddons.rb? In-Reply-To: <72799cd70506150924324df566@mail.gmail.com> References: <72799cd70506140759471f0b52@mail.gmail.com> <5.1.0.14.2.20050614132350.021bc980@127.0.0.1> <72799cd705061411302161a468@mail.gmail.com> <72799cd70506150924324df566@mail.gmail.com> Message-ID: <72799cd70506151557637ae98b@mail.gmail.com> On 6/15/05, Chris McMahon <christopher.mcmahon at gmail.com> wrote: > > > >point out that the unittests are pointers to the users about how to > > > >use WATIR, and with selectbox_test.rb, it's a long way to go to do > > > >something that's not standard. It's a little smelly. > > > > > > +1. Do you want to fix it? > > > > > Turned out not to be too tough. I don't have commit access to CVS, > and rather than spam the list with attachments, the code for > selectbox_test.rb, table_test.rb, and testUnitAddons.rb is > copy-n-pasted below. BTW, I did a little research. Having done the right thing by replacing assert_arrayEquals, I'm 99% sure that we can delete testUnitAddons.rb altogether. -Chris From jkohl at telusplanet.net Wed Jun 15 20:21:50 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Wed, 15 Jun 2005 18:21:50 -0600 Subject: [Wtr-general] Tree controls In-Reply-To: <20050615195107.B26574@utahkay.iserver.net> Message-ID: <20050616002136.TVF24732.priv-edtnes27.telusplanet.net@tintin> > Hmm, now I need to figure out what the widgets are. With dTree all I can > see with "view source" is the javascript code used to construct the > widgets. So I have no idea what they're called or how I can access them. > Where can I find out more about how watir supports Joust? Maybe that would > help me figure out how to make it work for dTree. I added an FAQ entry on doing this with Joust: http://wtr.rubyforge.org/wiki/wiki.pl?FrequentQuestions (It's the last Q) > I don't suppose there's a way I can call javascript methods or access > javascript objects from my tests? You can use "fire_event" to emulate user actions such as "onMouseOver", "onClick", "onKeyPress" etc. -Jonathan > On Wed, 15 Jun 2005 jkohl at telusplanet.net wrote: > > > Hi Kay; > > > > You would click the widgets in the tree control. I haven't looked at > this in a > > while; maybe Paul or someone else will chime in with more details. > > > > "Flash" is a method we use to see if we have the right object or not. > This > > article: http://www.kohl.ca/articles/watir_works.pdf describes using > flash > > among other things. There is some info here: > http://wtr.rubyforge.org/s101/doc/ > > with the Watir Cheat Sheet: http://wtr.rubyforge.org/s101/doc/Watir- > cheat- > > sheet.doc that you might find helpful. > > > > -Jonathan > > > > > > Quoting Kay Johansen <kay at utahkay.iserver.net>: > > > >> I'm new to Watir and thought I'd see if I could use it to automate > tests > >> for our application. We use the dTree javascript tree control. I'm > >> wondering just how to expand and collapse nodes. Should I try clicking > on > >> widgets, or should I try somehow accessing the tree "object" itself? > >> > >> I found this email in the archives of this list talking about scripting > >> tests for Joust. I wondered, how did you know to call "flash"? what > does > >> "flash" do? is that something defined in Joust, or in Watir? > >> > >> Thanks, > >> -Kay > >> > >> Another popular treeview is Joust ( http://www.ivanpeters.com/ ) > >> This can be accessed easily: > >> ie.goto('http://www.ivanpeters.com/') > >> irb(main):039:0> ie.show_frames > >> there are 4 frames > >> frame index: 0 name: title > >> frame index: 1 name: menu > >> frame index: 2 name: menuCntrl > >> frame index: 3 name: text > >> > >> ie.frame("menu").link(:text , /Wel/).flash > >> > >> Because of the images used, its easier to iterate through the links > >> collection or use :index > >> > >> 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 paul.rogers at shaw.ca Wed Jun 15 21:07:02 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 15 Jun 2005 19:07:02 -0600 Subject: [Wtr-general] Anyone has used AutoIT to deal with Windows Explorer"Choose File "? In-Reply-To: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D17@iris.win.barra.com> Message-ID: <002d01c5720f$b41e07b0$72d39044@NewDell> Paste this into your WinHelper.rb def set_filename_field( file_name ) @autoit.WinWait "Choose file" , "" @autoit.WinActivate "Choose file" , "" @autoit.Send "!n" # alt + n to set focus to file name field @autoit.Send file_name @autoit.Send "{ENTER}" end And then w= WindowHelper.new w.set_filename_field( Path_to_your_file) # use single quotes here - like 'c:\temp\myfile.txt' Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Tuyet Cong-Ton-Nu Sent: 15 June 2005 15:54 To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] Anyone has used AutoIT to deal with Windows Explorer"Choose File "? I'd like to be able to do a couple of things on the "Choose File" windows: 1) Navigate to the right path 2) Select the file that I need 3) Click on Open OR 1) Enter a filename in the "File name" textfield of the "Choose File" interface 2) Click on Open I would appreciate some examples if you have already done this in WATIR. Thanks! _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Wed Jun 15 21:12:44 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 15 Jun 2005 19:12:44 -0600 Subject: [Wtr-general] Anyone has used AutoIT to deal with Windows Explorer"Choose File "? Message-ID: <002e01c57210$80115570$72d39044@NewDell> Some versions of windows appear to have different titles, so you may need to replace the Choose file" with whatever appears on your pc. I did this on Win XP Paul -----Original Message----- From: Paul Rogers [mailto:paul.rogers at shaw.ca] Sent: 15 June 2005 19:07 To: 'wtr-general at rubyforge.org' Subject: RE: [Wtr-general] Anyone has used AutoIT to deal with Windows Explorer"Choose File "? Paste this into your WinHelper.rb def set_filename_field( file_name ) @autoit.WinWait "Choose file" , "" @autoit.WinActivate "Choose file" , "" @autoit.Send "!n" # alt + n to set focus to file name field @autoit.Send file_name @autoit.Send "{ENTER}" end And then w= WindowHelper.new w.set_filename_field( Path_to_your_file) # use single quotes here - like 'c:\temp\myfile.txt' Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Tuyet Cong-Ton-Nu Sent: 15 June 2005 15:54 To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] Anyone has used AutoIT to deal with Windows Explorer"Choose File "? I'd like to be able to do a couple of things on the "Choose File" windows: 1) Navigate to the right path 2) Select the file that I need 3) Click on Open OR 1) Enter a filename in the "File name" textfield of the "Choose File" interface 2) Click on Open I would appreciate some examples if you have already done this in WATIR. Thanks! _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Wed Jun 15 21:40:13 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 15 Jun 2005 19:40:13 -0600 Subject: [Wtr-general] Tree controls In-Reply-To: <20050615172410.H26574@utahkay.iserver.net> Message-ID: <002f01c57214$56f9efe0$72d39044@NewDell> Kay, Im assuming you are using the control from ths site: http://www.destroydrop.com/javascripts/tree/default.html In this case the tree is just links, so you can do this ie.link(:text , /Node 2/).flash ie.link(:text , /Node 2/).click To click the + on Node 1 I used: ie.image(:src , /plus/).click Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Kay Johansen Sent: 15 June 2005 11:31 To: wtr-general at rubyforge.org Subject: [Wtr-general] Tree controls I'm new to Watir and thought I'd see if I could use it to automate tests for our application. We use the dTree javascript tree control. I'm wondering just how to expand and collapse nodes. Should I try clicking on widgets, or should I try somehow accessing the tree "object" itself? I found this email in the archives of this list talking about scripting tests for Joust. I wondered, how did you know to call "flash"? what does "flash" do? is that something defined in Joust, or in Watir? Thanks, -Kay Another popular treeview is Joust ( http://www.ivanpeters.com/ ) This can be accessed easily: ie.goto('http://www.ivanpeters.com/') irb(main):039:0> ie.show_frames there are 4 frames frame index: 0 name: title frame index: 1 name: menu frame index: 2 name: menuCntrl frame index: 3 name: text ie.frame("menu").link(:text , /Wel/).flash Because of the images used, its easier to iterate through the links collection or use :index Paul _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Wed Jun 15 22:37:46 2005 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 15 Jun 2005 21:37:46 -0500 Subject: [Wtr-general] How to shut down IE after tests? In-Reply-To: <20050615193527.X26574@utahkay.iserver.net> References: <1118860924.42b0767c86836@webmail.telusplanet.net> <20050615165118.J26574@utahkay.iserver.net> <1118860924.42b0767c86836@webmail.telusplanet.net> Message-ID: <5.1.0.14.2.20050615213649.0334b760@127.0.0.1> At 02:41 PM 6/15/2005, Kay Johansen wrote: >I wonder if, by closing ie in teardown and opening it in setup, opening >was happening so soon after closing that it caused IE to go into a bad >state. Weird. We'd actually seen this long ago with IEC (precursor to Watir). We fixed it there, but may need to fix the same problem here. _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Wed Jun 15 22:45:00 2005 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 15 Jun 2005 21:45:00 -0500 Subject: [Wtr-general] Tree controls In-Reply-To: <20050615195107.B26574@utahkay.iserver.net> References: <1118860554.42b0750ac0e49@webmail.telusplanet.net> <20050615172410.H26574@utahkay.iserver.net> <1118860554.42b0750ac0e49@webmail.telusplanet.net> Message-ID: <5.1.0.14.2.20050615214349.0334b9e0@127.0.0.1> At 02:58 PM 6/15/2005, Kay Johansen wrote: >I don't suppose there's a way I can call javascript methods or access >javascript objects from my tests? There have to be actual html controls that javacript interacts with. Use show_all_objects to reveal these. _____________________ Bret Pettichord www.pettichord.com From zeljko.filipin at gmail.com Thu Jun 16 03:59:58 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Thu, 16 Jun 2005 09:59:58 +0200 Subject: [Wtr-general] Unable to locate a radio button Message-ID: <42b13150.102247d2.2583.696e@mx.gmail.com> I got the following error message. I tried to check check box but there is none at page (I made a mistake). The strange thing is that error said it can not find radio button. I know I have read in Watir API Reference that check boxes and radio buttons share the same code, but, could error message let user know that (something like 'Unable to locate a radio button or checkbox...' instead of just 'Unable to locate a radio button...' ). I remember a while ago I got the same error message and how confusing it was to me (I guess before I found out about code sharing among check boxes and radio buttons). Zeljko C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3354:in `assert_exists': Unable to locate a radio button using id and ucContractInput__ctl0_ucPoolInput_rptPools__ct l0_chkPool (Watir::Exception::UnknownObjectException) from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3392:in `set' from ./../common.rb:418:in `manage_check_box' from ./shop.rb:173:in `add_contract' from ./shop.rb:286:in `manage_contracts' from C:/Documents and Settings/zfilipin/My Documents/Tests/shop/contracts.rb:20 From paul.rogers at shaw.ca Thu Jun 16 12:34:10 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 16 Jun 2005 10:34:10 -0600 Subject: [Wtr-general] Show_window Message-ID: <001001c57291$394bf1f0$72d39044@NewDell> This helped me in some recent testing. May be useful for others class IE def show_windows shell = WIN32OLE.new("Shell.Application") appWindows = shell.Windows() puts "url".ljust(80) + " title".ljust(20) appWindows.each do |aWin| begin title = aWin.document.title url = aWin.locationURL puts url.ljust(80) + " " + title.ljust(20) rescue # probably not an IE window end end shell=nil end end Paul From sboland at shiftwise.net Thu Jun 16 13:22:54 2005 From: sboland at shiftwise.net (Scott Boland - Origin) Date: Thu, 16 Jun 2005 12:22:54 -0500 Subject: [Wtr-general] Manipulating a new IE window created with javascript Message-ID: <OMECJNMKDCKGNJGAFKKAIEFJCCAA.sboland@shiftwise.net> I've encountered a puzzlement after successfully attaching to a new window. The attachment appears to succeed, but after doing this the object loses all access to the Watir:IE methods to inspect and manipulate the controls. I am performing operations in irb. The sequence goes like this. 1) Locate the link on the page and assign it to link The link href is "javascript:OpenWindow(\"order.aspx?order_id=E4A7A647C0BAED47\")" 2) Make use of the link by clicking it using link.click A new window opens without the standard ie controls visible. No toolbar or address entry area. 3) Attach a new Watir::IE object. irb(main):285:0> x = Watir::IE => Watir::IE irb(main):286:0> x.attach( :url, /order_id=E4A7A647C0BAED47/ ) => #<Watir::IE:0x2b3a108 @typingspeed=0.08, @activeObjectHighLightColor="yellow" , @form=nil, @url_list=[], @logger=#<Watir::DefaultLogger:0x2b399e8 @progname=ni l, @logdev=#<Logger::LogDevice:0x2b39088 @dev=#<IO:0x278e7d0>, @shift_size=nil, @shift_age=nil, @filename=nil>, @level=2, @datetime_format="%d-%b-%Y %H:%M:%S">, @error_checkers=[#<Proc:0x02abeb08 at D:/Coding/Ruby/Ruby_1.8.2-15/lib/ruby/s ite_r uby/1.8/watir.rb:1213>], @defaultSleepTime=0.1, @enable_spinner=false, @ie=#<WIN 32OLE:0x2b39f58>> At this point x is attached to the window apparently. But now all the normal methods to show objects or manipulate them are gone. It's class has become 'Class' instead of Watir::IE. irb(main):287:0> x.methods => ["send", "name", "start", "class_eval", "attach", "object_id", "new", "singleton_methods", "__send__", "private_method_defined?", "equal?", "taint", "frozen?", "instance_variable_get", "constants", "kind_of?", "to_a", "instance_eval", "require", "ancestors", "const_missing", "type", "instance_methods", "protected_methods", "extend", "protected_method_defined?", "eql?", "public_class_method", "const_get", "instance_variable_set", "hash", "is_a?", "autoload", "to_s", "class_variables", "class", "tainted?", "private_methods", "public_instance_methods", "instance_method", "require_gem_with_options", "untaint", "included_modules", "private_class_method", "const_set", "id", "<", "inspect", "<=>", "==", "method_defined?", ">", "===", "clone", "public_methods", "protected_instance_methods", ">=", "respond_to?", "display", "freeze", "<=", "module_eval", "autoload?", "allocate", "__id__", "=~", "methods", "require_gem", "method", "public_method_defined?", "superclass", "nil?", "dup", "private_instance_methods", "instance_variables", "include?", "const_defined?", "instance_of?"] I'm new to Watir and Ruby in general, but I'm hoping somebody on this list can clue me in to what is going on and how I can fix it. -- Scott B From ashetty at velozglobal.com Thu Jun 16 08:48:54 2005 From: ashetty at velozglobal.com (Amita Shetty) Date: Thu, 16 Jun 2005 07:48:54 -0500 Subject: [Wtr-general] Unable to locate an image and click Message-ID: <48966054EF494649A988314F1C8307731CA9F1@DC1Mail01> I am not able to click on an image to view the popup. I am not able to do it even with the URL. Is this due to watir version? My watir version is watir_v1_31. The following is the HTML code: onclick="MM_openBrWindow('./ReportController.do?reportId=3&reportCategory=EO&reportType=EOScorecard&eoInstanceId=6143&eoid=110&eoName=SystemEDGE NT System&eoInstanceName=AHA-AHAMAIL1-SH','','width=800, height=600, scrollbars=yes')" href="" src="test_files/menu_reports.gif" border=0></A>  <A Thanks, Amitha From jkohl at telusplanet.net Thu Jun 16 15:11:03 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Thu, 16 Jun 2005 12:11:03 -0700 Subject: [Wtr-general] Unable to locate an image and click In-Reply-To: <48966054EF494649A988314F1C8307731CA9F1@DC1Mail01> References: <48966054EF494649A988314F1C8307731CA9F1@DC1Mail01> Message-ID: <1118949063.42b1cec7961ed@webmail.telusplanet.net> Did you try fire_event("onclick") on the image? The onclick seems to be what is opening the window. ie.image(:src, /menu_reports.gif/).fire_event("onclick") -Jonathan Quoting Amita Shetty <ashetty at velozglobal.com>: > I am not able to click on an image to view the popup. I am not able to do it > even with the URL. > Is this due to watir version? My watir version is watir_v1_31. > > The following is the HTML code: > > onclick="MM_openBrWindow('./ReportController.do? reportId=3&reportCategory=EO&reportType=EOScorecard&eoInstanceId=614 3&eoid=110&eoName=SystemEDGE > NT System&eoInstanceName=AHA-AHAMAIL1-SH','','width=800, height=600, > scrollbars=yes')" > href="" > src="test_files/menu_reports.gif" > border=0></A>  <A > > Thanks, > Amitha > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From drew.cox at gmail.com Thu Jun 16 15:29:56 2005 From: drew.cox at gmail.com (Drew Cox) Date: Thu, 16 Jun 2005 15:29:56 -0400 Subject: [Wtr-general] Carriage returns in textarea? Message-ID: <252308cf05061612295cb479f7@mail.gmail.com> How do you add a carriage return to a textarea? Drew From alf at klickit.com Thu Jun 16 15:32:49 2005 From: alf at klickit.com (Alfred Whitehead) Date: Thu, 16 Jun 2005 15:32:49 -0400 Subject: [Wtr-general] Carriage returns in textarea? In-Reply-To: <252308cf05061612295cb479f7@mail.gmail.com> References: <252308cf05061612295cb479f7@mail.gmail.com> Message-ID: <42B1D3E1.6020108@klickit.com> Hi Drew, Passing a string like "line one\nline two\nline three" to the set method of the text field should work. The "\n"s will be converted to carriage returns. Drew Cox wrote: >How do you add a carriage return to a textarea? > > > -- Alf Whitehead Quality Assurance Specialist alf at klickit.com 416-214-4977 x260 From alf at klickit.com Thu Jun 16 16:20:52 2005 From: alf at klickit.com (Alfred Whitehead) Date: Thu, 16 Jun 2005 16:20:52 -0400 Subject: [Wtr-general] global variables in a new process Message-ID: <42B1DF24.4050807@klickit.com> >hi, > >My web app currently has modal dialog boxes which I'm getting rid of >through a function I wrote which mimicks winClicker. I'm searching >for a specific title so that autoit can activate the popup. I look 10 >times, afterwhich I decide the pop up cannot be found and I set: > >$modalFound = false > >otherwise, if it does manage to find the window, it closes it and I set: > >$modalFound = true > >back in the main test I do a check: > >puts $modalFound > >I get "nil" . > >any insight as to why I can't access this global variable? Not sure if this is still an issue for you or not, Shao... You can probably pass an exit code from process to process. In the child process (your modal box clicker), finish off with if modalFound exit(1) else exit(0) end In the parent process, you can talk to it like this: # make your process run and wait for it to finish modalDialog = ($? >> 8) == 1 $? is the exit code of the last child process to run. Shift it right 8 bits due to POSIX "features" and you've got whatever you passed out from exit -- Alf Whitehead <alf at klickit.com> Quality Assurance Specialist Klick Communications, http://klick.com/ From paul.rogers at shaw.ca Thu Jun 16 16:59:21 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 16 Jun 2005 14:59:21 -0600 Subject: [Wtr-general] Unable to locate a radio button In-Reply-To: <42b13150.102247d2.2583.696e@mx.gmail.com> Message-ID: <001901c572b6$45050b60$72d39044@NewDell> This to me seems like a 'bad' refactoring. The early code had a Radio object and a Checkbox object, both of which descended from the radiocheckCommon object. I don't think they added any code, they just created new classes with more meaningful names. The facorting here did what a refacor is supposed to do - namely reduce the amount of code - but in my opinion made the end user experience worse by giving a less meaningful error meassage, and probably less useful rdocs. I think I would prefer a slightly bigger code base to gain more meaning. I think we will have to go back to hacing separate radio and checkbox classes to overcome the set/clear problem I detailed earlier in the week. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: 16 June 2005 02:00 To: wtr-general at rubyforge.org Subject: [Wtr-general] Unable to locate a radio button I got the following error message. I tried to check check box but there is none at page (I made a mistake). The strange thing is that error said it can not find radio button. I know I have read in Watir API Reference that check boxes and radio buttons share the same code, but, could error message let user know that (something like 'Unable to locate a radio button or checkbox...' instead of just 'Unable to locate a radio button...' ). I remember a while ago I got the same error message and how confusing it was to me (I guess before I found out about code sharing among check boxes and radio buttons). Zeljko C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3354:in `assert_exists': Unable to locate a radio button using id and ucContractInput__ctl0_ucPoolInput_rptPools__ct l0_chkPool (Watir::Exception::UnknownObjectException) from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3392:in `set' from ./../common.rb:418:in `manage_check_box' from ./shop.rb:173:in `add_contract' from ./shop.rb:286:in `manage_contracts' from C:/Documents and Settings/zfilipin/My Documents/Tests/shop/contracts.rb:20 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From drew.cox at gmail.com Thu Jun 16 17:12:07 2005 From: drew.cox at gmail.com (Drew Cox) Date: Thu, 16 Jun 2005 17:12:07 -0400 Subject: [Wtr-general] Carriage returns in textarea? In-Reply-To: <42B1D3E1.6020108@klickit.com> References: <252308cf05061612295cb479f7@mail.gmail.com> <42B1D3E1.6020108@klickit.com> Message-ID: <252308cf0506161412551c8b9b@mail.gmail.com> Ah - nuby error. I tried that, but with the single quote instead of double. D'oh! Thanks, Drew On 6/16/05, Alfred Whitehead <alf at klickit.com> wrote: > Hi Drew, > > Passing a string like "line one\nline two\nline three" to the set method > of the text field should work. The "\n"s will be converted to carriage > returns. > > Drew Cox wrote: > > >How do you add a carriage return to a textarea? > > > > > > > > -- > Alf Whitehead > Quality Assurance Specialist > alf at klickit.com > 416-214-4977 x260 > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From christopher.mcmahon at gmail.com Thu Jun 16 17:49:48 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 16 Jun 2005 15:49:48 -0600 Subject: [Wtr-general] Odd install problem Message-ID: <72799cd705061614491c2ed309@mail.gmail.com> Hi... I'm trying to install ruby/watir on a machine that recently had a virus. We've had issues like not being allowed to updated PATH. Currently trying to run any WATIR script yields the following message. Can anybody see what's wrong with this box? C:\dev_tools\watir\examples>ruby google_maps.rb C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:i such file to load -- watir/winClicker (LoadError) from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_re quire' from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:76 from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_re quire__' from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_re quire' from google_maps.rb:12 C:\dev_tools\watir\examples> From tuyet.ctn at mscibarra.com Thu Jun 16 22:47:20 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Thu, 16 Jun 2005 19:47:20 -0700 Subject: [Wtr-general] RE: Anyone has used AutoIT to deal with Windows Explorer "Choose File"? Message-ID: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D29@iris.win.barra.com> Thanks Paul and Jonathan for the code. My windows version has "Choose File" as well for title. > I am able to make it work if I run it in irb mode after I manually clicked > on the "Add a file" button to launch the "Choose File". > > However when I run my ruby script, after the "Choose File" is opened, it just hangs! > I tried to insert puts into the WindowHelper.rb code but I didn't see anything come out. I have > to do ctrl-break to get out of the "hanging" and get back to the command prompt. > I suspect it is trying to execute these commands that Paul suggested (which works fine in irb mode): > w = WindowHelper.new > w.set_filename_field('Import.csv') > > > I did try to put in the code that Jonathan suggested: > ie.file_field(:index,1).click, but got an error: > irb(main):018:0> ie.file_field(:index, 1).click > Watir::Exception::UnknownObjectException: Unable to locate object, using > index and 1 > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1979:in > `object_exist_check' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2094:in `click' > > > I am wondering if somehow the "Choose File" dialog is not activated?? > I also tried putting a sleep statement right before the w= > WindowHelper.new > just in case the Choose File is not "visible" yet, but no dice! > > Any thoughts? > From paul.rogers at shaw.ca Thu Jun 16 23:18:13 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 16 Jun 2005 21:18:13 -0600 Subject: [Wtr-general] RE: Anyone has used AutoIT to deal with Windows Explorer "Choose File"? In-Reply-To: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D29@iris.win.barra.com> Message-ID: <001001c572eb$320ef810$72d39044@NewDell> I think we sent part of a solution! Attached files contains the rest. Place the files in your unittests dir. Assumes you have already added the other method that was previously sent to windowhelper.rb file Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Tuyet Cong-Ton-Nu Sent: 16 June 2005 20:47 To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] RE: Anyone has used AutoIT to deal with Windows Explorer "Choose File"? Thanks Paul and Jonathan for the code. My windows version has "Choose File" as well for title. > I am able to make it work if I run it in irb mode after I manually > clicked on the "Add a file" button to launch the "Choose File". > > However when I run my ruby script, after the "Choose File" is opened, > it just hangs! > I tried to insert puts into the WindowHelper.rb code but I didn't see anything come out. I have > to do ctrl-break to get out of the "hanging" and get back to the > command prompt. > I suspect it is trying to execute these commands that Paul suggested (which works fine in irb mode): > w = WindowHelper.new > w.set_filename_field('Import.csv') > > > I did try to put in the code that Jonathan suggested: > ie.file_field(:index,1).click, but got an error: irb(main):018:0> > ie.file_field(:index, 1).click > Watir::Exception::UnknownObjectException: Unable to locate object, > using index and 1 > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1979:in > `object_exist_check' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2094:in `click' > > > I am wondering if somehow the "Choose File" dialog is not activated?? > I also tried putting a sleep statement right before the w= > WindowHelper.new just in case the Choose File is not "visible" yet, > but no dice! > > Any thoughts? > _______________________________________________ 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: set_file_field.rb Type: application/octet-stream Size: 306 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050616/e7998b49/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: upload_it.rb Type: application/octet-stream Size: 154 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050616/e7998b49/attachment-0001.obj From paul.rogers at shaw.ca Thu Jun 16 23:20:31 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 16 Jun 2005 21:20:31 -0600 Subject: [Wtr-general] RE: Anyone has used AutoIT to deal with WindowsExplorer "Choose File"? In-Reply-To: <001001c572eb$320ef810$72d39044@NewDell> Message-ID: <001a01c572eb$84b6a310$72d39044@NewDell> You need to run the set_file_field.rb to make it work -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: 16 June 2005 21:18 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] RE: Anyone has used AutoIT to deal with WindowsExplorer "Choose File"? I think we sent part of a solution! Attached files contains the rest. Place the files in your unittests dir. Assumes you have already added the other method that was previously sent to windowhelper.rb file Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Tuyet Cong-Ton-Nu Sent: 16 June 2005 20:47 To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] RE: Anyone has used AutoIT to deal with Windows Explorer "Choose File"? Thanks Paul and Jonathan for the code. My windows version has "Choose File" as well for title. > I am able to make it work if I run it in irb mode after I manually > clicked on the "Add a file" button to launch the "Choose File". > > However when I run my ruby script, after the "Choose File" is opened, > it just hangs! > I tried to insert puts into the WindowHelper.rb code but I didn't see anything come out. I have > to do ctrl-break to get out of the "hanging" and get back to the > command prompt. > I suspect it is trying to execute these commands that Paul suggested (which works fine in irb mode): > w = WindowHelper.new > w.set_filename_field('Import.csv') > > > I did try to put in the code that Jonathan suggested: > ie.file_field(:index,1).click, but got an error: irb(main):018:0> > ie.file_field(:index, 1).click > Watir::Exception::UnknownObjectException: Unable to locate object, > using index and 1 > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1979:in > `object_exist_check' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2094:in `click' > > > I am wondering if somehow the "Choose File" dialog is not activated?? > I also tried putting a sleep statement right before the w= > WindowHelper.new just in case the Choose File is not "visible" yet, > but no dice! > > Any thoughts? > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Jan.Montano at thomson.com Fri Jun 17 03:28:36 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Fri, 17 Jun 2005 15:28:36 +0800 Subject: [Wtr-general] Links Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE3C@tfphmanilmul01.ERF.THOMSON.COM> Hi! I need to access the LAST link in a page. I can't navigate thru the links array using ie.links. Please advise on what's the correct way of doing it.Thanks a lot. Jan M. Montano QA / Developer Regional Application Development Thomson (Philippines) Corporation 18th Floor Ayala Life - FGU Center 6811 Ayala Ave., Makati City Philippines (632) 878-5890 From zeljko.filipin at gmail.com Fri Jun 17 03:47:43 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Fri, 17 Jun 2005 09:47:43 +0200 Subject: [Wtr-general] Links In-Reply-To: <71EA7CA4B789864F9B3AC722A7F016B68DBE3C@tfphmanilmul01.ERF.THOMSON.COM> Message-ID: <42b27ff2.0c81df90.7c90.ffffe28e@mx.gmail.com> This should do it ie.link(:index, number_of_the_last_link).click Why can't navigate thru the links array using ie.links? Because in that case it would be easy to find number_of_the_last_link with ie.links.length. Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jan.Montano at thomson.com Sent: Friday, June 17, 2005 9:29 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Links Hi! I need to access the LAST link in a page. I can't navigate thru the links array using ie.links. Please advise on what's the correct way of doing it.Thanks a lot. Jan M. Montano QA / Developer Regional Application Development Thomson (Philippines) Corporation 18th Floor Ayala Life - FGU Center 6811 Ayala Ave., Makati City Philippines (632) 878-5890 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From ashetty at velozglobal.com Fri Jun 17 05:43:47 2005 From: ashetty at velozglobal.com (Amita Shetty) Date: Fri, 17 Jun 2005 04:43:47 -0500 Subject: [Wtr-general] Unable to locate an image and click Message-ID: <48966054EF494649A988314F1C8307731CA9F7@DC1Mail01> Thanks. It worked. -----Original Message----- From: wtr-general-bounces at rubyforge.org on behalf of jkohl at telusplanet.net Sent: Thu 6/16/2005 2:11 PM To: wtr-general at rubyforge.org Cc: Subject: Re: [Wtr-general] Unable to locate an image and click Did you try fire_event("onclick") on the image? The onclick seems to be what is opening the window. ie.image(:src, /menu_reports.gif/).fire_event("onclick") -Jonathan Quoting Amita Shetty <ashetty at velozglobal.com>: > I am not able to click on an image to view the popup. I am not able to do it > even with the URL. > Is this due to watir version? My watir version is watir_v1_31. > > The following is the HTML code: > > onclick="MM_openBrWindow('./ReportController.do? reportId=3&reportCategory=EO&reportType=EOScorecard&eoInstanceId=614 3&eoid=110&eoName=SystemEDGE > NT System&eoInstanceName=AHA-AHAMAIL1-SH','','width=800, height=600, > scrollbars=yes')" > href="" > src="test_files/menu_reports.gif" > border=0></A>  <A > > Thanks, > Amitha > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5402 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050617/71695d01/attachment.bin From cafedelamar at yahoo.com Fri Jun 17 13:25:19 2005 From: cafedelamar at yahoo.com (L de la Mar) Date: Fri, 17 Jun 2005 10:25:19 -0700 (PDT) Subject: [Wtr-general] RE: Anyone has used AutoIT to deal with Windows Explorer "Choose File"? Message-ID: <20050617172519.78106.qmail@web53802.mail.yahoo.com> Could someone please tell me where to find WindowHelper.rb ? Tanks, Loren __________________________________ Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html From tuyet.ctn at mscibarra.com Fri Jun 17 15:25:24 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Fri, 17 Jun 2005 12:25:24 -0700 Subject: [Wtr-general] RE: Anyone has used AutoIT to deal with Windows Explorer "Choose File"? SUCCESS Message-ID: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D2E@iris.win.barra.com> Thanks, Paul and Jonathan. I did as you suggested and ran set_file_field.rb and it works perfectly in unittests! Then, I incorporated the code into my login.rb file and IT WORKS! WOWEE! Thanks so much! From exortech at gmail.com Sat Jun 18 11:57:31 2005 From: exortech at gmail.com (Owen Rogers) Date: Sat, 18 Jun 2005 11:57:31 -0400 Subject: [Wtr-general] form flooding in watir Message-ID: <d125f85d050618085716fbd768@mail.gmail.com> apologies if this question has been asked before (i've just joined the mailing list). has anyone written code to do form flooding [1] with watir. i tried out FormFlood [2], but as it relies strictly on parsing the http response, it doesn't support pages with javascript. i was just curious if anyone has written an extension to watir to do something similar? cheers, owen. [1] by form flooding i mean randomly inserting predefined text into form fields and randomly navigating through the site with the goal to produce errors [2] http://formflood.sourceforge.net/ -- Owen Rogers | http://dotnetjunkies.com/weblog/exortech | CruiseControl.NET - http://ccnet.thoughtworks.com From paul.rogers at shaw.ca Sat Jun 18 12:58:51 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sat, 18 Jun 2005 10:58:51 -0600 Subject: [Wtr-general] RE: Anyone has used AutoIT to deal with Windows Explorer "Choose File"? In-Reply-To: <20050617172519.78106.qmail@web53802.mail.yahoo.com> Message-ID: <000e01c57427$00ae59e0$72d39044@NewDell> Its normally C:\ruby\lib\ruby\site_ruby\1.8\watir\WindowHelper.rb Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of L de la Mar Sent: 17 June 2005 11:25 To: wtr-general at rubyforge.org Subject: [Wtr-general] RE: Anyone has used AutoIT to deal with Windows Explorer "Choose File"? Could someone please tell me where to find WindowHelper.rb ? Tanks, Loren __________________________________ Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Sat Jun 18 13:04:35 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sat, 18 Jun 2005 11:04:35 -0600 Subject: [Wtr-general] Manipulating a new IE window created with javascript In-Reply-To: <OMECJNMKDCKGNJGAFKKAIEFJCCAA.sboland@shiftwise.net> Message-ID: <000f01c57427$cdc47cc0$72d39044@NewDell> I think this may be related to the way the IE object is created when using attach. I would use the following x=Watir::IE.attach(:url , /order/) Rather than the 2 lines you currently have Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Scott Boland - Origin Sent: 16 June 2005 11:23 To: wtr-general at rubyforge.org Subject: [Wtr-general] Manipulating a new IE window created with javascript I've encountered a puzzlement after successfully attaching to a new window. The attachment appears to succeed, but after doing this the object loses all access to the Watir:IE methods to inspect and manipulate the controls. I am performing operations in irb. The sequence goes like this. 1) Locate the link on the page and assign it to link The link href is "javascript:OpenWindow(\"order.aspx?order_id=E4A7A647C0BAED47\")" 2) Make use of the link by clicking it using link.click A new window opens without the standard ie controls visible. No toolbar or address entry area. 3) Attach a new Watir::IE object. irb(main):285:0> x = Watir::IE => Watir::IE irb(main):286:0> x.attach( :url, /order_id=E4A7A647C0BAED47/ ) => #<Watir::IE:0x2b3a108 @typingspeed=0.08, @activeObjectHighLightColor="yellow" , @form=nil, @url_list=[], @logger=#<Watir::DefaultLogger:0x2b399e8 @progname=ni l, @logdev=#<Logger::LogDevice:0x2b39088 @dev=#<IO:0x278e7d0>, @shift_size=nil, @shift_age=nil, @filename=nil>, @level=2, @datetime_format="%d-%b-%Y %H:%M:%S">, @error_checkers=[#<Proc:0x02abeb08 at D:/Coding/Ruby/Ruby_1.8.2-15/lib/ruby /s ite_r uby/1.8/watir.rb:1213>], @defaultSleepTime=0.1, @enable_spinner=false, @ie=#<WIN 32OLE:0x2b39f58>> At this point x is attached to the window apparently. But now all the normal methods to show objects or manipulate them are gone. It's class has become 'Class' instead of Watir::IE. irb(main):287:0> x.methods => ["send", "name", "start", "class_eval", "attach", "object_id", "new", "singleton_methods", "__send__", "private_method_defined?", "equal?", "taint", "frozen?", "instance_variable_get", "constants", "kind_of?", "to_a", "instance_eval", "require", "ancestors", "const_missing", "type", "instance_methods", "protected_methods", "extend", "protected_method_defined?", "eql?", "public_class_method", "const_get", "instance_variable_set", "hash", "is_a?", "autoload", "to_s", "class_variables", "class", "tainted?", "private_methods", "public_instance_methods", "instance_method", "require_gem_with_options", "untaint", "included_modules", "private_class_method", "const_set", "id", "<", "inspect", "<=>", "==", "method_defined?", ">", "===", "clone", "public_methods", "protected_instance_methods", ">=", "respond_to?", "display", "freeze", "<=", "module_eval", "autoload?", "allocate", "__id__", "=~", "methods", "require_gem", "method", "public_method_defined?", "superclass", "nil?", "dup", "private_instance_methods", "instance_variables", "include?", "const_defined?", "instance_of?"] I'm new to Watir and Ruby in general, but I'm hoping somebody on this list can clue me in to what is going on and how I can fix it. -- Scott B _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Jan.Montano at thomson.com Sun Jun 19 22:54:33 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Mon, 20 Jun 2005 10:54:33 +0800 Subject: [Wtr-general] Links Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE3E@tfphmanilmul01.ERF.THOMSON.COM> It's working now. Thanks! -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Zeljko Filipin Sent: Friday, June 17, 2005 3:48 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Links This should do it ie.link(:index, number_of_the_last_link).click Why can't navigate thru the links array using ie.links? Because in that case it would be easy to find number_of_the_last_link with ie.links.length. Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jan.Montano at thomson.com Sent: Friday, June 17, 2005 9:29 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Links Hi! I need to access the LAST link in a page. I can't navigate thru the links array using ie.links. Please advise on what's the correct way of doing it.Thanks a lot. Jan M. Montano QA / Developer Regional Application Development Thomson (Philippines) Corporation 18th Floor Ayala Life - FGU Center 6811 Ayala Ave., Makati City Philippines (632) 878-5890 _______________________________________________ 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 Jan.Montano at thomson.com Mon Jun 20 02:47:45 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Mon, 20 Jun 2005 14:47:45 +0800 Subject: [Wtr-general] Popup window was blocked Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE3F@tfphmanilmul01.ERF.THOMSON.COM> Hi! I have a problem simulating my test script because of the 'popup window was blocked' message. I'm using IE6 sp2 and I have a popup blocker. However during my tests, I disabled the popup blocker. I even included in the filter, my test site so that when the popup blocker is enabled, i will have no problem with popups regarding my test site upon clicking a link. When I click a link, a new page will spawn and this is where my problem occurs. Supposedly, there should be no problem with this. And this problem only occurs using my test script. When manually done, I mean manually clicking the link of my test site, that popup window message will not appear. Have you encountered similar problems like this one? Thanks! Jan M. Montano Lead QA / Developer Regional Application Development Thomson (Philippines) Corporation 18th Floor Ayala Life - FGU Center 6811 Ayala Ave., Makati City Philippines (632) 878-5890 From Jan.Montano at thomson.com Mon Jun 20 02:51:42 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Mon, 20 Jun 2005 14:51:42 +0800 Subject: [Wtr-general] Popup window was blocked Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE40@tfphmanilmul01.ERF.THOMSON.COM> btw, I've only encountered this the first time. The only difference is that these links are in a frame. I'm executing this code when 'popup window was blocked message' appears. $ie.frame('frContent').link(:url, link_of_news).click and the i.e. just reads and reads not knowing what to output. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Montano, Jan (Corp,IB&IM) Sent: Monday, June 20, 2005 2:48 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Popup window was blocked Hi! I have a problem simulating my test script because of the 'popup window was blocked' message. I'm using IE6 sp2 and I have a popup blocker. However during my tests, I disabled the popup blocker. I even included in the filter, my test site so that when the popup blocker is enabled, i will have no problem with popups regarding my test site upon clicking a link. When I click a link, a new page will spawn and this is where my problem occurs. Supposedly, there should be no problem with this. And this problem only occurs using my test script. When manually done, I mean manually clicking the link of my test site, that popup window message will not appear. Have you encountered similar problems like this one? Thanks! Jan M. Montano Lead QA / Developer Regional Application Development Thomson (Philippines) Corporation 18th Floor Ayala Life - FGU Center 6811 Ayala Ave., Makati City Philippines (632) 878-5890 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Jan.Montano at thomson.com Mon Jun 20 03:39:59 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Mon, 20 Jun 2005 15:39:59 +0800 Subject: [Wtr-general] Popup window was blocked Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE41@tfphmanilmul01.ERF.THOMSON.COM> hi! my fault. It seems that I have a yahoo pop up enabled and this was the one causing the blocking. Sorry for the trouble. Thanks! -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Montano, Jan (Corp,IB&IM) Sent: Monday, June 20, 2005 2:52 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Popup window was blocked btw, I've only encountered this the first time. The only difference is that these links are in a frame. I'm executing this code when 'popup window was blocked message' appears. $ie.frame('frContent').link(:url, link_of_news).click and the i.e. just reads and reads not knowing what to output. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Montano, Jan (Corp,IB&IM) Sent: Monday, June 20, 2005 2:48 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Popup window was blocked Hi! I have a problem simulating my test script because of the 'popup window was blocked' message. I'm using IE6 sp2 and I have a popup blocker. However during my tests, I disabled the popup blocker. I even included in the filter, my test site so that when the popup blocker is enabled, i will have no problem with popups regarding my test site upon clicking a link. When I click a link, a new page will spawn and this is where my problem occurs. Supposedly, there should be no problem with this. And this problem only occurs using my test script. When manually done, I mean manually clicking the link of my test site, that popup window message will not appear. Have you encountered similar problems like this one? Thanks! Jan M. Montano Lead QA / Developer Regional Application Development Thomson (Philippines) Corporation 18th Floor Ayala Life - FGU Center 6811 Ayala Ave., Makati City Philippines (632) 878-5890 _______________________________________________ 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 Jan.Montano at thomson.com Mon Jun 20 03:59:49 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Mon, 20 Jun 2005 15:59:49 +0800 Subject: [Wtr-general] Http streaming Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE42@tfphmanilmul01.ERF.THOMSON.COM> I have a problem with this one. Hope you'll be able to help. upon clicking a link on a page, a second page appears. However, http streaming is applied on this and thus, the first page always reads and is always busy. take this code for example: $ie.link(:url,test_link).click this method always wait because the page is always reading... Is there a word arouund here? Jan M. Montano Lead QA / Developer Regional Application Development Thomson (Philippines) Corporation 18th Floor Ayala Life - FGU Center 6811 Ayala Ave., Makati City Philippines (632) 878-5890 From christopher.mcmahon at gmail.com Mon Jun 20 09:17:37 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 20 Jun 2005 07:17:37 -0600 Subject: [Wtr-general] Popup window was blocked In-Reply-To: <71EA7CA4B789864F9B3AC722A7F016B68DBE41@tfphmanilmul01.ERF.THOMSON.COM> References: <71EA7CA4B789864F9B3AC722A7F016B68DBE41@tfphmanilmul01.ERF.THOMSON.COM> Message-ID: <72799cd705062006175d0fe77f@mail.gmail.com> On 6/20/05, Jan.Montano at thomson.com <Jan.Montano at thomson.com> wrote: > hi! my fault. It seems that I have a yahoo pop up enabled and this was the one causing the blocking. Sorry for the trouble. Thanks! I've had this problem, too, and it's really frustrating. The Yahoo Messenger installation also installs a popup blocker without telling the user that it's doing it. Maybe add this to the FAQ? -Chris From christopher.mcmahon at gmail.com Mon Jun 20 10:14:20 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 20 Jun 2005 08:14:20 -0600 Subject: [Wtr-general] New Windows command shell "Monad" Message-ID: <72799cd705062007143bfae8ca@mail.gmail.com> Hi... I ran across a link to this on slashdot. Looks like MS is (finally) going to beef up the command shell. Good news for scripters, but I wonder if this will have any impact on other scripting languages used in Windows? http://channel9.msdn.com/wiki/default.aspx/Channel9.MSHWiki -Chris From Kevin.Williams at Level3.com Mon Jun 20 14:46:45 2005 From: Kevin.Williams at Level3.com (Williams, Kevin) Date: Mon, 20 Jun 2005 12:46:45 -0600 Subject: [Wtr-general] Command-line args and authentication Message-ID: <F471782CD383EF43BE648A4AA0B808A158E1EC@idc1exc0003.corp.global.level3.com> Hello all, I just started evaluating Watir today. :) I'm using it from Fitnesse, and passing "-b" as an argument to the Fit server doesn't seem to work. Is there another way to run it without IE windows popping up all over? Also, I'm not seeing a way to specify any authentication. Am I missing something? Cheers, Kevin From alf at klickit.com Mon Jun 20 14:57:12 2005 From: alf at klickit.com (Alfred Whitehead) Date: Mon, 20 Jun 2005 14:57:12 -0400 Subject: [Wtr-general] Command-line args and authentication In-Reply-To: <F471782CD383EF43BE648A4AA0B808A158E1EC@idc1exc0003.corp.global.level3.com> References: <F471782CD383EF43BE648A4AA0B808A158E1EC@idc1exc0003.corp.global.level3.com> Message-ID: <42B71188.5020207@klickit.com> Williams, Kevin wrote: >I'm using it from Fitnesse, and passing "-b" as an argument to the Fit >server doesn't seem to work. Is there another way to run it without IE >windows popping up all over? > > Hi Kevin, Try setting $HIDE_IE = true before instantiating the Watir::IE object. This is what Watir does internally when you specify the -b flag. -- Alf Whitehead <alf at klickit.com> Quality Assurance Specialist Klick Communications, http://klick.com/ From Kevin.Williams at Level3.com Mon Jun 20 15:01:38 2005 From: Kevin.Williams at Level3.com (Williams, Kevin) Date: Mon, 20 Jun 2005 13:01:38 -0600 Subject: [Wtr-general] Command-line args and authentication Message-ID: <F471782CD383EF43BE648A4AA0B808A158E1ED@idc1exc0003.corp.global.level3.com> Excellent! Many thanks! -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alfred Whitehead Sent: Monday, June 20, 2005 12:57 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Command-line args and authentication Williams, Kevin wrote: >I'm using it from Fitnesse, and passing "-b" as an argument to the Fit >server doesn't seem to work. Is there another way to run it without IE >windows popping up all over? > > Hi Kevin, Try setting $HIDE_IE = true before instantiating the Watir::IE object. This is what Watir does internally when you specify the -b flag. -- Alf Whitehead <alf at klickit.com> Quality Assurance Specialist Klick Communications, http://klick.com/ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From sboland at shiftwise.net Mon Jun 20 17:05:59 2005 From: sboland at shiftwise.net (Scott Boland - Origin) Date: Mon, 20 Jun 2005 16:05:59 -0500 Subject: [Wtr-general] RE:Manipulating a new IE window created with javascript In-Reply-To: <200506201843.j5KIhAcS027855@rubyforge.org> Message-ID: <OMECJNMKDCKGNJGAFKKAEEGCCCAA.sboland@shiftwise.net> I successfully managed a workaround for this problem, but your solution is obviously superior to the one I used. I wound up using the undocumented creation with a boolean true and then using attach_init(). new = Watir::IE.new(true) new.attach_init( :url, re) The problem is that the examples from the user guide are so incomplete as to prove useless. They work _only_ if you have an existing ie controller that you wish to give up in favor of the new attachment. Creating a new ie controller that is not already attached is an undocumented process. >From the Manual: New Windows Some web applications will have popup windows or new windows that contain HTML. Watir has an attach method that allows you to access and control the new window. If you click a button or link that opens a new window, you can attach to it by identifying the window by its URL or by the Window title: $new_window.attach(:url, 'http://mytestsite') $new_window.attach(:title, 'Test New Window') Correction for the Manual: New Windows Some web applications will have popup windows or new windows that contain HTML. Watir has an attach method that allows you to access and control the new window. If you click a button or link that opens a new window, you can attach to it by identifying the window by its URL or by the Window title: new_window = Watir::IE.attach(:url , 'http://mytestsite') new_window = Watir::IE.attach(:title, 'Test New Window') From sboland at shiftwise.net Mon Jun 20 17:26:34 2005 From: sboland at shiftwise.net (Scott Boland - Origin) Date: Mon, 20 Jun 2005 16:26:34 -0500 Subject: [Wtr-general] Need advice on navigating a complex web page In-Reply-To: <200506201843.j5KIhAcS027855@rubyforge.org> Message-ID: <OMECJNMKDCKGNJGAFKKAEEGDCCAA.sboland@shiftwise.net> The web site I am trying to test has buttons within table cells within tables within tables. Trying to navigate to a sub-element and then using it successfully is tricky at best. The top level search and show functions become unavailable as soon as you are dealing with a table, tablerow, or tablecell. Since the app doesn't uniquely identify buttons, I wind up having to figure out the right index value and use that instead. What I would like to do is locate the table and row that I need, then perform a find to locate the button on that particular tablerow, tablecell, or span. Non-Working Examples: ie.table(:index, 3)[3].show_buttons ie.table(:index, 2)[4][8].button( :name, '').click ie.table(:index, 3).show_links .. etc If there is already a way of performing this kind of navigation, I'd appreciate any help required to make use of it. If it doesn't exist, any suggestions on how best to add it? -- Scott B From tuyet.ctn at mscibarra.com Mon Jun 20 19:35:48 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Mon, 20 Jun 2005 16:35:48 -0700 Subject: [Wtr-general] Run a ruby script 50 times Message-ID: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D4F@iris.win.barra.com> I have a login.rb script that I'd like to execute 50 times in a row. What's the best way to do this? From Jan.Montano at thomson.com Mon Jun 20 21:12:32 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Tue, 21 Jun 2005 09:12:32 +0800 Subject: [Wtr-general] Popup window was blocked Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE43@tfphmanilmul01.ERF.THOMSON.COM> yeah! I guess that's a good idea. So that next time, users won't have a hard time analyzing what went wrong. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Chris McMahon Sent: Monday, June 20, 2005 9:18 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Popup window was blocked On 6/20/05, Jan.Montano at thomson.com <Jan.Montano at thomson.com> wrote: > hi! my fault. It seems that I have a yahoo pop up enabled and this was the one causing the blocking. Sorry for the trouble. Thanks! I've had this problem, too, and it's really frustrating. The Yahoo Messenger installation also installs a popup blocker without telling the user that it's doing it. Maybe add this to the FAQ? -Chris _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From shaorobics at gmail.com Mon Jun 20 21:49:12 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Mon, 20 Jun 2005 21:49:12 -0400 Subject: [Wtr-general] Need advice on navigating a complex web page In-Reply-To: <OMECJNMKDCKGNJGAFKKAEEGDCCAA.sboland@shiftwise.net> References: <200506201843.j5KIhAcS027855@rubyforge.org> <OMECJNMKDCKGNJGAFKKAEEGDCCAA.sboland@shiftwise.net> Message-ID: <593b9ae805062018496231d736@mail.gmail.com> if I'm reading this right, you have a table with many rows and columns. Each row probably contains a button or link or something in some determined column and you want to access that button/link on that particular row in that particular column...right? If so, I know what to do in that case, if not, nevermind :) Shao On 6/20/05, Scott Boland - Origin <sboland at shiftwise.net> wrote: > > The web site I am trying to test has buttons within table cells within > tables within tables. Trying to navigate to a sub-element and then using it > successfully is tricky at best. > > The top level search and show functions become unavailable as soon as you > are dealing with a table, tablerow, or tablecell. Since the app doesn't > uniquely identify buttons, I wind up having to figure out the right index > value and use that instead. > > What I would like to do is locate the table and row that I need, then > perform a find to locate the button on that particular tablerow, tablecell, > or span. > > Non-Working Examples: > ie.table(:index, 3)[3].show_buttons > ie.table(:index, 2)[4][8].button( :name, '').click > ie.table(:index, 3).show_links > .. etc > > If there is already a way of performing this kind of navigation, I'd > appreciate any help required to make use of it. If it doesn't exist, any > suggestions on how best to add it? > > > -- Scott B > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From jfry at lyris.com Mon Jun 20 21:52:46 2005 From: jfry at lyris.com (Jeff Fry) Date: Mon, 20 Jun 2005 18:52:46 -0700 Subject: [Wtr-general] Run a ruby script 50 times In-Reply-To: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D4F@iris.win.barra.com> References: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D4F@iris.win.barra.com> Message-ID: <42B772EE.5030907@lyris.com> Tuyet Cong-Ton-Nu wrote: >I have a login.rb script that I'd like to execute 50 times in a row. >What's the best way to do this? > > One flexible option I've used: $MAX_ITERATIONS = 50 # will go forever if == -1 ... while (i <= $MAX_ITERATIONS || $MAX_ITERATIONS == -1 ) # run until interrupted if MAX == -1 check_members() if i.quo(10) == i.div(10) # puts every 10th success t = Time.now puts t.strftime("%c") + ": admin & login still correct as of try "+ i.to_s end i+=1 end Given how little I know coding in general and ruby in particular, I would trust that there are many more elegant ways to do this, but this worked quite well for me. BTW, the only things outside of this while loop in my case were variable, constant & method definitions, plus IE.start & IE.close. Jeff Fry From sboland at shiftwise.net Mon Jun 20 22:06:23 2005 From: sboland at shiftwise.net (Scott Boland - Origin) Date: Mon, 20 Jun 2005 21:06:23 -0500 Subject: [Wtr-general] Re: Need advice on navigating a complex web page Message-ID: <OMECJNMKDCKGNJGAFKKAIEGFCCAA.sboland@shiftwise.net> > if I'm reading this right, you have a table with many rows and > columns. Each row probably contains a button or link or something in > some determined column and you want to access that button/link on that > particular row in that particular column...right? > If so, I know what to do in that case, if not, nevermind :) > Shao That is certainly one of the things I need to do. I know how to pull the innner table from the cell in the outer table and then to find the row of the button in question, but pulling it up as an object that can be manipulated is a bit more difficult. So far I have to pull up the html code directly and parse that. Surely there is a better way. -- Scott B From jfry at lyris.com Mon Jun 20 22:18:29 2005 From: jfry at lyris.com (Jeff Fry) Date: Mon, 20 Jun 2005 19:18:29 -0700 Subject: [Wtr-general] Run a ruby script 50 times In-Reply-To: <42B772EE.5030907@lyris.com> References: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D4F@iris.win.barra.com> <42B772EE.5030907@lyris.com> Message-ID: <42B778F5.6070208@lyris.com> As an aside, this is from a script that I used to consistantly reproduce a very rare but very serious occational issue we were seeing. I have isolated several formerly "non-reproducible" issues using this and similiar watir scripts - for me this has been the biggest "bang for the buck" of my watir scripting thus far. Jeff ===== Jeff Fry wrote: > Tuyet Cong-Ton-Nu wrote: > >> I have a login.rb script that I'd like to execute 50 times in a row. >> What's the best way to do this? >> >> > One flexible option I've used: > > $MAX_ITERATIONS = 50 # will go forever if == -1 > > ... > > while (i <= $MAX_ITERATIONS || $MAX_ITERATIONS == -1 ) # run until > interrupted if MAX == -1 > check_members() > if i.quo(10) == i.div(10) # puts every 10th success > t = Time.now > puts t.strftime("%c") + ": admin & login still > correct as of try "+ i.to_s > end > i+=1 > end > > Given how little I know coding in general and ruby in particular, I > would trust that there are many more elegant ways to do this, but this > worked quite well for me. > > BTW, the only things outside of this while loop in my case were > variable, constant & method definitions, plus IE.start & IE.close. > > Jeff Fry From Jan.Montano at thomson.com Mon Jun 20 22:19:13 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Tue, 21 Jun 2005 10:19:13 +0800 Subject: [Wtr-general] interrupt waiting of IE. Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE44@tfphmanilmul01.ERF.THOMSON.COM> Is there a way to interrupt or not wait for the IE to finish loading a page? I have this link which opens a new page, and the main page still does some processing although the new page is finished loading. I need to get pass through the click method without even waiting for the processing to complete. Any ideas? Could I just pass an additional parameter on the click method of link so that It won't wait? please Advise. Thank you very much! Jan M. Montano QA / Developer Regional Application Development Thomson (Philippines) Corporation 18th Floor Ayala Life - FGU Center 6811 Ayala Ave., Makati City Philippines (632) 878-5890 From bret at pettichord.com Mon Jun 20 22:36:59 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 20 Jun 2005 21:36:59 -0500 Subject: [Wtr-general] form flooding in watir In-Reply-To: <d125f85d050618085716fbd768@mail.gmail.com> Message-ID: <5.1.0.14.2.20050620213614.037e4e70@127.0.0.1> This is a new idea to the Watir world. Hmm. Flooding with Watir... I like the sound of it... At 10:57 AM 6/18/2005, Owen Rogers wrote: >apologies if this question has been asked before (i've just joined the >mailing list). > >has anyone written code to do form flooding [1] with watir. i tried >out FormFlood [2], but as it relies strictly on parsing the http >response, it doesn't support pages with javascript. i was just >curious if anyone has written an extension to watir to do something >similar? > >cheers, >owen. > >[1] by form flooding i mean randomly inserting predefined text into >form fields and randomly navigating through the site with the goal to >produce errors >[2] http://formflood.sourceforge.net/ >-- >Owen Rogers | http://dotnetjunkies.com/weblog/exortech | >CruiseControl.NET - http://ccnet.thoughtworks.com > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Mon Jun 20 22:39:08 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 20 Jun 2005 21:39:08 -0500 Subject: [Wtr-general] Popup window was blocked In-Reply-To: <72799cd705062006175d0fe77f@mail.gmail.com> References: <71EA7CA4B789864F9B3AC722A7F016B68DBE41@tfphmanilmul01.ERF.THOMSON.COM> <71EA7CA4B789864F9B3AC722A7F016B68DBE41@tfphmanilmul01.ERF.THOMSON.COM> Message-ID: <5.1.0.14.2.20050620213858.037f6238@127.0.0.1> At 08:17 AM 6/20/2005, Chris McMahon wrote: > I've had this problem, too, and it's really frustrating. The >Yahoo Messenger installation also installs a popup blocker without >telling the user that it's doing it. > Maybe add this to the FAQ? good idea. _____________________ Bret Pettichord www.pettichord.com From shaorobics at gmail.com Mon Jun 20 22:53:05 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Mon, 20 Jun 2005 22:53:05 -0400 Subject: [Wtr-general] Re: Need advice on navigating a complex web page In-Reply-To: <OMECJNMKDCKGNJGAFKKAIEGFCCAA.sboland@shiftwise.net> References: <OMECJNMKDCKGNJGAFKKAIEGFCCAA.sboland@shiftwise.net> Message-ID: <593b9ae805062019536a3d5cd3@mail.gmail.com> ok well in that case, it is almost exactly as what I've been doing...finding links/buttons/checkboxes in certain rows & columns of tables, and pulling the object out to play with. Seeing as how you already know how to get the table, let's just say your table is called "t". row = whatever calculation you need to do to get the correct row col = whatever calculation you need to do to get the correct column thisButton = t[row][col].button(:id, //) # assuming that there is only one button in that cell, this should work, as it does for me, alternatively you can put in the exact button ID or a partial of that ID if you know it, for example .button(:id, /clickme_/) # now you can take that button object and do stuff to it like: thisButton.click() ...this works for checkboxes and links and other objects too that I've tried. For example, in my apps, I have rows of products and sometimes i want to check off certain things for a particular product. Good luck. Shao On 6/20/05, Scott Boland - Origin <sboland at shiftwise.net> wrote: > > > if I'm reading this right, you have a table with many rows and > > columns. Each row probably contains a button or link or something in > > some determined column and you want to access that button/link on that > > particular row in that particular column...right? > > > If so, I know what to do in that case, if not, nevermind :) > > > Shao > > That is certainly one of the things I need to do. I know how to pull the > innner table from the cell in the outer table and then to find the row of > the button in question, but pulling it up as an object that can be > manipulated is a bit more difficult. So far I have to pull up the html code > directly and parse that. Surely there is a better way. > > -- Scott B > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From christopher.mcmahon at gmail.com Mon Jun 20 23:15:24 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 20 Jun 2005 22:15:24 -0500 Subject: Watir puns Re: [Wtr-general] form flooding in watir In-Reply-To: <5.1.0.14.2.20050620213614.037e4e70@127.0.0.1> References: <d125f85d050618085716fbd768@mail.gmail.com> <5.1.0.14.2.20050620213614.037e4e70@127.0.0.1> Message-ID: <72799cd705062020153f92b06@mail.gmail.com> OK, I've been restraining myself, but this is too much. On 6/20/05, Bret Pettichord <bret at pettichord.com> wrote: > This is a new idea to the Watir world. Hmm. Flooding with Watir... I like > the sound of it... The catalog so far... Making Watir (Pettichord blog) Watir works (Kohl/Rogers in Better Software) Running Watir (Kohl/Rogers in Better Software) Lead a horse (mule) to Watir (Hendrickson blog) And now, flooding in Watir What's next? Blood is thicker than Watir? Watir under the bridge? Deep Watir? Everybody who hasn't published a blog entry or magazine article with a Watir pun, please raise your hand... =) -Chris From exortech at gmail.com Tue Jun 21 07:48:17 2005 From: exortech at gmail.com (Owen Rogers) Date: Tue, 21 Jun 2005 07:48:17 -0400 Subject: [Wtr-general] tracking page load times and request size with watir Message-ID: <d125f85d050621044848d62e7@mail.gmail.com> i'm interested in using watir to track the time it takes each page to load and the size of the returned http request. we have certain standard targets that our pages must meet (load in less than 4s in the dev/test environment, and should be small enough to support users over a dial-up connection) that i would like to bake into our automated test suite. does watir support this? if not, any suggestions on where i should begin looking to add in this functionality? cheers, owen. -- Owen Rogers | http://dotnetjunkies.com/weblog/exortech | CruiseControl.NET - http://ccnet.thoughtworks.com From paul.rogers at shaw.ca Tue Jun 21 09:52:29 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 21 Jun 2005 07:52:29 -0600 Subject: [Wtr-general] tracking page load times and request size with watir In-Reply-To: <d125f85d050621044848d62e7@mail.gmail.com> Message-ID: <001a01c57668$77080da0$72d39044@NewDell> Every time a page reloads, the @down_load_time variable shold contain the time it took to download So you can do this: ie.goto('http://google.com') puts "Google load time: #{ie.down_load_time) seconds" There is also a @pageHasReloaded variable that will tell yo if the page has reloaded. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Owen Rogers Sent: 21 June 2005 05:48 To: wtr-general at rubyforge.org Subject: [Wtr-general] tracking page load times and request size with watir i'm interested in using watir to track the time it takes each page to load and the size of the returned http request. we have certain standard targets that our pages must meet (load in less than 4s in the dev/test environment, and should be small enough to support users over a dial-up connection) that i would like to bake into our automated test suite. does watir support this? if not, any suggestions on where i should begin looking to add in this functionality? cheers, owen. -- Owen Rogers | http://dotnetjunkies.com/weblog/exortech | CruiseControl.NET - http://ccnet.thoughtworks.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From exortech at gmail.com Tue Jun 21 10:00:22 2005 From: exortech at gmail.com (Owen Rogers) Date: Tue, 21 Jun 2005 10:00:22 -0400 Subject: [Wtr-general] tracking page load times and request size with watir In-Reply-To: <001a01c57668$77080da0$72d39044@NewDell> References: <d125f85d050621044848d62e7@mail.gmail.com> <001a01c57668$77080da0$72d39044@NewDell> Message-ID: <d125f85d050621070077aa5b69@mail.gmail.com> thanks paul! what about determining the size of the http response? any suggestions there? cheers, owen. On 6/21/05, Paul Rogers <paul.rogers at shaw.ca> wrote: > Every time a page reloads, the @down_load_time variable shold contain > the time it took to download > > So you can do this: > > ie.goto('http://google.com') > puts "Google load time: #{ie.down_load_time) seconds" > > There is also a @pageHasReloaded variable that will tell yo if the page > has reloaded. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Owen Rogers > Sent: 21 June 2005 05:48 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] tracking page load times and request size with > watir > > > i'm interested in using watir to track the time it takes each page to > load and the size of the returned http request. we have certain > standard targets that our pages must meet (load in less than 4s in the > dev/test environment, and should be small enough to support users over a > dial-up connection) that i would like to bake into our automated test > suite. does watir support this? if not, any suggestions on where i > should begin looking to add in this functionality? cheers, owen. > > -- > Owen Rogers | http://dotnetjunkies.com/weblog/exortech | > CruiseControl.NET - http://ccnet.thoughtworks.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- Owen Rogers | http://dotnetjunkies.com/weblog/exortech | CruiseControl.NET - http://ccnet.thoughtworks.com From paul.rogers at shaw.ca Tue Jun 21 12:00:01 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 21 Jun 2005 10:00:01 -0600 Subject: [Wtr-general] tracking page load times and request size with watir In-Reply-To: <d125f85d050621070077aa5b69@mail.gmail.com> Message-ID: <001d01c5767a$47e058e0$72d39044@NewDell> I don't think we get access to the raw headers. The only thing I can suggest is you get the size of the retreived doc, and base your calculations on that doc_size = ie.html.length Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Owen Rogers Sent: 21 June 2005 08:00 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] tracking page load times and request size with watir thanks paul! what about determining the size of the http response? any suggestions there? cheers, owen. On 6/21/05, Paul Rogers <paul.rogers at shaw.ca> wrote: > Every time a page reloads, the @down_load_time variable shold contain > the time it took to download > > So you can do this: > > ie.goto('http://google.com') > puts "Google load time: #{ie.down_load_time) seconds" > > There is also a @pageHasReloaded variable that will tell yo if the > page has reloaded. > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Owen Rogers > Sent: 21 June 2005 05:48 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] tracking page load times and request size with > watir > > > i'm interested in using watir to track the time it takes each page to > load and the size of the returned http request. we have certain > standard targets that our pages must meet (load in less than 4s in the > dev/test environment, and should be small enough to support users over > a dial-up connection) that i would like to bake into our automated > test suite. does watir support this? if not, any suggestions on where > i should begin looking to add in this functionality? cheers, owen. > > -- > Owen Rogers | http://dotnetjunkies.com/weblog/exortech | > CruiseControl.NET - http://ccnet.thoughtworks.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- Owen Rogers | http://dotnetjunkies.com/weblog/exortech | CruiseControl.NET - http://ccnet.thoughtworks.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Tue Jun 21 11:59:48 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 21 Jun 2005 10:59:48 -0500 Subject: [Wtr-general] Test Scripting with Watir at Agile 2005 Denver Message-ID: <5.1.0.14.2.20050621105808.020cfd50@127.0.0.1> I am looking for people to assist me with an automated testing class i'm teaching at the Agile 2005 conference in Denver. Paul Rogers had originally committed to teaching it with me, but he's had to cancel, and we were going to need a bit of additional help anyway. It's a half-day tutorial called "Scripting Web Tests," to be held Wednesday morning, July 27. This class is based on Watir and Ruby, and we need people with some familiarity with both. It's a hands-on class, where students bring laptops and we provide a CD with all the software they need. Because it's a hands-on class we really need assistants to help students when they get stuck. This is actually a really fun class. I've been teaching it for a couple years and the materials have really jelled. In fact, the Watir tool is actually an offshoot of the class itself. The original idea was simply to show people how much automation they could do with just a decent scripting language. Like Watir itself, all the class materials are open-source. They are called "Scripting101" and you can browse through them here: http://wtr.rubyforge.org/s101/doc/ And download the full package here: http://rubyforge.org/frs/?group_id=104&release_id=2242 A detailed class description is here: http://wtr.rubyforge.org/wiki/wiki.pl?ScriptingForTesters You can find out more about Agile 2005 here: http://www.agile2005.org/welcome Please contact me if you are planning to attend the conference and interested in helping out. _____________________ Bret Pettichord www.pettichord.com From martin.echtner at gmail.com Tue Jun 21 13:34:50 2005 From: martin.echtner at gmail.com (Martin Echtner) Date: Tue, 21 Jun 2005 11:34:50 -0600 Subject: [Wtr-general] checkboxes() method Message-ID: <2da00b2f05062110342f7d2cde@mail.gmail.com> I am using the following line of code to access checkboxes on a page which I then want to grab the name of the checkbox. ie.checkboxes.each do |s| ; puts s.to_s ; end ; # iterate through all the check boxes on the page I get this error: 1) Error: test_new_modules_class(Test_ImportProject_Template): WIN32OLERuntimeError: Unknown property or method `value' HRESULT error code:0x80020006 Unknown name. c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2020:in `invoke' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2020:in `value' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2047:in `string_creator' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2063:in `to_s' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `resIds' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `each' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2191:in `upto' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2191:in `each' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `resIds' C:/watir_bonus/releaseplannertesting/RPUtilities/Test_ImportProject_Template.rb:65:in `test_new_ modules_class' I have also tried using ie.checkbox(:index, 1).name and it returns "" (a blank string) I ran the unit tests that come with watir and the one for checkboxes that use the above line of code works for the assert_equal. But this does not work for me, not sure why. Please advise on what I am doing wrong the only thing I get to work is varName = ie.checkbox(:name, /chBoxName/) then I do temp=varName.name<http://varName.name> . Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050621/afc42e63/attachment.html From martin.echtner at gmail.com Tue Jun 21 13:39:04 2005 From: martin.echtner at gmail.com (Martin Echtner) Date: Tue, 21 Jun 2005 11:39:04 -0600 Subject: [Wtr-general] Unable to access javascript popups Message-ID: <2da00b2f05062110393c6ba342@mail.gmail.com> I have tried every method of accessing javascript popups (eg. conformation popup). I have used the AutoIT techniques but it does not find the popup window. I have tried using the WindowHelper, winClicker but nothing seems to work. I am using the current watir release 1.3.1. Please advise thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050621/d486f27a/attachment.html From shaorobics at gmail.com Tue Jun 21 14:46:22 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Tue, 21 Jun 2005 14:46:22 -0400 Subject: [Wtr-general] checkboxes() method In-Reply-To: <2da00b2f05062110342f7d2cde@mail.gmail.com> References: <2da00b2f05062110342f7d2cde@mail.gmail.com> Message-ID: <593b9ae805062111465063f2cf@mail.gmail.com> Did you take a look at the HTML source for the page you're testing? It could be possible that the developers didn't assign a name to the check box(es) that you want to use. That's my guess as to why the call to .name gives you "". Also, in your call: ie.checkboxes.each do |s| ; puts s.to_s ; end ; # iterate through all the check did you try taking out the .to_s? I find that it prints the details out for me fine when I just do a put whatever_object. Shao On 6/21/05, Martin Echtner <martin.echtner at gmail.com> wrote: > I am using the following line of code to access checkboxes on a page which I > then want to grab > the name of the checkbox. > > ie.checkboxes.each do |s| ; puts s.to_s ; end ; # iterate through all the > check boxes on the page > > I get this error: > > 1) Error: > test_new_modules_class(Test_ImportProject_Template): > WIN32OLERuntimeError: Unknown property or method `value' > HRESULT error code:0x80020006 > Unknown name. > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2020:in > `invoke' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2020:in `value' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2047:in > `string_creator' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2063:in `to_s' > > C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in > `resIds' > > C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in > `each' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2191:in `upto' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2191:in `each' > > C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in > `resIds' > > C:/watir_bonus/releaseplannertesting/RPUtilities/Test_ImportProject_Template.rb:65:in > `test_new_ > modules_class' > > I have also tried using ie.checkbox(:index, 1).name and it returns "" (a > blank string) I ran the unit tests that come with watir and the one for > checkboxes that use the above line of code works for the assert_equal. But > this does not work for me, not sure why. > > Please advise on what I am doing wrong the only thing I get to work is > varName = ie.checkbox(:name, /chBoxName/) then I do temp=varName.name. > > Thanks in advance > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > From shaorobics at gmail.com Tue Jun 21 14:48:51 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Tue, 21 Jun 2005 14:48:51 -0400 Subject: [Wtr-general] Unable to access javascript popups In-Reply-To: <2da00b2f05062110393c6ba342@mail.gmail.com> References: <2da00b2f05062110393c6ba342@mail.gmail.com> Message-ID: <593b9ae805062111485dc8f6f9@mail.gmail.com> If you are using winClicker, did you try the call to clickWindow_NewProcess() right before you expect the pop up to appear? If not the script will just hang Shao On 6/21/05, Martin Echtner <martin.echtner at gmail.com> wrote: > I have tried every method of accessing javascript popups (eg. conformation > popup). I have used the AutoIT techniques but it does not find the popup > window. I have tried using the WindowHelper, winClicker but nothing seems > to work. I am using the current watir release 1.3.1. > > Please advise > > thanks in advance > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > From sgtn2000 at gmail.com Tue Jun 21 15:03:35 2005 From: sgtn2000 at gmail.com (Sean Gallagher) Date: Tue, 21 Jun 2005 12:03:35 -0700 Subject: [Wtr-general] tracking page load times and request size with watir In-Reply-To: <001d01c5767a$47e058e0$72d39044@NewDell> References: <d125f85d050621070077aa5b69@mail.gmail.com> <001d01c5767a$47e058e0$72d39044@NewDell> Message-ID: <7f8ae47d050621120328e46d41@mail.gmail.com> Owen, You can use http-access2 to get headers--similar to LWP, but for Ruby Homepage: http://dev.ctor.org/http-access2 Example here: http://raa.ruby-lang.org/gonzui/markup/http-access2/sample/howto.rb -sean On 6/21/05, Paul Rogers <paul.rogers at shaw.ca> wrote: > I don't think we get access to the raw headers. The only thing I can > suggest is you get the size of the retreived doc, and base your > calculations on that > > doc_size = ie.html.length > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Owen Rogers > Sent: 21 June 2005 08:00 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] tracking page load times and request size > with watir > > > thanks paul! what about determining the size of the http response? > any suggestions there? > cheers, > owen. > > On 6/21/05, Paul Rogers <paul.rogers at shaw.ca> wrote: > > Every time a page reloads, the @down_load_time variable shold contain > > the time it took to download > > > > So you can do this: > > > > ie.goto('http://google.com') > > puts "Google load time: #{ie.down_load_time) seconds" > > > > There is also a @pageHasReloaded variable that will tell yo if the > > page has reloaded. > > > > Paul > > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Owen Rogers > > Sent: 21 June 2005 05:48 > > To: wtr-general at rubyforge.org > > Subject: [Wtr-general] tracking page load times and request size with > > watir > > > > > > i'm interested in using watir to track the time it takes each page to > > load and the size of the returned http request. we have certain > > standard targets that our pages must meet (load in less than 4s in the > > > dev/test environment, and should be small enough to support users over > > > a dial-up connection) that i would like to bake into our automated > > test suite. does watir support this? if not, any suggestions on where > > > i should begin looking to add in this functionality? cheers, owen. > > > > -- > > Owen Rogers | http://dotnetjunkies.com/weblog/exortech | > > CruiseControl.NET - http://ccnet.thoughtworks.com > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > -- > Owen Rogers | http://dotnetjunkies.com/weblog/exortech | > CruiseControl.NET - http://ccnet.thoughtworks.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From martin.echtner at gmail.com Tue Jun 21 15:28:33 2005 From: martin.echtner at gmail.com (Martin Echtner) Date: Tue, 21 Jun 2005 13:28:33 -0600 Subject: [Wtr-general] checkboxes() method Message-ID: <2da00b2f0506211228d87f460@mail.gmail.com> Thank you *Shao Kang Tat *for the reply: - yes the checkboxes all have unique names - and I tried ie.checkboxes.each do |s| ; puts s ; end ; and I still get the same error not sure why I am using the most recent version of Watir martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050621/a8ae229b/attachment.html From paul.rogers at shaw.ca Tue Jun 21 17:00:00 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 21 Jun 2005 15:00:00 -0600 Subject: [Wtr-general] checkboxes() method In-Reply-To: <2da00b2f05062110342f7d2cde@mail.gmail.com> Message-ID: <003501c576a4$306c86a0$72d39044@NewDell> I tried this on the checkboxes.html in the unittests, and its working ok for me. Can you post the html that causes the problem. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Martin Echtner Sent: 21 June 2005 11:35 To: wtr-general at rubyforge.org Subject: [Wtr-general] checkboxes() method I am using the following line of code to access checkboxes on a page which I then want to grab the name of the checkbox. ie.checkboxes.each do |s| ; puts s.to_s ; end ; # iterate through all the check boxes on the page I get this error: 1) Error: test_new_modules_class(Test_ImportProject_Template): WIN32OLERuntimeError: Unknown property or method `value' HRESULT error code:0x80020006 Unknown name. c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2020:in `invoke' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2020:in `value' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2047:in `string_creator' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2063:in `to_s' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `resIds' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `each' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2191:in `upto' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2191:in `each' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `resIds' C:/watir_bonus/releaseplannertesting/RPUtilities/Test_ImportProject_Temp late.rb:65:in `test_new_ modules_class' I have also tried using ie.checkbox(:index, 1).name and it returns "" (a blank string) I ran the unit tests that come with watir and the one for checkboxes that use the above line of code works for the assert_equal. But this does not work for me, not sure why. Please advise on what I am doing wrong the only thing I get to work is varName = ie.checkbox(:name, /chBoxName/) then I do temp=varName.name. Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050621/636f38f7/attachment.html From paul.rogers at shaw.ca Tue Jun 21 17:01:21 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 21 Jun 2005 15:01:21 -0600 Subject: [Wtr-general] Unable to access javascript popups In-Reply-To: <2da00b2f05062110393c6ba342@mail.gmail.com> Message-ID: <003a01c576a4$6092ba70$72d39044@NewDell> does the unit tests work ok? Are you using a non-english version of windows? Id avoid the winclicker, and concentrate your effors on windowhelper/autoit Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Martin Echtner Sent: 21 June 2005 11:39 To: wtr-general at rubyforge.org Subject: [Wtr-general] Unable to access javascript popups I have tried every method of accessing javascript popups (eg. conformation popup). I have used the AutoIT techniques but it does not find the popup window. I have tried using the WindowHelper, winClicker but nothing seems to work. I am using the current watir release 1.3.1. Please advise thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050621/76d12491/attachment.html From Mark_Cain at rl.gov Tue Jun 21 17:06:26 2005 From: Mark_Cain at rl.gov (Cain, Mark) Date: Tue, 21 Jun 2005 14:06:26 -0700 Subject: [Wtr-general] Unable to access javascript popups Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D29E@EX5V.rl.gov> The problem would appear to be the checkbox has no .value assigned. Maybe the iterator in WATIR needs to trap for this. I tested this out and the same code (ie.checkboxes.each do |c| ; puts c.to_s ; end ;) works if the checkbox has the value attribute set (see unittest >> checkbox_test.rb--at line 129 paste in "puts c.to_s") and throws the error (you describe earlier) for checkboxes that do not. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Tuesday, June 21, 2005 2:01 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Unable to access javascript popups does the unit tests work ok? Are you using a non-english version of windows? Id avoid the winclicker, and concentrate your effors on windowhelper/autoit Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Martin Echtner Sent: 21 June 2005 11:39 To: wtr-general at rubyforge.org Subject: [Wtr-general] Unable to access javascript popups I have tried every method of accessing javascript popups (eg. conformation popup). I have used the AutoIT techniques but it does not find the popup window. I have tried using the WindowHelper, winClicker but nothing seems to work. I am using the current watir release 1.3.1. Please advise thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050621/07bd2e64/attachment.html From Mark_Cain at rl.gov Tue Jun 21 17:09:08 2005 From: Mark_Cain at rl.gov (Cain, Mark) Date: Tue, 21 Jun 2005 14:09:08 -0700 Subject: [Wtr-general] checkboxes() method Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D29F@EX5V.rl.gov> Sorry replied to the wrong one ;-( The problem would appear to be the checkbox has no .value assigned. Maybe the iterator in WATIR needs to trap for this. I tested this out and the same code (ie.checkboxes.each do |c| ; puts c.to_s ; end ;) works if the checkbox has the value attribute set (see unittest >> checkbox_test.rb--at line 129 paste in "puts c.to_s") and throws the error (you describe earlier) for checkboxes that do not. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Tuesday, June 21, 2005 2:00 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] checkboxes() method I tried this on the checkboxes.html in the unittests, and its working ok for me. Can you post the html that causes the problem. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Martin Echtner Sent: 21 June 2005 11:35 To: wtr-general at rubyforge.org Subject: [Wtr-general] checkboxes() method I am using the following line of code to access checkboxes on a page which I then want to grab the name of the checkbox. ie.checkboxes.each do |s| ; puts s.to_s ; end ; # iterate through all the check boxes on the page I get this error: 1) Error: test_new_modules_class(Test_ImportProject_Template): WIN32OLERuntimeError: Unknown property or method `value' HRESULT error code:0x80020006 Unknown name. c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2020:in `invoke' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2020:in `value' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2047:in `string_creator' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2063:in `to_s' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `resIds' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `each' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2191:in `upto' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2191:in `each' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `resIds' C:/watir_bonus/releaseplannertesting/RPUtilities/Test_ImportProject_Temp late.rb:65:in `test_new_ modules_class' I have also tried using ie.checkbox(:index, 1).name and it returns "" (a blank string) I ran the unit tests that come with watir and the one for checkboxes that use the above line of code works for the assert_equal. But this does not work for me, not sure why. Please advise on what I am doing wrong the only thing I get to work is varName = ie.checkbox(:name, /chBoxName/) then I do temp=varName.name. Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050621/e6c2c49e/attachment.html From paul.rogers at shaw.ca Tue Jun 21 17:16:28 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 21 Jun 2005 15:16:28 -0600 Subject: [Wtr-general] checkboxes() method In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D29F@EX5V.rl.gov> Message-ID: <004b01c576a6$7d7c3d30$72d39044@NewDell> I think I must have a different version of watir.... the first check box on the page doesnt have a value CheckBox 1 <input type = checkbox name = box1> ( or after IE has changed it CheckBox 1 <INPUT type=checkbox name=box1> ) and it works ok via both the iterator and the ie.checbox(:index,1).value Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: 21 June 2005 15:09 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] checkboxes() method Sorry replied to the wrong one ;-( The problem would appear to be the checkbox has no .value assigned. Maybe the iterator in WATIR needs to trap for this. I tested this out and the same code (ie.checkboxes.each do |c| ; puts c.to_s ; end ;) works if the checkbox has the value attribute set (see unittest >> checkbox_test.rb--at line 129 paste in "puts c.to_s") and throws the error (you describe earlier) for checkboxes that do not. --Mark _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Tuesday, June 21, 2005 2:00 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] checkboxes() method I tried this on the checkboxes.html in the unittests, and its working ok for me. Can you post the html that causes the problem. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Martin Echtner Sent: 21 June 2005 11:35 To: wtr-general at rubyforge.org Subject: [Wtr-general] checkboxes() method I am using the following line of code to access checkboxes on a page which I then want to grab the name of the checkbox. ie.checkboxes.each do |s| ; puts s.to_s ; end ; # iterate through all the check boxes on the page I get this error: 1) Error: test_new_modules_class(Test_ImportProject_Template): WIN32OLERuntimeError: Unknown property or method `value' HRESULT error code:0x80020006 Unknown name. c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2020:in `invoke' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2020:in `value' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2047:in `string_creator' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2063:in `to_s' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `resIds' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `each' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2191:in `upto' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2191:in `each' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `resIds' C:/watir_bonus/releaseplannertesting/RPUtilities/Test_ImportProject_Temp late.rb:65:in `test_new_ modules_class' I have also tried using ie.checkbox(:index, 1).name and it returns "" (a blank string) I ran the unit tests that come with watir and the one for checkboxes that use the above line of code works for the assert_equal. But this does not work for me, not sure why. Please advise on what I am doing wrong the only thing I get to work is varName = ie.checkbox(:name, /chBoxName/) then I do temp=varName.name. Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050621/dd15715b/attachment.html From Mark_Cain at rl.gov Tue Jun 21 17:35:05 2005 From: Mark_Cain at rl.gov (Cain, Mark) Date: Tue, 21 Jun 2005 14:35:05 -0700 Subject: [Wtr-general] checkboxes() method Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D2A0@EX5V.rl.gov> I have 1.3.1-downloaded and reinstalled it yesterday. I also have XP SP2 with the very latest (forced to upgrade yesterday) IE patches and stuff. Maybe that is the issue. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Tuesday, June 21, 2005 2:16 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] checkboxes() method I think I must have a different version of watir.... the first check box on the page doesnt have a value CheckBox 1 <input type = checkbox name = box1> ( or after IE has changed it CheckBox 1 <INPUT type=checkbox name=box1> ) and it works ok via both the iterator and the ie.checbox(:index,1).value Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: 21 June 2005 15:09 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] checkboxes() method Sorry replied to the wrong one ;-( The problem would appear to be the checkbox has no .value assigned. Maybe the iterator in WATIR needs to trap for this. I tested this out and the same code (ie.checkboxes.each do |c| ; puts c.to_s ; end ;) works if the checkbox has the value attribute set (see unittest >> checkbox_test.rb--at line 129 paste in "puts c.to_s") and throws the error (you describe earlier) for checkboxes that do not. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Tuesday, June 21, 2005 2:00 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] checkboxes() method I tried this on the checkboxes.html in the unittests, and its working ok for me. Can you post the html that causes the problem. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Martin Echtner Sent: 21 June 2005 11:35 To: wtr-general at rubyforge.org Subject: [Wtr-general] checkboxes() method I am using the following line of code to access checkboxes on a page which I then want to grab the name of the checkbox. ie.checkboxes.each do |s| ; puts s.to_s ; end ; # iterate through all the check boxes on the page I get this error: 1) Error: test_new_modules_class(Test_ImportProject_Template): WIN32OLERuntimeError: Unknown property or method `value' HRESULT error code:0x80020006 Unknown name. c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2020:in `invoke' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2020:in `value' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2047:in `string_creator' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2063:in `to_s' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `resIds' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `each' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2191:in `upto' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2191:in `each' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `resIds' C:/watir_bonus/releaseplannertesting/RPUtilities/Test_ImportProject_Temp late.rb:65:in `test_new_ modules_class' I have also tried using ie.checkbox(:index, 1).name and it returns "" (a blank string) I ran the unit tests that come with watir and the one for checkboxes that use the above line of code works for the assert_equal. But this does not work for me, not sure why. Please advise on what I am doing wrong the only thing I get to work is varName = ie.checkbox(:name, /chBoxName/) then I do temp=varName.name. Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050621/53f30d9e/attachment.html From bret at pettichord.com Tue Jun 21 18:38:36 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 21 Jun 2005 17:38:36 -0500 Subject: [Wtr-general] Run a ruby script 50 times In-Reply-To: <42B772EE.5030907@lyris.com> References: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D4F@iris.win.barra.com> <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D4F@iris.win.barra.com> Message-ID: <5.1.0.14.2.20050621173709.03819b90@127.0.0.1> At 08:52 PM 6/20/2005, Jeff Fry wrote: >I would trust that there are many more elegant ways to do this yup: $MAX_ITERATIONS.times do # run your script end _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Tue Jun 21 18:42:56 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 21 Jun 2005 17:42:56 -0500 Subject: [Wtr-general] interrupt waiting of IE. In-Reply-To: <71EA7CA4B789864F9B3AC722A7F016B68DBE44@tfphmanilmul01.ERF. THOMSON.COM> Message-ID: <5.1.0.14.2.20050621174138.03846dd0@127.0.0.1> At 09:19 PM 6/20/2005, Jan.Montano at thomson.com wrote: >Is there a way to interrupt or not wait for the IE to finish loading a >page? I have this link which opens a new page, and the main page still >does some processing although the new page is finished loading. I need to >get pass through the click method without even waiting for the processing >to complete. Any ideas? > >Could I just pass an additional parameter on the click method of link so >that It won't wait? please Advise. Thank you very much! instead of: ie.link(:name, 'foo').click try: ie.link(:name, 'foo').getOLEObject.click That should avoid the wait. _____________________ Bret Pettichord www.pettichord.com From jkohl at telusplanet.net Tue Jun 21 19:07:26 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Tue, 21 Jun 2005 16:07:26 -0700 Subject: [Wtr-general] Run a ruby script 50 times In-Reply-To: <5.1.0.14.2.20050621173709.03819b90@127.0.0.1> References: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D4F@iris.win.barra.com> <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D4F@iris.win.barra.com> <5.1.0.14.2.20050621173709.03819b90@127.0.0.1> Message-ID: <1119395246.42b89dae6dbe7@webmail.telusplanet.net> Another variation if you would like to run all the test cases in a Test Case class using test::unit is to use a test suite and loop through the test case class as many times as you want. This can be done by creating a test_suite.rb file like this: require 'test/unit' require 'test/unit/ui/console/testrunner' require 'test' #this is your test case file MAX_ITERATIONS = 50 result = Test::Unit::TestResult.new MAX_ITERATIONS.times do <your_test_case_class_name>.suite.run(result) do |s, name| puts "Status=#{s} and name = #{name}" end puts result.to_s puts result.failure_count end exit! Quoting Bret Pettichord <bret at pettichord.com>: > At 08:52 PM 6/20/2005, Jeff Fry wrote: > >I would trust that there are many more elegant ways to do this > > yup: > > $MAX_ITERATIONS.times do > # run your script > end > > > _____________________ > Bret Pettichord > www.pettichord.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From Kevin.Williams at Level3.com Tue Jun 21 19:45:45 2005 From: Kevin.Williams at Level3.com (Williams, Kevin) Date: Tue, 21 Jun 2005 17:45:45 -0600 Subject: [Wtr-general] rdoc Message-ID: <F471782CD383EF43BE648A4AA0B808A158E1F3@idc1exc0003.corp.global.level3.com> I'm pretty new to Ruby and I'm not sure about the documentation. None of my Ruby tools (fxri, jEdit) are seeing the documentation or able to infer code completion. I suspect there is some "rdoc ..." command that will fix me up, but I don't know much about that either. Any suggestions? From paul.rogers at shaw.ca Tue Jun 21 23:23:15 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 21 Jun 2005 21:23:15 -0600 Subject: [Wtr-general] Tables bug Message-ID: <007001c576d9$ba61a770$72d39044@NewDell> Version 1.3.1 Looks like finding a table using :id and a reg exp is broken This uses the C:\watir_bonus\unitTests\html\table1.html file irb(main):004:0> ie.show_tables Found 6 tables 1 id= rows=2 columns=2 2 id=t1 rows=5 columns=1 3 id=t2 rows=2 columns=2 4 id= rows=1 columns=2 5 id=body_test rows=5 columns=1 6 id=pic_table rows=1 columns=4 => nil irb(main):005:0> ie.table(:id, /t/).flash Watir::Exception::UnknownObjectException: Unable to locate object, using id and (?-mix:t) from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1979:in `object_exist_check' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2106:in `flash' from (irb):5 from :0 irb(main):006:0> From paul.rogers at shaw.ca Tue Jun 21 23:26:58 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 21 Jun 2005 21:26:58 -0600 Subject: [Wtr-general] checkboxes() method In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D2A0@EX5V.rl.gov> Message-ID: <007101c576da$3f269b50$72d39044@NewDell> I reinstalled 1.3.1 to test this. And it still works! I have IE6 version ( take a deep breath) 6.0.2900.2180.xpsp_sp2_gdr.050301-1519 When I used to use vbscrpt, I was forever getting problems on one machine that didnt show on another Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: 21 June 2005 15:35 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] checkboxes() method I have 1.3.1-downloaded and reinstalled it yesterday. I also have XP SP2 with the very latest (forced to upgrade yesterday) IE patches and stuff. Maybe that is the issue. --Mark _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Tuesday, June 21, 2005 2:16 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] checkboxes() method I think I must have a different version of watir.... the first check box on the page doesnt have a value CheckBox 1 <input type = checkbox name = box1> ( or after IE has changed it CheckBox 1 <INPUT type=checkbox name=box1> ) and it works ok via both the iterator and the ie.checbox(:index,1).value Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: 21 June 2005 15:09 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] checkboxes() method Sorry replied to the wrong one ;-( The problem would appear to be the checkbox has no .value assigned. Maybe the iterator in WATIR needs to trap for this. I tested this out and the same code (ie.checkboxes.each do |c| ; puts c.to_s ; end ;) works if the checkbox has the value attribute set (see unittest >> checkbox_test.rb--at line 129 paste in "puts c.to_s") and throws the error (you describe earlier) for checkboxes that do not. --Mark _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Tuesday, June 21, 2005 2:00 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] checkboxes() method I tried this on the checkboxes.html in the unittests, and its working ok for me. Can you post the html that causes the problem. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Martin Echtner Sent: 21 June 2005 11:35 To: wtr-general at rubyforge.org Subject: [Wtr-general] checkboxes() method I am using the following line of code to access checkboxes on a page which I then want to grab the name of the checkbox. ie.checkboxes.each do |s| ; puts s.to_s ; end ; # iterate through all the check boxes on the page I get this error: 1) Error: test_new_modules_class(Test_ImportProject_Template): WIN32OLERuntimeError: Unknown property or method `value' HRESULT error code:0x80020006 Unknown name. c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2020:in `invoke' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2020:in `value' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2047:in `string_creator' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2063:in `to_s' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `resIds' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `each' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2191:in `upto' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2191:in `each' C:/watir_bonus/releaseplannertesting/RPUtilities/ResourcesRP.rb:191:in `resIds' C:/watir_bonus/releaseplannertesting/RPUtilities/Test_ImportProject_Temp late.rb:65:in `test_new_ modules_class' I have also tried using ie.checkbox(:index, 1).name and it returns "" (a blank string) I ran the unit tests that come with watir and the one for checkboxes that use the above line of code works for the assert_equal. But this does not work for me, not sure why. Please advise on what I am doing wrong the only thing I get to work is varName = ie.checkbox(:name, /chBoxName/) then I do temp=varName.name. Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050621/94c89f7a/attachment.html From huemach at Cybersoft-VN.com Tue Jun 21 21:24:22 2005 From: huemach at Cybersoft-VN.com (Hue Mach Dieu) Date: Wed, 22 Jun 2005 08:24:22 +0700 Subject: [Wtr-general] [Automation Test] Button in frame Message-ID: <99DF6C0285C2CE4C99F02D78385719660169B410@hue.cybersoft-vn.com> Dear All I have this web screen like enclosed file and when I view source of this page as below. Currently, I would like click on [Search] button, but I cannot found it name or index in HTML source. How can I solve this problem? Thank you for help <html> <head> <title>sEDA Client -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050622/cac63dcb/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: screen.jpg Type: image/jpeg Size: 75842 bytes Desc: screen.jpg Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050622/cac63dcb/attachment.jpg From jkohl at telusplanet.net Tue Jun 21 23:56:51 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Tue, 21 Jun 2005 21:56:51 -0600 Subject: [Wtr-general] [Automation Test] Button in frame In-Reply-To: <99DF6C0285C2CE4C99F02D78385719660169B410@hue.cybersoft-vn.com> Message-ID: <20050622035628.VRRR27502.priv-edtnes57.telusplanet.net@tintin> Did you try this? ie.frame("rightframe").button(:value, "Search").click -Jonathan _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Hue Mach Dieu Sent: June 21, 2005 7:24 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] [Automation Test] Button in frame Dear All I have this web screen like enclosed file and when I view source of this page as below. Currently, I would like click on [Search] button, but I cannot found it name or index in HTML source. How can I solve this problem? Thank you for help <html> <head> <title>sEDA Client</title> <meta http-equiv="Content-Type" content="text/html"> </head> <!-- <frameset cols="230,*" border="0"> <frame name="leftframe" scrolling="no" src="mainmenu?span=false" marginwidth="0" marginheight="0" noresize> <frame name="rightframe" src="blank.html" scrolling="auto"> <noframes> --> <frameset rows="70,*" frameborder="NO" border="0" framespacing="0"> <frame name="topframe" scrolling="no" src="top.html" noresize> <frameset cols="230,*" border="0"> <frame name="leftframe" scrolling="no" src="templates/English/menu/menu.html" marginwidth="0" marginheight="0" noresize> <frame name="rightframe" src="DefaultPage" scrolling="auto"> <noframes> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050621/24748f2f/attachment.html From Jan.Montano at thomson.com Wed Jun 22 00:05:23 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Wed, 22 Jun 2005 12:05:23 +0800 Subject: [Wtr-general] [Automation Test] Button in frame Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE46@tfphmanilmul01.ERF.THOMSON.COM> try viewing the source of the correct frame. perhaps near the button. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Hue Mach Dieu Sent: Wednesday, June 22, 2005 9:24 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] [Automation Test] Button in frame Dear All I have this web screen like enclosed file and when I view source of this page as below. Currently, I would like click on [Search] button, but I cannot found it name or index in HTML source. How can I solve this problem? Thank you for help <html> <head> <title>sEDA Client</title> <meta http-equiv="Content-Type" content="text/html"> </head> <!-- <frameset cols="230,*" border="0"> <frame name="leftframe" scrolling="no" src="mainmenu?span=false" marginwidth="0" marginheight="0" noresize> <frame name="rightframe" src="blank.html" scrolling="auto"> <noframes> --> <frameset rows="70,*" frameborder="NO" border="0" framespacing="0"> <frame name="topframe" scrolling="no" src="top.html" noresize> <frameset cols="230,*" border="0"> <frame name="leftframe" scrolling="no" src="templates/English/menu/menu.html" marginwidth="0" marginheight="0" noresize> <frame name="rightframe" src="DefaultPage" scrolling="auto"> <noframes> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050622/e85935b3/attachment.html From huemach at Cybersoft-VN.com Wed Jun 22 00:07:45 2005 From: huemach at Cybersoft-VN.com (Hue Mach Dieu) Date: Wed, 22 Jun 2005 11:07:45 +0700 Subject: [Wtr-general] RE: [Automation Test] Button in frame (Hue Mach Dieu) Message-ID: <99DF6C0285C2CE4C99F02D78385719660169B500@hue.cybersoft-vn.com> Dear, I try both code: ie.frame(:name , 'rightframe').button(:value, "Search").click or ie.frame("rightframe").button(:value, "Search").click But get error message when execute it: Error message: 'method_missing': Unknown property or method 'body' <WIN32OLERuntimeError> HRESULT error code: 0x8007005 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050622/c1de16be/attachment.html From huemach at Cybersoft-VN.com Wed Jun 22 00:16:53 2005 From: huemach at Cybersoft-VN.com (Hue Mach Dieu) Date: Wed, 22 Jun 2005 11:16:53 +0700 Subject: [Wtr-general] RE: [Automation Test] Button in frame (Hue Mach Dieu) Message-ID: <99DF6C0285C2CE4C99F02D78385719660169B518@hue.cybersoft-vn.com> Dear I view HTML source near this [Search] button, I get this code: <input name="submitForm" type="submit" value="Search"> And Run it with code ie.frame(:name, 'rightframe').button(:name, "submitForm").click but don't work Hue Mach -----Original Message----- From: wtr-general-request at rubyforge.org [mailto:wtr-general-request at rubyforge.org] Sent: Wednesday, June 22, 2005 11:02 AM To: wtr-general at rubyforge.org Subject: Wtr-general Digest, Vol 19, Issue 30 Send Wtr-general mailing list submissions to wtr-general at rubyforge.org To subscribe or unsubscribe via the World Wide Web, visit http://rubyforge.org/mailman/listinfo/wtr-general or, via email, send a message with subject or body 'help' to wtr-general-request at rubyforge.org You can reach the person managing the list at wtr-general-owner at rubyforge.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Wtr-general digest..." Today's Topics: 1. RE: [Automation Test] Button in frame (Jonathan Kohl) 2. RE: [Automation Test] Button in frame (Jan.Montano at thomson.com) ---------------------------------------------------------------------- Message: 1 Date: Tue, 21 Jun 2005 21:56:51 -0600 From: "Jonathan Kohl" <jkohl at telusplanet.net> Subject: RE: [Wtr-general] [Automation Test] Button in frame To: <wtr-general at rubyforge.org> Message-ID: <20050622035628.VRRR27502.priv-edtnes57.telusplanet.net at tintin> Content-Type: text/plain; charset="us-ascii" Did you try this? ie.frame("rightframe").button(:value, "Search").click -Jonathan _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Hue Mach Dieu Sent: June 21, 2005 7:24 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] [Automation Test] Button in frame Dear All I have this web screen like enclosed file and when I view source of this page as below. Currently, I would like click on [Search] button, but I cannot found it name or index in HTML source. How can I solve this problem? Thank you for help <html> <head> <title>sEDA Client</title> <meta http-equiv="Content-Type" content="text/html"> </head> <!-- <frameset cols="230,*" border="0"> <frame name="leftframe" scrolling="no" src="mainmenu?span=false" marginwidth="0" marginheight="0" noresize> <frame name="rightframe" src="blank.html" scrolling="auto"> <noframes> --> <frameset rows="70,*" frameborder="NO" border="0" framespacing="0"> <frame name="topframe" scrolling="no" src="top.html" noresize> <frameset cols="230,*" border="0"> <frame name="leftframe" scrolling="no" src="templates/English/menu/menu.html" marginwidth="0" marginheight="0" noresize> <frame name="rightframe" src="DefaultPage" scrolling="auto"> <noframes> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050621/24748f2f /attachment-0001.htm ------------------------------ Message: 2 Date: Wed, 22 Jun 2005 12:05:23 +0800 From: <Jan.Montano at thomson.com> Subject: RE: [Wtr-general] [Automation Test] Button in frame To: <wtr-general at rubyforge.org> Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE46 at tfphmanilmul01.ERF.THOMSON.COM> Content-Type: text/plain; charset="iso-8859-1" try viewing the source of the correct frame. perhaps near the button. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Hue Mach Dieu Sent: Wednesday, June 22, 2005 9:24 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] [Automation Test] Button in frame Dear All I have this web screen like enclosed file and when I view source of this page as below. Currently, I would like click on [Search] button, but I cannot found it name or index in HTML source. How can I solve this problem? Thank you for help <html> <head> <title>sEDA Client</title> <meta http-equiv="Content-Type" content="text/html"> </head> <!-- <frameset cols="230,*" border="0"> <frame name="leftframe" scrolling="no" src="mainmenu?span=false" marginwidth="0" marginheight="0" noresize> <frame name="rightframe" src="blank.html" scrolling="auto"> <noframes> --> <frameset rows="70,*" frameborder="NO" border="0" framespacing="0"> <frame name="topframe" scrolling="no" src="top.html" noresize> <frameset cols="230,*" border="0"> <frame name="leftframe" scrolling="no" src="templates/English/menu/menu.html" marginwidth="0" marginheight="0" noresize> <frame name="rightframe" src="DefaultPage" scrolling="auto"> <noframes> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050622/e85935b3 /attachment.htm ------------------------------ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general End of Wtr-general Digest, Vol 19, Issue 30 ******************************************* From Jan.Montano at thomson.com Wed Jun 22 01:18:38 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Wed, 22 Jun 2005 13:18:38 +0800 Subject: [Wtr-general] RE: [Automation Test] Button in frame (Hue Mach Dieu) Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE47@tfphmanilmul01.ERF.THOMSON.COM> try ie.frame(name_of_frame).form(:name,'submitForm').submit -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Hue Mach Dieu Sent: Wednesday, June 22, 2005 12:17 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] RE: [Automation Test] Button in frame (Hue Mach Dieu) Dear I view HTML source near this [Search] button, I get this code: <input name="submitForm" type="submit" value="Search"> And Run it with code ie.frame(:name, 'rightframe').button(:name, "submitForm").click but don't work Hue Mach -----Original Message----- From: wtr-general-request at rubyforge.org [mailto:wtr-general-request at rubyforge.org] Sent: Wednesday, June 22, 2005 11:02 AM To: wtr-general at rubyforge.org Subject: Wtr-general Digest, Vol 19, Issue 30 Send Wtr-general mailing list submissions to wtr-general at rubyforge.org To subscribe or unsubscribe via the World Wide Web, visit http://rubyforge.org/mailman/listinfo/wtr-general or, via email, send a message with subject or body 'help' to wtr-general-request at rubyforge.org You can reach the person managing the list at wtr-general-owner at rubyforge.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Wtr-general digest..." Today's Topics: 1. RE: [Automation Test] Button in frame (Jonathan Kohl) 2. RE: [Automation Test] Button in frame (Jan.Montano at thomson.com) ---------------------------------------------------------------------- Message: 1 Date: Tue, 21 Jun 2005 21:56:51 -0600 From: "Jonathan Kohl" <jkohl at telusplanet.net> Subject: RE: [Wtr-general] [Automation Test] Button in frame To: <wtr-general at rubyforge.org> Message-ID: <20050622035628.VRRR27502.priv-edtnes57.telusplanet.net at tintin> Content-Type: text/plain; charset="us-ascii" Did you try this? ie.frame("rightframe").button(:value, "Search").click -Jonathan _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Hue Mach Dieu Sent: June 21, 2005 7:24 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] [Automation Test] Button in frame Dear All I have this web screen like enclosed file and when I view source of this page as below. Currently, I would like click on [Search] button, but I cannot found it name or index in HTML source. How can I solve this problem? Thank you for help <html> <head> <title>sEDA Client</title> <meta http-equiv="Content-Type" content="text/html"> </head> <!-- <frameset cols="230,*" border="0"> <frame name="leftframe" scrolling="no" src="mainmenu?span=false" marginwidth="0" marginheight="0" noresize> <frame name="rightframe" src="blank.html" scrolling="auto"> <noframes> --> <frameset rows="70,*" frameborder="NO" border="0" framespacing="0"> <frame name="topframe" scrolling="no" src="top.html" noresize> <frameset cols="230,*" border="0"> <frame name="leftframe" scrolling="no" src="templates/English/menu/menu.html" marginwidth="0" marginheight="0" noresize> <frame name="rightframe" src="DefaultPage" scrolling="auto"> <noframes> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050621/24748f2f /attachment-0001.htm ------------------------------ Message: 2 Date: Wed, 22 Jun 2005 12:05:23 +0800 From: <Jan.Montano at thomson.com> Subject: RE: [Wtr-general] [Automation Test] Button in frame To: <wtr-general at rubyforge.org> Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE46 at tfphmanilmul01.ERF.THOMSON.COM> Content-Type: text/plain; charset="iso-8859-1" try viewing the source of the correct frame. perhaps near the button. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Hue Mach Dieu Sent: Wednesday, June 22, 2005 9:24 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] [Automation Test] Button in frame Dear All I have this web screen like enclosed file and when I view source of this page as below. Currently, I would like click on [Search] button, but I cannot found it name or index in HTML source. How can I solve this problem? Thank you for help <html> <head> <title>sEDA Client</title> <meta http-equiv="Content-Type" content="text/html"> </head> <!-- <frameset cols="230,*" border="0"> <frame name="leftframe" scrolling="no" src="mainmenu?span=false" marginwidth="0" marginheight="0" noresize> <frame name="rightframe" src="blank.html" scrolling="auto"> <noframes> --> <frameset rows="70,*" frameborder="NO" border="0" framespacing="0"> <frame name="topframe" scrolling="no" src="top.html" noresize> <frameset cols="230,*" border="0"> <frame name="leftframe" scrolling="no" src="templates/English/menu/menu.html" marginwidth="0" marginheight="0" noresize> <frame name="rightframe" src="DefaultPage" scrolling="auto"> <noframes> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050622/e85935b3 /attachment.htm ------------------------------ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general End of Wtr-general Digest, Vol 19, Issue 30 ******************************************* _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From jgould at seek.com.au Wed Jun 22 04:28:00 2005 From: jgould at seek.com.au (Justin Gould) Date: Wed, 22 Jun 2005 18:28:00 +1000 Subject: [Wtr-general] frame error in waitdocument Message-ID: <B3EC6F72546AFD429A19CBF83CF91059023BC5AF@melmail.seek.int> Hi, When I run this code snippet I get errors about framerror in waitdocument require 'watir' require 'test/unit' require 'watir/testUnitAddons' require 'smoketest_setup' include Watir class TC_jobseeker < Test::Unit::TestCase def test_jobseeker #initialise the ie object @@ie = IE.new @@ie.set_fast_speed arrayLoc = [1000,1001,1002,1003,1004,1005,1006,1009,1010,1007,1008,1011,1012,1015,1013,1014,1018,1019,1020,1021,1022,1023] #pick a random location from the array loc = arrayLoc[rand(arrayLoc.length)] @@ie.goto("http://seek.com.au/jobsearch/index.ascx?DateRange=31&catlocation=" + loc.to_s) @ie.close end end Any idea why? Justin Gould QA Team Lead/IT Process Manager SEEK Limited -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050622/92a4e561/attachment.html From alex at verk.info Wed Jun 22 08:53:19 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Wed, 22 Jun 2005 08:53:19 -0400 Subject: [Wtr-general] Run a ruby script 50 times In-Reply-To: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D4F@iris.win.barra.com> References: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D4F@iris.win.barra.com> Message-ID: <42B95F3F.8020004@verk.info> Tuyet Cong-Ton-Nu wrote: >I have a login.rb script that I'd like to execute 50 times in a row. >What's the best way to do this? > > Literally, this: 50.times do your_script end :) From alex at verk.info Wed Jun 22 08:54:53 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Wed, 22 Jun 2005 08:54:53 -0400 Subject: Watir puns Re: [Wtr-general] form flooding in watir In-Reply-To: <72799cd705062020153f92b06@mail.gmail.com> References: <d125f85d050618085716fbd768@mail.gmail.com> <5.1.0.14.2.20050620213614.037e4e70@127.0.0.1> <72799cd705062020153f92b06@mail.gmail.com> Message-ID: <42B95F9D.3060404@verk.info> Chris McMahon wrote: >The catalog so far... > >Making Watir (Pettichord blog) >Watir works (Kohl/Rogers in Better Software) >Running Watir (Kohl/Rogers in Better Software) >Lead a horse (mule) to Watir (Hendrickson blog) >And now, flooding in Watir > >What's next? > Smoke on the Watir From jkohl at telusplanet.net Wed Jun 22 09:36:58 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Wed, 22 Jun 2005 07:36:58 -0600 Subject: Watir puns Re: [Wtr-general] form flooding in watir In-Reply-To: <42B95F9D.3060404@verk.info> Message-ID: <20050622133630.BDVI14858.priv-edtnes40.telusplanet.net@tintin> > Smoke on the Watir The smoke testing article I presume. :) -Jonathan From bret at pettichord.com Wed Jun 22 01:28:07 2005 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 22 Jun 2005 00:28:07 -0500 Subject: [Wtr-general] rdoc In-Reply-To: <F471782CD383EF43BE648A4AA0B808A158E1F3@idc1exc0003.corp.gl obal.level3.com> Message-ID: <5.1.0.14.2.20050622002737.026eb300@127.0.0.1> At 06:45 PM 6/21/2005, Williams, Kevin wrote: >I'm pretty new to Ruby and I'm not sure about the documentation. None of >my Ruby tools (fxri, jEdit) are seeing the documentation or able to >infer code completion. I suspect there is some "rdoc ..." command that >will fix me up, but I don't know much about that either. > >Any suggestions? http://rubyforge.org/pipermail/wtr-general/2005-May/001739.html _____________________ Bret Pettichord www.pettichord.com From Kevin.Williams at Level3.com Wed Jun 22 10:02:53 2005 From: Kevin.Williams at Level3.com (Williams, Kevin) Date: Wed, 22 Jun 2005 08:02:53 -0600 Subject: [Wtr-general] rdoc Message-ID: <F471782CD383EF43BE648A4AA0B808A158E1F4@idc1exc0003.corp.global.level3.com> Thanks! -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Tuesday, June 21, 2005 11:28 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] rdoc At 06:45 PM 6/21/2005, Williams, Kevin wrote: >I'm pretty new to Ruby and I'm not sure about the documentation. None >of my Ruby tools (fxri, jEdit) are seeing the documentation or able to >infer code completion. I suspect there is some "rdoc ..." command that >will fix me up, but I don't know much about that either. > >Any suggestions? http://rubyforge.org/pipermail/wtr-general/2005-May/001739.html _____________________ 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 Wed Jun 22 10:35:45 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 22 Jun 2005 08:35:45 -0600 Subject: [Wtr-general] Microsoft help format ( .chm ) Message-ID: <002c01c57737$acdedb00$72d39044@NewDell> Some people have asked about the docs in microsoft help format. You can use this line to generate these docs. You will need to goto the dir where you unzipped the watir download. You will also need to download ms help generator, which you can download from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhel p/html/hwMicrosoftHTMLHelpDownloads.asp rdoc -f chm -m ReadMe -o rdoc --exclude "unittests|examples|install.rb" Then in the rdoc directory there will be a rdoc.chm file. It's a big file which prevented me from posting it to the list as well. I imagine we can make it an option at install time to install this help format Paul From bret at pettichord.com Wed Jun 22 11:06:41 2005 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 22 Jun 2005 10:06:41 -0500 Subject: [Wtr-general] Fwd: Watir Web Page Message-ID: <5.1.0.14.2.20050622100603.032eb9c0@127.0.0.1> Is there a fix to this? >Hi Bret, > >Ever since I installed WATIR at AWTA, there's been a strange keyboard >shortcut introduced into my system. When I press Shift-Ctrl-F from >anywhere I get this page: C:\watir-v1_0_2\doc\watir_user_guide.html. This >is a real pain 'cause Shift-Ctrl-F used to be my "Search and replace >across all files" shortcut in MultiEdit, my favourite programmers editor. > >I can't figure out how WATIR set this shortcut and how to remove >it. Could you please help? > >Thanks very much, > >C. Martin Taylor >Sr. Test Automation Specialist >Texas Instruments, Inc. >Educational and Productivity Solutions >7800 Banner Dr. MS 3908 >Dallas, TX 75251 _____________________ Bret Pettichord www.pettichord.com From jmccarthy at cafepress.com Wed Jun 22 11:52:22 2005 From: jmccarthy at cafepress.com (Justin McCarthy) Date: Wed, 22 Jun 2005 08:52:22 -0700 Subject: [Wtr-general] Fwd: Watir Web Page Message-ID: <A87EA24E23D129448118A73A43EDB763016E7999@exchange02.corp.cafepress.com> Since the 1.1 release, that shortcut is not bound any longer. Martin, you could navigate to Start -> Programs -> watir, right-click, select "Properties", and remove the shortcut key binding. /Justin -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Wednesday, June 22, 2005 8:07 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Fwd: Watir Web Page Is there a fix to this? >Hi Bret, > >Ever since I installed WATIR at AWTA, there's been a strange keyboard >shortcut introduced into my system. When I press Shift-Ctrl-F from >anywhere I get this page: C:\watir-v1_0_2\doc\watir_user_guide.html. >This is a real pain 'cause Shift-Ctrl-F used to be my "Search and >replace across all files" shortcut in MultiEdit, my favourite programmers editor. > >I can't figure out how WATIR set this shortcut and how to remove it. >Could you please help? > >Thanks very much, > >C. Martin Taylor >Sr. Test Automation Specialist >Texas Instruments, Inc. >Educational and Productivity Solutions >7800 Banner Dr. MS 3908 >Dallas, TX 75251 _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------------------------------------------------------------------- The contents of this message, together with any attachments, are intended only for the use of the individual or entity to which they are addressed and may contain information that is confidential and exempt from disclosure. If you are not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this message, or any attachment, is strictly prohibited. If you have received this message in error, please notify the original sender immediately by telephone or by return E-mail and delete this message, along with any attachments, from your computer. Thank you. From jfry at lyris.com Wed Jun 22 19:17:15 2005 From: jfry at lyris.com (Jeff Fry) Date: Wed, 22 Jun 2005 16:17:15 -0700 Subject: [Wtr-general] Run a ruby script 50 times In-Reply-To: <5.1.0.14.2.20050621173709.03819b90@127.0.0.1> References: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D4F@iris.win.barra.com> <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D4F@iris.win.barra.com> <5.1.0.14.2.20050621173709.03819b90@127.0.0.1> Message-ID: <42B9F17B.5080102@lyris.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050622/5db8edbc/attachment.html From christopher.mcmahon at gmail.com Wed Jun 22 20:21:00 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 22 Jun 2005 19:21:00 -0500 Subject: [Wtr-general] Run a ruby script 50 times In-Reply-To: <42B9F17B.5080102@lyris.com> References: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3D4F@iris.win.barra.com> <5.1.0.14.2.20050621173709.03819b90@127.0.0.1> <42B9F17B.5080102@lyris.com> Message-ID: <72799cd705062217215cc8cfb7@mail.gmail.com> > Now that looks quite a bit more like ruby! One goal of mine though was for > someone else running the script to be able to quickly guess how to either > set it to run N iterations or to run until interrupted. I felt that Is this too simpleminded? puts "How many times?" x = gets x = x.to_i x.times do puts "yo" end -Chris From alex at verk.info Wed Jun 22 22:51:46 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Wed, 22 Jun 2005 22:51:46 -0400 Subject: Watir puns Re: [Wtr-general] form flooding in watir In-Reply-To: <20050622133630.BDVI14858.priv-edtnes40.telusplanet.net@tintin> References: <20050622133630.BDVI14858.priv-edtnes40.telusplanet.net@tintin> Message-ID: <42BA23C2.4050400@verk.info> Jonathan Kohl wrote: >>Smoke on the Watir >> >> >The smoke testing article I presume. :) > > Something like that. :) Other ideas: * Watir-resistant (or even watir-proof, up to 50 m depth) * Watirfall development methods Best regards, Alexey Verkhovsky From jkohl at telusplanet.net Wed Jun 22 22:59:31 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Wed, 22 Jun 2005 20:59:31 -0600 Subject: Watir puns Re: [Wtr-general] form flooding in watir In-Reply-To: <42BA23C2.4050400@verk.info> Message-ID: <20050623025855.TEUP13833.priv-edtnes57.telusplanet.net@tintin> Those are good ones. Before we throw some dirt on the horse... A Watirshed Moment Watir Under the Bridge Given the floods we've had in Alberta lately: Watir Watir Everywhere and Not a Drop to drink The High Watir Mark Watirlogged #doing logging with Watir I'll stop now. :) > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of Alexey Verkhovsky > Sent: June 22, 2005 8:52 PM > To: wtr-general at rubyforge.org > Subject: Re: Watir puns Re: [Wtr-general] form flooding in watir > > Jonathan Kohl wrote: > > >>Smoke on the Watir > >> > >> > >The smoke testing article I presume. :) > > > > > Something like that. :) > > Other ideas: > * Watir-resistant (or even watir-proof, up to 50 m depth) > * Watirfall development methods > > Best regards, > Alexey Verkhovsky > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Wed Jun 22 23:03:24 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 22 Jun 2005 22:03:24 -0500 Subject: Watir puns Re: [Wtr-general] form flooding in watir In-Reply-To: <42BA23C2.4050400@verk.info> References: <20050622133630.BDVI14858.priv-edtnes40.telusplanet.net@tintin> <42BA23C2.4050400@verk.info> Message-ID: <72799cd70506222003183e35da@mail.gmail.com> > Other ideas: > * Watir-resistant (or even watir-proof, up to 50 m depth) As in, "ActiveX is Watir-resistant"? > * Watirfall development methods As in, "good thing I can write test so quickly, since we're doing Watirfall"? -Chris "I love that dirty Watir, Boston you're my home" -The Standells "Baby's on fire, better throw her in the Watir" -Brian Eno From christopher.mcmahon at gmail.com Wed Jun 22 23:04:48 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 22 Jun 2005 22:04:48 -0500 Subject: Watir puns Re: [Wtr-general] form flooding in watir In-Reply-To: <20050623025855.TEUP13833.priv-edtnes57.telusplanet.net@tintin> References: <42BA23C2.4050400@verk.info> <20050623025855.TEUP13833.priv-edtnes57.telusplanet.net@tintin> Message-ID: <72799cd70506222004710c0f9c@mail.gmail.com> > Watirlogged #doing logging with Watir > Now THAT has legs... -C From k_o_g at yahoo.com Thu Jun 23 00:26:47 2005 From: k_o_g at yahoo.com (so man hung) Date: Thu, 23 Jun 2005 12:26:47 +0800 (CST) Subject: [Wtr-general] Test Case class Message-ID: <20050623042648.15757.qmail@web50906.mail.yahoo.com> I have read about the testCase class 's RDoc but i still have some problems: 1) The user's guide on the watir homepage told that "When we run the test script from the command line, test::unit uses reflection to go through our test class and execute all the test cases declared in it. The runner by default executes the test cases randomly". but i can't run the test cases in a random order. below is my sample code. require 'watir' require 'watir/WindowHelper' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'watir/testUnitAddons' class TC_myTest < Test::Unit::TestCase def test_dsda_case1 puts "1"; end def test_dsda_case2 puts "2"; end def test_dsda_case3 puts "3"; end def test_dsda_case4 puts "4"; end def test_dsda_case5 puts "5"; end end 2) i am a little bit confuse about the testSuite class and the testResult class. How can I record the result of the testCase to testResult class. moreover, is testSuite class is only a "wrapping" class for all the "test case" classes subclass from the testCase class? BTW, I found that Watir is really cool!! Hope that it can become more and more popular Cheers, lEd Mirage From satti_mg at yahoo.com Thu Jun 23 07:38:25 2005 From: satti_mg at yahoo.com (sathya shankar) Date: Thu, 23 Jun 2005 04:38:25 -0700 (PDT) Subject: [Wtr-general] Get the objects of the Table Message-ID: <20050623113825.9366.qmail@web33510.mail.mud.yahoo.com> Hi All, I am a new guy for the watir. I am planning to use the watir for my automation. And in the mean while i ran to problems with the Getting the All the objects in the table such as button, radios and images. BTW i could get the text out of the tables. Our project has the buttons, dropdown lists in the Table so i used the following command. a1=a.table(:index , "2").to_a a2=a.table(:index, "2").to_s s=a1[0].to_s puts s This gave me all the text in the table but i am not able to get the table values and then the table buttons. And my second question is how to know that the text belongs to which cells, which row and which column? I appreciate all the Help Given. Thanks Sathya Shankar __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From shaorobics at gmail.com Thu Jun 23 07:46:51 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Thu, 23 Jun 2005 07:46:51 -0400 Subject: [Wtr-general] Get the objects of the Table In-Reply-To: <20050623113825.9366.qmail@web33510.mail.mud.yahoo.com> References: <20050623113825.9366.qmail@web33510.mail.mud.yahoo.com> Message-ID: <593b9ae805062304461dca802d@mail.gmail.com> Hi, read this http://rubyforge.org/pipermail/wtr-general/2005-June/002164.html and http://rubyforge.org/pipermail/wtr-general/2005-June/002093.html It should help to get out objects in specific rows/columns from a specific table... Shao On 6/23/05, sathya shankar <satti_mg at yahoo.com> wrote: > Hi All, > > I am a new guy for the watir. I am planning to use > the watir for my automation. And in the mean while i > ran to problems with the Getting the All the objects > in the table such as button, radios and images. > > BTW i could get the text out of the tables. Our > project has the buttons, dropdown lists in the Table > so i used the following command. > > a1=a.table(:index , "2").to_a > a2=a.table(:index, "2").to_s > s=a1[0].to_s > puts s > > This gave me all the text in the table but i am not > able to get the table values and then the table > buttons. > > And my second question is how to know that the text > belongs to which cells, which row and which column? > > I appreciate all the Help Given. > > Thanks > Sathya Shankar > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From shaorobics at gmail.com Thu Jun 23 07:50:59 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Thu, 23 Jun 2005 07:50:59 -0400 Subject: [Wtr-general] Test Case class In-Reply-To: <20050623042648.15757.qmail@web50906.mail.yahoo.com> References: <20050623042648.15757.qmail@web50906.mail.yahoo.com> Message-ID: <593b9ae805062304506efe871@mail.gmail.com> if you don't want to run them in a random order, try something like this: def test_main case1() case2() .... end def case1 puts "1" end def case2 puts "2" end Since test_main is the only one that starts with test, it will only run that, but in there you make calls to your actual test cases. I actually prefer it this way as it makes it easier to run specific tests by just commenting out test cases you don't want to run...unless there is an easier way, let me know Shao On 6/23/05, so man hung <k_o_g at yahoo.com> wrote: > I have read about the testCase class 's RDoc but i > still have some problems: > 1) The user's guide on the watir homepage told that > "When we run the test script from the command line, > test::unit uses reflection to go through our test > class and execute all the test cases declared in it. > The runner by default executes the test cases > randomly". but i can't run the test cases in a random > order. below is my sample code. > require 'watir' > require 'watir/WindowHelper' > require 'test/unit' > require 'test/unit/ui/console/testrunner' > require 'watir/testUnitAddons' > > class TC_myTest < Test::Unit::TestCase > def test_dsda_case1 > puts "1"; > end > > def test_dsda_case2 > puts "2"; > end > > def test_dsda_case3 > puts "3"; > end > > def test_dsda_case4 > puts "4"; > end > > def test_dsda_case5 > puts "5"; > end > end > > 2) i am a little bit confuse about the testSuite class > and the testResult class. > How can I record the result of the testCase to > testResult class. moreover, is testSuite class is only > a "wrapping" class for all the "test case" classes > subclass from the testCase class? > > BTW, I found that Watir is really cool!! Hope that it > can become more and more popular > > Cheers, > lEd Mirage > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From jfry at lyris.com Thu Jun 23 11:16:47 2005 From: jfry at lyris.com (Jeff Fry) Date: Thu, 23 Jun 2005 08:16:47 -0700 Subject: Watir puns Re: [Wtr-general] form flooding in watir In-Reply-To: <72799cd70506222004710c0f9c@mail.gmail.com> References: <42BA23C2.4050400@verk.info> <20050623025855.TEUP13833.priv-edtnes57.telusplanet.net@tintin> <72799cd70506222004710c0f9c@mail.gmail.com> Message-ID: <42BAD25F.8020309@lyris.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050623/518a71ed/attachment.html From Kevin.Williams at Level3.com Thu Jun 23 12:00:59 2005 From: Kevin.Williams at Level3.com (Williams, Kevin) Date: Thu, 23 Jun 2005 10:00:59 -0600 Subject: Watir puns Re: [Wtr-general] form flooding in watir Message-ID: <F471782CD383EF43BE648A4AA0B808A158E1F6@idc1exc0003.corp.global.level3.com> I can't keep it in any longer: Watir torture - the new bug tracker -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jeff Fry Sent: Thursday, June 23, 2005 9:17 AM To: wtr-general at rubyforge.org Subject: Re: Watir puns Re: [Wtr-general] form flooding in watir Ok, I can't resist: Passing Watir # ...Yea, the new release was quite unstable at first, but now it's passing watir ;-) Chris McMahon wrote: Watirlogged #doing logging with Watir Now THAT has legs... -C _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Mark_Cain at rl.gov Thu Jun 23 12:07:57 2005 From: Mark_Cain at rl.gov (Cain, Mark) Date: Thu, 23 Jun 2005 09:07:57 -0700 Subject: Watir puns Re: [Wtr-general] form flooding in watir Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D2B0@EX5V.rl.gov> Ok my turn... WATIR-loo - the ultimate stress tool. --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Williams, Kevin Sent: Thursday, June 23, 2005 9:01 AM To: wtr-general at rubyforge.org Subject: RE: Watir puns Re: [Wtr-general] form flooding in watir I can't keep it in any longer: Watir torture - the new bug tracker -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jeff Fry Sent: Thursday, June 23, 2005 9:17 AM To: wtr-general at rubyforge.org Subject: Re: Watir puns Re: [Wtr-general] form flooding in watir Ok, I can't resist: Passing Watir # ...Yea, the new release was quite unstable at first, but now it's passing watir ;-) Chris McMahon wrote: Watirlogged #doing logging with Watir Now THAT has legs... -C _______________________________________________ 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 zeljko.filipin at gmail.com Thu Jun 23 12:26:45 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Thu, 23 Jun 2005 18:26:45 +0200 Subject: Watir puns Re: [Wtr-general] form flooding in watir In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D2B0@EX5V.rl.gov> References: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D2B0@EX5V.rl.gov> Message-ID: <f81b12505062309265692d6f8@mail.gmail.com> Or just 'Watir test tool - Making developers cry since 2003' (not so shure about the year, and, it is an old joke - http://blogs.msdn.com/micahel/) :) On 6/23/05, Cain, Mark <Mark_Cain at rl.gov> wrote: > Ok my turn... > > WATIR-loo - the ultimate stress tool. > > --Mark > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Williams, Kevin > Sent: Thursday, June 23, 2005 9:01 AM > To: wtr-general at rubyforge.org > Subject: RE: Watir puns Re: [Wtr-general] form flooding in watir > > I can't keep it in any longer: > > Watir torture - the new bug tracker > > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jeff Fry > Sent: Thursday, June 23, 2005 9:17 AM > To: wtr-general at rubyforge.org > Subject: Re: Watir puns Re: [Wtr-general] form flooding in watir > > Ok, I can't resist: > > Passing Watir # ...Yea, the new release was quite unstable at first, > but now it's passing watir ;-) > > > Chris McMahon wrote: > > Watirlogged #doing logging with Watir > > > > > > Now THAT has legs... > -C > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Thu Jun 23 14:29:15 2005 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 23 Jun 2005 13:29:15 -0500 Subject: [Wtr-general] Tables bug In-Reply-To: <007001c576d9$ba61a770$72d39044@NewDell> Message-ID: <5.1.0.14.2.20050623132408.02eca4e8@127.0.0.1> Paul, I'm not exactly sure about the purpose of this bug report. Are you confessing an error? Is this something you plan to fix? Are you going to add it to our bug tracker? Do you want someone else to add it to the tracker? Do you want to discuss whether it really is a bug? Are you accusing someone of breaking your code? Are you asking for someone to fix this? Bret At 10:23 PM 6/21/2005, Paul Rogers wrote: >Version 1.3.1 > >Looks like finding a table using :id and a reg exp is broken > >This uses the C:\watir_bonus\unitTests\html\table1.html file > >irb(main):004:0> ie.show_tables >Found 6 tables >1 id= rows=2 columns=2 >2 id=t1 rows=5 columns=1 >3 id=t2 rows=2 columns=2 >4 id= rows=1 columns=2 >5 id=body_test rows=5 columns=1 >6 id=pic_table rows=1 columns=4 >=> nil >irb(main):005:0> ie.table(:id, /t/).flash >Watir::Exception::UnknownObjectException: Unable to locate object, using >id and (?-mix:t) > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1979:in >`object_exist_check' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2106:in `flash' > from (irb):5 > from :0 >irb(main):006:0> > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From wkruse at sars.gov.za Tue Jun 21 09:01:44 2005 From: wkruse at sars.gov.za (Walter Kruse) Date: Tue, 21 Jun 2005 15:01:44 +0200 Subject: [Wtr-general] tracking page load times and request size with watir Message-ID: <373AA889F642934D8983245F7A514588D95A1F@gaptarcbnt00002.sars.prod> NB: This email and its contents are subject to our email legal notice which can be viewed at http://www.sars.gov.za/Email_Disclaimer.pdf ---- Hi Owen Michael Kelly's article will probably get you started. It was where I started with WATiR. http://www.informit.com/articles/article.asp?p=370634&seqNum=3 krgds Walter -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Owen Rogers Sent: 21 June 2005 01:48 To: wtr-general at rubyforge.org Subject: [Wtr-general] tracking page load times and request size with watir i'm interested in using watir to track the time it takes each page to load and the size of the returned http request. we have certain standard targets that our pages must meet (load in less than 4s in the dev/test environment, and should be small enough to support users over a dial-up connection) that i would like to bake into our automated test suite. does watir support this? if not, any suggestions on where i should begin looking to add in this functionality? cheers, owen. -- Owen Rogers | http://dotnetjunkies.com/weblog/exortech | CruiseControl.NET - http://ccnet.thoughtworks.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From martin.echtner at gmail.com Thu Jun 23 17:15:10 2005 From: martin.echtner at gmail.com (Martin Echtner) Date: Thu, 23 Jun 2005 15:15:10 -0600 Subject: [Wtr-general] Unable to access javascript popups Message-ID: <2da00b2f05062314152a92e25b@mail.gmail.com> I have tried using windowhelper/autoit and I have had no luck with it just sits there and waits once the javascript popup comes up. I am using Win XP pro and no it is not non-english. Yes the unit tests work but not when I use it in my code and I am doing pretty much the same thing. All I want to do is hit the OK button. Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050623/334ff057/attachment.html From christopher.mcmahon at gmail.com Thu Jun 23 17:59:44 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 23 Jun 2005 15:59:44 -0600 Subject: [Wtr-general] Unable to access javascript popups In-Reply-To: <2da00b2f05062314152a92e25b@mail.gmail.com> References: <2da00b2f05062314152a92e25b@mail.gmail.com> Message-ID: <72799cd705062314593afc06a5@mail.gmail.com> On 6/23/05, Martin Echtner <martin.echtner at gmail.com> wrote: > I have tried using windowhelper/autoit and I have had no luck with it just > sits there and waits once the javascript popup comes up. I am using Win XP > pro and no it is not non-english. Yes the unit tests work but not when I > use it in my code and I am doing pretty much the same thing. All I want to > do is hit the OK button. This is the most reliable way I've found to handle normal Windows clients. (Ha, ha, only serious, to quote Mr. Verkhovsky.) #!/usr/bin/perl use warnings; use strict; use Win32::GuiTest qw(FindWindowLike GetWindowText SetForegroundWindow SendKeys); system (1, "C:\\ruby\\bin\\ruby.exe C:\\watir\\unittests\\mytest.rb"); while (1) { sleep 1; my @windows = FindWindowLike(0, "^myWindowTitle" ); for (@windows) { SetForegroundWindow($_); SendKeys("{ENTER}"); } From jkohl at telusplanet.net Thu Jun 23 18:17:57 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Thu, 23 Jun 2005 15:17:57 -0700 Subject: [Wtr-general] Unable to access javascript popups In-Reply-To: <2da00b2f05062314152a92e25b@mail.gmail.com> References: <2da00b2f05062314152a92e25b@mail.gmail.com> Message-ID: <1119565077.42bb35157ff36@webmail.telusplanet.net> I've had this happen when the web browser was minimized on the task bar when using AutoIT in my own tests or running the unit test on its own. I think the Ruby version of Win32::GUITest would be the way to go if it gets running again. Or you can crack out the bronze age tool and use Perl as Chris suggests. ;) It seems to work well. -Jonathan Quoting Martin Echtner <martin.echtner at gmail.com>: > I have tried using windowhelper/autoit and I have had no luck with it just > sits there and waits once the javascript popup comes up. I am using Win XP > pro and no it is not non-english. Yes the unit tests work but not when I use > > it in my code and I am doing pretty much the same thing. All I want to do is > > hit the OK button. > > Martin > From softwarespack at yahoo.com Thu Jun 23 19:44:15 2005 From: softwarespack at yahoo.com (Scott Pack) Date: Thu, 23 Jun 2005 16:44:15 -0700 (PDT) Subject: [Wtr-general] Multiple failure scenarios with Checkbox methods Message-ID: <20050623234415.29178.qmail@web32207.mail.mud.yahoo.com> Hi, Not sure you are aware of this, I didn't see any mention of the problem in the archives. Checkbox methods fail if on the page under test you have a table that contains hrefs, and or ordered/numbered lists as data. The methods either fail to find the checkbox's or find the incorrect element. Does not have to be in the same table either. In the case below checkbox.flash finds the incorrect object -> hrefs, li, etc and FLASHES them! But for exists and set, I am unable to find the controls by any combination of name, value or index attributes. I hope that you will address this very soon. Below is a test script and html: #-------------------------------------------------------------------------------- # Checkbox failures for tables with href and ul/ol elements #-------------------------------------------------------------------------------- require 'test/unit' require 'watir' include Watir class TestAdministration < Test::Unit::TestCase @ie = nil; @url = "HTTP://localhost/epmcheckbox.html" def setup @ie = IE.new @ie.goto("HTTP://localhost/velocity.html") end def teardown @ie.close end def testEditCapabilities @ie.checkbox(:index, 1).flash @ie.checkbox(:index, 2).flash @ie.checkbox(:index, 3).flash @ie.checkbox(:index, 4).flash @ie.checkbox(:index, 5).flash @ie.checkbox(:index, 6).flash @ie.checkbox(:index, 7).flash @ie.checkbox(:index, 8).flash end end <!-- velocity.html --> <html> <head><title >FooBar</title></head> <body> <form action="" method="post"> <table> <!-- a/hrefs tags cause checkbox methods to fail --> <tr><td width="100%">Row1</td></tr> <tr><td><a href="">HRef1</a></td></tr> <tr><td><a href="">HRef2</a></td></tr> <!-- and ul/ol tags in tables cause checkbox methods to fail --> <!-- checkbox.flash causes three hits: 2 for LI1/HRef1 and 1 for HRef2 --> <tr><td> <ul> <li><a href="">ListItem1 and HRef3</a></li> <li><span>ListItem2</span></li> </ul> </td> </tr> <tr> <td> <!-- only the first checkbox is flashed.... --> <input type="checkbox" name="FooBarCheckbox" value="CB1"><span>CB1</span><br> <input type="checkbox" name="FooBarCheckbox" value="CB2"><span>CB2</span><br> <input type="checkbox" name="FooBarCheckbox" value="CB3"><span>CB3</span><br> <input type="checkbox" name="FooBarCheckbox" value="CB4"><span>CB4</span><br> <input type="checkbox" name="FooBarCheckbox" value="CB5"><span>CB5</span><br> <input type="checkbox" name="FooBarCheckbox" value="CB6"><span>CB6</span><br> <input type="checkbox" name="FooBarCheckbox" value="CB7"><span>CB7</span><br> <input type="checkbox" name="FooBarCheckbox" value="CB8"><span>CB8</span><br> </td> </tr> </table> </form> </body> </html> __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From paul.rogers at shaw.ca Thu Jun 23 22:34:50 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 23 Jun 2005 20:34:50 -0600 Subject: [Wtr-general] Unable to access javascript popups In-Reply-To: <2da00b2f05062314152a92e25b@mail.gmail.com> Message-ID: <005601c57865$4ba0b320$72d39044@NewDell> can you post the code you are using? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Martin Echtner Sent: 23 June 2005 15:15 To: wtr-general at rubyforge.org Subject: [Wtr-general] Unable to access javascript popups I have tried using windowhelper/autoit and I have had no luck with it just sits there and waits once the javascript popup comes up. I am using Win XP pro and no it is not non-english. Yes the unit tests work but not when I use it in my code and I am doing pretty much the same thing. All I want to do is hit the OK button. Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050623/2a127b60/attachment.html From huemach at Cybersoft-VN.com Fri Jun 24 00:53:41 2005 From: huemach at Cybersoft-VN.com (Hue Mach Dieu) Date: Fri, 24 Jun 2005 11:53:41 +0700 Subject: [Wtr-general] Help click on menu action Message-ID: <99DF6C0285C2CE4C99F02D78385719660169BA39@hue.cybersoft-vn.com> Dear I want click on [MENU1] but don't work My script like this Ie.frame("leftframe").link(:index, 1).click The source code as below <body> <table border="1" width="228" cellspacing="0" cellpadding="10"> <tr> <td class="index"> <div>EES</div> </td> </tr> <tr> <td class="title"> <div onClick="menuDisplay(tree1,MENU1)"> <span id="MENU1" style="cursor: hand"><img src="templates/English/images/colPoint.gif">&nbsp Operating Management</span> </div> <div id="tree1" style="display:none;" class="member"> &nbsp&nbsp&nbsp<a href="#" onClick="selectMenu(101)">Alarm - Error History</a><br> &nbsp&nbsp&nbsp<a href="#" onClick="selectMenu(102)">Alarm - Error Total</a><br> &nbsp&nbsp&nbsp<a href="#" onClick="selectMenu(103)">Equipment Operating History</a><br> &nbsp&nbsp&nbsp<a href="#" onClick="selectMenu(104)">Equipment Operating Total</a><br> &nbsp&nbsp&nbsp<a href="#" onClick="selectMenu(105)">Operating Time List</a><br> &nbsp&nbsp&nbsp<a href="#" onClick="selectMenu(106)">Operating Time Total</a><br> </div> Thank you for help Regards Hue Mach From ati.ozgur at gmail.com Fri Jun 24 03:28:50 2005 From: ati.ozgur at gmail.com (Atilla Ozgur) Date: Fri, 24 Jun 2005 10:28:50 +0300 Subject: [Wtr-general] Help click on menu action In-Reply-To: <99DF6C0285C2CE4C99F02D78385719660169BA39@hue.cybersoft-vn.com> References: <99DF6C0285C2CE4C99F02D78385719660169BA39@hue.cybersoft-vn.com> Message-ID: <b9570ed205062400287fa848e6@mail.gmail.com> require 'watir' # have sp2 therefore i use attach instead of go beacuse of javascripts ie = Watir::IE.attach(:url,/a.html/) ie.show_all_objects ie.span(:id,"MENU1").click From ashetty at velozglobal.com Fri Jun 24 06:53:37 2005 From: ashetty at velozglobal.com (Amita Shetty) Date: Fri, 24 Jun 2005 05:53:37 -0500 Subject: [Wtr-general] Unable to attach popups Message-ID: <48966054EF494649A988314F1C8307731CAA3B@DC1Mail01> Hi, I am not able to attach the popups.Using attach method gives an error stating : undefined method `attach' for #<Watir ::IE:0x2dcd948> (NoMethodError) My code is as follows: $ie.frame(:index, 2).image(:src, /icons2_add2.gif/).fire_event("onclick") sleep 5 cw =$ie.attach(:title, 'Popup') cw.text_field(:name, "Name").set("Watir World") How do I proceed?? Thanks, Amitha -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3750 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050624/2844f74a/attachment.bin From satti_mg at yahoo.com Fri Jun 24 07:13:57 2005 From: satti_mg at yahoo.com (sathya shankar) Date: Fri, 24 Jun 2005 04:13:57 -0700 (PDT) Subject: [Wtr-general] Accessing the Popup windows Message-ID: <20050624111357.33098.qmail@web33508.mail.mud.yahoo.com> Hi I Want to know how to access the Popup window in watir. d=a.frame("mainFrame") d.show_links() d.select_list(:name, "actionSelect209").select("Delete") d.link(:index, 8).click w = WinClicker.new w.clickWindowsButton("Microsoft Internet Explorer", "OK") w.clickJavaScriptDialog("OK") I know that i have hard coded here but its working upto the Poup window and then it doesnt presses the Ok button and displays the whole options and objects under the microsoft internet explorer after i click on cancel button. I appreciate all the help regarding this. Thanks Sathya Shankar __________________________________ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail From ati.ozgur at gmail.com Fri Jun 24 07:18:24 2005 From: ati.ozgur at gmail.com (Atilla Ozgur) Date: Fri, 24 Jun 2005 14:18:24 +0300 Subject: [Wtr-general] Unable to attach popups In-Reply-To: <48966054EF494649A988314F1C8307731CAA3B@DC1Mail01> References: <48966054EF494649A988314F1C8307731CAA3B@DC1Mail01> Message-ID: <b9570ed2050624041843343b5b@mail.gmail.com> Look to popup test in unittest folder. On 6/24/05, Amita Shetty <ashetty at velozglobal.com> wrote: > Hi, > I am not able to attach the popups.Using attach method gives an error stating > : undefined method `attach' for #<Watir > ::IE:0x2dcd948> (NoMethodError) > > > My code is as follows: > $ie.frame(:index, 2).image(:src, /icons2_add2.gif/).fire_event("onclick") > sleep 5 > cw =$ie.attach(:title, 'Popup') > cw.text_field(:name, "Name").set("Watir World") > > How do I proceed?? > > Thanks, > Amitha > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > From ashetty at velozglobal.com Fri Jun 24 07:27:42 2005 From: ashetty at velozglobal.com (Amita Shetty) Date: Fri, 24 Jun 2005 06:27:42 -0500 Subject: [Wtr-general] Unable to attach popups Message-ID: <48966054EF494649A988314F1C8307731CAA3F@DC1Mail01> I have seen the popup test. That works fine if the popup is an alert or prompt message. But the popup which I am trying to attach here is another window where I need to click on a link.I am not able to attach it. Please help me in this regard. Thanks, Amitha -----Original Message----- From: wtr-general-bounces at rubyforge.org on behalf of Atilla Ozgur Sent: Fri 6/24/2005 6:18 AM To: wtr-general at rubyforge.org Cc: Subject: Re: [Wtr-general] Unable to attach popups Look to popup test in unittest folder. On 6/24/05, Amita Shetty <ashetty at velozglobal.com> wrote: > Hi, > I am not able to attach the popups.Using attach method gives an error stating > : undefined method `attach' for #<Watir > ::IE:0x2dcd948> (NoMethodError) > > > My code is as follows: > $ie.frame(:index, 2).image(:src, /icons2_add2.gif/).fire_event("onclick") > sleep 5 > cw =$ie.attach(:title, 'Popup') > cw.text_field(:name, "Name").set("Watir World") > > How do I proceed?? > > Thanks, > Amitha > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5022 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050624/47c12a43/attachment.bin From zeljko.filipin at gmail.com Fri Jun 24 07:39:51 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Fri, 24 Jun 2005 13:39:51 +0200 Subject: [Wtr-general] Unable to attach popups In-Reply-To: <48966054EF494649A988314F1C8307731CAA3F@DC1Mail01> Message-ID: <42bbf0d8.50560d44.1967.7594@mx.gmail.com> Try this: require 'watir' include Watir ie = IE.attach(:title, 'Popup') It works just fine for me. Let me know if it did not help you. Zeljko _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Amita Shetty Sent: Friday, June 24, 2005 1:28 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Unable to attach popups I have seen the popup test. That works fine if the popup is an alert or prompt message. But the popup which I am trying to attach here is another window where I need to click on a link.I am not able to attach it. Please help me in this regard. Thanks, Amitha -----Original Message----- From: wtr-general-bounces at rubyforge.org on behalf of Atilla Ozgur Sent: Fri 6/24/2005 6:18 AM To: wtr-general at rubyforge.org Cc: Subject: Re: [Wtr-general] Unable to attach popups Look to popup test in unittest folder. On 6/24/05, Amita Shetty <ashetty at velozglobal.com> wrote: > Hi, > I am not able to attach the popups.Using attach method gives an error stating > : undefined method `attach' for #<Watir > ::IE:0x2dcd948> (NoMethodError) > > > My code is as follows: > $ie.frame(:index, 2).image(:src, /icons2_add2.gif/).fire_event("onclick") > sleep 5 > cw =$ie.attach(:title, 'Popup') > cw.text_field(:name, "Name").set("Watir World") > > How do I proceed?? > > Thanks, > Amitha > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 4654 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050624/c85b63ca/attachment.bin From ashetty at velozglobal.com Fri Jun 24 08:38:44 2005 From: ashetty at velozglobal.com (Amita Shetty) Date: Fri, 24 Jun 2005 07:38:44 -0500 Subject: [Wtr-general] Unable to attach popups Message-ID: <48966054EF494649A988314F1C8307731CAA41@DC1Mail01> Its working now. Thank you. -----Original Message----- From: wtr-general-bounces at rubyforge.org on behalf of Zeljko Filipin Sent: Fri 6/24/2005 6:39 AM To: wtr-general at rubyforge.org Cc: Subject: RE: [Wtr-general] Unable to attach popups Try this: require 'watir' include Watir ie = IE.attach(:title, 'Popup') It works just fine for me. Let me know if it did not help you. Zeljko _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Amita Shetty Sent: Friday, June 24, 2005 1:28 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Unable to attach popups I have seen the popup test. That works fine if the popup is an alert or prompt message. But the popup which I am trying to attach here is another window where I need to click on a link.I am not able to attach it. Please help me in this regard. Thanks, Amitha -----Original Message----- From: wtr-general-bounces at rubyforge.org on behalf of Atilla Ozgur Sent: Fri 6/24/2005 6:18 AM To: wtr-general at rubyforge.org Cc: Subject: Re: [Wtr-general] Unable to attach popups Look to popup test in unittest folder. On 6/24/05, Amita Shetty <ashetty at velozglobal.com> wrote: > Hi, > I am not able to attach the popups.Using attach method gives an error stating > : undefined method `attach' for #<Watir > ::IE:0x2dcd948> (NoMethodError) > > > My code is as follows: > $ie.frame(:index, 2).image(:src, /icons2_add2.gif/).fire_event("onclick") > sleep 5 > cw =$ie.attach(:title, 'Popup') > cw.text_field(:name, "Name").set("Watir World") > > How do I proceed?? > > Thanks, > Amitha > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 6746 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050624/71ac6481/attachment.bin From DBoyt at anteon.com Fri Jun 24 10:00:09 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Fri, 24 Jun 2005 10:00:09 -0400 Subject: [Wtr-general] Tidy Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC8709602@HQ-EXVS02.anteon.com> Has anyone on the list used the Tidy lib with watir to validate a page's accessibility, structure, etc.? Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama From sboland at shiftwise.net Fri Jun 24 11:10:08 2005 From: sboland at shiftwise.net (Scott Boland - Origin) Date: Fri, 24 Jun 2005 10:10:08 -0500 Subject: [Wtr-general] Wiki access. Was RE: Unable to attach popups Message-ID: <OMECJNMKDCKGNJGAFKKAAEHMCCAA.sboland@shiftwise.net> I would like to have access to the Wiki in order to post solutions to some of the common problems being seen in emails on Watir. Apparently the issue with using JS Popups comes up regularly, not to mention selection of sub elements and the like. > I have seen the popup test. That works fine if the popup is an alert or prompt message. > But the popup which I am trying to attach here is another window where I need to click > on a link.I am not able to attach it. Please help me in this regard. > > Thanks, > Amitha The documentation is unclear on what is going on here. What you desire may be possible, but not with the obvious code samples. Issue 1: Ruby won't allow access to the 'attach' method under some circumstances. Won't work: require 'watir' x = Watir::IE x.attach( :url, /url/) Will Work: require 'watir' include Watir # Provides access to methods otherwise inaccessible x = IE.attach( :url, /url/) Recommended: require 'watir' x = Watir::IE.attach( :url, /url/) Issue 2: Control of popup windows is unclear in the documentation. The problem stems from the fact that the IE controller object never completes the action that creates the JS popup until that popup closes down. The Unittests and I imagine other people getting around the problem are creating a separate ruby system process to find and activate the buttons on the popup window. What we need is a way to click on a link and start an independent thread easily. For my own use I've encoded multiple 'click' methods in addition to the standard one. item.click # Use the standard IE controller click ie = item.popupClick( :title, /url/) #Create new controller, attach ie to new one item.jsClick( :title, /url/, keys) #Activates JS Window and sends keystrokes to it What I would try is creating a new method modalClick for handling a modal JS window with more complex entries that simply sending keystrokes can't handle. I don't know if Watir will be able to attach to such a dialog and read data from it or not. However, our app does have such a creature, so I'll go ahead and see. -- Scott B From bret at pettichord.com Fri Jun 24 11:34:48 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 24 Jun 2005 10:34:48 -0500 Subject: [Wtr-general] Wiki access. Was RE: Unable to attach popups In-Reply-To: <OMECJNMKDCKGNJGAFKKAAEHMCCAA.sboland@shiftwise.net> Message-ID: <5.1.0.14.2.20050624103421.02f16650@127.0.0.1> At 10:10 AM 6/24/2005, Scott Boland - Origin wrote: >I would like to have access to the Wiki in order to post solutions to some >of the common problems being seen in emails on Watir. You have it. Every one does. _____________________ Bret Pettichord www.pettichord.com From paul.rogers at shaw.ca Fri Jun 24 14:10:18 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 24 Jun 2005 12:10:18 -0600 Subject: [Wtr-general] Tidy In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC8709602@HQ-EXVS02.anteon.com> Message-ID: <002701c578e7$facd3c60$72d39044@NewDell> I don't think you can get the original html, only Ies version of it ( which has often changed from the page sent by the server), so using tidy doesn't validate the right stuff. If we can get the original, it would be a nice addition Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 24 June 2005 08:00 To: wtr-general at rubyforge.org Subject: [Wtr-general] Tidy Has anyone on the list used the Tidy lib with watir to validate a page's accessibility, structure, etc.? Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Fri Jun 24 14:10:07 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 24 Jun 2005 13:10:07 -0500 Subject: [Wtr-general] Multiple failure scenarios with Checkbox methods In-Reply-To: <20050623234415.29178.qmail@web32207.mail.mud.yahoo.com> Message-ID: <5.1.0.14.2.20050624130930.02fc0c70@127.0.0.1> Scott, Thanks for the report and example. The html page got munged by our mail filter. Could you send it as an attachment? Bret At 06:44 PM 6/23/2005, Scott Pack wrote: >Hi, > >Not sure you are aware of this, I didn't see any >mention of the problem in the archives. > >Checkbox methods fail if on the page under test you >have a table that contains hrefs, and or >ordered/numbered lists as data. The methods either >fail to find the checkbox's or find the incorrect >element. Does not have to be in the same table either. > >In the case below checkbox.flash finds the incorrect >object -> hrefs, li, etc and FLASHES them! But for >exists and set, I am unable to find the controls by >any combination of name, value or index attributes. > >I hope that you will address this very soon. > >Below is a test script and html: > >#-------------------------------------------------------------------------------- ># Checkbox failures for tables with href and ul/ol >elements >#-------------------------------------------------------------------------------- > >require 'test/unit' >require 'watir' >include Watir > >class TestAdministration < Test::Unit::TestCase > @ie = nil; > @url = "HTTP://localhost/epmcheckbox.html" > > def setup > @ie = IE.new > @ie.goto("HTTP://localhost/velocity.html") > end > > def teardown > @ie.close > end > > def testEditCapabilities > @ie.checkbox(:index, 1).flash > @ie.checkbox(:index, 2).flash > @ie.checkbox(:index, 3).flash > @ie.checkbox(:index, 4).flash > @ie.checkbox(:index, 5).flash > @ie.checkbox(:index, 6).flash > @ie.checkbox(:index, 7).flash > @ie.checkbox(:index, 8).flash > end >end > ><!-- velocity.html --> >Row1 >HRef1 >HRef2 > * ListItem1 and HRef3 > * ListItem2 >CB1 >CB2 >CB3 >CB4 >CB5 >CB6 >CB7 >CB8 > > >__________________________________________________ >Do You Yahoo!? >Tired of spam? Yahoo! Mail has the best spam protection around >http://mail.yahoo.com >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From sboland at shiftwise.net Fri Jun 24 14:43:48 2005 From: sboland at shiftwise.net (Scott Boland - Origin) Date: Fri, 24 Jun 2005 13:43:48 -0500 Subject: [Wtr-general] RE: Wiki access. Was RE: Unable to attach popups In-Reply-To: <OMECJNMKDCKGNJGAFKKAAEHMCCAA.sboland@shiftwise.net> Message-ID: <OMECJNMKDCKGNJGAFKKAAEHNCCAA.sboland@shiftwise.net> Tested it out. Nope, can't attach an IE controller to a modal popup window. Best I can do is send blind keystrokes to it. If a developer believes this to be incorrect, send me an email and I'll give you a link to see the behavior in question. -- Scott B -----Original Message----- I would like to have access to the Wiki in order to post solutions to some of the common problems being seen in emails on Watir. Apparently the issue with using JS Popups comes up regularly, not to mention selection of sub elements and the like. > I have seen the popup test. That works fine if the popup is an alert or prompt message. > But the popup which I am trying to attach here is another window where I need to click > on a link.I am not able to attach it. Please help me in this regard. > > Thanks, > Amitha The documentation is unclear on what is going on here. What you desire may be possible, but not with the obvious code samples. Issue 1: Ruby won't allow access to the 'attach' method under some circumstances. Won't work: require 'watir' x = Watir::IE x.attach( :url, /url/) Will Work: require 'watir' include Watir # Provides access to methods otherwise inaccessible x = IE.attach( :url, /url/) Recommended: require 'watir' x = Watir::IE.attach( :url, /url/) Issue 2: Control of popup windows is unclear in the documentation. The problem stems from the fact that the IE controller object never completes the action that creates the JS popup until that popup closes down. The Unittests and I imagine other people getting around the problem are creating a separate ruby system process to find and activate the buttons on the popup window. What we need is a way to click on a link and start an independent thread easily. For my own use I've encoded multiple 'click' methods in addition to the standard one. item.click # Use the standard IE controller click ie = item.popupClick( :title, /url/) #Create new controller, attach ie to new one item.jsClick( :title, /url/, keys) #Activates JS Window and sends keystrokes to it What I would try is creating a new method modalClick for handling a modal JS window with more complex entries that simply sending keystrokes can't handle. I don't know if Watir will be able to attach to such a dialog and read data from it or not. However, our app does have such a creature, so I'll go ahead and see. -- Scott B From paul.rogers at shaw.ca Fri Jun 24 16:17:46 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 24 Jun 2005 14:17:46 -0600 Subject: [Wtr-general] Multiple failure scenarios with Checkbox methods In-Reply-To: <20050623234415.29178.qmail@web32207.mail.mud.yahoo.com> Message-ID: <002801c578f9$c8e64090$72d39044@NewDell> The fix is to change this line in watir.rb in getObject method o = getObjectAtIndex( container, what , types , value) To o = getObjectAtIndex( container, what , elementTypes , value) I guess our unit tests only use :index when all the elements are the same type. Need to look into these to make sure we get some better tests Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Scott Pack Sent: 23 June 2005 17:44 To: wtr-general at rubyforge.org Subject: [Wtr-general] Multiple failure scenarios with Checkbox methods Hi, Not sure you are aware of this, I didn't see any mention of the problem in the archives. Checkbox methods fail if on the page under test you have a table that contains hrefs, and or ordered/numbered lists as data. The methods either fail to find the checkbox's or find the incorrect element. Does not have to be in the same table either. In the case below checkbox.flash finds the incorrect object -> hrefs, li, etc and FLASHES them! But for exists and set, I am unable to find the controls by any combination of name, value or index attributes. I hope that you will address this very soon. Below is a test script and html: #----------------------------------------------------------------------- --------- # Checkbox failures for tables with href and ul/ol elements #----------------------------------------------------------------------- --------- require 'test/unit' require 'watir' include Watir class TestAdministration < Test::Unit::TestCase @ie = nil; @url = "HTTP://localhost/epmcheckbox.html" def setup @ie = IE.new @ie.goto("HTTP://localhost/velocity.html") end def teardown @ie.close end def testEditCapabilities @ie.checkbox(:index, 1).flash @ie.checkbox(:index, 2).flash @ie.checkbox(:index, 3).flash @ie.checkbox(:index, 4).flash @ie.checkbox(:index, 5).flash @ie.checkbox(:index, 6).flash @ie.checkbox(:index, 7).flash @ie.checkbox(:index, 8).flash end end <!-- velocity.html --> <html> <head><title >FooBar</title></head> <body> <form action="" method="post"> <table> <!-- a/hrefs tags cause checkbox methods to fail --> <tr><td width="100%">Row1</td></tr> <tr><td><a href="">HRef1</a></td></tr> <tr><td><a href="">HRef2</a></td></tr> <!-- and ul/ol tags in tables cause checkbox methods to fail --> <!-- checkbox.flash causes three hits: 2 for LI1/HRef1 and 1 for HRef2 --> <tr><td> <ul> <li><a href="">ListItem1 and HRef3</a></li> <li><span>ListItem2</span></li> </ul> </td> </tr> <tr> <td> <!-- only the first checkbox is flashed.... --> <input type="checkbox" name="FooBarCheckbox" value="CB1"><span>CB1</span><br> <input type="checkbox" name="FooBarCheckbox" value="CB2"><span>CB2</span><br> <input type="checkbox" name="FooBarCheckbox" value="CB3"><span>CB3</span><br> <input type="checkbox" name="FooBarCheckbox" value="CB4"><span>CB4</span><br> <input type="checkbox" name="FooBarCheckbox" value="CB5"><span>CB5</span><br> <input type="checkbox" name="FooBarCheckbox" value="CB6"><span>CB6</span><br> <input type="checkbox" name="FooBarCheckbox" value="CB7"><span>CB7</span><br> <input type="checkbox" name="FooBarCheckbox" value="CB8"><span>CB8</span><br> </td> </tr> </table> </form> </body> </html> __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From sboland at shiftwise.net Fri Jun 24 17:14:30 2005 From: sboland at shiftwise.net (Scott Boland - Origin) Date: Fri, 24 Jun 2005 16:14:30 -0500 Subject: [Wtr-general] BUG: New IE windows share session state with existing open windows Message-ID: <OMECJNMKDCKGNJGAFKKAOEHNCCAA.sboland@shiftwise.net> The web application I am looking at uses unique session states with the client browser to keep track of what should be displayed. In order to use a different login to the same site from the same location one has to open a _new_ IE session and cannot re-use any existing ones. Apparently if one uses WIN32OLE.new('InternetExplorer.Application') some system shortcut discovers there is already an existing ie session, and all of the session information from the existing connection is used instead of a fresh document. When opening a fresh ie controller it is important for me to be able to create a brand new window. My current workaround is simply to run iexplorer from a shell and then attach to it. `"c:\\Program Files\\Internet Explorer\\iexplore.exe" http://localhost ` ie = Watir::IE.attach( :url, 'http://loclahost') This guarantees the window will not be contaminated with data from a previous session. Probably the correct way to do this in Watir is to use WIN32OLE.new('Shell.Application') and run the executable, rather than simply starting a new instance of InternetExplorer.Application -- Scott B From martin.echtner at gmail.com Fri Jun 24 17:40:59 2005 From: martin.echtner at gmail.com (Martin Echtner) Date: Fri, 24 Jun 2005 15:40:59 -0600 Subject: [Wtr-general] Unable to access javascript popups Message-ID: <2da00b2f0506241440527a15bb@mail.gmail.com> wc=WinClicker.new $ie.selectBox(:name, "action").select_value("delete") wc.clickJSDialog_NewProcess() $ie.button(:value, "Go").click #invokes js popup wc.clickJavaScriptDialog() i get this error 1) Error: test_new_modules_class(Test_Template): NoMethodError: undefined method `log' for #<WinClicker:0x2b89848> c:/ruby/lib/ruby/site_ruby/1.8/watir/winClicker.rb:124:in `clickJSDialog_NewProcess' C:/watir_bonus/releaseplannertesting/RPUtilities/StakeHoldersRP.rb:157:in `removeSH' C:/watir_bonus/releaseplannertesting/RPUtilities/Test.rb:75:in `test_new_modules_class' Have also tried this: helper = WindowHelper.new $ie.selectBox(:name, "action").select_value("delete") $ie.button(:value, "Go").click #invokes js popup helper.push_confirm_button_ok() it just hangs till I hit enter or select the OK button and I have to hit ctrl c to get the test to stop waiting in the cmd window. The window is maximized and the js popup is the active window I have dual monitors maybe this matters??? not sure. Thanks Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050624/9aa10d25/attachment.html From martin.echtner at gmail.com Fri Jun 24 18:38:21 2005 From: martin.echtner at gmail.com (Martin Echtner) Date: Fri, 24 Jun 2005 16:38:21 -0600 Subject: [Wtr-general] Unable to access javascript popups Message-ID: <2da00b2f0506241538ff11d0a@mail.gmail.com> using the AutoIt I was able to get it to work only after I hit OK manually then made the pop appear again in the same instance of the test and after doing this it sent the OK command from AutoIt. So I tried putting in a sleep() in my test so it has time to find the OK button this doesn't help either, I am stumped. martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050624/417b0ee2/attachment.html From exortech at gmail.com Fri Jun 24 19:09:38 2005 From: exortech at gmail.com (Owen Rogers) Date: Fri, 24 Jun 2005 19:09:38 -0400 Subject: [Wtr-general] Unable to access javascript popups In-Reply-To: <2da00b2f0506241538ff11d0a@mail.gmail.com> References: <2da00b2f0506241538ff11d0a@mail.gmail.com> Message-ID: <d125f85d05062416093e685356@mail.gmail.com> try looking at the WindowLogonExample.rb file in the unittests folder. it launches a new thread to create a system process to talk to autoit. i believe (though i'm also new to watir) that this is the preferred approach to dealing with popups. it would be nice if this thread and process spawning logic was encapsulated in a class somewhere (it probably is and i just haven't found it yet). cheers, owen. On 6/24/05, Martin Echtner <martin.echtner at gmail.com> wrote: > using the AutoIt I was able to get it to work only after I hit OK manually > then made the pop appear again in the same instance of the test and after > doing this it sent the OK command from AutoIt. > > So I tried putting in a sleep() in my test so it has time to find the OK > button this doesn't help either, I am stumped. > > martin > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > -- Owen Rogers | http://dotnetjunkies.com/weblog/exortech | CruiseControl.NET - http://ccnet.thoughtworks.com From chrismo at clabs.org Fri Jun 24 21:42:56 2005 From: chrismo at clabs.org (Chris Morris) Date: Fri, 24 Jun 2005 20:42:56 -0500 Subject: [Wtr-general] Wiki access. Was RE: Unable to attach popups In-Reply-To: <OMECJNMKDCKGNJGAFKKAAEHMCCAA.sboland@shiftwise.net> References: <OMECJNMKDCKGNJGAFKKAAEHMCCAA.sboland@shiftwise.net> Message-ID: <42BCB6A0.6080007@clabs.org> Scott Boland - Origin wrote: >I would like to have access to the Wiki in order to post solutions to some >of the common problems being seen in emails on Watir. > > The old wiki on clabs.org requires a different url to post to it, but the newer wiki should let anyone post, as Bret said. Don't post anything to the clabs.org one, it's on its way out. -- Chris http://clabs.org/blogki From bret at pettichord.com Fri Jun 24 23:46:22 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 24 Jun 2005 22:46:22 -0500 Subject: [Wtr-general] Unable to access javascript popups In-Reply-To: <d125f85d05062416093e685356@mail.gmail.com> References: <2da00b2f0506241538ff11d0a@mail.gmail.com> <2da00b2f0506241538ff11d0a@mail.gmail.com> Message-ID: <5.1.0.14.2.20050624224513.02f25628@127.0.0.1> At 06:09 PM 6/24/2005, Owen Rogers wrote: >it would be nice if this >thread and process spawning logic was encapsulated in a class >somewhere (it probably is and i just haven't found it yet). It would be nice, but we haven't done it yet. _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Fri Jun 24 23:54:19 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 24 Jun 2005 22:54:19 -0500 Subject: [Wtr-general] BUG: New IE windows share session state with existing open windows In-Reply-To: <OMECJNMKDCKGNJGAFKKAOEHNCCAA.sboland@shiftwise.net> Message-ID: <5.1.0.14.2.20050624224822.02f258a8@127.0.0.1> +1 on providing a better method for creating new IE windows with new sessions. This is a common issue and something that Watir needs to make easier to do. -1 on your particular suggestion as a general solution. Your suggestion depends on IE.attach, which uses heuristic methods. I don't know how to ensure that a call to IE.attach will attach to the iexplore window that was just spawned in the general case. I wish i had a better alternative, however. Bret At 04:14 PM 6/24/2005, Scott Boland - Origin wrote: >The web application I am looking at uses unique session states with the >client browser to keep track of what should be displayed. In order to use a >different login to the same site from the same location one has to open a >_new_ IE session and cannot re-use any existing ones. > >Apparently if one uses WIN32OLE.new('InternetExplorer.Application') some >system shortcut discovers there is already an existing ie session, and all >of the session information from the existing connection is used instead of a >fresh document. > >When opening a fresh ie controller it is important for me to be able to >create a brand new window. My current workaround is simply to run >iexplorer from a shell and then attach to it. > > `"c:\\Program Files\\Internet Explorer\\iexplore.exe" > http://localhost ` > ie = Watir::IE.attach( :url, 'http://loclahost') > >This guarantees the window will not be contaminated with data from a >previous session. >Probably the correct way to do this in Watir is to use >WIN32OLE.new('Shell.Application') and run the executable, rather than simply >starting a new instance of InternetExplorer.Application > > > -- Scott B > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From martin.echtner at gmail.com Mon Jun 27 12:44:26 2005 From: martin.echtner at gmail.com (Martin Echtner) Date: Mon, 27 Jun 2005 10:44:26 -0600 Subject: [Wtr-general] Unable to access javascript popups Message-ID: <2da00b2f050627094445fc937@mail.gmail.com> So I finally got it to work this is what I had to do: $ie.selectBox(:name, "action").select_value("delete") a=Thread.new{ system('ruby PushOkButton.rb') } $ie.button(:value, "Go").click sleep(1) a.join I had to make this module that is called PushOkButton.rb it contains this code: $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ require 'watir/WindowHelper' helper = WindowHelper.new helper.push_confirm_button_ok() Not sure why I couldn't just call this code in the new thread, but it works now! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050627/e2b1940a/attachment.html From softwarespack at yahoo.com Mon Jun 27 14:45:46 2005 From: softwarespack at yahoo.com (Scott Pack) Date: Mon, 27 Jun 2005 11:45:46 -0700 (PDT) Subject: [Wtr-general] Checkbox failures using :value attribute Message-ID: <20050627184546.1535.qmail@web32205.mail.mud.yahoo.com> In followup to my previous report of problems with checkboxes, there is another issue. Checkbox calls fail when using the :value attribute. This because the call in getObject to getObjectsWithValue does not include the type passed into getObject. The fix is below: o = getObjectWithValue( what, container , types, "submit" , "button" ) I suppose this bug would affect other control types as well, but I haven't experienced it directly yet. Thanks. Scott __________________________________ Discover Yahoo! Get on-the-go sports scores, stock quotes, news and more. Check it out! http://discover.yahoo.com/mobile.html From softwarespack at yahoo.com Mon Jun 27 14:53:43 2005 From: softwarespack at yahoo.com (Scott Pack) Date: Mon, 27 Jun 2005 11:53:43 -0700 (PDT) Subject: [Wtr-general] Re: Wtr-general Digest, Vol 19, Issue 36 In-Reply-To: <200506242136.j5OLaMcS003090@rubyforge.org> Message-ID: <20050627185343.55200.qmail@web32212.mail.mud.yahoo.com> Paul, Yes this works. Thanks. You do intent to commit this in CVS I hope. Scott > The fix is to change this line in watir.rb in > getObject method > > o = getObjectAtIndex( container, what , types , > value) > > To > > o = getObjectAtIndex( container, what , elementTypes > , value) > > I guess our unit tests only use :index when all the > elements are the > same type. Need to look into these to make sure we > get some better tests > > Paul > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From shaorobics at gmail.com Wed Jun 29 13:12:08 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Wed, 29 Jun 2005 13:12:08 -0400 Subject: [Wtr-general] dbi & stored procedures Message-ID: <593b9ae805062910126738c29@mail.gmail.com> Hi, I have a stored procedure as follows: CREATE procedure dbo.DeleteGlobalBudget @year as smallint as delete from ProjectScenario where ProjectScenarioID in (select ID from vProjectScenario where FiscalYear = @year) delete from Project where ProjectID in (select ID from vProject where FiscalYear = @year) delete from Tactic where TacticID in (select ID from vTactic where FiscalYear = @year) delete from Strategy where StrategyID in (select ID from vStrategy where FiscalYear = @year) delete from Issue where IssueID in (select ID from vIssue where FiscalYear = @year) delete from ProductBudget where FiscalYear = @year delete from GlobalBudget where FiscalYear = @year I'm trying to call this stored procedure using dbi and ruby. I get no errors, but it doesn't do anything. I have tried cmd = dbh.prepare("EXECUTE deleteGlobalBudget 2049") and other variations to no avail. I also tried copying all the code from the stored procedure and executing it: cmd.do("delete from ProjectScenario where ProjectScenarioID in (select ID from vProjectScenario where FiscalYear = 2049)") ... ...etc again, it runs but it doesn't do anything to the database. I know this stored procedure works because when I call it within an asp page, it actually goes in and deletes the records. Any idea? From tuyet.ctn at mscibarra.com Wed Jun 29 17:24:44 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Wed, 29 Jun 2005 14:24:44 -0700 Subject: [Wtr-general] Working with JavaScripts Message-ID: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3DBE@iris.win.barra.com> I am looking at your unittests example jscript_test.rb and can't figure out what check_dialog refers to?: check_dialog('jscriptExtraAlert', /Alert OK/){ $ie.button(:id, 'btnAlert').click } In my application, I am trying to figure out how to click on the image "/image/icon_open.gif" (see bolded text below) that will launch a dialog. I've tried many things from the WATIR User Guide but no luck: irb(main):003:0> ie.frame("main").frame(:name, "context_bar").getHTML => "\r\n<BODY class=contextBarBody onload=javascript:onLoad() onunload=javascrip t:closeContextBarPopups();cOnUnload();><FORM name=headerform onsubmit=\"return f alse;\">\r\n<TABLE cellSpacing=0 cellPadding=0 width=\"100%\" border=0>\r\n<TBOD Y>\r\n<TR>\r\n<TD vAlign=center>\r\n<TABLE height=24 cellSpacing=0 cellPadding=0 width=\"100%\" border=0>\r\n<TBODY>\r\n<TR>\r\n<TD width=40><NOBR>&nbsp;<IMG on mouseover=\"window.status=' ';return true;\" alt=\"You do not have a portfolio o pen to save\" src=\"/images/icon_save_gray.gif\" border=0> &nbsp;<A onclick=java script:onClickOpen(); href=\"#\"><IMG onmouseover=\"window.status='Select Portfo lio';return true;\" alt=\"Select Portfolio\" src=\"/images/icon_open.gif\" borde r=0></A> &nbsp;<IMG onmouseover=\"window.status=' ';return true;\" alt=\"You do not have a portfolio open to save\" src=\"/images/icon_save_as_off.gif\" border= This should work, but I got compiled error. irb(main):007:0> ie.frame("main").frame(:name, "context_bar").image(:src, icon_open.gif/).fire_event("onmouseover") SyntaxError: compile error (irb):7: syntax error ie.frame("main").frame(:name, "context_bar").image(:src, icon_open.gif/).fire_event("onmouseover") ^ from (irb):7 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050629/59b3400c/attachment.html From shaorobics at gmail.com Wed Jun 29 22:53:05 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Wed, 29 Jun 2005 22:53:05 -0400 Subject: [Wtr-general] Working with JavaScripts In-Reply-To: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3DBE@iris.win.barra.com> References: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3DBE@iris.win.barra.com> Message-ID: <593b9ae805062919535814affa@mail.gmail.com> My guess would be to change irb(main):007:0> ie.frame("main").frame(:name, "context_bar").image(:src, icon_open.gif/).fire_event("onmouseover") to irb(main):007:0> ie.frame("main").frame(:name, "context_bar").image(:src, /icon_open.gif/).fire_event("onmouseover") Shao On 6/29/05, Tuyet Cong-Ton-Nu <tuyet.ctn at mscibarra.com> wrote: > > > I am looking at your unittests example jscript_test.rb and can't figure out > what check_dialog refers to?: > > > > check_dialog('jscriptExtraAlert', /Alert OK/){ > $ie.button(:id, 'btnAlert').click } > > > > In my application, I am trying to figure out how to click on the image > "/image/icon_open.gif" (see bolded text below) that will launch a dialog. > I've tried many things from the WATIR User Guide but no luck: > > > > irb(main):003:0> ie.frame("main").frame(:name, "context_bar").getHTML > > => "\r\n<BODY class=contextBarBody onload=javascript:onLoad() > onunload=javascrip > > t:closeContextBarPopups();cOnUnload();><FORM > name=headerform onsubmit=\"return f > > alse;\">\r\n<TABLE cellSpacing=0 cellPadding=0 width=\"100%\" > border=0>\r\n<TBOD > > Y>\r\n<TR>\r\n<TD vAlign=center>\r\n<TABLE height=24 cellSpacing=0 > cellPadding=0 > > width=\"100%\" border=0>\r\n<TBODY>\r\n<TR>\r\n<TD > width=40><NOBR>&nbsp;<IMG on > > mouseover=\"window.status=' ';return true;\" alt=\"You do not have a > portfolio o > > pen to save\" src=\"/images/icon_save_gray.gif\" border=0> > &nbsp;<A onclick=java > > script:onClickOpen(); href=\"#\"><IMG onmouseover=\"window.status='Select > Portfo > > lio';return true;\" alt=\"Select Portfolio\" src=\"/images/icon_open.gif\" > borde > > r=0></A> &nbsp;<IMG onmouseover=\"window.status=' ';return true;\" alt=\"You > do > > not have a portfolio open to save\" > src=\"/images/icon_save_as_off.gif\" border= > > > > > > This should work, but I got compiled error. > > irb(main):007:0> ie.frame("main").frame(:name, "context_bar").image(:src, > icon_open.gif/).fire_event("onmouseover") > > SyntaxError: compile error > > (irb):7: syntax error > > ie.frame("main").frame(:name, "context_bar").image(:src, > icon_open.gif/).fire_event("onmouseover") > > > > ^ > > from (irb):7 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > From dvshchyokin at hotmail.com Thu Jun 30 13:43:09 2005 From: dvshchyokin at hotmail.com (Daniel Shchyokin) Date: Thu, 30 Jun 2005 17:43:09 +0000 Subject: [Wtr-general] Can't get access to a child winow object Message-ID: <BAY101-F4059F3C7065D089B20F2C2B7E30@phx.gbl> I am trying to run the "newWindow_test" unit test for Watir (I actually have another script but the unit test has almost exactly the same code, and exactly the same problem as my script), and getting the output C:\Watir\unittests>newWindow_test.rb Loaded suite C:/Watir/unittests/newWindow_test Started E Finished in 0.44 seconds. 1) Error: test_newWindows(TC_Links): NoMethodError: undefined method `title' for nil:NilClass C:/Watir_Bonus/unittests/newWindow_test.rb:15:in `test_newWindows' every time. The js popup test is also having problems (auto-it dll was registered OK according the the message at the end of install) I am using the latest version of watir/ruby with default installs The OS is Win2K, the Browser is ie6 I've googled for this problem, and read the list but only found an error Is there any additional configuration I have to do to be able to run this test? From tuyet.ctn at mscibarra.com Thu Jun 30 14:17:30 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Thu, 30 Jun 2005 11:17:30 -0700 Subject: [Wtr-general] Working with JavaScripts Message-ID: <AA1E1F7FC9E1124F999E37BFA1DD344707FA3DC3@iris.win.barra.com> Thanks, Shao. Your suggestion: irb(main):007:0> ie.frame("main").frame(:name, "context_bar").image(:src, /icon_open.gif/).fire_event("onmouseover") works great! Now I know what to do with images. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050630/1b98f814/attachment.html From guru_sc at yahoo.com Thu Jun 30 17:04:19 2005 From: guru_sc at yahoo.com (Guru Subramanyam) Date: Thu, 30 Jun 2005 14:04:19 -0700 (PDT) Subject: [Wtr-general] Javascript menus Message-ID: <20050630210419.60693.qmail@web80306.mail.yahoo.com> Hi, I'm currently evaluating Watir for automating our Web based application. I would like to know if Watir supports Javascript menus. Thanks in advance Guru From guru_sc at yahoo.com Thu Jun 30 17:04:24 2005 From: guru_sc at yahoo.com (Guru Subramanyam) Date: Thu, 30 Jun 2005 14:04:24 -0700 (PDT) Subject: [Wtr-general] Javascript menus Message-ID: <20050630210424.4627.qmail@web80303.mail.yahoo.com> Hi, I'm currently evaluating Watir for automating our Web based application. I would like to know if Watir supports Javascript menus. Thanks in advance Guru From jkohl at telusplanet.net Thu Jun 30 17:46:34 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Thu, 30 Jun 2005 14:46:34 -0700 Subject: [Wtr-general] Javascript menus In-Reply-To: <20050630210424.4627.qmail@web80303.mail.yahoo.com> References: <20050630210424.4627.qmail@web80303.mail.yahoo.com> Message-ID: <1120167994.42c4683a0ee71@webmail.telusplanet.net> If you mean the dropdown or flyout menus that are activated with a mouseover, then not exactly. You can use the "fire_event" method to cause the menus to appear, but can only access the links if they are declared on the page. (To see how to fake it, check the watir_bonus/examples directory and run the "mouse_over.rb" example for an example.) If the links are declared in a JavaScript file that is not currently loaded in the DOM, like on this page: http://www.cbc.ca (do a mouse over on "RADIO" at the top), Watir doesn't seem to support that yet. -Jonathan Quoting Guru Subramanyam <guru_sc at yahoo.com>: > > Hi, > > I'm currently evaluating Watir for automating our Web > based application. I would like to know if Watir > supports Javascript menus. > > Thanks in advance > Guru > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From guru_sc at yahoo.com Thu Jun 30 18:16:31 2005 From: guru_sc at yahoo.com (Guru Subramanyam) Date: Thu, 30 Jun 2005 15:16:31 -0700 (PDT) Subject: [Wtr-general] Javascript menus In-Reply-To: <1120167994.42c4683a0ee71@webmail.telusplanet.net> Message-ID: <20050630221631.56625.qmail@web80302.mail.yahoo.com> Hi, Thanks for the response. I tried running this example and I got the following error Regards Guru C:\watir\examples>mouse_over.rb ## Beginning of Example: FortLewis.edu Step 1: go to the test site: http://www.fortlewis.edu c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1979:in `object_exist_check': Unable to locate object, using text and Prospective Students (Watir::Exception ::UnknownObjectException) from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2120:in `fireEvent' from C:/watir/examples/mouse_over.rb:16 --- jkohl at telusplanet.net wrote: > If you mean the dropdown or flyout menus that are > activated with a mouseover, > then not exactly. You can use the "fire_event" > method to cause the menus to > appear, but can only access the links if they are > declared on the page. (To see > how to fake it, check the watir_bonus/examples > directory and run > the "mouse_over.rb" example for an example.) If the > links are declared in a > JavaScript file that is not currently loaded in the > DOM, like on this page: > http://www.cbc.ca (do a mouse over on "RADIO" at the > top), Watir doesn't seem > to support that yet. > > -Jonathan > > Quoting Guru Subramanyam <guru_sc at yahoo.com>: > > > > > Hi, > > > > I'm currently evaluating Watir for automating our > Web > > based application. I would like to know if Watir > > supports Javascript menus. > > > > Thanks in advance > > Guru > > _______________________________________________ > > 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 tuyet.ctn at mscibarra.com Thu Jun 30 21:27:27 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Thu, 30 Jun 2005 18:27:27 -0700 Subject: [Wtr-general] Use of Wildcard? Message-ID: <AA1E1F7FC9E1124F999E37BFA1DD34471077B1B3@iris.win.barra.com> Instead of doing this: ie.frame(:name, "portfolioTreeContent").frame(:name, "treeframe1120166572909").getHTML How can I do this: ie.frame(:name, "portfolioTreeContent").frame(:name, "treeframe*").getHTML I want to put a wildcard in the last part of the "treeframe" name where the numbers are because it changes every time the user logs in (it's probably a session ID). So I can't code a static name here, but need to figure out how to get around the dynamic portion of this name tag. Any suggestion is appreciated! Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050630/0d982edf/attachment.html From paul.rogers at shaw.ca Thu Jun 30 22:15:51 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 30 Jun 2005 20:15:51 -0600 Subject: [Wtr-general] Use of Wildcard? In-Reply-To: <AA1E1F7FC9E1124F999E37BFA1DD34471077B1B3@iris.win.barra.com> Message-ID: <003601c57de2$cd7b7bf0$6400a8c0@NewDell> if frame doesnt take a reg exp, its a bug! so you should be able to do ie.frame(:name, "portfolioTreeContent").frame(:name, /treeframe/).getHTML -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Tuyet Cong-Ton-Nu Sent: 30 June 2005 19:27 To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] Use of Wildcard? Instead of doing this: ie.frame(:name, "portfolioTreeContent").frame(:name, "treeframe1120166572909").getHTML How can I do this: ie.frame(:name, "portfolioTreeContent").frame(:name, "treeframe*").getHTML I want to put a wildcard in the last part of the "treeframe" name where the numbers are because it changes every time the user logs in (it's probably a session ID). So I can't code a static name here, but need to figure out how to get around the dynamic portion of this name tag. Any suggestion is appreciated! Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050630/a512fdf4/attachment.html From calfdog at yahoo.com Thu Jun 30 23:32:33 2005 From: calfdog at yahoo.com (Rob Marchetti) Date: Thu, 30 Jun 2005 20:32:33 -0700 (PDT) Subject: [Wtr-general] Watir Message-ID: <20050701033233.20200.qmail@web50005.mail.yahoo.com> Hello, I just wanted to say GREAT JOB! to the Ruby developer(s) of Watir. It is great to see more open source automated test tools out there. I can defintely appreciate what you guys have done so far. I have had my own adventures writing PAMIE over the last years or so. I am currently writing a module that will take the output of the testcase results in XML and convert them to HTML. Similar to JUnit and JMeter I found other tools like NUnit, JUnit and JMeter do this very well and it has been extremely useful to be able to display the results in a nice HTML format. I am not sure if Watir does this, but if not, the code is generic enough that it can be ported from Python into Ruby. I would be great if there was a central location like QAForums does to discuss, post snippets of code , etc..for opensource apps like WATIR, Selenium, SAMIE and PAMIE since there are very similiar in they way the function. Just a thought! Good luck with your project and keep up the good work on WATIR!! Cheers! Rob M. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050630/b7cb9ce8/attachment.html