From alex at verk.info Wed Feb 1 22:53:13 2006 From: alex at verk.info (Alexey Verkhovsky) Date: Wed, 01 Feb 2006 20:53:13 -0700 Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help with File.join(File.dirname(__FILE__), '..') ? In-Reply-To: <72799cd70601311217h757f0d0bk347dc7ef4c42fca2@mail.gmail.com> References: <72799cd70601301337y444c7299vcc0f9ee8b5df29f2@mail.gmail.com> <43DEDBF8.1000906@verk.info> <72799cd70601302002l7fa0aec3g11e6d3bb157f1151@mail.gmail.com> <72799cd70601311217h757f0d0bk347dc7ef4c42fca2@mail.gmail.com> Message-ID: <43E18229.8000207@verk.info> Chris McMahon wrote: >Seriously, I thought I might have missed some sort of super-brainless >CruiseControl integration. I'm definitely going to be studying on >Reporter in the very near future. > Chris, In terms of CruiseControl connection, it should be entirely brainless, because I wrote it for CruiseControl connection, and used it that way. The Reporter produces XML output conforming to the same schema as JUnit. You treat it exactly the same way as you do JUnit output. It's putting the test suite together that is a little more complicated than it should be - you need to actually assemble a TestSuite object, can't just write a list of require statements in a file. I've also heard that there is a "require 'stringio'" missing, and README has some wrong (in fact, obsolete) module names. All going well, weather permitting, you should be able to figure it all out in under an hour. If you get it working, please at least write some "how-to". Apparently, I'm going to need the same thing soon :))) Best regards, Alex From bret at pettichord.com Wed Feb 1 00:43:13 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 31 Jan 2006 23:43:13 -0600 Subject: [Wtr-general] My Tab Click problem In-Reply-To: <20060201012551.1632.qmail@web42108.mail.yahoo.com> References: <20060201012551.1632.qmail@web42108.mail.yahoo.com> Message-ID: I suggest you email us the entire html for the page, possibly as an attachment. On 1/31/06, Gavazn Vahshi wrote: > > Hi All, > > I went through the recent email thread for the tab > click problem, but unfortunately was unable to solve > my problem. I'm knida new to Ruby and Watir and any > help is greatly appreciated. > > It's about a JS pop-up wizard with 4 tabs which opens > up when I click on a gif image in main UI. > > HTML source for the wizard looks like this (... > instead of some tags & extras): > > border='0'... >
class='tsc' border='0' cellpadding... > title_for_tab1
height='19'>... class='sel' style='background...>... href='#?ctrl=pstabset&action=TabClick¶m=tab1'> > title_for_tab2 height='19'>... class='unsel' style...>... href='#?ctrl=pstabset&action=TabClick¶m=tab2'> > ... (total of 4 tabs on page) >
> > For my testing purposes I need to click on each tab > and visit each page. There're some text fields that I > need to modify. > > Thanks in advance, > gavazn > > __________________________________________________ > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060131/e14051a0/attachment.html From buggins at byte-force.com Wed Feb 1 04:55:16 2006 From: buggins at byte-force.com (Yury Krasavin) Date: Wed, 1 Feb 2006 12:55:16 +0300 Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help with File.join(File.dirname(__FILE__), '..') ? In-Reply-To: Message-ID: <001501c62715$9afd0ef0$5864bbd5@byteforce.yar.ru> > It's putting the test suite together that is a little more > complicated > than it should be - you need to actually assemble a TestSuite object, > can't just write a list of require statements in a file. > I've also heard that there is a "require 'stringio'" missing, > and README > has some wrong (in fact, obsolete) module names. > > If you get it working, please at least write some "how-to". > Apparently, > I'm going to need the same thing soon :))) > > Best regards, > Alex Hi, Alexey. I was previously asked here to give a sample of usage of the Reporter. So I did it in my blog: http://blogs.byte-force.com/buggins/archive/2005/11/29/704.aspx Reporter, as it is now, seems to suppose replacement of the autorunner. I didn't like the idea. I would prefer to call runner implicitly, because running test for xml is not really a common case. Although I haven't assembled a TestSuite in my sample runner. Cases executed in random order are enough for me. So I left it simplest yet. Best regards, Yury From carl.l.shaulis at convergys.com Wed Feb 1 08:47:46 2006 From: carl.l.shaulis at convergys.com (carl.l.shaulis at convergys.com) Date: Wed, 1 Feb 2006 07:47:46 -0600 Subject: [Wtr-general] method In-Reply-To: Message-ID: Hi Gina, Something like this should give you a start. # Creates the array of elements in the list myList = ie2.select_list(:name, "").getAllContents # Prints the elements in the list puts connections[1] puts connections[2] puts connections[3] puts connections[4] puts connections[5] puts connections[6] puts connections[7] puts connections[8] puts connections[9] puts connections[10] puts connections[11] puts connections[12] puts connections[13] # Asserts that specific values are present assert(connections.include?("")) assert(connections.include?("")) assert_false(connections.include?("")) Good luck! Carl L. Shaulis Convergys - Senior Analyst "Rexhina Alickolli" Sent by: cc wtr-general-bounc es at rubyforge.org Subject [Wtr-general] method 01/31/2006 04:07 PM Please respond to wtr-general at rubyf orge.org How can I verify the presence of an item in an item list (checklist/dropdown list etc)? I am trying to find the method but no being successful. Thanks-- gina _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From carl.l.shaulis at convergys.com Wed Feb 1 08:49:19 2006 From: carl.l.shaulis at convergys.com (carl.l.shaulis at convergys.com) Date: Wed, 1 Feb 2006 07:49:19 -0600 Subject: [Wtr-general] method In-Reply-To: Message-ID: Sorry I forgot to edit the print statements! Probably obvious, but they should be puts myList[1] etc... Carl L. Shaulis Convergys - Senior Analyst Carl L Shaulis/CIMG/CVG To 02/01/2006 07:47 wtr-general at rubyforge.org AM cc Subject Re: [Wtr-general] method(Document link: Carl L Shaulis) Hi Gina, Something like this should give you a start. # Creates the array of elements in the list myList = ie2.select_list(:name, "").getAllContents # Prints the elements in the list puts connections[1] puts connections[2] puts connections[3] puts connections[4] puts connections[5] puts connections[6] puts connections[7] puts connections[8] puts connections[9] puts connections[10] puts connections[11] puts connections[12] puts connections[13] # Asserts that specific values are present assert(connections.include?("")) assert(connections.include?("")) assert_false(connections.include?("")) Good luck! Carl L. Shaulis Convergys - Senior Analyst "Rexhina Alickolli" Sent by: cc wtr-general-bounc es at rubyforge.org Subject [Wtr-general] method 01/31/2006 04:07 PM Please respond to wtr-general at rubyf orge.org How can I verify the presence of an item in an item list (checklist/dropdown list etc)? I am trying to find the method but no being successful. Thanks-- gina _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From gavazn at yahoo.com Wed Feb 1 12:40:55 2006 From: gavazn at yahoo.com (Gavazn Vahshi) Date: Wed, 1 Feb 2006 09:40:55 -0800 (PST) Subject: [Wtr-general] My Tab Click problem In-Reply-To: <003701c626e5$a62078b0$0902a8c0@Koko> Message-ID: <20060201174055.4577.qmail@web42109.mail.yahoo.com> I can't select another tab, don't know how to do it here. Well when the wizard opens up, it defaults to the first tab. From there I'm unable to select tabs for other pages. For instance if I want to modify stuff on the 2nd tab, I'd rather click on the tab in order to see it's content. -gavazn --- Michael Bolton wrote: > What is the problem that you were unable to solve? > > ---Michael B. > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf > Of Gavazn Vahshi > Sent: January 31, 2006 8:26 PM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] My Tab Click problem > > Hi All, > > I went through the recent email thread for the tab > click problem, but unfortunately was unable to solve > my problem. I'm knida new to Ruby and Watir and any > help is greatly appreciated. > > It's about a JS pop-up wizard with 4 tabs which > opens > up when I click on a gif image in main UI. > > HTML source for the wizard looks like this (... > instead of some tags & extras): > > border='0'... >
class='tsc' border='0' cellpadding... > title_for_tab1
height='19'>... class='sel' style='background...>... href='#?ctrl=pstabset&action=TabClick¶m=tab1'> > title_for_tab2 height='19'>... class='unsel' style...>... href='#?ctrl=pstabset&action=TabClick¶m=tab2'> > ... (total of 4 tabs on page) >
> > For my testing purposes I need to click on each tab > and visit each page. There're some text fields that > I > need to modify. > > Thanks in advance, > gavazn > > __________________________________________________ > 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 > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From Mark_Cain at rl.gov Wed Feb 1 13:31:37 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Wed, 1 Feb 2006 10:31:37 -0800 Subject: [Wtr-general] My Tab Click problem Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D546@EX5V.rl.gov> Is the wizard a separate window that opens? If yes then you might want to try: #e.g. usage from WATiR API # IE.attach(:url, 'www.google.com') # IE.attach(:title, 'Google') $ie.image(:src, //).click new_ie = IE.attach(:title, //i) new_ie.show_all_objects new_ie.span(:index,2).click #index for tab2 NOTE: If the window is invoked as showModalDialog then you'll need to use AutoIT. WATiR currently does not support windows invoked as showModalDialog. Hope this helps, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Gavazn Vahshi Sent: Wednesday, February 01, 2006 9:41 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] My Tab Click problem I can't select another tab, don't know how to do it here. Well when the wizard opens up, it defaults to the first tab. From there I'm unable to select tabs for other pages. For instance if I want to modify stuff on the 2nd tab, I'd rather click on the tab in order to see it's content. -gavazn --- Michael Bolton <mb at michaelbolton.net> wrote: > What is the problem that you were unable to solve? > > ---Michael B. > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf > Of Gavazn Vahshi > Sent: January 31, 2006 8:26 PM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] My Tab Click problem > > Hi All, > > I went through the recent email thread for the tab > click problem, but unfortunately was unable to solve > my problem. I'm knida new to Ruby and Watir and any > help is greatly appreciated. > > It's about a JS pop-up wizard with 4 tabs which > opens > up when I click on a gif image in main UI. > > HTML source for the wizard looks like this (... > instead of some tags & extras): > > <table id='tabs_table' cellspacing='0' class='tsc' > border='0'... > <div id='tabset_pstabset'><table cellspacing='0' > class='tsc' border='0' cellpadding... > <span>title_for_tab1</span></a></td><td > height='19'><img width...>...</td><td height='19' > class='sel' style='background...>...<a > href='#?ctrl=pstabset&action=TabClick¶m=tab1'> > <span>title_for_tab2</span></a></td><td > height='19'><img width...>...</td><td height='19' > class='unsel' style...>...<a > href='#?ctrl=pstabset&action=TabClick¶m=tab2'> > ... (total of 4 tabs on page) > </table></div> > > For my testing purposes I need to click on each tab > and visit each page. There're some text fields that > I > need to modify. > > Thanks in advance, > gavazn > > __________________________________________________ > 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 > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > __________________________________________________ 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 gavazn at yahoo.com Wed Feb 1 13:55:19 2006 From: gavazn at yahoo.com (Gavazn Vahshi) Date: Wed, 1 Feb 2006 10:55:19 -0800 (PST) Subject: [Wtr-general] My Tab Click problem In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D546@EX5V.rl.gov> Message-ID: <20060201185519.27497.qmail@web42109.mail.yahoo.com> Thanks for the input Mark, Even though a new pop-up opens up, but it's not a new window. It's more of a "div block" containing javascript that opens up. -g --- "Cain, Mark" <Mark_Cain at rl.gov> wrote: > Is the wizard a separate window that opens? If yes > then you might want > to try: > #e.g. usage from WATiR API > # IE.attach(:url, 'www.google.com') > # IE.attach(:title, 'Google') > > $ie.image(:src, /<gif image name in main UI>/).click > > new_ie = IE.attach(:title, /<Title of the new > window>/i) > > new_ie.show_all_objects > > new_ie.span(:index,2).click #index for tab2 > > NOTE: If the window is invoked as showModalDialog > then you'll need to > use AutoIT. WATiR currently does not support > windows invoked as > showModalDialog. > > Hope this helps, > > --Mark > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf > Of Gavazn Vahshi > Sent: Wednesday, February 01, 2006 9:41 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] My Tab Click problem > > I can't select another tab, don't know how to do it > here. > > Well when the wizard opens up, it defaults to the > first tab. From there I'm unable to select tabs for > other pages. For instance if I want to modify stuff > on the 2nd tab, I'd rather click on the tab in order > to see it's content. > > -gavazn > > --- Michael Bolton <mb at michaelbolton.net> wrote: > > > What is the problem that you were unable to solve? > > > > ---Michael B. > > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On > Behalf > > Of Gavazn Vahshi > > Sent: January 31, 2006 8:26 PM > > To: wtr-general at rubyforge.org > > Subject: [Wtr-general] My Tab Click problem > > > > Hi All, > > > > I went through the recent email thread for the tab > > click problem, but unfortunately was unable to > solve > > my problem. I'm knida new to Ruby and Watir and > any > > help is greatly appreciated. > > > > It's about a JS pop-up wizard with 4 tabs which > > opens > > up when I click on a gif image in main UI. > > > > HTML source for the wizard looks like this (... > > instead of some tags & extras): > > > > <table id='tabs_table' cellspacing='0' class='tsc' > > border='0'... > > <div id='tabset_pstabset'><table cellspacing='0' > > class='tsc' border='0' cellpadding... > > <span>title_for_tab1</span></a></td><td > > height='19'><img width...>...</td><td height='19' > > class='sel' style='background...>...<a > > href='#?ctrl=pstabset&action=TabClick¶m=tab1'> > > <span>title_for_tab2</span></a></td><td > > height='19'><img width...>...</td><td height='19' > > class='unsel' style...>...<a > > href='#?ctrl=pstabset&action=TabClick¶m=tab2'> > > ... (total of 4 tabs on page) > > </table></div> > > > > For my testing purposes I need to click on each > tab > > and visit each page. There're some text fields > that > > I > > need to modify. > > > > Thanks in advance, > > gavazn > > > > __________________________________________________ > > 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 > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > __________________________________________________ > 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 > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From gavazn at yahoo.com Wed Feb 1 13:59:59 2006 From: gavazn at yahoo.com (Gavazn Vahshi) Date: Wed, 1 Feb 2006 10:59:59 -0800 (PST) Subject: [Wtr-general] My Tab Click problem In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D546@EX5V.rl.gov> Message-ID: <20060201185959.87307.qmail@web42107.mail.yahoo.com> I don't know if that helps or not. When I first open the wizard (showing 1st tab) and do ie.showAllObjects, I get some stuff. Then when I click on the 2nd tab and do ie.showAllObjects I get the extra line below: hidden name=com.cc.framework.state id=com.cc.framework.state value=ctrl=pstabset;first=tab1;selected=tab2 alt= src= Is there a way to use this info to access tab2? Thanks, -g --- "Cain, Mark" <Mark_Cain at rl.gov> wrote: > Is the wizard a separate window that opens? If yes > then you might want > to try: > #e.g. usage from WATiR API > # IE.attach(:url, 'www.google.com') > # IE.attach(:title, 'Google') > > $ie.image(:src, /<gif image name in main UI>/).click > > new_ie = IE.attach(:title, /<Title of the new > window>/i) > > new_ie.show_all_objects > > new_ie.span(:index,2).click #index for tab2 > > NOTE: If the window is invoked as showModalDialog > then you'll need to > use AutoIT. WATiR currently does not support > windows invoked as > showModalDialog. > > Hope this helps, > > --Mark > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf > Of Gavazn Vahshi > Sent: Wednesday, February 01, 2006 9:41 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] My Tab Click problem > > I can't select another tab, don't know how to do it > here. > > Well when the wizard opens up, it defaults to the > first tab. From there I'm unable to select tabs for > other pages. For instance if I want to modify stuff > on the 2nd tab, I'd rather click on the tab in order > to see it's content. > > -gavazn > > --- Michael Bolton <mb at michaelbolton.net> wrote: > > > What is the problem that you were unable to solve? > > > > ---Michael B. > > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On > Behalf > > Of Gavazn Vahshi > > Sent: January 31, 2006 8:26 PM > > To: wtr-general at rubyforge.org > > Subject: [Wtr-general] My Tab Click problem > > > > Hi All, > > > > I went through the recent email thread for the tab > > click problem, but unfortunately was unable to > solve > > my problem. I'm knida new to Ruby and Watir and > any > > help is greatly appreciated. > > > > It's about a JS pop-up wizard with 4 tabs which > > opens > > up when I click on a gif image in main UI. > > > > HTML source for the wizard looks like this (... > > instead of some tags & extras): > > > > <table id='tabs_table' cellspacing='0' class='tsc' > > border='0'... > > <div id='tabset_pstabset'><table cellspacing='0' > > class='tsc' border='0' cellpadding... > > <span>title_for_tab1</span></a></td><td > > height='19'><img width...>...</td><td height='19' > > class='sel' style='background...>...<a > > href='#?ctrl=pstabset&action=TabClick¶m=tab1'> > > <span>title_for_tab2</span></a></td><td > > height='19'><img width...>...</td><td height='19' > > class='unsel' style...>...<a > > href='#?ctrl=pstabset&action=TabClick¶m=tab2'> > > ... (total of 4 tabs on page) > > </table></div> > > > > For my testing purposes I need to click on each > tab > > and visit each page. There're some text fields > that > > I > > need to modify. > > > > Thanks in advance, > > gavazn > > > > __________________________________________________ > > 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 > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > __________________________________________________ > 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 > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From Mark_Cain at rl.gov Wed Feb 1 14:13:49 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Wed, 1 Feb 2006 11:13:49 -0800 Subject: [Wtr-general] My Tab Click problem Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D547@EX5V.rl.gov> Is the content of the tabs displayed in an iFrame? If you could post the entire html for the main page and popup wizard it would help. --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Gavazn Vahshi Sent: Wednesday, February 01, 2006 11:00 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] My Tab Click problem I don't know if that helps or not. When I first open the wizard (showing 1st tab) and do ie.showAllObjects, I get some stuff. Then when I click on the 2nd tab and do ie.showAllObjects I get the extra line below: hidden name=com.cc.framework.state id=com.cc.framework.state value=ctrl=pstabset;first=tab1;selected=tab2 alt= src= Is there a way to use this info to access tab2? Thanks, -g --- "Cain, Mark" <Mark_Cain at rl.gov> wrote: > Is the wizard a separate window that opens? If yes > then you might want > to try: > #e.g. usage from WATiR API > # IE.attach(:url, 'www.google.com') > # IE.attach(:title, 'Google') > > $ie.image(:src, /<gif image name in main UI>/).click > > new_ie = IE.attach(:title, /<Title of the new > window>/i) > > new_ie.show_all_objects > > new_ie.span(:index,2).click #index for tab2 > > NOTE: If the window is invoked as showModalDialog > then you'll need to > use AutoIT. WATiR currently does not support > windows invoked as > showModalDialog. > > Hope this helps, > > --Mark > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf > Of Gavazn Vahshi > Sent: Wednesday, February 01, 2006 9:41 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] My Tab Click problem > > I can't select another tab, don't know how to do it > here. > > Well when the wizard opens up, it defaults to the > first tab. From there I'm unable to select tabs for > other pages. For instance if I want to modify stuff > on the 2nd tab, I'd rather click on the tab in order > to see it's content. > > -gavazn > > --- Michael Bolton <mb at michaelbolton.net> wrote: > > > What is the problem that you were unable to solve? > > > > ---Michael B. > > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On > Behalf > > Of Gavazn Vahshi > > Sent: January 31, 2006 8:26 PM > > To: wtr-general at rubyforge.org > > Subject: [Wtr-general] My Tab Click problem > > > > Hi All, > > > > I went through the recent email thread for the tab > > click problem, but unfortunately was unable to > solve > > my problem. I'm knida new to Ruby and Watir and > any > > help is greatly appreciated. > > > > It's about a JS pop-up wizard with 4 tabs which > > opens > > up when I click on a gif image in main UI. > > > > HTML source for the wizard looks like this (... > > instead of some tags & extras): > > > > <table id='tabs_table' cellspacing='0' class='tsc' > > border='0'... > > <div id='tabset_pstabset'><table cellspacing='0' > > class='tsc' border='0' cellpadding... > > <span>title_for_tab1</span></a></td><td > > height='19'><img width...>...</td><td height='19' > > class='sel' style='background...>...<a > > href='#?ctrl=pstabset&action=TabClick¶m=tab1'> > > <span>title_for_tab2</span></a></td><td > > height='19'><img width...>...</td><td height='19' > > class='unsel' style...>...<a > > href='#?ctrl=pstabset&action=TabClick¶m=tab2'> > > ... (total of 4 tabs on page) > > </table></div> > > > > For my testing purposes I need to click on each > tab > > and visit each page. There're some text fields > that > > I > > need to modify. > > > > Thanks in advance, > > gavazn > > > > __________________________________________________ > > 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 > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > __________________________________________________ > 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 > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > __________________________________________________ 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 David.J.Solis at wellsfargo.com Wed Feb 1 16:21:40 2006 From: David.J.Solis at wellsfargo.com (David.J.Solis at wellsfargo.com) Date: Wed, 1 Feb 2006 15:21:40 -0600 Subject: [Wtr-general] clicking on a link problem Message-ID: <493148DCF171954FBBF8E8AAB261638C057506@msgswbmnmsp35.wellsfargo.com> I encountered an error that I cannot figure out. In my code, I'm linking to a new page using $ie.link(:text, "Administration").click But instead, I get this error: WIN32OLERuntimeError: Unknown property or method `document' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1347:in `method_missing' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1347:in `document' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:899:in `getLink' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2841:in `initialize' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:570:in `new' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:570:in `link' I have no idea what is causing this. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060201/dce4115c/attachment.html From rosecao at us.ibm.com Wed Feb 1 16:45:21 2006 From: rosecao at us.ibm.com (Rose Cao) Date: Wed, 1 Feb 2006 14:45:21 -0700 Subject: [Wtr-general] clicking on a link problem In-Reply-To: <493148DCF171954FBBF8E8AAB261638C057506@msgswbmnmsp35.wellsfargo.com> Message-ID: <OFCB07B53C.134F2FB2-ON87257108.007725E9-87257108.007746BA@us.ibm.com> Make sure the link 'Administration' is not in any frame like 'reportframe' etc. If the link is in one of the frame, then will be ie.frame("framename").link(:text, "Administration").click. Use this to see all the frame on the web page: ie.show_frames Use this to see all the detail of the frame on the web page: ie.show_all_objects Hope this will help. Please contact me if you have any questions or if I may be of any assistance. Thanks, Rose Cao SDC West - LLXC, ACD Team IBM Global Services 303.924.1916 T/L 347-1916 rosecao at us.ibm.com Highland Contractor <David.J.Solis at we llsfargo.com> Sent by: To wtr-general-bounc <wtr-general at rubyforge.org> es at rubyforge.org cc Subject 02/01/2006 02:21 [Wtr-general] clicking on a link PM problem Please respond to wtr-general I encountered an error that I cannot figure out. In my code, I'm linking to a new page using $ie.link(:text, "Administration").click But instead, I get this error: WIN32OLERuntimeError: Unknown property or method `document' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1347:in `method_missing' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1347:in `document' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:899:in `getLink' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2841:in `initialize' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:570:in `new' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:570:in `link' I have no idea what is causing this. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060201/4aeba535/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/20060201/4aeba535/attachment.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: pic32723.gif Type: image/gif Size: 1255 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060201/4aeba535/attachment-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/20060201/4aeba535/attachment-0002.gif From mb at michaelbolton.net Wed Feb 1 17:19:38 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Wed, 1 Feb 2006 17:19:38 -0500 Subject: [Wtr-general] clicking on a link problem In-Reply-To: <493148DCF171954FBBF8E8AAB261638C057506@msgswbmnmsp35.wellsfargo.com> Message-ID: <001801c6277d$97680610$0902a8c0@Koko> >I have no idea what is causing this. Neither do we. So far as we know, your code snippet might be preceded by $ie = nil What does the original page look like? What does your original code look like (that is, at least a few lines before the call in question)? (General question, not specific to David: When did the charter for this list begin to include "please, to the greatest extent possible, leave out HTML, Ruby code, or other clues that might help us to solve your problem?") ---Michael B., a little cranky this afternoon _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David.J.Solis at wellsfargo.com Sent: February 1, 2006 4:22 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] clicking on a link problem I encountered an error that I cannot figure out. In my code, I'm linking to a new page using $ie.link(:text, "Administration").click But instead, I get this error: WIN32OLERuntimeError: Unknown property or method `document' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1347:in `method_missing' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1347:in `document' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:899:in `getLink' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2841:in `initialize' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:570:in `new' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:570:in `link' I have no idea what is causing this. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060201/d15758a3/attachment.html From BPaatsch at activevoice.com Wed Feb 1 17:58:00 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Wed, 1 Feb 2006 16:58:00 -0600 Subject: [Wtr-general] How to handle a timeout when allert window not found? Message-ID: <DB8B2DF09344624C84867DA023FA4ADE44A097@activevoice2.necam.prv> Hi Rague, I refere to a thread Nov 22. Within this thread your recommended following code: We ran into a similar issue a while back. For some reason (I dont know if it is a ruby issue), rescue doesn't trap 'Timeout' errors. You have explicitly catch a Timeout error as: begin ..... ... rescue Timeout::Error puts "No alert window found" end Raghu I tried it and it does not work. Do I have to include any special module? I have this nasty and popup to deal with however when there is no popup window it does not go into rescue. begin puts "begin" br=nil br = Browser("url:=/add.php/") br.Dialog("title:=Microsoft Internet Explorer") #dublicate_win = br.Dialog("title:=Microsoft Internet Explorer").Label("index:=2") dublicate_win = br.Dialog("title:=Microsoft Internet Explorer").Label("text:=/DUPLICATE/") puts dublicate_win rescue TIMEOUT::ERROR # great we don't have dublicate extension puts "rescue" $logger.log( " Action: no popup window with dublicated extension found.") ensure text = dublicate_win.display_text # wwe have to deal with the popup window dublicate extension $logger.log( " Action: found popup window " + text) br.Dialog("title:=Microsoft Internet Explorer").Button("text:=OK").click sleep(1.5) dublicate_win = nil end Thanks, Bernd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060201/0e31d546/attachment.html From tester.paul at gmail.com Wed Feb 1 17:58:52 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Wed, 1 Feb 2006 17:58:52 -0500 Subject: [Wtr-general] Ruby Nubie fails to get out of the box with Unittests Message-ID: <37c405480602011458y2df7055fr@mail.gmail.com> Hello there. I just installed Ruby and WATIR on my computer a fewhours ago and am still learning about this scripting language. I started with the WATIR User Guide and tried out the steps in "Step 3- Run the Watir Unit Tests". The final sentence here says: "Thetests should all run and pass." Unfortunately, I keep getting failures when I run "all_tests.rb" :"182 tests, 1036 assertions, 5 failures, 2 errors" Here are my system specs:- Windows XP SP2 (all the latest windows updates/security patches applied)- Internet Explorer 6.0.2900.2180.xpsp_sp2_gdr.050301-1519- ruby182-15.exe (installed to default c:\ruby)- watir-1.4.1.exe (installed to default C:\Program Files\Watir)- Active Content is allowed to run in files on My Computer. (I knowthis is working for a fact because I am running my internet radioscript file in a background IE window process while I work.) I've scanned through the message archives and found similar errormessages reported by Hugh Sasse on Fri Jan 13 10:08:54 EST 2006(subject = "Unit testing"). First observation: I noticed that the unittests\html\images folder ismissing, but I'm assuming that these files aren't really required forsuccessful completion of the tests.Still, I did notice a few popup errors while running the testscomplaining that the files were missing. I can't think that this isnormal/expected behaviour. Second observation: it looks like a file (pass2.html) is missing. Isthis also intentional? I decided to run "core_tests.rb" but it also failed : "154 tests, 929assertions, 3 failures, 0 errors" -> Is there something that I'm missing here? Is there a setup optionor environment variable that I should set to get these tests to workcorrectly? Please let me know. Thanks in advance. I won't let these hiccupsslow me down while I run through the other examples and tutorials. Ijust thought I'd ask before I forget. Cheers.Paul. From rosecao at us.ibm.com Wed Feb 1 18:06:21 2006 From: rosecao at us.ibm.com (Rose Cao) Date: Wed, 1 Feb 2006 16:06:21 -0700 Subject: [Wtr-general] clicking on a link problem In-Reply-To: <001801c6277d$97680610$0902a8c0@Koko> Message-ID: <OFAE17E3AF.C999AFBC-ON87257108.007EE07D-87257108.007EB172@us.ibm.com> Yes, why not take off the $ before ie and run it again? Please contact me if you have any questions or if I may be of any assistance. Thanks, Rose Cao SDC West - LLXC, ACD Team IBM Global Services 303.924.1916 T/L 347-1916 rosecao at us.ibm.com Highland Contractor "Michael Bolton" <mb at michaelbolton .net> To Sent by: <wtr-general at rubyforge.org> wtr-general-bounc cc es at rubyforge.org Subject Re: [Wtr-general] clicking on a 02/01/2006 03:19 link problem PM Please respond to wtr-general >I have no idea what is causing this. Neither do we. So far as we know, your code snippet might be preceded by $ie = nil What does the original page look like? What does your original code look like (that is, at least a few lines before the call in question)? (General question, not specific to David: When did the charter for this list begin to include "please, to the greatest extent possible, leave out HTML, Ruby code, or other clues that might help us to solve your problem?") ---Michael B., a little cranky this afternoon From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David.J.Solis at wellsfargo.com Sent: February 1, 2006 4:22 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] clicking on a link problem I encountered an error that I cannot figure out. In my code, I'm linking to a new page using $ie.link(:text, "Administration").click But instead, I get this error: WIN32OLERuntimeError: Unknown property or method `document' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1347:in `method_missing' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1347:in `document' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:899:in `getLink' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2841:in `initialize' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:570:in `new' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:570:in `link' I have no idea what is causing this. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060201/f7563b98/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/20060201/f7563b98/attachment.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: pic00287.gif Type: image/gif Size: 1255 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060201/f7563b98/attachment-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/20060201/f7563b98/attachment-0002.gif From BPaatsch at activevoice.com Wed Feb 1 18:17:59 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Wed, 1 Feb 2006 17:17:59 -0600 Subject: [Wtr-general] How to handle a timeout when allert window not found? Message-ID: <DB8B2DF09344624C84867DA023FA4ADE44A098@activevoice2.necam.prv> I get following error: ./wacSubAddRangeSubscriber.rb:128:in `addRangeSubscriber': uninitialized constant WebAC::TIMEOUT (NameError) from C:/watir-v1_4/examples/WAC/wacTestCollection.rb:51 _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Wednesday, February 01, 2006 2:58 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] How to handle a timeout when allert window not found? Hi Rague, I refere to a thread Nov 22. Within this thread your recommended following code: We ran into a similar issue a while back. For some reason (I dont know if it is a ruby issue), rescue doesn't trap 'Timeout' errors. You have explicitly catch a Timeout error as: begin ..... ... rescue Timeout::Error puts "No alert window found" end Raghu I tried it and it does not work. Do I have to include any special module? I have this nasty and popup to deal with however when there is no popup window it does not go into rescue. begin puts "begin" br=nil br = Browser("url:=/add.php/") br.Dialog("title:=Microsoft Internet Explorer") #dublicate_win = br.Dialog("title:=Microsoft Internet Explorer").Label("index:=2") dublicate_win = br.Dialog("title:=Microsoft Internet Explorer").Label("text:=/DUPLICATE/") puts dublicate_win rescue TIMEOUT::ERROR # great we don't have dublicate extension puts "rescue" $logger.log( " Action: no popup window with dublicated extension found.") ensure text = dublicate_win.display_text # wwe have to deal with the popup window dublicate extension $logger.log( " Action: found popup window " + text) br.Dialog("title:=Microsoft Internet Explorer").Button("text:=OK").click sleep(1.5) dublicate_win = nil end Thanks, Bernd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060201/f395e189/attachment.html From BPaatsch at activevoice.com Wed Feb 1 18:32:43 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Wed, 1 Feb 2006 17:32:43 -0600 Subject: [Wtr-general] How to handle a timeout when allert window notf ound? Message-ID: <DB8B2DF09344624C84867DA023FA4ADE44A099@activevoice2.necam.prv> I found the answer reguire 'timeout' begin ..... ... rescue TimeoutError # this does not work on my machineTimeout::Error puts "No alert window found" end Bernd _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Wednesday, February 01, 2006 3:18 PM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] How to handle a timeout when allert window notfound? I get following error: ./wacSubAddRangeSubscriber.rb:128:in `addRangeSubscriber': uninitialized constant WebAC::TIMEOUT (NameError) from C:/watir-v1_4/examples/WAC/wacTestCollection.rb:51 _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paatsch, Bernd Sent: Wednesday, February 01, 2006 2:58 PM To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] How to handle a timeout when allert window not found? Hi Rague, I refere to a thread Nov 22. Within this thread your recommended following code: We ran into a similar issue a while back. For some reason (I dont know if it is a ruby issue), rescue doesn't trap 'Timeout' errors. You have explicitly catch a Timeout error as: begin ..... ... rescue Timeout::Error puts "No alert window found" end Raghu I tried it and it does not work. Do I have to include any special module? I have this nasty and popup to deal with however when there is no popup window it does not go into rescue. begin puts "begin" br=nil br = Browser("url:=/add.php/") br.Dialog("title:=Microsoft Internet Explorer") #dublicate_win = br.Dialog("title:=Microsoft Internet Explorer").Label("index:=2") dublicate_win = br.Dialog("title:=Microsoft Internet Explorer").Label("text:=/DUPLICATE/") puts dublicate_win rescue TIMEOUT::ERROR # great we don't have dublicate extension puts "rescue" $logger.log( " Action: no popup window with dublicated extension found.") ensure text = dublicate_win.display_text # wwe have to deal with the popup window dublicate extension $logger.log( " Action: found popup window " + text) br.Dialog("title:=Microsoft Internet Explorer").Button("text:=OK").click sleep(1.5) dublicate_win = nil end Thanks, Bernd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060201/8117c661/attachment.html From bret at pettichord.com Wed Feb 1 18:40:49 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 1 Feb 2006 17:40:49 -0600 Subject: [Wtr-general] Ruby Nubie fails to get out of the box with Unittests In-Reply-To: <37c405480602011458y2df7055fr@mail.gmail.com> References: <37c405480602011458y2df7055fr@mail.gmail.com> Message-ID: <ade75c5b0602011540y7ac55547x9cf173498b08b492@mail.gmail.com> Paul, There are several known problematical tests in all_tests.rb. I've updated the user guide so that the next version will tell people to run core_tests.rb, but you already figured that part out. The specific problems you mentioned (in all_tests.rb) mostly sound familiar. They are known and in several cases happen intermittently. However, i specifically created core_tests.rb as a robust subset of all_tests.rb. I would like to see the details about the 3 failures you found while running them. In one case recently, i found that -- believe it or not -- the IP phone software i was running caused a couple of these tests to fail. It somehow embedded html and javascript in every web page by browser served and therefore was affecting some of the element counts. In any case, it sounds like you've installed Watir correctly and have just run into some marginal issues. Bret On 2/1/06, Paul Carvalho <tester.paul at gmail.com> wrote: > > Hello there. I just installed Ruby and WATIR on my computer a fewhours > ago and am still learning about this scripting language. > I started with the WATIR User Guide and tried out the steps in "Step 3- > Run the Watir Unit Tests". The final sentence here says: "Thetests should > all run and pass." > Unfortunately, I keep getting failures when I run "all_tests.rb" :"182 > tests, 1036 assertions, 5 failures, 2 errors" > Here are my system specs:- Windows XP SP2 (all the latest windows > updates/security patches applied)- Internet Explorer > 6.0.2900.2180.xpsp_sp2_gdr.050301-1519- ruby182-15.exe (installed to > default c:\ruby)- watir-1.4.1.exe (installed to default C:\Program > Files\Watir)- Active Content is allowed to run in files on My Computer. (I > knowthis is working for a fact because I am running my internet radioscript > file in a background IE window process while I work.) > I've scanned through the message archives and found similar errormessages > reported by Hugh Sasse on Fri Jan 13 10:08:54 EST 2006(subject = "Unit > testing"). > First observation: I noticed that the unittests\html\images folder > ismissing, but I'm assuming that these files aren't really required > forsuccessful completion of the tests.Still, I did notice a few popup > errors while running the testscomplaining that the files were missing. I > can't think that this isnormal/expected behaviour. > Second observation: it looks like a file (pass2.html) is missing. Isthis > also intentional? > I decided to run "core_tests.rb" but it also failed : "154 tests, > 929assertions, 3 failures, 0 errors" > -> Is there something that I'm missing here? Is there a setup optionor > environment variable that I should set to get these tests to workcorrectly? > Please let me know. Thanks in advance. I won't let these hiccupsslow me > down while I run through the other examples and tutorials. Ijust thought > I'd ask before I forget. > Cheers.Paul. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060201/091831d0/attachment.html From bret at pettichord.com Wed Feb 1 20:22:40 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 1 Feb 2006 19:22:40 -0600 Subject: [Wtr-general] clicking on a link problem In-Reply-To: <493148DCF171954FBBF8E8AAB261638C057506@msgswbmnmsp35.wellsfargo.com> References: <493148DCF171954FBBF8E8AAB261638C057506@msgswbmnmsp35.wellsfargo.com> Message-ID: <ade75c5b0602011722t43128b1pd1fac41c34d90867@mail.gmail.com> Bolton is right. We need more to go on. But i can actually answer your actual question ("what is causing this") if not your implied question ("how can i get my code to work"). This is happening because the IE window that "$ie" was bound to was closed. That is what "The object invoked has disconnected from its clients" means. The object, in this case is the browser and the client is our COM binding to it. This message means that there used to be something at the other end of the $ie, but now it is gone. Bret On 2/1/06, David.J.Solis at wellsfargo.com <David.J.Solis at wellsfargo.com> wrote: > > I encountered an error that I cannot figure out. In my code, I'm linking > to a new page using > > $ie.link(:text, "Administration").click > > But instead, I get this error: > > WIN32OLERuntimeError: Unknown property or method `document' > HRESULT error code:0x80010108 > The object invoked has disconnected from its clients. > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1347:in `method_missing' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1347:in `document' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:899:in `getLink' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2841:in `initialize' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:570:in `new' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:570:in `link' > > > I have no idea what is causing this. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060201/5ad97e31/attachment.html From mb at michaelbolton.net Wed Feb 1 23:46:28 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Wed, 1 Feb 2006 23:46:28 -0500 Subject: [Wtr-general] Ruby Nubie fails to get out of the box with Unittests In-Reply-To: <37c405480602011458y2df7055fr@mail.gmail.com> Message-ID: <003b01c627b3$a28d5b40$0902a8c0@Koko> I'm not sure what Paul Carvalho's issue is such that the folder didn't get created. Are you sure you're looking in the right place, Paul? Just to be sure, it shouldn't appear anywhere in your C:\ruby directory tree (assuming that's your Ruby base directory). It should appear in a subdirectory of the same unittests directory in which all_tests.rb is found. Could you check again? I can report this: upon changing the name of the unittests\html\images folder to unittests\html\imagesx on my system, I get a report that 8 assertions failed and that there were 3 errors. That's Error Set A below. And when I restored that folder to its proper name, I got 5 failures and 2 errors. That's Error Set B below. ---Michael B. Error set A =========== 1) Failure: test_imageHasLoaded(TC_Images) [C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittest s/../unittests/images_test.rb:76]: <false> is not true. 2) Error: test_image_click(TC_Images): Watir::Exception::UnknownObjectException: Unable to locate object, using name and disabler_test C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../watir.rb:1939:in `asser t_exists' (eval):2:in `disabled' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/images_test.r b:56:in `test_image_click' 3) Failure: test_image_properties(TC_Images) [C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unitte sts/../unittests/images_test.rb:104]: <"88"> expected but was <"30">. 4) Error: test_save_local_image(TC_Images): WIN32OLERuntimeError: navigate OLE error code:800704C7 in <Unknown> <No Description> HRESULT error code:0x80020009 Exception occurred. C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../watir.rb:1253:in `metho d_missing' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../watir.rb:1253:in `goto' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../watir.rb:2808:in `save' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/images_test.r b:160:in `safe_file_block' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/images_test.r b:160:in `each' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/images_test.r b:160:in `safe_file_block' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/images_test.r b:143:in `test_save_local_image' 5) Error: test_save_local_image_returns_original_page(TC_Images): WIN32OLERuntimeError: navigate OLE error code:800704C7 in <Unknown> <No Description> HRESULT error code:0x80020009 Exception occurred. C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../watir.rb:1253:in `metho d_missing' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../watir.rb:1253:in `goto' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../watir.rb:2808:in `save' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/images_test.r b:160:in `safe_file_block' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/images_test.r b:160:in `each' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/images_test.r b:160:in `safe_file_block' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/images_test.r b:153:in `test_save_local_image_returns_original_page' 6) Failure: test_navigation(TC_Navigate) [C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/ ../unittests/navigate_test.rb:19]: <"file://c:/documents%20and%20settings/michael%20bolton/my%20documents/downl oad/watir/watir-v1_4/unittests/html/buttons1 .html"> expected but was <"file://c:/documents and settings/michael bolton/my documents/download/watir/watir-v1_4/unittests/html/buttons1.html">. 7) Failure: test_links_and_images_in_table(TC_Tables) [C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1 _4/unittests/../unittests/table_test.rb:165]: <"106"> expected but was <"28">. 8) Failure: test_button_frames(TC_show_frames) [C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/frame_test.r b:113:in `capture_and_compare' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/frame_test.r b:125:in `test_button_frames']: <"there are 2 frames\nframe index: 0 name: buttonFrame\nframe index: 1 name: buttonFrame2\n"> expected but was <"there are 2 frames\nframe index: 1 name: buttonFrame\nframe index: 2 name: buttonFrame2\n">. 9) Failure: test_iframes(TC_show_frames) [C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/frame_test.r b:113:in `capture_and_compare' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/frame_test.r b:133:in `test_iframes']: <"there are 2 frames\nframe index: 0 name: senderFrame\nframe index: 1 name: receiverFrame\n"> expected but was <"there are 2 frames\nframe index: 1 name: senderFrame\nframe index: 2 name: receiverFrame\n">. 10) Failure: test_show_nested_frames(TC_show_frames) [C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/frame_test.r b:113:in `capture_and_compare' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/frame_test.r b:117:in `test_show_nested_frames']: <"there are 2 frames\nframe index: 0 name: nestedFrame\nframe index: 1 name: nestedFrame2\n"> expected but was <"there are 2 frames\nframe index: 1 name: nestedFrame\nframe index: 2 name: nestedFrame2\n">. 11) Failure: test_showLinks(TC_showlinks) [C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/links_test.r b:163:in `test_showLinks' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/links_test.r b:163:in `each_with_index' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/links_test.r b:163:in `each' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/links_test.r b:163:in `each_with_index' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/links_test.r b:163:in `test_showLinks']: <"1 file:///c:/documents%20and%20settings/michael%20bolton/my%20documents/downlo ad/watir/wat ir-v1_4/unittests/html/links2.htmltest1"> expected to be =~ </^1 + +file:\/\/\/c:\/documents and settings\/michael bolton\/my documents\/download\/watir\/watir-v1_4\/unittests\/htm l\/links2.html *test1$/>. 182 tests, 1032 assertions, 8 failures, 3 errors Error set B =========== 1) Error: test_image_click(TC_Images): Watir::Exception::UnknownObjectException: Unable to locate object, using name and disabler_test C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../watir.rb:1939:in `asser t_exists' (eval):2:in `disabled' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/images_test.r b:56:in `test_image_click' 2) Error: test_save_local_image(TC_Images): Errno::ENOENT: No such file or directory - C:/Documents%20and%20Settings/Michael%20Bolton/My%20Documents/Download/Watir / watir-v1_4/unittests/html/images/triangle.jpg c:/ruby/lib/ruby/1.8/ftools.rb:136:in `stat' c:/ruby/lib/ruby/1.8/ftools.rb:136:in `compare' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/images_test.r b:144:in `test_save_local_image' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/images_test.r b:143:in `safe_file_block' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/images_test.r b:143:in `test_save_local_image' 3) Failure: test_navigation(TC_Navigate) [C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/ ../unittests/navigate_test.rb:19]: <"file://c:/documents%20and%20settings/michael%20bolton/my%20documents/downl oad/watir/watir-v1_4/unittests/html/buttons1 .html"> expected but was <"file://c:/documents and settings/michael bolton/my documents/download/watir/watir-v1_4/unittests/html/buttons1.html">. 4) Failure: test_button_frames(TC_show_frames) [C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/frame_test.r b:113:in `capture_and_compare' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/frame_test.r b:125:in `test_button_frames']: <"there are 2 frames\nframe index: 0 name: buttonFrame\nframe index: 1 name: buttonFrame2\n"> expected but was <"there are 2 frames\nframe index: 1 name: buttonFrame\nframe index: 2 name: buttonFrame2\n">. 5) Failure: test_iframes(TC_show_frames) [C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/frame_test.r b:113:in `capture_and_compare' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/frame_test.r b:133:in `test_iframes']: <"there are 2 frames\nframe index: 0 name: senderFrame\nframe index: 1 name: receiverFrame\n"> expected but was <"there are 2 frames\nframe index: 1 name: senderFrame\nframe index: 2 name: receiverFrame\n">. 6) Failure: test_show_nested_frames(TC_show_frames) [C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/frame_test.r b:113:in `capture_and_compare' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/frame_test.r b:117:in `test_show_nested_frames']: <"there are 2 frames\nframe index: 0 name: nestedFrame\nframe index: 1 name: nestedFrame2\n"> expected but was <"there are 2 frames\nframe index: 1 name: nestedFrame\nframe index: 2 name: nestedFrame2\n">. 7) Failure: test_showLinks(TC_showlinks) [C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/links_test.r b:163:in `test_showLinks' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/links_test.r b:163:in `each_with_index' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/links_test.r b:163:in `each' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/links_test.r b:163:in `each_with_index' C:/Documents and Settings/Michael Bolton/My Documents/Download/Watir/watir-v1_4/unittests/../unittests/links_test.r b:163:in `test_showLinks']: <"1 file:///c:/documents%20and%20settings/michael%20bolton/my%20documents/downlo ad/watir/wat ir-v1_4/unittests/html/links2.htmltest1"> expected to be =~ </^1 + +file:\/\/\/c:\/documents and settings\/michael bolton\/my documents\/download\/watir\/watir-v1_4\/unittests\/htm l\/links2.html *test1$/>. 182 tests, 1040 assertions, 5 failures, 2 errors -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho Sent: February 1, 2006 5:59 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Ruby Nubie fails to get out of the box with Unittests Hello there. I just installed Ruby and WATIR on my computer a fewhours ago and am still learning about this scripting language. I started with the WATIR User Guide and tried out the steps in "Step 3- Run the Watir Unit Tests". The final sentence here says: "Thetests should all run and pass." Unfortunately, I keep getting failures when I run "all_tests.rb" :"182 tests, 1036 assertions, 5 failures, 2 errors" Here are my system specs:- Windows XP SP2 (all the latest windows updates/security patches applied)- Internet Explorer 6.0.2900.2180.xpsp_sp2_gdr.050301-1519- ruby182-15.exe (installed to default c:\ruby)- watir-1.4.1.exe (installed to default C:\Program Files\Watir)- Active Content is allowed to run in files on My Computer. (I knowthis is working for a fact because I am running my internet radioscript file in a background IE window process while I work.) I've scanned through the message archives and found similar errormessages reported by Hugh Sasse on Fri Jan 13 10:08:54 EST 2006(subject = "Unit testing"). First observation: I noticed that the unittests\html\images folder ismissing, but I'm assuming that these files aren't really required forsuccessful completion of the tests.Still, I did notice a few popup errors while running the testscomplaining that the files were missing. I can't think that this isnormal/expected behaviour. Second observation: it looks like a file (pass2.html) is missing. Isthis also intentional? I decided to run "core_tests.rb" but it also failed : "154 tests, 929assertions, 3 failures, 0 errors" -> Is there something that I'm missing here? Is there a setup optionor environment variable that I should set to get these tests to workcorrectly? Please let me know. Thanks in advance. I won't let these hiccupsslow me down while I run through the other examples and tutorials. Ijust thought I'd ask before I forget. Cheers.Paul. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Thu Feb 2 00:58:37 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 1 Feb 2006 23:58:37 -0600 Subject: [Wtr-general] Ruby Nubie fails to get out of the box with Unittests In-Reply-To: <003b01c627b3$a28d5b40$0902a8c0@Koko> References: <37c405480602011458y2df7055fr@mail.gmail.com> <003b01c627b3$a28d5b40$0902a8c0@Koko> Message-ID: <ade75c5b0602012158o5971df4fg11e406f3903732ff@mail.gmail.com> Thanks for the detailed reports. The image bugs are common. That code is buggy and needs rewriting. The frame index bugs (expected 0, actual 1) are test-bugs. The code is correct and the tests were fixed in 1.4.1. (Michael is running 1.4.0, but Paul is running 1.4.1). A couple of these bugs are new to me, but seem to stem from the fact that Michael has watir installed in a directory with blanks in its path. I don't know why the table count problem is happening. That is a new one for me too. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060201/1fca2263/attachment.html From tester.paul at gmail.com Thu Feb 2 09:30:23 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Thu, 2 Feb 2006 09:30:23 -0500 Subject: [Wtr-general] Ruby Nubie fails to get out of the box with Unittests In-Reply-To: <ade75c5b0602011540y7ac55547x9cf173498b08b492@mail.gmail.com> References: <37c405480602011458y2df7055fr@mail.gmail.com> <ade75c5b0602011540y7ac55547x9cf173498b08b492@mail.gmail.com> Message-ID: <37c405480602020630n7d0e06ebw@mail.gmail.com> On 01/02/06, Bret Pettichord <bret at pettichord.com> wrote:>> However, i specifically created core_tests.rb as a robust subset of> all_tests.rb. I would like to see the details about the 3 failures you found> while running them.> Hi Bret, I ran the tests again this morning with nothing else running(disabled MSN Messenger, A/V service, etc.) and I got the same errors: ---- C:\Program Files\Watir\unittests>core_tests.rbLoaded suite C:/Program Files/Watir/unittests/core_testsStarted...........................................................-----------Objects in page ------------- [snip] .......................F......................................F............................FFinished in 69.985 seconds. 1) Failure:test_navigation(TC_Navigate) [C:/Program Files/Watir/unittests/../unittests/navigate_test.rb:19]:<"file://c:/program%20files/watir/unittests/html/buttons1.html"> expected but was<"file://c:/program files/watir/unittests/html/buttons1.html">. 2) Failure:test_links_and_images_in_table(TC_Tables) [C:/Program Files/Watir/unittests/../unittests/table_test.rb:165]:<"106"> expected but was<"28">. 3) Failure:test_showLinks(TC_showlinks) [C:/ProgramFiles/Watir/unittests/../unittests/links_test.rb:163:in`test_showLinks' C:/ProgramFiles/Watir/unittests/../unittests/links_test.rb:163:in`each_with_index' C:/Program Files/Watir/unittests/../unittests/links_test.rb:163:in `each' C:/ProgramFiles/Watir/unittests/../unittests/links_test.rb:163:in`each_with_index' C:/ProgramFiles/Watir/unittests/../unittests/links_test.rb:163:in`test_showLinks']:<"1 file:///c:/program%20files/watir/unittests/html/links2.html test1"> expected to be =~</^1 + +file:\/\/\/c:\/program files\/watir\/unittests\/html\/links2.html *test1$/>. 154 tests, 929 assertions, 3 failures, 0 errors ---- Hope this helps. TTYL. Paul. From bret at pettichord.com Thu Feb 2 12:09:29 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 2 Feb 2006 11:09:29 -0600 Subject: [Wtr-general] Ruby Nubie fails to get out of the box with Unittests In-Reply-To: <37c405480602020630n7d0e06ebw@mail.gmail.com> References: <37c405480602011458y2df7055fr@mail.gmail.com> <ade75c5b0602011540y7ac55547x9cf173498b08b492@mail.gmail.com> <37c405480602020630n7d0e06ebw@mail.gmail.com> Message-ID: <ade75c5b0602020909u5744ad5dif817e545af541d67@mail.gmail.com> 1 and 3 are happening because of test-bugs -- the tests don't work right when watir is installed in a directory with a space in the name. 2 fails in: table = $ie.table(:id, 'pic_table') image = table[1][2].image(:index,1) assert_equal("106", image.width) At the moment i am stumped as to what this failure indicates. It is getting the wrong width for the image. Hmm. Bret On 2/2/06, Paul Carvalho <tester.paul at gmail.com> wrote: > > On 01/02/06, Bret Pettichord <bret at pettichord.com> wrote:>> However, i > specifically created core_tests.rb as a robust subset of> all_tests.rb. I > would like to see the details about the 3 failures you found> while running > them.> > Hi Bret, I ran the tests again this morning with nothing else > running(disabled MSN Messenger, A/V service, etc.) and I got the same > errors: > ---- > C:\Program Files\Watir\unittests>core_tests.rbLoaded suite C:/Program > Files/Watir/unittests/core_testsStarted...........................................................-----------Objects > in page ------------- > [snip] > .......................F......................................F............................FFinished > in 69.985 seconds. > 1) Failure:test_navigation(TC_Navigate) [C:/Program > Files/Watir/unittests/../unittests/navigate_test.rb:19]:<" > file://c:/program%20files/watir/unittests/html/buttons1.html"> expected > but was<"file://c:/program files/watir/unittests/html/buttons1.html">. > 2) Failure:test_links_and_images_in_table(TC_Tables) [C:/Program > Files/Watir/unittests/../unittests/table_test.rb:165]:<"106"> expected but > was<"28">. > 3) > Failure:test_showLinks(TC_showlinks) [C:/ProgramFiles/Watir/unittests/../unittests/links_test.rb:163:in`test_showLinks' > C:/ProgramFiles/Watir/unittests/../unittests/links_test.rb:163:in`each_with_index' > C:/Program Files/Watir/unittests/../unittests/links_test.rb:163:in > `each' > C:/ProgramFiles/Watir/unittests/../unittests/links_test.rb:163:in`each_with_index' > C:/ProgramFiles/Watir/unittests/../unittests/links_test.rb:163:in`test_showLinks']:<"1 > file:///c:/program%20files/watir/unittests/html/links2.html test1"> > expected to be =~</^1 + +file:\/\/\/c:\/program > files\/watir\/unittests\/html\/links2.html *test1$/>. > 154 tests, 929 assertions, 3 failures, 0 errors > ---- > Hope this helps. TTYL. Paul. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060202/5ed0eb95/attachment.html From tester.paul at gmail.com Thu Feb 2 18:35:50 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Thu, 2 Feb 2006 18:35:50 -0500 Subject: [Wtr-general] Watir Examples that need to be updated Message-ID: <37c405480602021535t54547dc3k@mail.gmail.com> I've spent the day running through examples and creating new scripts. I am now happily exploring our web apps and struggling throughdeveloping some scripts. Regarding the Watir examples, here is some feedback on what I've observed. The C:\Program Files\Watir\examples folder has 4 scripts that need tobe updated: (1) articleExample.rb- assertion fails because the exact string doesn't appear on the page (2) google_maps.rb- line 34: the text field ID has changed from "q" to "q_d" (3) mouse_over.rb- The last 3 page navigation links fail because the URL links havechanged from "05" to "06".- 'TopicProposalScheduleW05.htm' has also changed to'ProposalPresentationsW06.htm' (4) yahooCheckbox_test.rb- Only the first test actually works. The rest all fail because thesepages have completely changed on the Yahoo! site. If you want to democheckboxes, you'll have to find another site to use. ---- On a related note, I tried to work through the "Scripting 101" Labexercises, but the instructions seem to be missing a key piece ofinformation:=> How do you launch the Timeclock web application?? I read through the specs, cheat sheets, and every script I could find,but nowhere does it say how to launch the app. I must be missingsomething. (I've run the Timeclock server and tested it as per theInstall instructions, so I know that part works.) I've decided to ignore these exercises, but I would be curious to knowhow to get the app working for my own piece of mind. Paul. From Mark_Cain at rl.gov Fri Feb 3 10:16:35 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Fri, 3 Feb 2006 07:16:35 -0800 Subject: [Wtr-general] Watir Examples that need to be updated Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D558@EX5V.rl.gov> Probably a better use of your time would be to go through the unittests (in the Watir install directory) for examples of usage. There is not much that I have encountered that does not have a fairly decent representation in the unittests; and they are maintained a little better than the examples because they are really used to unittest Watir. As to specific question regarding how to do something in Watir that is not in the unittests this forum is the best that I have seen--people are eager to pass alone things they have learned and post solutions and improved solutions quickly as well as offer direction for getting over or around the roadblocks! Also, for general all-around ruby information you can't do any better than the famous Pickaxe book - Programming Ruby (2nd edition) by Dave Thomas it is well worth the money. --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho Sent: Thursday, February 02, 2006 3:36 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Watir Examples that need to be updated I've spent the day running through examples and creating new scripts. I am now happily exploring our web apps and struggling throughdeveloping some scripts. Regarding the Watir examples, here is some feedback on what I've observed. The C:\Program Files\Watir\examples folder has 4 scripts that need tobe updated: (1) articleExample.rb- assertion fails because the exact string doesn't appear on the page (2) google_maps.rb- line 34: the text field ID has changed from "q" to "q_d" (3) mouse_over.rb- The last 3 page navigation links fail because the URL links havechanged from "05" to "06".- 'TopicProposalScheduleW05.htm' has also changed to'ProposalPresentationsW06.htm' (4) yahooCheckbox_test.rb- Only the first test actually works. The rest all fail because thesepages have completely changed on the Yahoo! site. If you want to democheckboxes, you'll have to find another site to use. ---- On a related note, I tried to work through the "Scripting 101" Labexercises, but the instructions seem to be missing a key piece ofinformation:=> How do you launch the Timeclock web application?? I read through the specs, cheat sheets, and every script I could find,but nowhere does it say how to launch the app. I must be missingsomething. (I've run the Timeclock server and tested it as per theInstall instructions, so I know that part works.) I've decided to ignore these exercises, but I would be curious to knowhow to get the app working for my own piece of mind. Paul. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060203/54321944/attachment.html From Joseph_Graham at adp.com Fri Feb 3 11:04:05 2006 From: Joseph_Graham at adp.com (Graham, Joseph x66237) Date: Fri, 3 Feb 2006 11:04:05 -0500 Subject: [Wtr-general] how to set frame URL location Message-ID: <DA5E76C21FEA85459B0E959CFAC237820813580C@sisexpo01.sis> Hello, I recently installed (2 days ago) the latest release of Watir and am running into some issues. Is there an example somewhere of how to set the URL of a frame. I tried the following <code_snip> # provides a reference to a frame with name "main" main_frame = ie.frame('main') main_frame.navigate_to( ...url... ) // <-- not supported </code_snip> I could also just invoke some javascript function because I am really trying to manipulate a custom DHTML toolbar that has some JS hooks exposed for navigating the frame in question. Any examples of this would be great. I would also appreciate any guidance as to best practices of testing applications that take extensive advantage of AJAX and js. BR_joe _ This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 2102 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060203/40251003/attachment.bin From tester.paul at gmail.com Fri Feb 3 12:04:19 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Fri, 3 Feb 2006 12:04:19 -0500 Subject: [Wtr-general] Ruby Nubie fails to get out of the box with Unittests In-Reply-To: <ade75c5b0602020909u5744ad5dif817e545af541d67@mail.gmail.com> References: <37c405480602011458y2df7055fr@mail.gmail.com> <ade75c5b0602011540y7ac55547x9cf173498b08b492@mail.gmail.com> <37c405480602020630n7d0e06ebw@mail.gmail.com> <ade75c5b0602020909u5744ad5dif817e545af541d67@mail.gmail.com> Message-ID: <37c405480602030904j168b1f86v@mail.gmail.com> I followed up on your suggestions. I downloaded "watir-v1_4.zip" and extracted just the"/unittests/html/images" folder.I then copied the whole "unittests" folder (and subfolders) to my"C:\Scripts\" folder. Now when I run "all_tests.rb", I get the result: "182 tests, 1063 assertions, 0 failures, 0 errors" When I run "core_tests.rb", I get the result: "154 tests, 947 assertions, 0 failures, 0 errors" I think this is the result you expected. Just thought you'd want toknow. Thanks for the help. Cheers. Paul. On 02/02/06, Bret Pettichord <bret at pettichord.com> wrote:> 1 and 3 are happening because of test-bugs -- the tests don't work right> when watir is installed in a directory with a space in the name.>> 2 fails in:>> table = $ie.table(:id, 'pic_table')> image = table[1][2].image(:index,1)> assert_equal("106", image.width)>> At the moment i am stumped as to what this failure indicates. It is getting> the wrong width for the image. Hmm.>> Bret From angrez at gmail.com Fri Feb 3 12:40:00 2006 From: angrez at gmail.com (Angrez Singh) Date: Fri, 3 Feb 2006 23:10:00 +0530 Subject: [Wtr-general] Is it a bug in doKeyPress() function? Message-ID: <e26bda3e0602030940w6718eff0h4f391b18e32e0369@mail.gmail.com> Hi, I have noticed a variable called suppliedValue that is not defined anywhere in the code. Is it a bug or I am missing something? def doKeyPress( value ) begin maxLength = @o.maxLength if value.length > maxLength value = suppliedValue[0 .. maxLength ] @container.log " Supplied string is #{suppliedValue.length} chars, which exceeds the max length (#{maxLength}) of the field. Using value: #{value}" Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060203/92f61283/attachment.html From tester.paul at gmail.com Fri Feb 3 17:41:01 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Fri, 3 Feb 2006 17:41:01 -0500 Subject: [Wtr-general] How do you pass values to Hidden Input fields? Message-ID: <37c405480602031441o53eb252eq@mail.gmail.com> Hi there, I have encountered an interesting roadblock that I need somehelp with. In the Dot-Net application that I am testing, there is a Context Treein the Left frame that when you click on something, it changes thecontext/display in the MainWindow frame. (i.e. similar to the"Interacting with a JavaScripttree view" example in the FAQ.) Unfortunately, the Javascript tree that our app uses is not quite assimple as the Joust example. When I use "ie.frame("ContextTree").image(:index, 3).flash", the[-]/[+] icon flashes. I can "click" this to expand/collapse thecurrently selected item. (that's good) However, this command/control doesn't actually *select* the item. (that's bad) I scanned through the HTML (and used SpySmith) to discover that thetree item names are stored within "div" tags. Okay. So then Idiscovered that I can highlight any item in the tree that I want usingsomething like: "ie.frame("ContextTree").div(:id, "ContextList1Tree_1_2").flash" (where the "_1_2" is kind of like an array of the items listed in thetree.) (that's good) When I try to "click" this item, nothing happens. (that's bad) Back to scanning the HTML. I used "show_all_objects" to give me alist of the frame elements. Then I noticed the *hidden* input fields. I think that I need to pass values to one of these hidden inputfields, but I haven't been successful using ".text_field(..).set(..)" When I try this, I keep getting an error similar to the following:"Watir::Exception::UnknownObjectException: Unable to locate object.." I've searched through the mail archives for other postings on Hiddenfields, but I haven't found any solutions posted that would apply tothe page/frame that I am trying to interact with. There are *no*visible fields to input on this Context Tree. It is simply lookingfor an onkeydown / onkeyup / onclick event of some sort. Has anyone had any success trying to pass values to hidden inputfields that are looking for these kinds of values? I'll keep exploring, but I thought I would post my question in themeantime to see if anyone here has any advice that might help. Cheers. Paul. From bret at pettichord.com Fri Feb 3 20:33:54 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 3 Feb 2006 19:33:54 -0600 Subject: [Wtr-general] Is it a bug in doKeyPress() function? In-Reply-To: <e26bda3e0602030940w6718eff0h4f391b18e32e0369@mail.gmail.com> References: <e26bda3e0602030940w6718eff0h4f391b18e32e0369@mail.gmail.com> Message-ID: <ade75c5b0602031733m4b9bf784r1e617e53b1837192@mail.gmail.com> Looks like a bug to me. I guess we need to add a unit test for this case. In any case, i just checked in a fix, or at least an improvement for this. Bret On 2/3/06, Angrez Singh <angrez at gmail.com> wrote: > > Hi, > > I have noticed a variable called suppliedValue that is not defined anywhere in the code. Is it a bug or I am missing something? > > def doKeyPress( value ) > begin > maxLength = @o.maxLength > if value.length > maxLength > value = suppliedValue[0 .. maxLength ] > @container.log " Supplied string is #{suppliedValue.length } chars, > which exceeds the max length (#{maxLength}) of the field. Using value: > #{value}" > > > > Regards, > Angrez > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060203/8c0221b5/attachment.html From bret at pettichord.com Fri Feb 3 20:47:40 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 3 Feb 2006 19:47:40 -0600 Subject: [Wtr-general] How do you pass values to Hidden Input fields? In-Reply-To: <37c405480602031441o53eb252eq@mail.gmail.com> References: <37c405480602031441o53eb252eq@mail.gmail.com> Message-ID: <ade75c5b0602031747g4fd82c8cpcdc57a4d5d8a9517@mail.gmail.com> There are tricks you sometimes (always?) have to use to enter text with hidden text fields. But watir can see hidden fields without any special problem and the error you are getting is because watir can't find it. So you are still have problems with the identification. Bret On 2/3/06, Paul Carvalho <tester.paul at gmail.com> wrote: > > Hi there, I have encountered an interesting roadblock that I need somehelp > with. > In the Dot-Net application that I am testing, there is a Context Treein > the Left frame that when you click on something, it changes > thecontext/display in the MainWindow frame. (i.e. similar to > the"Interacting with a JavaScripttree view" example in the FAQ.) > Unfortunately, the Javascript tree that our app uses is not quite assimple > as the Joust example. > When I use "ie.frame("ContextTree").image(:index, 3).flash", the[-]/[+] > icon flashes. I can "click" this to expand/collapse thecurrently selected > item. (that's good) > However, this command/control doesn't actually *select* the item. (that's > bad) > I scanned through the HTML (and used SpySmith) to discover that thetree > item names are stored within "div" tags. Okay. So then Idiscovered that I > can highlight any item in the tree that I want usingsomething like: " > ie.frame("ContextTree").div(:id, "ContextList1Tree_1_2").flash" > (where the "_1_2" is kind of like an array of the items listed in > thetree.) (that's good) > When I try to "click" this item, nothing happens. (that's bad) > Back to scanning the HTML. I used "show_all_objects" to give me alist of > the frame elements. Then I noticed the *hidden* input fields. > I think that I need to pass values to one of these hidden inputfields, but > I haven't been successful using ".text_field(..).set(..)" > When I try this, I keep getting an error similar to the > following:"Watir::Exception::UnknownObjectException: Unable to locate > object.." > > I've searched through the mail archives for other postings on > Hiddenfields, but I haven't found any solutions posted that would apply > tothe page/frame that I am trying to interact with. There are *no*visible > fields to input on this Context Tree. It is simply lookingfor an onkeydown > / onkeyup / onclick event of some sort. > Has anyone had any success trying to pass values to hidden inputfields > that are looking for these kinds of values? > I'll keep exploring, but I thought I would post my question in themeantime > to see if anyone here has any advice that might help. > Cheers. Paul. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060203/6bb80abb/attachment.html From murgundesachin at yahoo.com Sat Feb 4 00:21:41 2006 From: murgundesachin at yahoo.com (SACHIN MURGUNDE) Date: Fri, 3 Feb 2006 21:21:41 -0800 (PST) Subject: [Wtr-general] Regarding Links Message-ID: <20060204052141.76765.qmail@web50713.mail.yahoo.com> Hi, Iam very very new to watir and ruby. I have a small problem in watir.Iam having a page with 10 links with same name "Send Message" with differend parameter in query string eg <a href="http://mail.yahoo.com/config/login? View' target=_blank>fuseaction=user.viewProfile&friendID=53045355"> View Profile </a> <a href="http://mail.yahoo.com/config/login?View' target=_blank>fuseaction=user.viewProfile&friendID=53040035">View Profile </a> <br /> . . . . . etc...... so how can i write script to click or open new window from "view Profile" hyper link as shown above Is it possible to do so? Thanks and regards, Sachin --------------------------------- Relax. Yahoo! Mail virus scanning helps detect nasty viruses! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060203/c21e1c70/attachment.html From bret at pettichord.com Sat Feb 4 13:08:20 2006 From: bret at pettichord.com (Bret Pettichord) Date: Sat, 4 Feb 2006 12:08:20 -0600 Subject: [Wtr-general] Regarding Links In-Reply-To: <20060204052141.76765.qmail@web50713.mail.yahoo.com> References: <20060204052141.76765.qmail@web50713.mail.yahoo.com> Message-ID: <ade75c5b0602041008l14338e5bs62027bfcfaffcfff@mail.gmail.com> ie.link(:url, "http://mail.yahoo.com/config/login? fuseaction=user.viewProfile&friendID=53045355"<http://www.myspace.com/index.cfm?fuseaction=http://mail.yahoo.com/config/login?/user.viewProfile&friendID=53045355%22%3E+View> ).click On 2/3/06, SACHIN MURGUNDE <murgundesachin at yahoo.com> wrote: > > Hi, > > Iam very very new to watir and ruby. > I have a small problem in watir.Iam having a page with 10 links with same > name "Send Message" with differend parameter in query string > > eg <a href="http://mail.yahoo.com/config/login?fuseaction=user.viewProfile&friendID=53045355"> > View<http://www.myspace.com/index.cfm?fuseaction=http://mail.yahoo.com/config/login?/user.viewProfile&friendID=53045355%22%3E+View>Profile </a> > > <a href="http://mail.yahoo.com/config/login? > fuseaction=user.viewProfile&friendID=53040035">View<http://www.myspace.com/index.cfm?fuseaction=http://mail.yahoo.com/config/login?/user.viewProfile&friendID=53040035%22%3EView>Profile </a> <br /> > > . > . > . > . > . > etc...... > > so how can i write script to click or open new window from "*view Profile*" > hyper link as shown above > Is it possible to do so? > > Thanks and regards, > Sachin > > ------------------------------ > Relax. Yahoo! Mail virus scanning<http://us.rd.yahoo.com/mail_us/taglines/viruscc/*http://communications.yahoo.com/features.php?page=221>helps detect nasty viruses! > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060204/b157aa17/attachment.html From sreedhar.kharidehal at gmail.com Mon Feb 6 05:56:39 2006 From: sreedhar.kharidehal at gmail.com (Sreedhar Kharidehal) Date: Mon, 6 Feb 2006 16:26:39 +0530 Subject: [Wtr-general] link click problem Message-ID: <48150ae20602060256y549d1b64wfbb54575b19c5a9d@mail.gmail.com> Hi ,i see the following for a link in view source <a href="javascript:fnOnView(75)">link name</a> I want to click link using "javascript:fnOnView(75)" function and not the text which happens to be link name in this case .How can i do it ? some more info: Number 75 comes from the database and it changes .I can connect to the database and access the id I tried the following ie.link(:title,"\"javascript:fnOnView("+link_id+")\"").click where link_id is 75 but i got the following exception Unable to locate object, using title and "javascript:fnOnView(75)" (Watir::Exception::UnknownObjectException) .Does the href need to have explicit title = "" for the above to work . Thanks --sreedhar From sreedhar.kharidehal at gmail.com Mon Feb 6 07:06:39 2006 From: sreedhar.kharidehal at gmail.com (Sreedhar Kharidehal) Date: Mon, 6 Feb 2006 17:36:39 +0530 Subject: [Wtr-general] link click problem In-Reply-To: <48150ae20602060256y549d1b64wfbb54575b19c5a9d@mail.gmail.com> References: <48150ae20602060256y549d1b64wfbb54575b19c5a9d@mail.gmail.com> Message-ID: <48150ae20602060406o23352db6qc596e7eec483e89b@mail.gmail.com> Hi ,tried using :url instead of title and it worked. On 2/6/06, Sreedhar Kharidehal <sreedhar.kharidehal at gmail.com> wrote: > Hi ,i see the following for a link in view source > <a href="javascript:fnOnView(75)">link name</a> > I want to click link using "javascript:fnOnView(75)" function and not > the text which happens to be link name in this case .How can i do it ? > some more info: > Number 75 comes from the database and it changes .I can connect to the > database and access the id > I tried the following > ie.link(:title,"\"javascript:fnOnView("+link_id+")\"").click > where link_id is 75 but i got the following exception > Unable to locate object, using title and "javascript:fnOnView(75)" > (Watir::Exception::UnknownObjectException) > .Does the href need to have explicit title = "" for the above to work . > > Thanks > --sreedhar > -- sreedhar From jimche218 at gmail.com Mon Feb 6 07:40:27 2006 From: jimche218 at gmail.com (Jim Che) Date: Mon, 6 Feb 2006 20:40:27 +0800 Subject: [Wtr-general] How to get the second part which is found by Regexp Message-ID: <5397f6f80602060440m4462c3dbk@mail.gmail.com> for example there is a line as below: http://www.co.bo.com in the http://www.hello.com I am want to find the all website address and use the reguler express: re = /http\:\/\/[_a-zA-Z0-9-]+[\._a-zA-Z0-9-]+/ md = re.match(line) but the result was just the first website address http://www.co.bo.com So my question is how to get the "http://www.hello.com" thank you for any help Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060206/d1a42330/attachment.html From christopher.mcmahon at gmail.com Mon Feb 6 09:52:04 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 6 Feb 2006 08:52:04 -0600 Subject: [Wtr-general] How to get the second part which is found by Regexp In-Reply-To: <5397f6f80602060440m4462c3dbk@mail.gmail.com> References: <5397f6f80602060440m4462c3dbk@mail.gmail.com> Message-ID: <72799cd70602060652k22fc4d11g16e0e97363276785@mail.gmail.com> On 2/6/06, Jim Che <jimche218 at gmail.com> wrote: > for example there is a line as below: > http://www.co.bo.com in the http://www.hello.com > I am want to find the all website address and use the reguler express: > re = /http\:\/\/[_a-zA-Z0-9-]+[\._a-zA-Z0-9-]+/ > md = re.match(line) > but the result was just the first website address http://www.co.bo.com > So my question is how to get the "http://www.hello.com" > thank you for any help You could use scan: matches = [] your_http_string.scan //http\:\/\/[_a-zA-Z0-9-]+[\._a-zA-Z0-9-]+/ do |match| matches<<match end It's not tested, but I think it'll work. -Chris From tester.paul at gmail.com Mon Feb 6 10:28:47 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Mon, 6 Feb 2006 10:28:47 -0500 Subject: [Wtr-general] Assertions help Message-ID: <37c405480602060728v6bc7244j@mail.gmail.com> Hi there. I have been trying to figure out how the Assertions work inWatir, but I seem to be getting something wrong. I tried to add the following to one of my scripts (improvised from theexamples in the "WATIR User Guide"), but it doesn't work the way Iexpect it to: if assert($ie.contains_text("Please try again")) puts "=> TEST PASSED. Found test string: 'Please try again.' " else puts "=> TEST FAILED." end --> This *always* returns "TEST FAILED", even when the string isreally on the page. (unexpected for me - so I must have somethingwrong.) >From the Help file, I found the following, less than helpful info:> assert(boolean, message=nil)> Passes if boolean is true. Absolutely clueless as to what this actually means, I tried to outputthe assert line and I see that it always returns "nil". Of course,that would be unexpected for the "if" statement waiting for aTrue/False response, so that's why it goes to the .else. when I expectit to pass. Back to the less-than-helpful Help file, I found the following:> assert_nil(object, message="")> Passes if object.nil?. Should I use this instead? Is it even possible to combine the assertand if statements in this way? Please let me know. Thanks.Paul. From sreedhar.kharidehal at gmail.com Mon Feb 6 10:34:43 2006 From: sreedhar.kharidehal at gmail.com (Sreedhar Kharidehal) Date: Mon, 6 Feb 2006 21:04:43 +0530 Subject: [Wtr-general] running watir scripts from ANT Message-ID: <48150ae20602060734q155dbf44hc2aec6a222e9b031@mail.gmail.com> Hi i am not sure whether this is the right group to post this question but can i run watir scripts from ANT ? -- sreedhar From jeff.darklight at gmail.com Mon Feb 6 10:43:33 2006 From: jeff.darklight at gmail.com (Jeff Wood) Date: Mon, 06 Feb 2006 07:43:33 -0800 Subject: [Wtr-general] How to get the second part which is found by Regexp In-Reply-To: <5397f6f80602060440m4462c3dbk@mail.gmail.com> References: <5397f6f80602060440m4462c3dbk@mail.gmail.com> Message-ID: <43E76EA5.9010901@gmail.com> Jim Che wrote: > for example there is a line as below: > http://www.co.bo.com in the http://www.hello.com > I am want to find the all website address and use the reguler express: > re = /http\:\/\/[_a-zA-Z0-9-]+[\._a-zA-Z0-9-]+/ > md = re.match(line) > but the result was just the first website > address http://www.co.bo.com > So my question is how to get the "http://www.hello.com > <http://www.hello.com/>" > thank you for any help > Jim > ------------------------------------------------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general Usually for this I will go the opposite direction ... Use something like : re = /http\:\/\/[_a-zA-Z0-9-]+[\._a-zA-Z0-9-]+/ matches = line.scan( re ) It will return an array that contains everything you are looking for ... Whats nice is if you use grouping inside your regexp like this: re = /http\:\/\/([_a-zA-Z0-9-]+)([\._a-zA-Z0-9-]+)/ matches = line.scan( re ) each of the matches items will be an array of the groupings. ... anyways, thats how I normally do it, just my $0.02USD j. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060206/d3afafaa/attachment.html From christopher.mcmahon at gmail.com Mon Feb 6 10:48:53 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 6 Feb 2006 09:48:53 -0600 Subject: [Wtr-general] How to get the second part which is found by Regexp In-Reply-To: <43E76EA5.9010901@gmail.com> References: <5397f6f80602060440m4462c3dbk@mail.gmail.com> <43E76EA5.9010901@gmail.com> Message-ID: <72799cd70602060748p825100dx21f32dd581000a79@mail.gmail.com> > re = /http\:\/\/[_a-zA-Z0-9-]+[\._a-zA-Z0-9-]+/ > matches = line.scan( re ) > > It will return an array that contains everything you are looking for ... Cool, I didn't know if scan returned an array (although I might have suspected it, so many Ruby methods do.) -Chris From email at derkaan.de Mon Feb 6 10:59:59 2006 From: email at derkaan.de (Kaan Karaca) Date: Mon, 6 Feb 2006 16:59:59 +0100 Subject: [Wtr-general] running watir scripts from ANT In-Reply-To: <48150ae20602060734q155dbf44hc2aec6a222e9b031@mail.gmail.com> Message-ID: <E1F68mS-0003pn-8K@vizzard.develnet> There is an "Exec" task in Ant where you can invoke system commands. Maybe you should also look at rake - ruby make (google for it). Its really powerful. -----Urspr?ngliche Nachricht----- Von: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] Im Auftrag von Sreedhar Kharidehal Gesendet: Montag, 6. Februar 2006 16:35 An: Wtr-general at rubyforge.org Betreff: [Wtr-general] running watir scripts from ANT Hi i am not sure whether this is the right group to post this question but can i run watir scripts from ANT ? -- sreedhar _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/251 - Release Date: 04.02.2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/251 - Release Date: 04.02.2006 From bret at pettichord.com Mon Feb 6 12:30:27 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 6 Feb 2006 11:30:27 -0600 Subject: [Wtr-general] Assertions help In-Reply-To: <37c405480602060728v6bc7244j@mail.gmail.com> References: <37c405480602060728v6bc7244j@mail.gmail.com> Message-ID: <ade75c5b0602060930n20aaff5ctc3ed46db28b93005@mail.gmail.com> You are looking at old and buggy documentation. Is this what we bundled with 1.4.1? Updated documentation is here: http://wtr.rubyforge.org/watir_user_guide.html >Is it even possible to combine the assertand if statements in this way? No. Bret On 2/6/06, Paul Carvalho <tester.paul at gmail.com> wrote: > > Hi there. I have been trying to figure out how the Assertions work > inWatir, but I seem to be getting something wrong. > I tried to add the following to one of my scripts (improvised from > theexamples in the "WATIR User Guide"), but it doesn't work the way Iexpect > it to: > if assert($ie.contains_text("Please try again")) puts "=> TEST > PASSED. Found test string: 'Please try again.' " else puts "=> TEST > FAILED." end > --> This *always* returns "TEST FAILED", even when the string isreally on > the page. (unexpected for me - so I must have somethingwrong.) > >From the Help file, I found the following, less than helpful info:> > assert(boolean, message=nil)> Passes if boolean is true. > Absolutely clueless as to what this actually means, I tried to outputthe > assert line and I see that it always returns "nil". Of course,that would be > unexpected for the "if" statement waiting for aTrue/False response, so > that's why it goes to the .else. when I expectit to pass. > Back to the less-than-helpful Help file, I found the following:> > assert_nil(object, message="")> Passes if object.nil?. > Should I use this instead? Is it even possible to combine the assertand > if statements in this way? > Please let me know. Thanks.Paul. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060206/04e6a54e/attachment.html From thealy at midicorp.com Mon Feb 6 12:53:21 2006 From: thealy at midicorp.com (Thomas Healy) Date: Mon, 6 Feb 2006 12:53:21 -0500 Subject: [Wtr-general] Assertions help Message-ID: <8EA615B25AB5F849BF0193B80E6D4C49800CD1@MIDISERVER> Can Watir be used to test drop and drag functionality? If so how? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060206/5ccda095/attachment.html From christopher.mcmahon at gmail.com Mon Feb 6 13:41:12 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 6 Feb 2006 12:41:12 -0600 Subject: [Wtr-general] Drag'n'drop Re: Assertions help Message-ID: <72799cd70602061041j57c9d975yc407f8358507f3b2@mail.gmail.com> > Can Watir be used to test drop and drag functionality? If so how? I hope Paul sees this. Some time ago we looked into this, and it seemed possible, but the demand was lacking. Maybe it's time to re-examine. If I remember, it was a matter of extending support for more Javascript: onDrag and onDrop messages. Maybe it's already in there? -Chris From tester.paul at gmail.com Mon Feb 6 16:38:22 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Mon, 6 Feb 2006 16:38:22 -0500 Subject: [Wtr-general] How do you pass values to Hidden Input fields? In-Reply-To: <ade75c5b0602031747g4fd82c8cpcdc57a4d5d8a9517@mail.gmail.com> References: <37c405480602031441o53eb252eq@mail.gmail.com> <ade75c5b0602031747g4fd82c8cpcdc57a4d5d8a9517@mail.gmail.com> Message-ID: <37c405480602061338w3380445fn@mail.gmail.com> I found some of the classes and methods for working with Hiddenfields, but all this programming stuff is a bit too terse for me.(Dammit Jim, I'm a tester not a programmer! ;)) I tried the following:> ie.frame("ContextTree").hiddens.length=> Returns a value of 8. (matches the number identified via "show_all_objects") > ie.frame("ContextTree").text_fields.length=> Returned a value of 2. (This is interesting, because only one inputfield is visible.) When I tried to input text into the first text_field, it appeared asexpected. When I tried to input text into the second input field, Igot the following: > ie.frame("ContextTree").text_field(:index, 2).set("wasup?")=> WIN32OLERuntimeError: focus OLE error code:800A083E in htmlfile Can't move focus to the control because it is invisible, notenabled, or of a type that does not accept the focus.[snip] So, how do I send info to this input field? Do I use something likethe following?> ie.frame("ContextTree").hidden(:id, "_ContextList1:Tree").set("wasup?") I think I'm mixing apples and oranges here. The second text inputfield doesn't have a "hidden" attribute, yet it is "invisible". This tree control will be the end of me yet. I think I've found a wayto bypass it using the URL. If that works, I'm going to give up ontrying to manipulate the UI directly with Watir. This is one timewhere the mouse is mightier than the keyboard. Sigh. Cheers. Paul. BTW, does anyone know a tool that will allow me to see what info IEpasses from one page to another? SpySmith is nice for viewing staticinformation on a page, but not for showing me what's being passed fromone page to another. TIA. On 03/02/06, Bret Pettichord <bret at pettichord.com> wrote:> There are tricks you sometimes (always?) have to use to enter text with> hidden text fields. But watir can see hidden fields without any special> problem and the error you are getting is because watir can't find it. So you> are still have problems with the identification.>> Bret From christopher.mcmahon at gmail.com Mon Feb 6 16:53:53 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 6 Feb 2006 15:53:53 -0600 Subject: [Wtr-general] page-to-page; sniffing server traffic. Re: How do you pass values to Hidden Input fields? Message-ID: <72799cd70602061353w867cbcfh5442a3b4e68b56df@mail.gmail.com> > BTW, does anyone know a tool that will allow me to see what info IEpasses from one page to another? SpySmith is nice for viewing staticinformation on a page, but not for showing me what's being passed fromone page to another. TIA. http://search.cpan.org/~book/HTTP-Proxy-0.17/lib/HTTP/Proxy.pm maybe with http://search.cpan.org/~leira/HTTP-Recorder-0.05/lib/HTTP/Recorder.pm I can't remember if you need Recorder to get the nice formatted output to STDOUT from the proxy. Please don't flame me, if I knew of a proxy as nice as this in Ruby, I'd recommend it. :) -Chris From bret at pettichord.com Mon Feb 6 16:57:30 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 6 Feb 2006 15:57:30 -0600 Subject: [Wtr-general] How do you pass values to Hidden Input fields? In-Reply-To: <37c405480602061338w3380445fn@mail.gmail.com> References: <37c405480602031441o53eb252eq@mail.gmail.com> <ade75c5b0602031747g4fd82c8cpcdc57a4d5d8a9517@mail.gmail.com> <37c405480602061338w3380445fn@mail.gmail.com> Message-ID: <ade75c5b0602061357y1566bbdcya1e98b2abf1b2d03@mail.gmail.com> Try ie.frame("ContextTree").text_field(:index, 2).value = "wasup?" As a general rule, setting the value of a field via value= often works when set fails. Bret On 2/6/06, Paul Carvalho <tester.paul at gmail.com> wrote: > > I found some of the classes and methods for working with Hiddenfields, but > all this programming stuff is a bit too terse for me.(Dammit Jim, I'm a > tester not a programmer! ;)) > I tried the following:> ie.frame("ContextTree").hiddens.length=> Returns a > value of 8. (matches the number identified via "show_all_objects") > > ie.frame("ContextTree").text_fields.length=> Returned a value of 2. > (This is interesting, because only one inputfield is visible.) > When I tried to input text into the first text_field, it appeared > asexpected. When I tried to input text into the second input field, Igot > the following: > > ie.frame("ContextTree").text_field(:index, 2).set("wasup?")=> > WIN32OLERuntimeError: focus OLE error code:800A083E in > htmlfile Can't move focus to the control because it is invisible, > notenabled, or of a type that does not accept the focus.[snip] > So, how do I send info to this input field? Do I use something likethe > following?> ie.frame("ContextTree").hidden(:id, > "_ContextList1:Tree").set("wasup?") > I think I'm mixing apples and oranges here. The second text inputfield > doesn't have a "hidden" attribute, yet it is "invisible". > This tree control will be the end of me yet. I think I've found a wayto > bypass it using the URL. If that works, I'm going to give up ontrying to > manipulate the UI directly with Watir. This is one timewhere the mouse is > mightier than the keyboard. Sigh. > Cheers. Paul. > BTW, does anyone know a tool that will allow me to see what info IEpasses > from one page to another? SpySmith is nice for viewing staticinformation on > a page, but not for showing me what's being passed fromone page to > another. TIA. > > On 03/02/06, Bret Pettichord <bret at pettichord.com> wrote:> There are > tricks you sometimes (always?) have to use to enter text with> hidden text > fields. But watir can see hidden fields without any special> problem and the > error you are getting is because watir can't find it. So you> are still have > problems with the identification.>> Bret > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060206/989c1f75/attachment.html From tester.paul at gmail.com Mon Feb 6 17:04:47 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Mon, 6 Feb 2006 17:04:47 -0500 Subject: [Wtr-general] page-to-page; sniffing server traffic. Re: How do you pass values to Hidden Input fields? In-Reply-To: <72799cd70602061353w867cbcfh5442a3b4e68b56df@mail.gmail.com> References: <72799cd70602061353w867cbcfh5442a3b4e68b56df@mail.gmail.com> Message-ID: <37c405480602061404x20595246j@mail.gmail.com> Thanks, Chris. A developer friend just sent me a link tohttp://www.blunck.info/iehttpheaders.html It's a nice plugin for IE. I'm still playing with it to see if itshows me what I want. Cheers. Paul. On 06/02/06, Chris McMahon <christopher.mcmahon at gmail.com> wrote:>> http://search.cpan.org/~book/HTTP-Proxy-0.17/lib/HTTP/Proxy.pm> maybe with> http://search.cpan.org/~leira/HTTP-Recorder-0.05/lib/HTTP/Recorder.pm>> I can't remember if you need Recorder to get the nice formatted output> to STDOUT from the proxy.>> Please don't flame me, if I knew of a proxy as nice as this in Ruby,> I'd recommend it. :)> -Chris From bret at pettichord.com Mon Feb 6 18:31:44 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 6 Feb 2006 17:31:44 -0600 Subject: [Wtr-general] running watir scripts from ANT In-Reply-To: <E1F68mS-0003pn-8K@vizzard.develnet> References: <48150ae20602060734q155dbf44hc2aec6a222e9b031@mail.gmail.com> <E1F68mS-0003pn-8K@vizzard.develnet> Message-ID: <ade75c5b0602061531o25a817e2ta6318d180b613853@mail.gmail.com> For Nant integration, see http://www.hanselman.com/blog/NUnitWatirRubyTestIntegration.aspx I suspect Ant would be similar. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060206/b7fc21bc/attachment.html From rosecao at us.ibm.com Mon Feb 6 23:40:01 2006 From: rosecao at us.ibm.com (Rose Cao) Date: Mon, 6 Feb 2006 21:40:01 -0700 Subject: [Wtr-general] how to connect to DB2 database. Message-ID: <OF44D65EBA.EF4899BD-ON8725710E.00189962-8725710E.001961EF@us.ibm.com> Please help ...... Here is what I need do: 1. Get value from DB2 database == value1 2. Get corresponding field from Webpage == value2 3. Compare value1 and value2 to see if they are matching each other. I have difficulty to connect to DB2 database and pass value1 out of database. The environment is: 1. IBM DB2 ODBC Driver is installed 2. system DSN name for the database is dsnbat Here is my testing code for getting database values, and it doesn't work: require 'DB2' conn = dsnbat.logon("username","password") cursor = conn.open cursor.parse("myquery here") cursor.exec while r = cursor.fetch p r end cursor.close conn.logoff Thanks, Rose -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060206/33bb8af0/attachment.html From jayasree.k at marlabs.com Mon Feb 6 23:40:31 2006 From: jayasree.k at marlabs.com (jayashree) Date: Tue, 7 Feb 2006 10:10:31 +0530 Subject: [Wtr-general] assert_equal problem in the module Message-ID: <EKEJIKLLJMIAAEDOAMDLEEILCAAA.jayasree.k@marlabs.com> Hi, I am new to watir and ruby. There are two ruby files.In the main ruby file I am using assert_equal.It's working fine.There is another ruby file which contains module.I want to write all the assert_equal statements in the module. At the top of the module, I am using - $LOAD_PATH.<< File.join(File.dirname(__FILE__), '') if $0 == __FILE__. If I use assert_equal in the module file, I am getting error: undefined method : assert_equal. What is the require statements for this. Thanks, Jayashree. Disclaimer: This e-mail, and any files transmitted with it are confidential to Marlabs Inc. and intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. From zeljko.filipin at gmail.com Tue Feb 7 03:11:18 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 7 Feb 2006 09:11:18 +0100 Subject: [Wtr-general] How do you pass values to Hidden Input fields? In-Reply-To: <37c405480602061338w3380445fn@mail.gmail.com> References: <37c405480602031441o53eb252eq@mail.gmail.com> <ade75c5b0602031747g4fd82c8cpcdc57a4d5d8a9517@mail.gmail.com> <37c405480602061338w3380445fn@mail.gmail.com> Message-ID: <f81b1250602070011s4a9a5394h@mail.gmail.com> Try http://www.fiddlertool.com/fiddler/ Zeljko 2006/2/6, Paul Carvalho <tester.paul at gmail.com>: > BTW, does anyone know a tool that will allow me to see what info IEpasses from one page to another? SpySmith is nice for viewing staticinformation on a page, but not for showing me what's being passed fromone page to another. TIA. From zeljko.filipin at gmail.com Tue Feb 7 03:14:42 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 7 Feb 2006 09:14:42 +0100 Subject: [Wtr-general] assert_equal problem in the module In-Reply-To: <EKEJIKLLJMIAAEDOAMDLEEILCAAA.jayasree.k@marlabs.com> References: <EKEJIKLLJMIAAEDOAMDLEEILCAAA.jayasree.k@marlabs.com> Message-ID: <f81b1250602070014p1557da83r@mail.gmail.com> require 'test/unit/assertions' include Test::Unit::Assertions 2006/2/7, jayashree <jayasree.k at marlabs.com>: > Hi, > I am new to watir and ruby. > There are two ruby files.In the main ruby file I am using assert_equal.It's > working fine.There is another ruby file which contains module.I want to > write all the assert_equal statements in the module. > At the top of the module, I am using - $LOAD_PATH.<< > File.join(File.dirname(__FILE__), '') if $0 == __FILE__. > > If I use assert_equal in the module file, I am getting error: undefined > method : assert_equal. > > What is the require statements for this. > > Thanks, > Jayashree. > > Disclaimer: > > This e-mail, and any files transmitted with it are confidential to Marlabs Inc. and intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- http://iskusivac.blog.hr/ From jayasree.k at marlabs.com Tue Feb 7 04:06:24 2006 From: jayasree.k at marlabs.com (jayashree) Date: Tue, 7 Feb 2006 14:36:24 +0530 Subject: [Wtr-general] assert_equal problem in the module In-Reply-To: <f81b1250602070014p1557da83r@mail.gmail.com> Message-ID: <EKEJIKLLJMIAAEDOAMDLMEIMCAAA.jayasree.k@marlabs.com> Hi Zeljko Filipin, It's working fine. Thank you, Jayashree. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Zeljko Filipin Sent: Tuesday, February 07, 2006 1:45 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] assert_equal problem in the module require 'test/unit/assertions' include Test::Unit::Assertions 2006/2/7, jayashree <jayasree.k at marlabs.com>: > Hi, > I am new to watir and ruby. > There are two ruby files.In the main ruby file I am using assert_equal.It's > working fine.There is another ruby file which contains module.I want to > write all the assert_equal statements in the module. > At the top of the module, I am using - $LOAD_PATH.<< > File.join(File.dirname(__FILE__), '') if $0 == __FILE__. > > If I use assert_equal in the module file, I am getting error: undefined > method : assert_equal. > > What is the require statements for this. > > Thanks, > Jayashree. > > Disclaimer: > > This e-mail, and any files transmitted with it are confidential to Marlabs Inc. and intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- http://iskusivac.blog.hr/ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Disclaimer: This e-mail, and any files transmitted with it are confidential to Marlabs Inc. and intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. From zeljko.filipin at gmail.com Tue Feb 7 04:21:04 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 7 Feb 2006 10:21:04 +0100 Subject: [Wtr-general] assert_equal problem in the module In-Reply-To: <EKEJIKLLJMIAAEDOAMDLMEIMCAAA.jayasree.k@marlabs.com> References: <f81b1250602070014p1557da83r@mail.gmail.com> <EKEJIKLLJMIAAEDOAMDLMEIMCAAA.jayasree.k@marlabs.com> Message-ID: <f81b1250602070121y2ee9ee2ey@mail.gmail.com> I had the same problem not so long ago :) 2006/2/7, jayashree <jayasree.k at marlabs.com>: > Hi Zeljko Filipin, > > It's working fine. > > Thank you, > Jayashree. > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Zeljko Filipin > Sent: Tuesday, February 07, 2006 1:45 PM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] assert_equal problem in the module > > > require 'test/unit/assertions' > include Test::Unit::Assertions > > 2006/2/7, jayashree <jayasree.k at marlabs.com>: > > Hi, > > I am new to watir and ruby. > > There are two ruby files.In the main ruby file I am using > assert_equal.It's > > working fine.There is another ruby file which contains module.I want to > > write all the assert_equal statements in the module. > > At the top of the module, I am using - $LOAD_PATH.<< > > File.join(File.dirname(__FILE__), '') if $0 == __FILE__. > > > > If I use assert_equal in the module file, I am getting error: undefined > > method : assert_equal. > > > > What is the require statements for this. > > > > Thanks, > > Jayashree. > > > > Disclaimer: > > > > This e-mail, and any files transmitted with it are confidential to Marlabs > Inc. and intended solely for the use of the individual or entity to whom it > is addressed. If you are not the intended recipient you are notified that > disclosing, copying, distributing or taking any action in reliance on the > contents of this information is strictly prohibited. > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > -- > http://iskusivac.blog.hr/ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > Disclaimer: > > This e-mail, and any files transmitted with it are confidential to Marlabs Inc. and intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- http://iskusivac.blog.hr/ From christopher.mcmahon at gmail.com Tue Feb 7 10:03:00 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 7 Feb 2006 09:03:00 -0600 Subject: [Wtr-general] how to connect to DB2 database. In-Reply-To: <OF44D65EBA.EF4899BD-ON8725710E.00189962-8725710E.001961EF@us.ibm.com> References: <OF44D65EBA.EF4899BD-ON8725710E.00189962-8725710E.001961EF@us.ibm.com> Message-ID: <72799cd70602070703q18c41ff3w7904fc1e7a7c7ead@mail.gmail.com> Hi... You *really* need to read more about ODBC: http://www.ch-werner.de/rubyodbc/ . Right now. I mean it. > Here is my testing code for getting database values, and it doesn't work: > require 'DB2' > conn = dsnbat.logon("username","password") > cursor = conn.open > cursor.parse("myquery here") > cursor.exec > while r = cursor.fetch > p r > end > cursor.close > conn.logoff require 'odbc' c = ODBC::connect('odbc database name, 'user', 'password') data = c.run("SELECT * FROM FOO") data.each do |record| puts record end c.disconnect You can't just make stuff up and expect it work. -Chris From tester.paul at gmail.com Tue Feb 7 12:21:42 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 7 Feb 2006 12:21:42 -0500 Subject: [Wtr-general] Assertions help In-Reply-To: <ade75c5b0602060930n20aaff5ctc3ed46db28b93005@mail.gmail.com> References: <37c405480602060728v6bc7244j@mail.gmail.com> <ade75c5b0602060930n20aaff5ctc3ed46db28b93005@mail.gmail.com> Message-ID: <37c405480602070921j672a2c7ct@mail.gmail.com> On 06/02/06, Bret Pettichord <bret at pettichord.com> wrote: > > >Is it even possible to combine the assertand if statements in this way? > No. > Hi Bret, I didn't want to give up on this and I managed to get part of it work. According to the Ruby Cheat Sheet's "Truth and falsehood" section, "In Ruby, anything but the two special values 'false' and 'nil' are considered true for purposes of an 'if' statement." Since the assert always returns "nil" when it works correctly, I just added a bang to the if statement: if ! assert($ie.contains_text("Please try again")) puts "TEST PASSED. Found test string: 'Please try again.' " end So now my script will output "Test Passed" if the assertion passes (i.e. = "nil"). The "else" doesn't work, but then it's kind of redundant to print "Test Failed" anyway since the failure info appears at the end of the run (as expected). Thanks for pointing me to the right doc info. Cheers. Paul. (P.S. as an aside, I am sending this msg with different formatting to see if it preserves the formatting and spacing. Sorry about the previous posts. I didn't know they were being truncated like that.) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060207/304374d1/attachment.html From rosecao at us.ibm.com Tue Feb 7 12:53:21 2006 From: rosecao at us.ibm.com (Rose Cao) Date: Tue, 7 Feb 2006 10:53:21 -0700 Subject: [Wtr-general] how to connect to DB2 database. In-Reply-To: <72799cd70602070703q18c41ff3w7904fc1e7a7c7ead@mail.gmail.com> Message-ID: <OFB403A0B2.1891DAC2-ON8725710E.0061F92A-8725710E.00620482@us.ibm.com> Thank you very much, Chris! It works and the document is helpful too. Is there any document on 'Schedule Watir Script to run on the server after the web pages generated'? I need some info on this topic too. Thanks, Rose Chris McMahon <christopher.mcma hon at gmail.com> To Sent by: wtr-general at rubyforge.org wtr-general-bounc cc es at rubyforge.org Subject Re: [Wtr-general] how to connect to 02/07/2006 08:03 DB2 database. AM Please respond to wtr-general Hi... You *really* need to read more about ODBC: http://www.ch-werner.de/rubyodbc/ . Right now. I mean it. > Here is my testing code for getting database values, and it doesn't work: > require 'DB2' > conn = dsnbat.logon("username","password") > cursor = conn.open > cursor.parse("myquery here") > cursor.exec > while r = cursor.fetch > p r > end > cursor.close > conn.logoff require 'odbc' c = ODBC::connect('odbc database name, 'user', 'password') data = c.run("SELECT * FROM FOO") data.each do |record| puts record end c.disconnect You can't just make stuff up and expect it work. -Chris _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060207/dfdd2999/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/20060207/dfdd2999/attachment.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: pic26928.gif Type: image/gif Size: 1255 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060207/dfdd2999/attachment-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/20060207/dfdd2999/attachment-0002.gif From bret at pettichord.com Tue Feb 7 13:20:42 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 7 Feb 2006 12:20:42 -0600 Subject: [Wtr-general] Assertions help In-Reply-To: <37c405480602070921j672a2c7ct@mail.gmail.com> References: <37c405480602060728v6bc7244j@mail.gmail.com> <ade75c5b0602060930n20aaff5ctc3ed46db28b93005@mail.gmail.com> <37c405480602070921j672a2c7ct@mail.gmail.com> Message-ID: <ade75c5b0602071020w604e3202qd8d2723f439a7bd2@mail.gmail.com> This would be clearer and has the same results: assert($ie.contains_text("Please try again")) puts "TEST PASSED. Found test string: 'Please try again.' " Bret On 2/7/06, Paul Carvalho <tester.paul at gmail.com> wrote: > > > if ! assert($ie.contains_text("Please try again")) > puts "TEST PASSED. Found test string: 'Please try again.' " > end > > So now my script will output "Test Passed" if the assertion passes (i.e. = > "nil"). The "else" doesn't work, but then it's kind of redundant to print > "Test Failed" anyway since the failure info appears at the end of the run > (as expected). <http://rubyforge.org/mailman/listinfo/wtr-general> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060207/43c6c13a/attachment.html From tester.paul at gmail.com Tue Feb 7 14:26:59 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 7 Feb 2006 14:26:59 -0500 Subject: [Wtr-general] Assertions help In-Reply-To: <ade75c5b0602071020w604e3202qd8d2723f439a7bd2@mail.gmail.com> References: <37c405480602060728v6bc7244j@mail.gmail.com> <ade75c5b0602060930n20aaff5ctc3ed46db28b93005@mail.gmail.com> <37c405480602070921j672a2c7ct@mail.gmail.com> <ade75c5b0602071020w604e3202qd8d2723f439a7bd2@mail.gmail.com> Message-ID: <37c405480602071126r4298218ch@mail.gmail.com> Okay, how that works is voodoo, man. I understand what you mean by clarity (compared to my not-nil-if-block), but it's unintuitive to me how the next line is magically attached to the "assert" command without some kind of "if" statement. Can you describe how this line coherence works? I noticed some strange behaviour in one script that I can't figure out yet. Here's what my script does (in pseudo code): def test_case_01 open browser goto Reset Password page enter incorrect email address check that the correct error message appears ("assert" & output here) press the "cancel" button to return to the Login page end What I noticed is that if the assert line passes, then this script works as expected. However, if the assert *doesn't* pass (i.e. the "contains_text" fails to find the message), then the next line is skipped. So the "cancel" button is never pressed and the remaining test cases all break because they're not starting from the correct [login] page. To get around this, I moved the "Press the "cancel" button" command to the start of the next test case. That way it starts from the right place. Do you know why this line is skipped (no matter how many blank lines I put between them) if the assert line fails? Paul. On 07/02/06, Bret Pettichord <bret at pettichord.com> wrote: > > This would be clearer and has the same results: > > assert($ie.contains_text("Please try again")) > puts "TEST PASSED. Found test string: 'Please try again.' " > > Bret > > On 2/7/06, Paul Carvalho <tester.paul at gmail.com> wrote: > > > > > > if ! assert($ie.contains_text("Please try again")) > > puts "TEST PASSED. Found test string: 'Please try again.' " > > end > > > > So now my script will output "Test Passed" if the assertion passes (i.e. > > = "nil"). The "else" doesn't work, but then it's kind of redundant to print > > "Test Failed" anyway since the failure info appears at the end of the run > > (as expected). <http://rubyforge.org/mailman/listinfo/wtr-general> > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060207/3d8f047b/attachment.html From thealy at midicorp.com Tue Feb 7 14:57:37 2006 From: thealy at midicorp.com (Thomas Healy) Date: Tue, 7 Feb 2006 14:57:37 -0500 Subject: [Wtr-general] Assertions help Message-ID: <8EA615B25AB5F849BF0193B80E6D4C49800CFB@MIDISERVER> Paul, It seems that you need a fail case for when it fails, I have run into the same thing yesterday... when I used the "rescue => e" it seems to work... in my case... the script that works for me is... begin assert($ie.contains_text("User profile has been updated.") ) $logger.log("###USER UPDATE TEST PASSED####' ") $logger.log_results("test_b_add_new_user", "User profile has been updated.", "User profile has been updated.", "TEST PASSED.") rescue => e $logger.log("###USER UPDATE TEST FAILED####" + e.message + "\n" + e.backtrace.join("\n")) $logger.log_results("test_b_add_new_user", "User profile has been updated.", "User profile has been updated.", "TEST FAILED.") end Regards, Thom ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho Sent: Tuesday, February 07, 2006 2:27 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Assertions help Okay, how that works is voodoo, man. I understand what you mean by clarity (compared to my not-nil-if-block), but it's unintuitive to me how the next line is magically attached to the "assert" command without some kind of "if" statement. Can you describe how this line coherence works? I noticed some strange behaviour in one script that I can't figure out yet. Here's what my script does (in pseudo code): def test_case_01 open browser goto Reset Password page enter incorrect email address check that the correct error message appears ("assert" & output here) press the "cancel" button to return to the Login page end What I noticed is that if the assert line passes, then this script works as expected. However, if the assert *doesn't* pass (i.e. the "contains_text" fails to find the message), then the next line is skipped. So the "cancel" button is never pressed and the remaining test cases all break because they're not starting from the correct [login] page. To get around this, I moved the "Press the "cancel" button" command to the start of the next test case. That way it starts from the right place. Do you know why this line is skipped (no matter how many blank lines I put between them) if the assert line fails? Paul. On 07/02/06, Bret Pettichord <bret at pettichord.com> wrote: This would be clearer and has the same results: assert($ie.contains_text("Please try again")) puts "TEST PASSED. Found test string: 'Please try again.' " Bret On 2/7/06, Paul Carvalho <tester.paul at gmail.com > wrote: if ! assert($ie.contains_text("Please try again")) puts "TEST PASSED. Found test string: 'Please try again.' " end So now my script will output "Test Passed" if the assertion passes (i.e. = "nil"). The "else" doesn't work, but then it's kind of redundant to print "Test Failed" anyway since the failure info appears at the end of the run (as expected). <http://rubyforge.org/mailman/listinfo/wtr-general> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060207/2ffc1c1f/attachment.html From tester.paul at gmail.com Tue Feb 7 15:24:48 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 7 Feb 2006 15:24:48 -0500 Subject: [Wtr-general] Assertions help In-Reply-To: <8EA615B25AB5F849BF0193B80E6D4C49800CFB@MIDISERVER> References: <8EA615B25AB5F849BF0193B80E6D4C49800CFB@MIDISERVER> Message-ID: <37c405480602071224w1ecdc772q@mail.gmail.com> Sweet! Thanks, Thomas. That did the trick. The last line in my script now works as expected when the assertion fails. Cheers. Paul. On 07/02/06, Thomas Healy <thealy at midicorp.com> wrote: > > Paul, > > It seems that you need a fail case for when it fails, I have run into the > same thing yesterday... when I used the "rescue => e" it seems to work... in > my case... the script that works for me is... > > begin > assert($ie.contains_text("User profile has been updated.") ) > $logger.log("###USER UPDATE TEST PASSED####' ") > rescue => e > $logger.log("###USER UPDATE TEST FAILED####") > end > Regards, > > Thom > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060207/938cb3f4/attachment.html From hgs at dmu.ac.uk Tue Feb 7 15:38:29 2006 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Tue, 7 Feb 2006 20:38:29 +0000 (WET) Subject: [Wtr-general] Assertions help In-Reply-To: <8EA615B25AB5F849BF0193B80E6D4C49800CFB@MIDISERVER> References: <8EA615B25AB5F849BF0193B80E6D4C49800CFB@MIDISERVER> Message-ID: <Pine.GSO.4.64.0602072026050.13317@brains.eng.cse.dmu.ac.uk> On Tue, 7 Feb 2006, Thomas Healy wrote: > Paul, > > It seems that you need a fail case for when it fails, I have run into > the same thing yesterday... when I used the "rescue => e" it seems to > work... in my case... the script that works for me is... > > begin > assert($ie.contains_text("User profile has been updated.") ) > $logger.log("###USER UPDATE TEST PASSED####' ") > $logger.log_results("test_b_add_new_user", "User profile has been > updated.", "User profile has been updated.", "TEST PASSED.") > rescue => e > $logger.log("###USER UPDATE TEST FAILED####" + e.message + "\n" + > e.backtrace.join("\n")) > $logger.log_results("test_b_add_new_user", "User profile has been > updated.", "User profile has been updated.", "TEST FAILED.") > end You are making work for yourself, I think. Watir is based on Test::Unit and it works like this: brains hgs 112 %> cat !$ cat ./test_unit_example #!/usr/local/bin/ruby -w # Example usage of Test::Unit require 'test/unit' class Testy < Test::Unit::TestCase def test_assertions assert(false, "this Will fail") assert(false, "So will this, but you won't see it.") end end brains hgs 113 %> So you get: brains hgs 113 %> ./test_unit_example Loaded suite ./test_unit_example Started F Finished in 0.048761 seconds. 1) Failure: test_assertions(Testy) [./test_unit_example:10]: this Will fail. <false> is not true. 1 tests, 1 assertions, 1 failures, 0 errors brains hgs 114 %> If there is a failure in one test, only so many assertions are completed. That test is then halted before any other assertions can be run, and then the other test_... methods are called. So you write each test method so that it works on its own. You can use methods called setup and teardown to do preliminary work before, and cleanup afterwards. http://www.rubygarden.org/ruby?UsingTestUnit http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/index.html I've entered in the middle of this, so sorry if you knew that already. > > Regards, > > Thom HTH Hugh From thealy at midicorp.com Tue Feb 7 15:48:44 2006 From: thealy at midicorp.com (Thomas Healy) Date: Tue, 7 Feb 2006 15:48:44 -0500 Subject: [Wtr-general] Assertions help Message-ID: <8EA615B25AB5F849BF0193B80E6D4C49800CFE@MIDISERVER> Hugh, I will stick to mine... I am a nubie and I understood very little of what you just wrote... I am sure as I go along and get more skilled... It will start to make sense... But for the new guy (me)... Readability & understandability is important... Thanks, Thom -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Hugh Sasse Sent: Tuesday, February 07, 2006 3:38 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Assertions help On Tue, 7 Feb 2006, Thomas Healy wrote: > Paul, > > It seems that you need a fail case for when it fails, I have run into > the same thing yesterday... when I used the "rescue => e" it seems to > work... in my case... the script that works for me is... > > begin > assert($ie.contains_text("User profile has been updated.") ) > $logger.log("###USER UPDATE TEST PASSED####' ") > $logger.log_results("test_b_add_new_user", "User profile has been > updated.", "User profile has been updated.", "TEST PASSED.") rescue => > e > $logger.log("###USER UPDATE TEST FAILED####" + e.message + "\n" + > e.backtrace.join("\n")) > $logger.log_results("test_b_add_new_user", "User profile has been > updated.", "User profile has been updated.", "TEST FAILED.") > end You are making work for yourself, I think. Watir is based on Test::Unit and it works like this: brains hgs 112 %> cat !$ cat ./test_unit_example #!/usr/local/bin/ruby -w # Example usage of Test::Unit require 'test/unit' class Testy < Test::Unit::TestCase def test_assertions assert(false, "this Will fail") assert(false, "So will this, but you won't see it.") end end brains hgs 113 %> So you get: brains hgs 113 %> ./test_unit_example Loaded suite ./test_unit_example Started F Finished in 0.048761 seconds. 1) Failure: test_assertions(Testy) [./test_unit_example:10]: this Will fail. <false> is not true. 1 tests, 1 assertions, 1 failures, 0 errors brains hgs 114 %> If there is a failure in one test, only so many assertions are completed. That test is then halted before any other assertions can be run, and then the other test_... methods are called. So you write each test method so that it works on its own. You can use methods called setup and teardown to do preliminary work before, and cleanup afterwards. http://www.rubygarden.org/ruby?UsingTestUnit http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/index.html I've entered in the middle of this, so sorry if you knew that already. > > Regards, > > Thom HTH Hugh _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From hgs at dmu.ac.uk Tue Feb 7 16:01:17 2006 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Tue, 7 Feb 2006 21:01:17 +0000 (WET) Subject: [Wtr-general] Assertions help In-Reply-To: <8EA615B25AB5F849BF0193B80E6D4C49800CFE@MIDISERVER> References: <8EA615B25AB5F849BF0193B80E6D4C49800CFE@MIDISERVER> Message-ID: <Pine.GSO.4.64.0602072054170.13317@brains.eng.cse.dmu.ac.uk> On Tue, 7 Feb 2006, Thomas Healy wrote: > Hugh, > > I will stick to mine... I am a nubie and I understood very little of > what you just wrote... I am sure as I go along and get more skilled... > It will start to make sense... But for the new guy (me)... Readability & > understandability is important... Yes, but writing less code means less chance to write bugs. Basically, you want tests to pass unless they cannot. The asserts determine whether a test is on track to pass. If an assert fails, Test::Unit does the begin...rescue...end magic for you, and bails out, and so that one test fails. It then allows the other tests to be run, in case those bits of code still work. Does that help? Else, tell me what baffles, and I'll try to explain differently. > > Thanks, > > Thom > Hugh From thealy at midicorp.com Tue Feb 7 16:32:03 2006 From: thealy at midicorp.com (Thomas Healy) Date: Tue, 7 Feb 2006 16:32:03 -0500 Subject: [Wtr-general] Assertions help Message-ID: <8EA615B25AB5F849BF0193B80E6D4C49800D01@MIDISERVER> Hugh, I am a nubie and I understand what you are saying that less is more... However, Readability of code is important for me... Especially when explaining the code to others in the office and having others in the office follow the code six months from now... While you are technically correct, less is more... In my case, readability is a high priority for me and less is... Well, less. My goal is to make it compact but readable by others... An example of the scripts I write is as follows... I would invite suggestions on making it tighter but still retain the readability so that 6 months from now when someone else in the office has to update this script to make it work with changes to the webpage... It will be easy to update and understand... def test_new_user #variables test_site = 'http://a_location' test_add_url = 'http://another_location' test_FN_field = 'xxxxx' test_LN_field = 'xxxxx' test_FN_value = 'xxxxx' test_LN_value = 'xxxxx' test_ID_field = 'xxxxx' test_ID_value = 'xxxxx' test_EM_field = 'xxxxx' test_EM_value = 'xxxxx' test_P1_field = 'xxxxx' test_P1_value = 'xxxxx' test_P2_field = 'xxxxx' test_P2_value = 'xxxxx' test_SN_field = 'xxxxx' test_SN_value = 'xxxxx' test_SE_field = 'xxxxx' test_SE_value = 'xxxxx' test_CF_field = 'xxxxx' test_CF_value = 'xxxxx' test_select_index = 'xxxxx' test_look_text = "This Student ID is already in use. Please select another Student ID." #go to the test page $ie.goto(test_site) $ie.goto(test_add_url) # add the page details $ie.text_field(:name, test_FN_field).set(test_FN_value) $ie.text_field(:name, test_LN_field).set(test_LN_value) $ie.text_field(:name, test_ID_field).set(test_ID_value) $ie.text_field(:name, test_EM_field).set(test_EM_value) $ie.text_field(:name, test_P1_field).set(test_P1_value) $ie.text_field(:name, test_P2_field).set(test_P2_value) $ie.text_field(:name, test_SN_field).set(test_SN_value) $ie.text_field(:name, test_SE_field).set(test_SE_value) $ie.text_field(:name, test_CF_field).set(test_CF_value) $ie.select_list( :index , 1).select(test_select_index) #submit page $ie.button(:name, "submit").click #check for expected text begin assert($ie.contains_text(test_look_text) ) $logger.log("###NEW USER TEST PASSED####' ") $logger.log_results("test_new_user", test_look_text, test_look_text, "TEST PASSED.") rescue => e $logger.log("###NEW USER TEST FAILED####" + e.message + "\n" + e.backtrace.join("\n")) $logger.log_results("test_new_user", test_look_text, test_look_text, "TEST FAILED.") end #return to the admin page $ie.link(:text, "administration").click end # end test_new_user Regards, Thom -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Hugh Sasse Sent: Tuesday, February 07, 2006 4:01 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Assertions help On Tue, 7 Feb 2006, Thomas Healy wrote: > Hugh, > > I will stick to mine... I am a nubie and I understood very little of > what you just wrote... I am sure as I go along and get more skilled... > It will start to make sense... But for the new guy (me)... Readability > & understandability is important... Yes, but writing less code means less chance to write bugs. Basically, you want tests to pass unless they cannot. The asserts determine whether a test is on track to pass. If an assert fails, Test::Unit does the begin...rescue...end magic for you, and bails out, and so that one test fails. It then allows the other tests to be run, in case those bits of code still work. Does that help? Else, tell me what baffles, and I'll try to explain differently. > > Thanks, > > Thom > Hugh _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Tue Feb 7 16:58:59 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 7 Feb 2006 15:58:59 -0600 Subject: [Wtr-general] Assertions help In-Reply-To: <8EA615B25AB5F849BF0193B80E6D4C49800D01@MIDISERVER> References: <8EA615B25AB5F849BF0193B80E6D4C49800D01@MIDISERVER> Message-ID: <72799cd70602071358g143120ccxfd274c03317ab22@mail.gmail.com> On 2/7/06, Thomas Healy <thealy at midicorp.com> wrote: > Hugh, > > I am a nubie and I understand what you are saying that less is more... > However, Readability of code is important for me... You should really learn test/unit-- for readability. It allows you to easily build your own readable assertions like assert_valid_token assert_guest_name_in_cookie assert_guest_ushered_to_room I stole these examples from Marcel Molina's (37signals, Rails) presentation to the Chicago Ruby User Group. You build these custom assertions from the raw materials of what's available in test/unit (and then you can hide them in a module or library and not have them cluttering up the beautiful logic of your tests): def assert_valid_token assert_equal @token, assigns(:token) end def assert_guest_name_in_cookie assert_equal [assigns(:guest).name], cookies['guest_name'] end def assert_guest_ushered_to_room assert_redirected_to room_url(:id => @token.room) end From PGarigue at EXTEND.COM Tue Feb 7 17:34:05 2006 From: PGarigue at EXTEND.COM (Pierre Garigue) Date: Tue, 7 Feb 2006 17:34:05 -0500 Subject: [Wtr-general] Assertions help Message-ID: <C629A6599EAF2B4C97CC314771BC292C04CAC29D@mail.extend.com> http://rspec.rubyforge.org/ while we are on the subject, at the last Toronto Ruby user's group we started talking about using Rspec to develop tests. This could be of interest to others. Have a look at the tutorial. Cheers Pierre From roy_sin at yahoo.com Tue Feb 7 20:17:17 2006 From: roy_sin at yahoo.com (Roy Sin) Date: Tue, 7 Feb 2006 17:17:17 -0800 (PST) Subject: [Wtr-general] is there a way to package watir scripts to run on another PC... Message-ID: <20060208011717.69560.qmail@web52915.mail.yahoo.com> I use Eclipse with RDT plugin to write my Test Scripts and I run them from my ide from my machine. But I want to be able to have someone else run the scripts from a different PC 1) Is there a way to package my test scripts to run on a machine that don't have Ruby/Watir installed. 2) If a PC has Ruby/Watir installed but don't have eclipse ide ,is there a way to make my scripts into an executable and the person running the scripts could just double click on the file thanks __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From christopher.mcmahon at gmail.com Tue Feb 7 21:30:08 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 7 Feb 2006 20:30:08 -0600 Subject: [Wtr-general] is there a way to package watir scripts to run on another PC... In-Reply-To: <20060208011717.69560.qmail@web52915.mail.yahoo.com> References: <20060208011717.69560.qmail@web52915.mail.yahoo.com> Message-ID: <72799cd70602071830m254c629ahc5f12d7464cf8ab0@mail.gmail.com> > 1) Is there a way to package my test scripts to run on a > machine that don't have Ruby/Watir installed. > > 2) If a PC has Ruby/Watir installed but don't have eclipse > ide ,is there a way to make my scripts into an executable > and the person running the scripts could just double click > on the file Google for rubyscript2exe. I haven't used it myself, but I know people who've used it with great success. In a nutshell, it creates an executable .dll file from any particular script you have that contains all require/include libraries and the ruby interpreter itself. (Pay attention to user input, though-- if you have any ARGV stuff, you'll have to change your script to get them from STDIN.) Also keep in mind that it isn't foolproof. Windows machines are weird, and sometimes the executable doesn't work. But it works enough that I definitely recommend you try it. -Chris From paul.rogers at shaw.ca Tue Feb 7 22:40:24 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 07 Feb 2006 20:40:24 -0700 Subject: [Wtr-general] drag drop Message-ID: <1f432aa1f41357.1f413571f432aa@shaw.ca> I think watir can currently do something like ie.text_field(:id, 'foo').dragContentsTo( :id, 'foo2') I may have a need to do some testing on more advanced drag drop so I will take a look at doing this if i get a chance. I guess the demo here http://demo.script.aculo.us/shop is the sort of thing Does anyone know of other drag and drop dhtml sites ? Paul From marco.neri at police.vic.gov.au Wed Feb 8 00:03:06 2006 From: marco.neri at police.vic.gov.au (Neri, Marco) Date: Wed, 8 Feb 2006 16:03:06 +1100 Subject: [Wtr-general] The object invoked has disconnected from its clients. Message-ID: <AE918470A1BAB34B97D28AA43952D5E7010B454C@wt14px03.vicpolice.internal> Has anyone else run into this error? ( whats worse is it's intermittent ). I've tried uninstall/reinstall of ruby and watir. >From within my test script I start an ie browser window as per normal @ie = IE.new @ie.bring_to_front() A new browser window is popped up. And that's as far as it gets. And the error is 1) Error: test001(TC_test001): WIN32OLERuntimeError: Unknown property or method `document' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in `method_missing' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in `title' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1302:in `bring_to_front' # Make the window come to the front def bring_to_front autoit = WIN32OLE.new('AutoItX3.Control') autoit.WinActivate title, '' end # Return the title of the window def title @ie.document.title end ======================================================= The information contained in this email and any files attached may be confidential information to the intended recipient and may be the subject of legal professional privilege or public interest immunity. If you are not the intended recipient, any use, disclosure or copying is unauthorised. If you have received this document in error please telephone 1300 307 082 ******************************************************************* This footnote also confirms that this email message has been swept for the presence of computer viruses. ******************************************************************* From bret at pettichord.com Wed Feb 8 00:23:05 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 7 Feb 2006 23:23:05 -0600 Subject: [Wtr-general] Watir Examples that need to be updated In-Reply-To: <37c405480602021535t54547dc3k@mail.gmail.com> References: <37c405480602021535t54547dc3k@mail.gmail.com> Message-ID: <ade75c5b0602072123x2703ccble0ef11087efdf6df@mail.gmail.com> I often get private requests from people who want to know how they can contribute to Watir. Here is a great list. Any interest? Send me the corrected files and i'll be happy to give you credit and update the examples. Bret On 2/2/06, Paul Carvalho <tester.paul at gmail.com> wrote: > > I've spent the day running through examples and creating new scripts. I am > now happily exploring our web apps and struggling throughdeveloping some > scripts. > Regarding the Watir examples, here is some feedback on what I've observed. > The C:\Program Files\Watir\examples folder has 4 scripts that need tobe > updated: > (1) articleExample.rb- assertion fails because the exact string doesn't > appear on the page > (2) google_maps.rb- line 34: the text field ID has changed from "q" to > "q_d" > (3) mouse_over.rb- The last 3 page navigation links fail because the URL > links havechanged from "05" to "06".- 'TopicProposalScheduleW05.htm' has > also changed to'ProposalPresentationsW06.htm' > (4) yahooCheckbox_test.rb- Only the first test actually works. The rest > all fail because thesepages have completely changed on the Yahoo! site. If > you want to democheckboxes, you'll have to find another site to use. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060207/cc4e58d5/attachment.html From bret at pettichord.com Wed Feb 8 00:37:56 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 7 Feb 2006 23:37:56 -0600 Subject: [Wtr-general] The object invoked has disconnected from its clients. In-Reply-To: <AE918470A1BAB34B97D28AA43952D5E7010B454C@wt14px03.vicpolice.internal> References: <AE918470A1BAB34B97D28AA43952D5E7010B454C@wt14px03.vicpolice.internal> Message-ID: <ade75c5b0602072137i63a78617h133533fb9eef4920@mail.gmail.com> Marco, I think i may know what the problem is. Please tell us whether this reliably fixes it: @ie = IE.new @ie.goto("http://www.google.com") # any site will do @ie.bring_to_front() Bret On 2/7/06, Neri, Marco <marco.neri at police.vic.gov.au> wrote: > > > Has anyone else run into this error? ( whats worse is it's intermittent > ). > > I've tried uninstall/reinstall of ruby and watir. > > >From within my test script I start an ie browser window as per normal > > @ie = IE.new > @ie.bring_to_front() > > A new browser window is popped up. And that's as far as it gets. > > And the error is > > 1) Error: > test001(TC_test001): > WIN32OLERuntimeError: Unknown property or method `document' > HRESULT error code:0x80010108 > The object invoked has disconnected from its clients. > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in `method_missing' > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in `title' > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1302:in `bring_to_front' > > > # Make the window come to the front > def bring_to_front > autoit = WIN32OLE.new('AutoItX3.Control') > autoit.WinActivate title, '' > end > > # Return the title of the window > def title > @ie.document.title > end > > > ======================================================= > The information contained in this email and any files attached may > be confidential information to the intended recipient and may be > the subject of legal professional privilege or public interest immunity. > > If you are not the intended recipient, any use, disclosure or copying is > unauthorised. > > If you have received this document in error please telephone 1300 307 082 > > ******************************************************************* > This footnote also confirms that this email message has been swept > for the presence of computer viruses. > ******************************************************************* > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060207/effbc333/attachment.html From bret at pettichord.com Wed Feb 8 00:56:24 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 7 Feb 2006 23:56:24 -0600 Subject: [Wtr-general] Assertions help In-Reply-To: <37c405480602071126r4298218ch@mail.gmail.com> References: <37c405480602060728v6bc7244j@mail.gmail.com> <ade75c5b0602060930n20aaff5ctc3ed46db28b93005@mail.gmail.com> <37c405480602070921j672a2c7ct@mail.gmail.com> <ade75c5b0602071020w604e3202qd8d2723f439a7bd2@mail.gmail.com> <37c405480602071126r4298218ch@mail.gmail.com> Message-ID: <ade75c5b0602072156p3f01cbceof35472dd2c5e8ffe@mail.gmail.com> Replies in line... On 2/7/06, Paul Carvalho <tester.paul at gmail.com> wrote: > > Okay, how that works is voodoo, man. > > I understand what you mean by clarity (compared to my not-nil-if-block), > but it's unintuitive to me how the next line is magically attached to the > "assert" command without some kind of "if" statement. It is very important that you understand this. I will try to explain, and if it's not clear please keep asking. What assert does is "raise an exception" -- that is the "voodoo" magic. It is also how modern languages handle errors, so every tester needs to understand the concept. Consider the following code puts "hello" raise "Error" puts "world" This code will print "hello", then an exception will be raised. Typically this will exit the program. Or the exception can be "caught" by other code that called this code, in which case it decides what to do. In any case, "world" will never be printed. All the assert does is raise an error conditionally. So this: assert($ie.contains_text("Please try again")) puts "TEST PASSED. Found test string: 'Please try again.' " Is the same as if ! $ie.contains_text("Please try again") raise "error" end puts "TEST PASSED. Found test string: 'Please try again.' " Can you describe how this line coherence works? I noticed some strange > behaviour in one script that I can't figure out yet. Here's what my script > does (in pseudo code): > > def test_case_01 > open browser > goto Reset Password page > enter incorrect email address > check that the correct error message appears ("assert" & output here) > press the "cancel" button to return to the Login page > end > > What I noticed is that if the assert line passes, then this script works > as expected. However, if the assert *doesn't* pass (i.e. the > "contains_text" fails to find the message), then the next line is skipped. > So the "cancel" button is never pressed and the remaining test cases all > break because they're not starting from the correct [login] page. Right. That is exactly how assert works. > To get around this, I moved the "Press the "cancel" button" command to the > start of the next test case. That way it starts from the right place. > > Do you know why this line is skipped (no matter how many blank lines I put > between them) if the assert line fails? Hopefully by now, this is clear to you. One thing you should know is that the test/unit testing framework has a special thing to handle this situation. The teardown method is always called after each test method. So you might want to try this instead: def test_case_01 open browser goto Reset Password page enter incorrect email address check that the correct error message appears ("assert" & output here) end def teardown press the "cancel" button to return to the Login page end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060207/513fbbfa/attachment.html From bret at pettichord.com Wed Feb 8 01:00:51 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 8 Feb 2006 00:00:51 -0600 Subject: [Wtr-general] Rspec was Re: Assertions help Message-ID: <ade75c5b0602072200n33166054y5aedaf3f8993ad2c@mail.gmail.com> Have you used Rspec with Watir? I'd be curious to see how this would be done. Bret On 2/7/06, Pierre Garigue <PGarigue at extend.com> wrote: > > http://rspec.rubyforge.org/ > > while we are on the subject, at the last Toronto Ruby user's group > we started talking about using Rspec to develop tests. > > This could be of interest to others. Have a look at the tutorial. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060208/667a50a2/attachment.html From bret at pettichord.com Wed Feb 8 01:05:18 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 8 Feb 2006 00:05:18 -0600 Subject: [Wtr-general] Assertions help In-Reply-To: <8EA615B25AB5F849BF0193B80E6D4C49800CFB@MIDISERVER> References: <8EA615B25AB5F849BF0193B80E6D4C49800CFB@MIDISERVER> Message-ID: <ade75c5b0602072205s1ea47c2ak17792c8ec2236869@mail.gmail.com> Thomas, i think there is a simpler way. On 2/7/06, Thomas Healy <thealy at midicorp.com> wrote: > begin > assert($ie.contains_text("User profile has been updated.") ) > $logger.log("###USER UPDATE TEST PASSED####' ") > $logger.log_results("test_b_add_new_user", "User profile has been > updated.", "User profile has been updated.", "TEST PASSED.") > rescue => e > $logger.log("###USER UPDATE TEST FAILED####" + e.message + "\n" + > e.backtrace.join("\n")) > $logger.log_results("test_b_add_new_user", "User profile has been > updated.", "User profile has been updated.", "TEST FAILED.") > end > I would write this instead: > if $ie.contains_text("User profile has been updated.") > $logger.log("###USER UPDATE TEST PASSED####' ") > $logger.log_results("test_b_add_new_user", "User profile has been > updated.", "User profile has been updated.", "TEST PASSED.") > else > $logger.log("###USER UPDATE TEST FAILED####" + e.message + "\n" + > e.backtrace.join("\n")) > $logger.log_results("test_b_add_new_user", "User profile has been > updated.", "User profile has been updated.", "TEST FAILED.") > end > Don't you find this easier to read? Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060208/6953192d/attachment.html From bret at pettichord.com Wed Feb 8 01:18:53 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 8 Feb 2006 00:18:53 -0600 Subject: [Wtr-general] is there a way to package watir scripts to run on another PC... In-Reply-To: <20060208011717.69560.qmail@web52915.mail.yahoo.com> References: <20060208011717.69560.qmail@web52915.mail.yahoo.com> Message-ID: <ade75c5b0602072218l1d6cf195yff8b2cb5b950c655@mail.gmail.com> On 2/7/06, Roy Sin <roy_sin at yahoo.com> wrote: > > 2) If a PC has Ruby/Watir installed but don't have eclipse > ide ,is there a way to make my scripts into an executable > and the person running the scripts could just double click > on the file First of all, they can just double click the test.rb file and it will run. The only problem is that the output will appear in a temporary command window that will go away when the script is done. But there you can get it to run in a nifty GUI if you run it with a command line argument. In a cmd window you can do this: test.rb --runner=t You can also create a shortcut to your test and then edit the target in the properties to include this argument. Then when you double click on it, it will run in its GUI. Target: C:\workspace\watir\unittests\div_test.rb --runner=t Everybody should actually give this a try. It looks cool! Another idea would be to put this in a batch file. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060208/eaee07be/attachment.html From zeljko.filipin at gmail.com Wed Feb 8 03:51:48 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 8 Feb 2006 09:51:48 +0100 Subject: [Wtr-general] Watir, Ruby, objects and variables Message-ID: <f81b1250602080051s1551d3f6k@mail.gmail.com> I would like to replace @page_view = Page.new( "app.com/view.aspx", ["File > View"]) @page_view_after_add = Page.new( "app.com/view.aspx", ["File > View", "File added."]) @page_view_after_edit = Page.new( "app.com/view.aspx", ["File > View", "File edited."]) with something like @page_view = @page_view_after_add = @page_view_after_edit = Page.new( "app.com/view.aspx", ["File > View"]) @page_view_after_add.texts << "File added." @page_view_after_edit.texts << "File edited." But (surprise!), it does not work. I started to explain why would I like to do that, but it got pretty long, so I put it at my blog. http://www.testingreflections.com/node/view/3214 From hgs at dmu.ac.uk Wed Feb 8 05:47:30 2006 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Wed, 8 Feb 2006 10:47:30 +0000 (WET) Subject: [Wtr-general] Assertions help In-Reply-To: <8EA615B25AB5F849BF0193B80E6D4C49800D01@MIDISERVER> References: <8EA615B25AB5F849BF0193B80E6D4C49800D01@MIDISERVER> Message-ID: <Pine.GSO.4.64.0602081005470.20514@brains.eng.cse.dmu.ac.uk> On Tue, 7 Feb 2006, Thomas Healy wrote: > Hugh, > > I am a nubie and I understand what you are saying that less is more... > However, Readability of code is important for me... Especially when > explaining the code to others in the office and having others in the > office follow the code six months from now... Agreed. People have asserted that Ruby is very readable, in comparison to languages where everything must be declared up front, for example. They have said it can be used a pseudocode. I can't find that example now, but a google for [Ruby readable] will turn up a lot. > > While you are technically correct, less is more... In my case, > readability is a high priority for me and less is... Well, less. My goal > is to make it compact but readable by others... Tell me which bits are opaque, and it may be that we can express them differently. Some things will boil down to the object oriented nature of ruby and will be part of the syntax. This is Web Application Testing *In Ruby* after all :-) > > An example of the scripts I write is as follows... I would invite > suggestions on making it tighter but still retain the readability so > that 6 months from now when someone else in the office has to update > this script to make it work with changes to the webpage... It will be > easy to update and understand... > > def test_new_user > > #variables > test_site = 'http://a_location' > test_add_url = 'http://another_location' > test_FN_field = 'xxxxx' [other declarations trimmed.] If you use these a lot it might make sense to make the instance variables, declared in one place. Instance variables belong to your testing object, and are shared between methods of that object. They begin with @. Also you can do the setup in a method named setup def setup # do stuff in here that apply to all tests for this testing object # i.e. all methods that are called test_... end > test_CF_value = 'xxxxx' > test_select_index = 'xxxxx' > test_look_text = "This Student ID is already in use. Please select > another Student ID." > > #go to the test page > $ie.goto(test_site) > $ie.goto(test_add_url) The URL is sufficient: it includes the test site, so you can do that in one clear step. > > # add the page details > $ie.text_field(:name, test_FN_field).set(test_FN_value) [...] > $ie.text_field(:name, test_CF_field).set(test_CF_value) > $ie.select_list( :index , 1).select(test_select_index) > > #submit page > $ie.button(:name, "submit").click > > #check for expected text > begin > assert($ie.contains_text(test_look_text) ) > $logger.log("###NEW USER TEST PASSED####' ") > $logger.log_results("test_new_user", test_look_text, > test_look_text, "TEST PASSED.") You don't really need to log those. Collect the output of the whole testing framework with something like C:\> ruby my_tests1.rb > test1_results.txt That way you can use the results any way you like, you keep the details of logging outside the code, you don't need the rescue block because the asserts handle all the "bailing out if something is wrong" for you. Your assertions about what should be there are not mixed up with logging details. If the test passed, you got the expected results, which are already documented in this script, no need to write them out to the log. The framework only writes out differences from what you expect, along with what was expected. That means you can find them easily enough. And leaving out all the $logger lines makes the method shorter. > rescue => e > $logger.log("###NEW USER TEST FAILED####" + e.message + "\n" + > e.backtrace.join("\n")) > $logger.log_results("test_new_user", test_look_text, > test_look_text, "TEST FAILED.") > end > This bit is done after each test so can go in a teardown method: > #return to the admin page > $ie.link(:text, "administration").click def teardown #return to the admin page $ie.link(:text, "administration").click end > > > end # end test_new_user > > > Regards, > > Thom > HTH Hugh From thealy at midicorp.com Wed Feb 8 08:09:58 2006 From: thealy at midicorp.com (Thomas Healy) Date: Wed, 8 Feb 2006 08:09:58 -0500 Subject: [Wtr-general] Assertions help Message-ID: <8EA615B25AB5F849BF0193B80E6D4C49800D03@MIDISERVER> Hugh, Hummm... I am convinced that I don't have enough background in RUBY to really go forward in this discussion... [Thom scrambles to find a good reference and sits down to read for a while...] I will e-mail more questions when I know the questions to ask... Thanks, Thom -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Hugh Sasse Sent: Wednesday, February 08, 2006 5:48 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Assertions help On Tue, 7 Feb 2006, Thomas Healy wrote: > Hugh, > > I am a nubie and I understand what you are saying that less is more... > However, Readability of code is important for me... Especially when > explaining the code to others in the office and having others in the > office follow the code six months from now... Agreed. People have asserted that Ruby is very readable, in comparison to languages where everything must be declared up front, for example. They have said it can be used a pseudocode. I can't find that example now, but a google for [Ruby readable] will turn up a lot. > > While you are technically correct, less is more... In my case, > readability is a high priority for me and less is... Well, less. My > goal is to make it compact but readable by others... Tell me which bits are opaque, and it may be that we can express them differently. Some things will boil down to the object oriented nature of ruby and will be part of the syntax. This is Web Application Testing *In Ruby* after all :-) > > An example of the scripts I write is as follows... I would invite > suggestions on making it tighter but still retain the readability so > that 6 months from now when someone else in the office has to update > this script to make it work with changes to the webpage... It will be > easy to update and understand... > > def test_new_user > > #variables > test_site = 'http://a_location' > test_add_url = 'http://another_location' > test_FN_field = 'xxxxx' [other declarations trimmed.] If you use these a lot it might make sense to make the instance variables, declared in one place. Instance variables belong to your testing object, and are shared between methods of that object. They begin with @. Also you can do the setup in a method named setup def setup # do stuff in here that apply to all tests for this testing object # i.e. all methods that are called test_... end > test_CF_value = 'xxxxx' > test_select_index = 'xxxxx' > test_look_text = "This Student ID is already in use. Please select > another Student ID." > > #go to the test page > $ie.goto(test_site) > $ie.goto(test_add_url) The URL is sufficient: it includes the test site, so you can do that in one clear step. > > # add the page details > $ie.text_field(:name, test_FN_field).set(test_FN_value) [...] > $ie.text_field(:name, test_CF_field).set(test_CF_value) > $ie.select_list( :index , 1).select(test_select_index) > > #submit page > $ie.button(:name, "submit").click > > #check for expected text > begin > assert($ie.contains_text(test_look_text) ) > $logger.log("###NEW USER TEST PASSED####' ") > $logger.log_results("test_new_user", test_look_text, > test_look_text, "TEST PASSED.") You don't really need to log those. Collect the output of the whole testing framework with something like C:\> ruby my_tests1.rb > test1_results.txt That way you can use the results any way you like, you keep the details of logging outside the code, you don't need the rescue block because the asserts handle all the "bailing out if something is wrong" for you. Your assertions about what should be there are not mixed up with logging details. If the test passed, you got the expected results, which are already documented in this script, no need to write them out to the log. The framework only writes out differences from what you expect, along with what was expected. That means you can find them easily enough. And leaving out all the $logger lines makes the method shorter. > rescue => e > $logger.log("###NEW USER TEST FAILED####" + e.message + "\n" + > e.backtrace.join("\n")) > $logger.log_results("test_new_user", test_look_text, > test_look_text, "TEST FAILED.") > end > This bit is done after each test so can go in a teardown method: > #return to the admin page > $ie.link(:text, "administration").click def teardown #return to the admin page $ie.link(:text, "administration").click end > > > end # end test_new_user > > > Regards, > > Thom > HTH Hugh _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From tester.paul at gmail.com Wed Feb 8 09:16:09 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Wed, 8 Feb 2006 09:16:09 -0500 Subject: [Wtr-general] Watir Examples that need to be updated In-Reply-To: <ade75c5b0602072123x2703ccble0ef11087efdf6df@mail.gmail.com> References: <37c405480602021535t54547dc3k@mail.gmail.com> <ade75c5b0602072123x2703ccble0ef11087efdf6df@mail.gmail.com> Message-ID: <37c405480602080616v49b6b70s@mail.gmail.com> Hi Bret, I already sent updated examples to Jonathan K. The only one I couldn't *update* was the "yahooCheckbox_test.rb" script. The page it refers to is completely gone. This script would have to be completely rewritten so I thought it best to leave that to someone else. Cheers. P. On 08/02/06, Bret Pettichord <bret at pettichord.com> wrote: > > I often get private requests from people who want to know how they can > contribute to Watir. > > Here is a great list. Any interest? Send me the corrected files and i'll > be happy to give you credit and update the examples. > > Bret > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060208/33d3b895/attachment.html From bret at pettichord.com Wed Feb 8 09:36:32 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 8 Feb 2006 08:36:32 -0600 Subject: [Wtr-general] Watir, Ruby, objects and variables In-Reply-To: <f81b1250602080051s1551d3f6k@mail.gmail.com> References: <f81b1250602080051s1551d3f6k@mail.gmail.com> Message-ID: <ade75c5b0602080636j69a9d8b4s192bdadb13f756e7@mail.gmail.com> > > @page_view = @page_view_after_add = @page_view_after_edit = Page.new( > "app.com/view.aspx", > ["File > View"]) > @page_view_after_add.texts << "File added." > @page_view_after_edit.texts << "File edited." > > But (surprise!), it does not work. Try this: @page_view = Page.new( "app.com/view.aspx", ["File > View"]) @page_view_after_add = @page_view.clone @page_view_after_edit = @page_view.clone @page_view_after_add.texts << "File added." @page_view_after_edit.texts << "File edited." Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060208/63c7394e/attachment.html From zeljko.filipin at gmail.com Wed Feb 8 09:51:49 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 8 Feb 2006 15:51:49 +0100 Subject: [Wtr-general] Watir, Ruby, objects and variables In-Reply-To: <ade75c5b0602080636j69a9d8b4s192bdadb13f756e7@mail.gmail.com> References: <f81b1250602080051s1551d3f6k@mail.gmail.com> <ade75c5b0602080636j69a9d8b4s192bdadb13f756e7@mail.gmail.com> Message-ID: <f81b1250602080651x307fdc28h@mail.gmail.com> Thanks, but it does not work. class Page attr_accessor :texts def initialize(url, texts) @url, @texts = url, texts end end @page_view = Page.new( "app.com/view.aspx", ["File > View"]) @page_view_after_add = @page_view.clone @page_view_after_edit = @page_view.clone @page_view_after_add.texts << "File added." @page_view_after_edit.texts << "File edited." [@page_view, @page_view_after_add, @page_view_after_edit].each {|page| puts page.inspect} #<Page:0x4c1dce0 @url="app.com/view.aspx", @texts=["File > View", "File added.", "File edited."]> #<Page:0x4c1dcc8 @url="app.com/view.aspx", @texts=["File > View", "File added.", "File edited."]> #<Page:0x4c1dc98 @url="app.com/view.aspx", @texts=["File > View", "File added.", "File edited."]> From zeljko.filipin at gmail.com Wed Feb 8 10:13:50 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 8 Feb 2006 16:13:50 +0100 Subject: [Wtr-general] Watir, Ruby, objects and variables In-Reply-To: <f81b1250602080651x307fdc28h@mail.gmail.com> References: <f81b1250602080051s1551d3f6k@mail.gmail.com> <ade75c5b0602080636j69a9d8b4s192bdadb13f756e7@mail.gmail.com> <f81b1250602080651x307fdc28h@mail.gmail.com> Message-ID: <f81b1250602080713l3eca864bt@mail.gmail.com> Now I know why it does not work. "ri Object#clone" and "ri Object#dup" prints this. Produces a shallow copy of _obj_---the instance variables of _obj_ are copied, but not the objects they reference. Anybody knows method that copies the object, not just the instance variables of object? From mb at michaelbolton.net Wed Feb 8 10:36:35 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Wed, 8 Feb 2006 10:36:35 -0500 Subject: [Wtr-general] is there a way to package watir scripts to run onanother PC... In-Reply-To: <72799cd70602071830m254c629ahc5f12d7464cf8ab0@mail.gmail.com> Message-ID: <007e01c62cc5$77f4f700$6801a8c0@Koko> >> 1) Is there a way to package my test scripts to run on a >> machine that don't have Ruby/Watir installed. >> >> 2) If a PC has Ruby/Watir installed but don't have eclipse >> ide ,is there a way to make my scripts into an executable >> and the person running the scripts could just double click >> on the file >Google for rubyscript2exe... Is that rubyscript2exe or ruby2exe? I've tried the latter with some success. ---Michael B. From zeljko.filipin at gmail.com Wed Feb 8 10:52:00 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 8 Feb 2006 16:52:00 +0100 Subject: [Wtr-general] Watir, Ruby, objects and variables In-Reply-To: <f81b1250602080713l3eca864bt@mail.gmail.com> References: <f81b1250602080051s1551d3f6k@mail.gmail.com> <ade75c5b0602080636j69a9d8b4s192bdadb13f756e7@mail.gmail.com> <f81b1250602080651x307fdc28h@mail.gmail.com> <f81b1250602080713l3eca864bt@mail.gmail.com> Message-ID: <f81b1250602080752i2b0aa4f3s@mail.gmail.com> Mr. Google helped me. I just asked "ruby copy object" and he showed me (narrow) path that led to http://www.rubygarden.org/ruby?Make_A_Deep_Copy_Of_An_Object I added this to class Page and got what I needed! def deep_clone Marshal::load(Marshal.dump(self)) end #<Page:0x4c1dae8 @url="app.com/view.aspx", @texts=["File > View"]> #<Page:0x4c1da28 @url="app.com/view.aspx", @texts=["File > View", "File added."]> #<Page:0x4c1d920 @url="app.com/view.aspx", @texts=["File > View", "File edited."]> Thanks for Object#clone, it showed me the way. From tester.paul at gmail.com Wed Feb 8 11:15:32 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Wed, 8 Feb 2006 11:15:32 -0500 Subject: [Wtr-general] Assertions help In-Reply-To: <ade75c5b0602072156p3f01cbceof35472dd2c5e8ffe@mail.gmail.com> References: <37c405480602060728v6bc7244j@mail.gmail.com> <ade75c5b0602060930n20aaff5ctc3ed46db28b93005@mail.gmail.com> <37c405480602070921j672a2c7ct@mail.gmail.com> <ade75c5b0602071020w604e3202qd8d2723f439a7bd2@mail.gmail.com> <37c405480602071126r4298218ch@mail.gmail.com> <ade75c5b0602072156p3f01cbceof35472dd2c5e8ffe@mail.gmail.com> Message-ID: <37c405480602080815i6be27997i@mail.gmail.com> Wow. *That* was very helpful. Thanks, Bret! On 08/02/06, Bret Pettichord <bret at pettichord.com> wrote: > > All the assert does is raise an error conditionally. So this: > > assert($ie.contains_text("Please try again")) > puts "TEST PASSED. Found test string: 'Please try again.' " > > Is the same as > > if ! $ie.contains_text("Please try again") > raise "error" > end > puts "TEST PASSED. Found test string: 'Please try again.' " > Okay, so then, along the same lines, in a different test script I wrote something like this: def test_case_03 Click a link to go to a Form input page * Check to see that the Form input page appeared as expected Input text, click Save button ** Check that the input saved correctly Return to the starting page end So, the assertion check at the first (*) will automatically break out of this test case if it fails, right? What would be a good way to catch the error here? Here's what I'm thinking... If the form input page (in my example above), doesn't appear, then it's likely one of two things. Either: (a) the page UI has changed in some way so that the assertion check just needs to be updated, or (b) a Server Error has occurred. If this happens, I need to capture the Error text displayed on the page. If the script were to continue with the next test at this point, I would lose this valuable info (and I don't want to do that). So, if I have just the following line (i.e. instead of the 'begin-rescue-end' block that Thomas suggested) at the start of my script (or anywhere I have an assertion, really): > assert($ie.frame("MainWindow").contains_text("Create New User")) ..and it fails, then the rest of the (test_case_03) script is skipped. That's good. I want that. How do I keep it from going on to test_case_04 though? That is, if an assertion kicks out of a test script, what would be a good way to redirect Ruby to capture the page contents before proceeding to the next test? It's important for me to know how to tell the scripts to tell the difference between a Server Error and a change in UI when a test fails at any time. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060208/00795767/attachment.html From hgs at dmu.ac.uk Wed Feb 8 11:47:17 2006 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Wed, 8 Feb 2006 16:47:17 +0000 (WET) Subject: [Wtr-general] Assertions help In-Reply-To: <37c405480602080815i6be27997i@mail.gmail.com> References: <37c405480602060728v6bc7244j@mail.gmail.com> <ade75c5b0602060930n20aaff5ctc3ed46db28b93005@mail.gmail.com> <37c405480602070921j672a2c7ct@mail.gmail.com> <ade75c5b0602071020w604e3202qd8d2723f439a7bd2@mail.gmail.com> <37c405480602071126r4298218ch@mail.gmail.com> <ade75c5b0602072156p3f01cbceof35472dd2c5e8ffe@mail.gmail.com> <37c405480602080815i6be27997i@mail.gmail.com> Message-ID: <Pine.GSO.4.64.0602081635040.20514@brains.eng.cse.dmu.ac.uk> On Wed, 8 Feb 2006, Paul Carvalho wrote: > Wow. *That* was very helpful. Thanks, Bret! [...] > Okay, so then, along the same lines, in a different test script I wrote > something like this: > > def test_case_03 > Click a link to go to a Form input page > * Check to see that the Form input page appeared as expected > Input text, click Save button > ** Check that the input saved correctly > Return to the starting page > end > > So, the assertion check at the first (*) will automatically break out of > this test case if it fails, right? Yes. > > What would be a good way to catch the error here? Here's what I'm > thinking... In general, you don't. It gets reported. > > If the form input page (in my example above), doesn't appear, then it's > likely one of two things. Either: > (a) the page UI has changed in some way so that the assertion check just > needs to be updated, or > (b) a Server Error has occurred. If this happens, I need to capture the > Error text displayed on the page. If the script were to continue with the > next test at this point, I would lose this valuable info (and I don't want > to do that). You can test for more than one thing in an assert. You can call the functions you normally use within the assert, $ie.frame("MainWindow").contains_text("Create New User") outside of an assert, and make if...else...end decisions on them. > > So, if I have just the following line (i.e. instead of the > 'begin-rescue-end' block that Thomas suggested) at the start of my script > (or anywhere I have an assertion, really): > > assert($ie.frame("MainWindow").contains_text("Create New User")) > > ..and it fails, then the rest of the (test_case_03) script is skipped. Correct. > That's good. I want that. > > How do I keep it from going on to test_case_04 though? That is, if an You only have one big test? > assertion kicks out of a test script, what would be a good way to redirect > Ruby to capture the page contents before proceeding to the next test? Capture them into a variable before the assert, clear it after all asserts and use teardown to put it somewhere @treasure = $ie.text assert(...) ... assert() @treasure = nil def teardown unless @treasure.nil? # squirt it out to a logfile, etc. end end > > It's important for me to know how to tell the scripts to tell the difference > between a Server Error and a change in UI when a test fails at any time. Not fluent enough in Watir myself to give good help there. > > Paul. Hugh > > From yannick.francois at gmail.com Wed Feb 8 12:16:43 2006 From: yannick.francois at gmail.com (Yannick Francois) Date: Wed, 8 Feb 2006 09:16:43 -0800 Subject: [Wtr-general] Introduce myself Message-ID: <caf9a2850602080916m2a532b54w@mail.gmail.com> Hi all, Just to say hello on watir list. I'm a fresh french ruby user (since 2 month) and some day for watir... After discovering QA software past year with Rational Robot (just launch some script made by someone else in the company) I change company few month ago (november). In this new company, I always make J2EE application but there no QA tools. I searched for one, saw watir and here we are... For the first time today I use it on 5 computers (due to a bad application popup using, i can't launche more than one IE instance on a computer) in the same time to test server reactions, it's so interesting, and so easy to deploy. Make ruby script for test plan is for me really good :-) Well, I read something about Watir 2, for multi browser and multi OS use. For me, it will be very nice !!! If I can help to do something ... Yannick. ps: Sorry for my bad english, I'm french and not so good in english ;-) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060208/53703912/attachment.html From ChintakrindiMeghana at managementdynamics.com Wed Feb 8 12:57:26 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Wed, 8 Feb 2006 12:57:26 -0500 Subject: [Wtr-general] Testing of the Java Classes Message-ID: <6CF3AA425295C7479483AC0018EDF98B01DADF85@MI8NYCMAIL03.Mi8.com> Hi I am using watir to test the web application from the browser. By using watir , is there any to unit test the java classes. Thanks Meghanath -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060208/5cd07ef3/attachment.html From thealy at midicorp.com Wed Feb 8 13:31:29 2006 From: thealy at midicorp.com (Thomas Healy) Date: Wed, 8 Feb 2006 13:31:29 -0500 Subject: [Wtr-general] Testing in Other Browsers Message-ID: <8EA615B25AB5F849BF0193B80E6D4C49800D16@MIDISERVER> I have been reading "Programming Ruby -- by David Thomas" today as a basis for me understanding Watir... I like what I see in Watir and want to learn more... there seems to be a lot that can happen. Someone just wrote about making exe programs but I noticed in the example folder in the Ruby build that there are menus and buttons that can be constructed in ruby... I wonder if anyone has constructed a Ruby program in such a way as to use it for launching Watir scripts... i.e.. have an interface with buttons on it... something like... for log into the site press button 1... to test adding a client to the site press button 2... to remove a client from the site... press button three... etc? The button will launch the Watir scripts... write a log and then return to the Ruby menu... Also, for me... Watir seems to handle IE testing good... and most of our clients use IE so it is, frankly, the focus of my testing... but there is a small (but growing) emphasis on other browsers... I need to test in other browsers and operating system platforms... >From my reading on Watir, it sounds like it may be supporting other browsers in the future, but not currently... Does anyone know of other testing tools I can deploy which will be similar to Watir but will work for other browsers and operating system platforms? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060208/2e3a9132/attachment.html From christopher.mcmahon at gmail.com Wed Feb 8 13:41:36 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 8 Feb 2006 12:41:36 -0600 Subject: [Wtr-general] Testing in Other Browsers In-Reply-To: <8EA615B25AB5F849BF0193B80E6D4C49800D16@MIDISERVER> References: <8EA615B25AB5F849BF0193B80E6D4C49800D16@MIDISERVER> Message-ID: <72799cd70602081041o44bac4c4kb6e0c53231e57127@mail.gmail.com> Welcome Thom... > I wonder if anyone has constructed a Ruby program in > such a way as to use it for launching Watir scripts... i.e.. have an > interface with buttons on it... something like... for log into the site > press button 1... to test adding a client to the site press button 2... to > remove a client from the site... press button three... etc? The button will > launch the Watir scripts... write a log and then return to the Ruby menu... Bret said recently on the list: ################################## But there you can get it to run in a nifty GUI if you run it with a command line argument. In a cmd window you can do this: test.rb --runner=t You can also create a shortcut to your test and then edit the target in the properties to include this argument. Then when you double click on it, it will run in its GUI. Target: C:\workspace\watir\unittests\div_test.rb --runner=t Everybody should actually give this a try. It looks cool! ######################################3 You might also look at Atomic Objects' "SYSTIR" project as well: http://atomicobject.com/systir.page > From my reading on Watir, it sounds like it may be supporting other browsers > in the future, but not currently... You might give Selenium a try: http://www.openqa.org/selenium/ It's a little fussier than Watir (and is missing some things that Watir has, like support for frames), but it might serve your purposes. -Chris From roy_sin at yahoo.com Wed Feb 8 13:52:20 2006 From: roy_sin at yahoo.com (Roy Sin) Date: Wed, 8 Feb 2006 10:52:20 -0800 (PST) Subject: [Wtr-general] is there a way to package watir scripts to run on another PC... In-Reply-To: <ade75c5b0602072218l1d6cf195yff8b2cb5b950c655@mail.gmail.com> Message-ID: <20060208185220.97581.qmail@web52913.mail.yahoo.com> Hi Bret, When I double click on any of my rb files. A command window comes up and disappear quickly but my script doesn't run. Any idea! But I did try textfields_test.rb --runner=t Thanks for that tip it looks really cool. --- Bret Pettichord <bret at pettichord.com> wrote: > On 2/7/06, Roy Sin <roy_sin at yahoo.com> wrote: > > > > 2) If a PC has Ruby/Watir installed but don't have > eclipse > > ide ,is there a way to make my scripts into an > executable > > and the person running the scripts could just double > click > > on the file > > > First of all, they can just double click the test.rb file > and it will run. > The only problem is that the output will appear in a > temporary command > window that will go away when the script is done. > > But there you can get it to run in a nifty GUI if you run > it with a command > line argument. > > In a cmd window you can do this: > test.rb --runner=t > > You can also create a shortcut to your test and then edit > the target in the > properties to include this argument. Then when you double > click on it, it > will run in its GUI. > > Target: C:\workspace\watir\unittests\div_test.rb > --runner=t > > Everybody should actually give this a try. It looks cool! > > Another idea would be to put this in a batch file. > > Bret > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From thealy at midicorp.com Wed Feb 8 14:00:53 2006 From: thealy at midicorp.com (Thomas Healy) Date: Wed, 8 Feb 2006 14:00:53 -0500 Subject: [Wtr-general] Testing in Other Browsers Message-ID: <8EA615B25AB5F849BF0193B80E6D4C49800D19@MIDISERVER> Chris, Thanks for the reply... I looked at Selenium but it appears that it has to be installed on the server hosting the item... For my testing, that is not always possible or desirable... I am looking more for an automated script like Watir... Also I keep trying to run the cmd window example suggested but I get error messages... The path is not correct -- blah blah blah ... I think it has to do with the space in the path "Program Files" where Watir was installed. I understand that Watir needs to live in this path structure? Suggestions on this? Thanks, Thom -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: Wednesday, February 08, 2006 1:42 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Testing in Other Browsers Welcome Thom... > I wonder if anyone has constructed a Ruby program in such a way as to > use it for launching Watir scripts... i.e.. have an interface with > buttons on it... something like... for log into the site press button > 1... to test adding a client to the site press button 2... to remove a > client from the site... press button three... etc? The button will > launch the Watir scripts... write a log and then return to the Ruby menu... Bret said recently on the list: ################################## But there you can get it to run in a nifty GUI if you run it with a command line argument. In a cmd window you can do this: test.rb --runner=t You can also create a shortcut to your test and then edit the target in the properties to include this argument. Then when you double click on it, it will run in its GUI. Target: C:\workspace\watir\unittests\div_test.rb --runner=t Everybody should actually give this a try. It looks cool! ######################################3 You might also look at Atomic Objects' "SYSTIR" project as well: http://atomicobject.com/systir.page > From my reading on Watir, it sounds like it may be supporting other > browsers in the future, but not currently... You might give Selenium a try: http://www.openqa.org/selenium/ It's a little fussier than Watir (and is missing some things that Watir has, like support for frames), but it might serve your purposes. -Chris _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Wed Feb 8 14:49:16 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 8 Feb 2006 13:49:16 -0600 Subject: [Wtr-general] is there a way to package watir scripts to run on another PC... In-Reply-To: <20060208185220.97581.qmail@web52913.mail.yahoo.com> References: <ade75c5b0602072218l1d6cf195yff8b2cb5b950c655@mail.gmail.com> <20060208185220.97581.qmail@web52913.mail.yahoo.com> Message-ID: <ade75c5b0602081149w3af1340br8b6ebde91cca0551@mail.gmail.com> Well the script is running, but it might have an error message. If you only learned to read faster, you'd know what it was saying. Try double clicking on this script and see if you can see what is actually happening. puts "hello" gets Bret On 2/8/06, Roy Sin <roy_sin at yahoo.com> wrote: > > Hi Bret, > > When I double click on any of my rb files. A command window > comes up and disappear quickly but my script doesn't run. > Any idea! > > But I did try > textfields_test.rb --runner=t > Thanks for that tip it looks really cool. > > > > --- Bret Pettichord <bret at pettichord.com> wrote: > > > On 2/7/06, Roy Sin <roy_sin at yahoo.com> wrote: > > > > > > 2) If a PC has Ruby/Watir installed but don't have > > eclipse > > > ide ,is there a way to make my scripts into an > > executable > > > and the person running the scripts could just double > > click > > > on the file > > > > > > First of all, they can just double click the test.rb file > > and it will run. > > The only problem is that the output will appear in a > > temporary command > > window that will go away when the script is done. > > > > But there you can get it to run in a nifty GUI if you run > > it with a command > > line argument. > > > > In a cmd window you can do this: > > test.rb --runner=t > > > > You can also create a shortcut to your test and then edit > > the target in the > > properties to include this argument. Then when you double > > click on it, it > > will run in its GUI. > > > > Target: C:\workspace\watir\unittests\div_test.rb > > --runner=t > > > > Everybody should actually give this a try. It looks cool! > > > > Another idea would be to put this in a batch file. > > > > Bret > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > __________________________________________________ > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060208/1b6d1a47/attachment.html From bret at pettichord.com Wed Feb 8 14:55:08 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 8 Feb 2006 13:55:08 -0600 Subject: [Wtr-general] Testing in Other Browsers In-Reply-To: <8EA615B25AB5F849BF0193B80E6D4C49800D19@MIDISERVER> References: <8EA615B25AB5F849BF0193B80E6D4C49800D19@MIDISERVER> Message-ID: <ade75c5b0602081155t11579606jcf597732d71dfcd7@mail.gmail.com> On 2/8/06, Thomas Healy <thealy at midicorp.com> wrote: > > Also I keep trying to run the cmd window example suggested but I get > error messages... The path is not correct -- blah blah blah ... I think > it has to do with the space in the path "Program Files" where Watir was > installed. I understand that Watir needs to live in this path structure? > > Suggestions on this? Send us the exact error message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060208/39334558/attachment.html From peppers at gmail.com Wed Feb 8 16:51:49 2006 From: peppers at gmail.com (Terry Peppers) Date: Wed, 8 Feb 2006 15:51:49 -0600 Subject: [Wtr-general] WindowHelper Message-ID: <8ca48b420602081351n61b3ab23jf7973abb119aae64@mail.gmail.com> I asked a real foolish question a couple of weeks ago with regard to how you can get Watir to enter in username and password credentials into a user auth dialog - that I should apologize for. I figured the silence was really a nod to RTFM so I did more digging in the 'unitTests' directory and found the ' WindowLogonExample.rb' and 'WindowLogonExtra.rb' files that apparently were named too well for me to notice the first time around. So I'm @ a bit of a stumbling block. In the 'WindowLogonExtra.rb' - which is the script called by one of the threads in the 'WindowLogonExample.rb' - the code is short and sweet. <begin_code> require 'watir/WindowHelper' helper = WindowHelper.new helper.logon('Connect to clio.lyris.com') <end_code> I modified the code so it reads the following: <begin_code> require 'watir/WindowHelper' r = Regexp.new("Connect to stage.*") helper = WindowHelper.new helper.logon("#{r}", name="foo", password="bar") <end_code> We have multiple staging sites, and I'd like not to clutter up the code with a huge if/else or case statement that accounts for all of the different domains. I basically want to login to any auth window that matches the Regex. Unfortunately, it looks like the script just hangs since the WindowHelper can't seem to find the window. Does anyone know if I'm doing something wrong? Can the 'logon' method not accept a Regular Expression for the 'title' parameter? Is this a AutoIt deficiency? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060208/2798bfaa/attachment.html From marco.neri at police.vic.gov.au Wed Feb 8 17:47:35 2006 From: marco.neri at police.vic.gov.au (Neri, Marco) Date: Thu, 9 Feb 2006 09:47:35 +1100 Subject: [Wtr-general] The object invoked has disconnected from its clients. Message-ID: <AE918470A1BAB34B97D28AA43952D5E7010B454D@wt14px03.vicpolice.internal> Brett good point about having to put the call to goto before bring_to_front. I suspect the problem may be something corrupt within ie or the OS. what I'd originally set up was a module module ModuleBrowser def startBrowser() ie = IE.new ie.goto(@test_site) ie.bring_to_front() ie.maximize() return ie end end I'd then do a call @ie = startBrowser() from within my scripts. That was working reliably. I then started having the errors. So I removed the module and put that code directly into my script to see if the problem was perhaps getting the reference to the ie object. That didn't work Reason I suspect something corrupt is that running only @ie = IE.new @ie.goto("http://www.google.com") is throwing WIN32OLERuntimeError: Unknown property or method `navigate' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. If I run only @ie = IE.new is throwing WIN32OLERuntimeError: document OLE error code:80004005 in <Unknown> It's not a consistent 100% failure sometimes the scripts run but more often than not they don't. So I'll have to try options 1) re-install ie 2) move all scripts to another box and if it runs reliably there I can conclude that problem is within the OS and not ruby/watir/my scripts. Thanks for helping I'll let you know what I find Marco ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Wednesday, 8 February 2006 16:38 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] The object invoked has disconnected from its clients. Marco, I think i may know what the problem is. Please tell us whether this reliably fixes it: @ie = IE.new @ie.goto("http://www.google.com") # any site will do @ie.bring_to_front() Bret On 2/7/06, Neri, Marco <marco.neri at police.vic.gov.au> wrote: Has anyone else run into this error? ( whats worse is it's intermittent ). I've tried uninstall/reinstall of ruby and watir. >From within my test script I start an ie browser window as per normal @ie = IE.new @ie.bring_to_front() A new browser window is popped up. And that's as far as it gets. And the error is 1) Error: test001(TC_test001): WIN32OLERuntimeError: Unknown property or method `document' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in `method_missing' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in `title' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1302:in `bring_to_front' # Make the window come to the front def bring_to_front autoit = WIN32OLE.new('AutoItX3.Control') autoit.WinActivate title, '' end # Return the title of the window def title @ ie.document.title end ======================================================= The information contained in this email and any files attached may be confidential information to the intended recipient and may be the subject of legal professional privilege or public interest immunity. If you are not the intended recipient, any use, disclosure or copying is unauthorised. If you have received this document in error please telephone 1300 307 082 ******************************************************************* This footnote also confirms that this email message has been swept for the presence of computer viruses. ******************************************************************* _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ======================================================= The information contained in this email and any files attached may be confidential information to the intended recipient and may be the subject of legal professional privilege or public interest immunity. If you are not the intended recipient, any use, disclosure or copying is unauthorised. If you have received this document in error please telephone 1300 307 082 ******************************************************************* This footnote also confirms that this email message has been swept for the presence of computer viruses. ******************************************************************* From rosecao at us.ibm.com Wed Feb 8 18:43:14 2006 From: rosecao at us.ibm.com (Rose Cao) Date: Wed, 8 Feb 2006 16:43:14 -0700 Subject: [Wtr-general] Ruby on AIX Message-ID: <OFEE012896.EE54479D-ON8725710F.0081AFFF-8725710F.00820B37@us.ibm.com> The scripts are running on Windows. But it is personal desktop. In order to schedule the scripts on server, need install Ruby to server which is AIX box. I found one binary Ruby @http://www.bullfreeware.com/download/aix52/ruby-1.8.2.0.bff. For caution, can anyone give some suggestions on use of the AIX version of Ruby? Or are there any documents on it? Thanks, Rose -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060208/30379d04/attachment.html From bret at pettichord.com Wed Feb 8 18:42:20 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 8 Feb 2006 17:42:20 -0600 Subject: [Wtr-general] The object invoked has disconnected from its clients. In-Reply-To: <AE918470A1BAB34B97D28AA43952D5E7010B454D@wt14px03.vicpolice.internal> References: <AE918470A1BAB34B97D28AA43952D5E7010B454D@wt14px03.vicpolice.internal> Message-ID: <ade75c5b0602081542j628521f5l92e660bd2aa7fb43@mail.gmail.com> Marco, Thank you for the detailed reply. I think you are running into a problem that i've also seen intermittently. My theory is that there is a resource leak in Watir. After a certain point, you start getting these errors. What i have found is that you can correct this problem by killing the IEXPLORE.EXE process -- at least for a while. Rebooting has the same effect. But with time, it recurs. The reason i think this is a resource or memory leak is as follows. If you start and stop IE manually, you'll see that the IEXPLORE process dies when IE is closed. However, if you start and stop IE from a Watir script, the IEXPLORE process is still running. This is a problem that very much concerns me. For various reasons, automated tests tend to open and close browsers more frequently than humans, so i need to be able to do this reliably. I'm planning to look into this further and would appreciate any ideas that anyone has about this. Bret On 2/8/06, Neri, Marco <marco.neri at police.vic.gov.au> wrote: > > Brett > > good point about having to put the call to goto before bring_to_front. > > I suspect the problem may be something corrupt within ie or the OS. what > I'd originally set up was a module > > module ModuleBrowser > def startBrowser() > ie = IE.new > ie.goto(@test_site) > ie.bring_to_front() > ie.maximize() > return ie > end > end > > I'd then do a call @ie = startBrowser() from within my scripts. That was > working reliably. I then started having the errors. So I removed the > module and put that code directly into my script to see if the problem > was perhaps getting the reference to the ie object. That didn't work > > Reason I suspect something corrupt is that running only > > @ie = IE.new > @ie.goto("http://www.google.com") > > is throwing > > WIN32OLERuntimeError: Unknown property or method `navigate' > HRESULT error code:0x80010108 > The object invoked has disconnected from its clients. > > If I run only > > @ie = IE.new > > is throwing > > WIN32OLERuntimeError: document > OLE error code:80004005 in <Unknown> > > It's not a consistent 100% failure sometimes the scripts run but more > often than not they don't. > > So I'll have to try options > 1) re-install ie > 2) move all scripts to another box and if it runs reliably there I can > conclude that problem is within the OS and not ruby/watir/my scripts. > > Thanks for helping > > I'll let you know what I find > > Marco > > > ________________________________ > > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord > Sent: Wednesday, 8 February 2006 16:38 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] The object invoked has disconnected from its > clients. > > > Marco, > > I think i may know what the problem is. > > Please tell us whether this reliably fixes it: > > @ie = IE.new > @ie.goto("http://www.google.com") # any site will do > @ie.bring_to_front() > > Bret > > > On 2/7/06, Neri, Marco <marco.neri at police.vic.gov.au> wrote: > > > Has anyone else run into this error? ( whats worse is it's > intermittent > ). > > I've tried uninstall/reinstall of ruby and watir. > > >From within my test script I start an ie browser window as per > normal > > @ie = IE.new > @ie.bring_to_front() > > A new browser window is popped up. And that's as far as it gets. > > > And the error is > > 1) Error: > test001(TC_test001): > WIN32OLERuntimeError: Unknown property or method `document' > HRESULT error code:0x80010108 > The object invoked has disconnected from its clients. > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in > `method_missing' > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in `title' > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1302:in > `bring_to_front' > > > # Make the window come to the front > def bring_to_front > autoit = WIN32OLE.new('AutoItX3.Control') > autoit.WinActivate title, '' > end > > # Return the title of the window > def title > @ ie.document.title > end > > > ======================================================= > The information contained in this email and any files attached > may > be confidential information to the intended recipient and may be > > the subject of legal professional privilege or public interest > immunity. > > If you are not the intended recipient, any use, disclosure or > copying is > unauthorised. > > If you have received this document in error please telephone > 1300 307 082 > > > ******************************************************************* > This footnote also confirms that this email message has been > swept > for the presence of computer viruses. > > ******************************************************************* > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > ======================================================= > The information contained in this email and any files attached may > be confidential information to the intended recipient and may be > the subject of legal professional privilege or public interest immunity. > > If you are not the intended recipient, any use, disclosure or copying is > unauthorised. > > If you have received this document in error please telephone 1300 307 082 > > ******************************************************************* > This footnote also confirms that this email message has been swept > for the presence of computer viruses. > ******************************************************************* > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060208/e1c3d918/attachment.html From jkohl at telusplanet.net Wed Feb 8 18:47:03 2006 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Wed, 8 Feb 2006 15:47:03 -0800 Subject: [Wtr-general] The object invoked has disconnected from its clients. In-Reply-To: <ade75c5b0602081542j628521f5l92e660bd2aa7fb43@mail.gmail.com> References: <AE918470A1BAB34B97D28AA43952D5E7010B454D@wt14px03.vicpolice.internal> <ade75c5b0602081542j628521f5l92e660bd2aa7fb43@mail.gmail.com> Message-ID: <1139442423.43ea82f79bd5a@webmail.telusplanet.net> Marco; Are you using Winclickers code anywhere in your scripts? I've seen this kind of behavior when using winclickers - it is leaky. -Jonathan Quoting Bret Pettichord <bret at pettichord.com>: > Marco, > > Thank you for the detailed reply. > > I think you are running into a problem that i've also seen intermittently. > My theory is that there is a resource leak in Watir. After a certain point, > you start getting these errors. > > What i have found is that you can correct this problem by killing the > IEXPLORE.EXE process -- at least for a while. Rebooting has the same effect. > But with time, it recurs. > > The reason i think this is a resource or memory leak is as follows. > > If you start and stop IE manually, you'll see that the IEXPLORE process dies > when IE is closed. However, if you start and stop IE from a Watir script, > the IEXPLORE process is still running. > > This is a problem that very much concerns me. For various reasons, automated > tests tend to open and close browsers more frequently than humans, so i need > to be able to do this reliably. > > I'm planning to look into this further and would appreciate any ideas that > anyone has about this. > > Bret > > > On 2/8/06, Neri, Marco <marco.neri at police.vic.gov.au> wrote: > > > > Brett > > > > good point about having to put the call to goto before bring_to_front. > > > > I suspect the problem may be something corrupt within ie or the OS. what > > I'd originally set up was a module > > > > module ModuleBrowser > > def startBrowser() > > ie = IE.new > > ie.goto(@test_site) > > ie.bring_to_front() > > ie.maximize() > > return ie > > end > > end > > > > I'd then do a call @ie = startBrowser() from within my scripts. That was > > working reliably. I then started having the errors. So I removed the > > module and put that code directly into my script to see if the problem > > was perhaps getting the reference to the ie object. That didn't work > > > > Reason I suspect something corrupt is that running only > > > > @ie = IE.new > > @ie.goto("http://www.google.com") > > > > is throwing > > > > WIN32OLERuntimeError: Unknown property or method `navigate' > > HRESULT error code:0x80010108 > > The object invoked has disconnected from its clients. > > > > If I run only > > > > @ie = IE.new > > > > is throwing > > > > WIN32OLERuntimeError: document > > OLE error code:80004005 in <Unknown> > > > > It's not a consistent 100% failure sometimes the scripts run but more > > often than not they don't. > > > > So I'll have to try options > > 1) re-install ie > > 2) move all scripts to another box and if it runs reliably there I can > > conclude that problem is within the OS and not ruby/watir/my scripts. > > > > Thanks for helping > > > > I'll let you know what I find > > > > Marco > > > > > > ________________________________ > > > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord > > Sent: Wednesday, 8 February 2006 16:38 > > To: wtr-general at rubyforge.org > > Subject: Re: [Wtr-general] The object invoked has disconnected from its > > clients. > > > > > > Marco, > > > > I think i may know what the problem is. > > > > Please tell us whether this reliably fixes it: > > > > @ie = IE.new > > @ie.goto("http://www.google.com") # any site will do > > @ie.bring_to_front() > > > > Bret > > > > > > On 2/7/06, Neri, Marco <marco.neri at police.vic.gov.au> wrote: > > > > > > Has anyone else run into this error? ( whats worse is it's > > intermittent > > ). > > > > I've tried uninstall/reinstall of ruby and watir. > > > > >From within my test script I start an ie browser window as per > > normal > > > > @ie = IE.new > > @ie.bring_to_front() > > > > A new browser window is popped up. And that's as far as it gets. > > > > > > And the error is > > > > 1) Error: > > test001(TC_test001): > > WIN32OLERuntimeError: Unknown property or method `document' > > HRESULT error code:0x80010108 > > The object invoked has disconnected from its clients. > > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in > > `method_missing' > > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in `title' > > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1302:in > > `bring_to_front' > > > > > > # Make the window come to the front > > def bring_to_front > > autoit = WIN32OLE.new('AutoItX3.Control') > > autoit.WinActivate title, '' > > end > > > > # Return the title of the window > > def title > > @ ie.document.title > > end > > > > > > ======================================================= > > The information contained in this email and any files attached > > may > > be confidential information to the intended recipient and may be > > > > the subject of legal professional privilege or public interest > > immunity. > > > > If you are not the intended recipient, any use, disclosure or > > copying is > > unauthorised. > > > > If you have received this document in error please telephone > > 1300 307 082 > > > > > > ******************************************************************* > > This footnote also confirms that this email message has been > > swept > > for the presence of computer viruses. > > > > ******************************************************************* > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > ======================================================= > > The information contained in this email and any files attached may > > be confidential information to the intended recipient and may be > > the subject of legal professional privilege or public interest immunity. > > > > If you are not the intended recipient, any use, disclosure or copying is > > unauthorised. > > > > If you have received this document in error please telephone 1300 307 082 > > > > ******************************************************************* > > This footnote also confirms that this email message has been swept > > for the presence of computer viruses. > > ******************************************************************* > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > From marco.neri at police.vic.gov.au Wed Feb 8 19:33:29 2006 From: marco.neri at police.vic.gov.au (Neri, Marco) Date: Thu, 9 Feb 2006 11:33:29 +1100 Subject: [Wtr-general] The object invoked has disconnected from itsclients. Message-ID: <AE918470A1BAB34B97D28AA43952D5E7010B454E@wt14px03.vicpolice.internal> Jonathan No. not using winclicker. I still suspect it's something corrupt within my OS as rebooting is not solving my problem. If it was purely a memory leak then a reboot should solve this. I have a utility that sits in the system tray ( meminfo ) that shows memory usage and I do notice it tends to increase over time though I haven't bothered too much what's holding onto the memory as the scripts were still running ok. In regards to Bretts comments about the iexplore process not stopping I'd suggest for those of us using xp to try using taskkill in the teardown for each test. I don't know if there's an equivalent cmd to taskkill for other os's or windows versions. Eg. exec "taskkill /F /IM mspaint.exe /IM iexplore.exe" -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of jkohl at telusplanet.net Sent: Thursday, 9 February 2006 10:47 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] The object invoked has disconnected from itsclients. Marco; Are you using Winclickers code anywhere in your scripts? I've seen this kind of behavior when using winclickers - it is leaky. -Jonathan Quoting Bret Pettichord <bret at pettichord.com>: > Marco, > > Thank you for the detailed reply. > > I think you are running into a problem that i've also seen intermittently. > My theory is that there is a resource leak in Watir. After a certain > point, you start getting these errors. > > What i have found is that you can correct this problem by killing the > IEXPLORE.EXE process -- at least for a while. Rebooting has the same effect. > But with time, it recurs. > > The reason i think this is a resource or memory leak is as follows. > > If you start and stop IE manually, you'll see that the IEXPLORE > process dies when IE is closed. However, if you start and stop IE from > a Watir script, the IEXPLORE process is still running. > > This is a problem that very much concerns me. For various reasons, > automated tests tend to open and close browsers more frequently than > humans, so i need to be able to do this reliably. > > I'm planning to look into this further and would appreciate any ideas > that anyone has about this. > > Bret > > > On 2/8/06, Neri, Marco <marco.neri at police.vic.gov.au> wrote: > > > > Brett > > > > good point about having to put the call to goto before bring_to_front. > > > > I suspect the problem may be something corrupt within ie or the OS. > > what I'd originally set up was a module > > > > module ModuleBrowser > > def startBrowser() > > ie = IE.new > > ie.goto(@test_site) > > ie.bring_to_front() > > ie.maximize() > > return ie > > end > > end > > > > I'd then do a call @ie = startBrowser() from within my scripts. That > > was working reliably. I then started having the errors. So I removed > > the module and put that code directly into my script to see if the > > problem was perhaps getting the reference to the ie object. That > > didn't work > > > > Reason I suspect something corrupt is that running only > > > > @ie = IE.new > > @ie.goto("http://www.google.com") > > > > is throwing > > > > WIN32OLERuntimeError: Unknown property or method `navigate' > > HRESULT error code:0x80010108 > > The object invoked has disconnected from its clients. > > > > If I run only > > > > @ie = IE.new > > > > is throwing > > > > WIN32OLERuntimeError: document > > OLE error code:80004005 in <Unknown> > > > > It's not a consistent 100% failure sometimes the scripts run but > > more often than not they don't. > > > > So I'll have to try options > > 1) re-install ie > > 2) move all scripts to another box and if it runs reliably there I > > can conclude that problem is within the OS and not ruby/watir/my scripts. > > > > Thanks for helping > > > > I'll let you know what I find > > > > Marco > > > > > > ________________________________ > > > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret > > Pettichord > > Sent: Wednesday, 8 February 2006 16:38 > > To: wtr-general at rubyforge.org > > Subject: Re: [Wtr-general] The object invoked has disconnected from > > its clients. > > > > > > Marco, > > > > I think i may know what the problem is. > > > > Please tell us whether this reliably fixes it: > > > > @ie = IE.new > > @ie.goto("http://www.google.com") # any site will do > > @ie.bring_to_front() > > > > Bret > > > > > > On 2/7/06, Neri, Marco <marco.neri at police.vic.gov.au> wrote: > > > > > > Has anyone else run into this error? ( whats worse is it's > > intermittent > > ). > > > > I've tried uninstall/reinstall of ruby and watir. > > > > >From within my test script I start an ie browser window as > > per normal > > > > @ie = IE.new > > @ie.bring_to_front() > > > > A new browser window is popped up. And that's as far as it gets. > > > > > > And the error is > > > > 1) Error: > > test001(TC_test001): > > WIN32OLERuntimeError: Unknown property or method `document' > > HRESULT error code:0x80010108 > > The object invoked has disconnected from its clients. > > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in > > `method_missing' > > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in `title' > > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1302:in > > `bring_to_front' > > > > > > # Make the window come to the front > > def bring_to_front > > autoit = WIN32OLE.new('AutoItX3.Control') > > autoit.WinActivate title, '' > > end > > > > # Return the title of the window > > def title > > @ ie.document.title > > end > > > > > > ======================================================= > > The information contained in this email and any files > > attached may > > be confidential information to the intended recipient and > > may be > > > > the subject of legal professional privilege or public > > interest immunity. > > > > If you are not the intended recipient, any use, disclosure > > or copying is > > unauthorised. > > > > If you have received this document in error please telephone > > 1300 307 082 > > > > > > ******************************************************************* > > This footnote also confirms that this email message has been > > swept > > for the presence of computer viruses. > > > > ******************************************************************* > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > ======================================================= > > The information contained in this email and any files attached may > > be confidential information to the intended recipient and may be the > > subject of legal professional privilege or public interest immunity. > > > > If you are not the intended recipient, any use, disclosure or > > copying is unauthorised. > > > > If you have received this document in error please telephone 1300 > > 307 082 > > > > ******************************************************************* > > This footnote also confirms that this email message has been swept > > for the presence of computer viruses. > > ******************************************************************* > > > > > > _______________________________________________ > > 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 ======================================================= The information contained in this email and any files attached may be confidential information to the intended recipient and may be the subject of legal professional privilege or public interest immunity. If you are not the intended recipient, any use, disclosure or copying is unauthorised. If you have received this document in error please telephone 1300 307 082 ******************************************************************* This footnote also confirms that this email message has been swept for the presence of computer viruses. ******************************************************************* From eduardorochabr at gmail.com Wed Feb 8 22:29:23 2006 From: eduardorochabr at gmail.com (Eduardo Rocha) Date: Thu, 9 Feb 2006 01:29:23 -0200 Subject: [Wtr-general] Testing of the Java Classes In-Reply-To: <6CF3AA425295C7479483AC0018EDF98B01DADF85@MI8NYCMAIL03.Mi8.com> References: <6CF3AA425295C7479483AC0018EDF98B01DADF85@MI8NYCMAIL03.Mi8.com> Message-ID: <f57e5a0e0602081929u6cc35c4ex@mail.gmail.com> Sorry Meghanath, but was this a question? I did not understand what you mean, could you post it again? 2006/2/8, Chintakrindi Meghanath <ChintakrindiMeghana at managementdynamics.com>: > > Hi > > I am using watir to test the web application from the browser. > By using watir , is there any to unit test the java classes. > > > > Thanks > > Meghanath > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From eduardorochabr at gmail.com Wed Feb 8 22:35:36 2006 From: eduardorochabr at gmail.com (Eduardo Rocha) Date: Thu, 9 Feb 2006 01:35:36 -0200 Subject: [Wtr-general] Ruby on AIX In-Reply-To: <OFEE012896.EE54479D-ON8725710F.0081AFFF-8725710F.00820B37@us.ibm.com> References: <OFEE012896.EE54479D-ON8725710F.0081AFFF-8725710F.00820B37@us.ibm.com> Message-ID: <f57e5a0e0602081935o120cbe83m@mail.gmail.com> Rose, Unfortunately, even if you successfully installs ruby on AIX, Watir currently only runs on Windows. []'s Eduardo 2006/2/8, Rose Cao <rosecao at us.ibm.com>: > > > The scripts are running on Windows. But it is personal desktop. In order to > schedule the scripts on server, need install Ruby to server which is AIX > box. I found one binary Ruby > @http://www.bullfreeware.com/download/aix52/ruby-1.8.2.0.bff. > For caution, can anyone give some suggestions on use of the AIX version of > Ruby? Or are there any documents on it? > > Thanks, > Rose > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From jkohl at telusplanet.net Wed Feb 8 22:37:29 2006 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Wed, 8 Feb 2006 20:37:29 -0700 Subject: [Wtr-general] Testing of the Java Classes In-Reply-To: <f57e5a0e0602081929u6cc35c4ex@mail.gmail.com> Message-ID: <000201c62d2a$272d89d0$6500a8c0@tintin> You can use JUnit to unit test Java code: http://www.junit.org/index.htm > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Eduardo Rocha > Sent: February 8, 2006 8:29 PM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Testing of the Java Classes > > Sorry Meghanath, but was this a question? I did not > understand what you mean, could you post it again? > > 2006/2/8, Chintakrindi Meghanath > <ChintakrindiMeghana at managementdynamics.com>: > > > > Hi > > > > I am using watir to test the web application from the browser. > > By using watir , is there any to unit test the java classes. > > > > > > > > Thanks > > > > Meghanath > > _______________________________________________ > > 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 Wed Feb 8 23:35:22 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 8 Feb 2006 22:35:22 -0600 Subject: [Wtr-general] The object invoked has disconnected from itsclients. In-Reply-To: <011501c62d28$02246840$6801a8c0@Koko> References: <ade75c5b0602081542j628521f5l92e660bd2aa7fb43@mail.gmail.com> <011501c62d28$02246840$6801a8c0@Koko> Message-ID: <ade75c5b0602082035l48dc2265qf17be0c2888a5125@mail.gmail.com> On 2/8/06, Michael Bolton <mb at michaelbolton.net> wrote: > > Hi, Bret... > > Would a script that opened and closed browsers repeatedly be expected to > expose this? I wrote something like Marco's thing > No. This is a different issue. In both cases you are getting RPC errors. I was not able to reproduce this using your script, but i do remember seeing it with other scripts. Although this occurs with 1.4.1, i do believe that we have this fixed in head. Would you mind checking. (BTW, you may want to use a smaller count, i ran your script on my machine and it unfortunately did not fail, but instead run until my battery ran out...) Bret require 'watir.rb' > > > def startBrowser() > ie = Watir::IE.new > ie.goto('http://192.168.1.100' <http://192.168.1.100%27>) > ie.bring_to_front() > ie.maximize() > ie.close > end > > 10000.times { > startBrowser() > } > > The site address above is, obviously, an IIS server on my own net. > > I got these two errors on subsequent runs... > > C:\Documents and Settings\Michael Bolton\My Documents\Ruby Scripts> > zillion.rb > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in `method_missing': Unknown > property or method `document' (WIN32OLERuntime > Error) > HRESULT error code:0x800706ba > The RPC server is unavailable. from > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in `title' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1302:in > `bring_to_front' > from C:/Documents and Settings/Michael Bolton/My Documents/Ruby > Scripts/zillion.rb:6:in `startBrowser' > from C:/Documents and Settings/Michael Bolton/My Documents/Ruby > Scripts/zillion.rb:12 > from C:/Documents and Settings/Michael Bolton/My Documents/Ruby > Scripts/zillion.rb:11:in `times' > from C:/Documents and Settings/Michael Bolton/My Documents/Ruby > Scripts/zillion.rb:11 > > C:\Documents and Settings\Michael Bolton\My Documents\Ruby Scripts> > zillion.rb > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1122:in `method_missing': > (WIN32OLERuntimeError) > OLE error code:0 in <Unknown> > <No Description> > HRESULT error code:0x800706be > The remote procedure call failed. from > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1122:in `set_defaults' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1087:in `initialize' > from C:/Documents and Settings/Michael Bolton/My Documents/Ruby > Scripts/zillion.rb:4:in `new' > from C:/Documents and Settings/Michael Bolton/My Documents/Ruby > Scripts/zillion.rb:4:in `startBrowser' > from C:/Documents and Settings/Michael Bolton/My Documents/Ruby > Scripts/zillion.rb:12 > from C:/Documents and Settings/Michael Bolton/My Documents/Ruby > Scripts/zillion.rb:11:in `times' > from C:/Documents and Settings/Michael Bolton/My Documents/Ruby > Scripts/zillion.rb:11 > > In each case, the program pooped out after opening and closing the browser > about 10 times or so. (It would be easy to get a better count.) > > In Marco's original version, note that he doesn't close the browser > explicitly. In those cases, the browser stays open when the function that > creates it goes out of scope. I don't know much about this OO stuff, but I > would believe that it's the intention for the browser to get garbage > collected after it goes out of scope, but that doesn't happen immediately. > > Also note that, in answer to Jonathan's question, Marco doesn't use > winclickers, but he plainly uses AutoIt if you look way down below. > > ---Michael B. > > ------------------------------ > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *Bret Pettichord > *Sent:* February 8, 2006 6:42 PM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] The object invoked has disconnected from > itsclients. > > Marco, > > Thank you for the detailed reply. > > I think you are running into a problem that i've also seen intermittently. > My theory is that there is a resource leak in Watir. After a certain point, > you start getting these errors. > > What i have found is that you can correct this problem by killing the > IEXPLORE.EXE process -- at least for a while. Rebooting has the same > effect. But with time, it recurs. > > The reason i think this is a resource or memory leak is as follows. > > If you start and stop IE manually, you'll see that the IEXPLORE process > dies when IE is closed. However, if you start and stop IE from a Watir > script, the IEXPLORE process is still running. > > This is a problem that very much concerns me. For various reasons, > automated tests tend to open and close browsers more frequently than humans, > so i need to be able to do this reliably. > > I'm planning to look into this further and would appreciate any ideas that > anyone has about this. > > Bret > > > On 2/8/06, Neri, Marco < marco.neri at police.vic.gov.au> wrote: > > > > Brett > > > > good point about having to put the call to goto before bring_to_front. > > > > I suspect the problem may be something corrupt within ie or the OS. what > > I'd originally set up was a module > > > > module ModuleBrowser > > def startBrowser() > > ie = IE.new > > ie.goto(@test_site) > > ie.bring_to_front() > > ie.maximize() > > return ie > > end > > end > > > > I'd then do a call @ie = startBrowser() from within my scripts. That was > > working reliably. I then started having the errors. So I removed the > > module and put that code directly into my script to see if the problem > > was perhaps getting the reference to the ie object. That didn't work > > > > Reason I suspect something corrupt is that running only > > > > @ie = IE.new > > @ie.goto("http://www.google.com") > > > > is throwing > > > > WIN32OLERuntimeError: Unknown property or method `navigate' > > HRESULT error code:0x80010108 > > The object invoked has disconnected from its clients. > > > > If I run only > > > > @ie = IE.new > > > > is throwing > > > > WIN32OLERuntimeError: document > > OLE error code:80004005 in <Unknown> > > > > It's not a consistent 100% failure sometimes the scripts run but more > > often than not they don't. > > > > So I'll have to try options > > 1) re-install ie > > 2) move all scripts to another box and if it runs reliably there I can > > conclude that problem is within the OS and not ruby/watir/my scripts. > > > > Thanks for helping > > > > I'll let you know what I find > > > > Marco > > > > > > ________________________________ > > > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord > > Sent: Wednesday, 8 February 2006 16:38 > > To: wtr-general at rubyforge.org > > Subject: Re: [Wtr-general] The object invoked has disconnected from its > > clients. > > > > > > Marco, > > > > I think i may know what the problem is. > > > > Please tell us whether this reliably fixes it: > > > > @ie = IE.new > > @ie.goto("http://www.google.com") # any site will do > > @ie.bring_to_front() > > > > Bret > > > > > > On 2/7/06, Neri, Marco < marco.neri at police.vic.gov.au> wrote: > > > > > > Has anyone else run into this error? ( whats worse is it's > > intermittent > > ). > > > > I've tried uninstall/reinstall of ruby and watir. > > > > >From within my test script I start an ie browser window as per > > normal > > > > @ie = IE.new > > @ie.bring_to_front() > > > > A new browser window is popped up. And that's as far as it gets. > > > > > > > > And the error is > > > > 1) Error: > > test001(TC_test001): > > WIN32OLERuntimeError: Unknown property or method `document' > > HRESULT error code:0x80010108 > > The object invoked has disconnected from its clients. > > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in > > `method_missing' > > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in `title' > > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1302:in > > `bring_to_front' > > > > > > # Make the window come to the front > > def bring_to_front > > autoit = WIN32OLE.new('AutoItX3.Control') > > autoit.WinActivate title, '' > > end > > > > # Return the title of the window > > def title > > @ ie.document.title > > end > > > > > > ======================================================= > > The information contained in this email and any files attached > > may > > be confidential information to the intended recipient and may be > > > > the subject of legal professional privilege or public interest > > immunity. > > > > If you are not the intended recipient, any use, disclosure or > > copying is > > unauthorised. > > > > If you have received this document in error please telephone > > 1300 307 082 > > > > > > ******************************************************************* > > This footnote also confirms that this email message has been > > swept > > for the presence of computer viruses. > > > > ******************************************************************* > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > ======================================================= > > The information contained in this email and any files attached may > > be confidential information to the intended recipient and may be > > the subject of legal professional privilege or public interest immunity. > > > > If you are not the intended recipient, any use, disclosure or copying is > > unauthorised. > > > > If you have received this document in error please telephone 1300 307 > > 082 > > > > ******************************************************************* > > This footnote also confirms that this email message has been swept > > for the presence of computer viruses. > > ******************************************************************* > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060208/63ad7bfb/attachment.html From tester.paul at gmail.com Thu Feb 9 00:54:18 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Thu, 9 Feb 2006 00:54:18 -0500 Subject: [Wtr-general] Are there any References to Ruby/Watir written by Testers? Message-ID: <37c405480602082154k48dda951r@mail.gmail.com> Hello there, before everyone jumps all over me, please allow me to explain.. I have been evaluating Ruby and Watir for about a week now and I think it will do what we want it to. Not completely sure yet -- there are still some features to check out, but it's looking good. One thing that I have noticed is that it has been a struggle for me to do what I want with Ruby and Watir. That's because all the references are geared towards programmers and not testers. The Ruby Cheat Sheet is _almost_ close to being an exception. The only reference book I know is called "Programming Ruby, The Pragmatic Programmer's Guide"... *not* something like "Testing with Ruby, The Pragmatic Tester's Guide." You see, I know what I want to test, but the documentation is not structured in such a way as to help me accomplish that. It's kind of like wanting to drive to a different city and all I have for reference is a book with a description of all the road signs. So, if I didn't already know what direction to head in and the general rules of the road, the documentation alone certainly wouldn't help me get there. If I didn't have any prior programming experience and some familiarity with OO design, I'm pretty sure that I would have given up on evaluating Ruby & Watir after the first day. I'm persistent, if nothing else, and sometimes it pays off. Actually, if it weren't for this mailing list, I'm pretty sure that I wouldn't have gotten as far as I have. (Thank you all for your time and help, by the way.) The technical API reference is just about next to useless for me and I may as well be reading an Auto Mechanic's Guide in Esperanto. Quoting from the "Forward" of the "Pragmatic Programmer's Guide", "Ruby is designed to make programming not only easy, but also fun. It allows you to concentrate on the creative side of programming, with less stress." Hmm, ya, that's nice. I don't really care about the creative side of programming. I'm pretty sure that I'm being paid to be a creative *tester*, and not a creative programmer. Does Ruby/Watir help me do that? No, not really. I still haven't figured out how to structure a decent test case in Watir, let alone script it. I believe that there currently is a big gap between the users of Ruby & Watir and the rest of the Tester community who could probably be making use of it. The Ruby and Watir languages just aren't translated into Tester-speak. Does anyone know of any efforts, either planned or in-progress, to address this gap? If so, I would be very interested in participating in the review of the documentation. Heck, if I had the time and a lot more experience with Ruby & Watir, I'd write it myself! Please don't take this as a slight against Watir. I think that Watir is a tremendously important framework for Ruby, and without it I *know* that I wouldn't be evaluating Ruby right now. (Excellent job on the part of the developers and contributors who continue to improve and expand the framework. Please keep up the good work.) I just think that it would likely be more popular if the documentation was less programmer-centric. I know it would help me be more productive. Thoughts? Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/bb0118c8/attachment.html From thealy at midicorp.com Thu Feb 9 08:38:14 2006 From: thealy at midicorp.com (Thomas Healy) Date: Thu, 9 Feb 2006 08:38:14 -0500 Subject: [Wtr-general] Are there any References to Ruby/Watir written byTesters? Message-ID: <8EA615B25AB5F849BF0193B80E6D4C49800D1F@MIDISERVER> Paul, Your note here is exactly where I am at... I am also trying to make sense of the language -- not because I want to become a Ruby expert but more because I want to make it functional to my needs. I have been placed in charge of QA at my company... I want to regression test our web based products on a consistent, objective and repetitive schedule. I too have been looking for *testing* solutions from Watir -- I find the people here are VERY helpful, very quick to offer good suggestions, and very knowledgeable. I purchased the Dave Thomas Book -- Programming Ruby -- and it is a good reference but unfortunately... your description is very apt... (I laughed when I read) it shows description of the street signs ... (I was not able to sum it up like that but I had similar feelings)... I have a brief programming background and relatively understand the OO reference but don't have the time to really *learn* Ruby. I keep looking for easy answers / prebuilt scripts or other things that will make my Watir QA tasks easier to complete. I have not found them yet and keep plugging away at my Watir scripts. Some people here gave me some feed back on a script I wrote the other day and some of the ideas helped in planning future scripts... Although, I guess I just did not get some of the modifications suggested. My focus is on making the scripts as readable as possible, making the scripts as easy to pick up six months from now and just pick up and go with them. What I really want to do is test, not write scripts or have to remember what the script does. I agree... Watir / Ruby, good... process, good... this e-mail resource, good... learning curve, steep... the resource I could use is a repository of examples geared more to a QA tester like me... perhaps I will have to start to make a website for it... [Thom thinks... hummm... another weekend project... grin] Regards, Thom ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho Sent: Thursday, February 09, 2006 12:54 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Are there any References to Ruby/Watir written byTesters? Hello there, before everyone jumps all over me, please allow me to explain.. I have been evaluating Ruby and Watir for about a week now and I think it will do what we want it to. Not completely sure yet -- there are still some features to check out, but it's looking good. One thing that I have noticed is that it has been a struggle for me to do what I want with Ruby and Watir. That's because all the references are geared towards programmers and not testers. The Ruby Cheat Sheet is _almost_ close to being an exception. The only reference book I know is called "Programming Ruby, The Pragmatic Programmer's Guide"... *not* something like "Testing with Ruby, The Pragmatic Tester's Guide." You see, I know what I want to test, but the documentation is not structured in such a way as to help me accomplish that. It's kind of like wanting to drive to a different city and all I have for reference is a book with a description of all the road signs. So, if I didn't already know what direction to head in and the general rules of the road, the documentation alone certainly wouldn't help me get there. If I didn't have any prior programming experience and some familiarity with OO design, I'm pretty sure that I would have given up on evaluating Ruby & Watir after the first day. I'm persistent, if nothing else, and sometimes it pays off. Actually, if it weren't for this mailing list, I'm pretty sure that I wouldn't have gotten as far as I have. (Thank you all for your time and help, by the way.) The technical API reference is just about next to useless for me and I may as well be reading an Auto Mechanic's Guide in Esperanto. Quoting from the "Forward" of the "Pragmatic Programmer's Guide", "Ruby is designed to make programming not only easy, but also fun. It allows you to concentrate on the creative side of programming, with less stress." Hmm, ya, that's nice. I don't really care about the creative side of programming. I'm pretty sure that I'm being paid to be a creative *tester*, and not a creative programmer. Does Ruby/Watir help me do that? No, not really. I still haven't figured out how to structure a decent test case in Watir, let alone script it. I believe that there currently is a big gap between the users of Ruby & Watir and the rest of the Tester community who could probably be making use of it. The Ruby and Watir languages just aren't translated into Tester-speak. Does anyone know of any efforts, either planned or in-progress, to address this gap? If so, I would be very interested in participating in the review of the documentation. Heck, if I had the time and a lot more experience with Ruby & Watir, I'd write it myself! Please don't take this as a slight against Watir. I think that Watir is a tremendously important framework for Ruby, and without it I *know* that I wouldn't be evaluating Ruby right now. (Excellent job on the part of the developers and contributors who continue to improve and expand the framework. Please keep up the good work.) I just think that it would likely be more popular if the documentation was less programmer-centric. I know it would help me be more productive. Thoughts? Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/0309d3b2/attachment.html From hgs at dmu.ac.uk Thu Feb 9 08:53:55 2006 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Thu, 9 Feb 2006 13:53:55 +0000 (WET) Subject: [Wtr-general] Are there any References to Ruby/Watir written byTesters? In-Reply-To: <8EA615B25AB5F849BF0193B80E6D4C49800D1F@MIDISERVER> References: <8EA615B25AB5F849BF0193B80E6D4C49800D1F@MIDISERVER> Message-ID: <Pine.GSO.4.64.0602091349281.20514@brains.eng.cse.dmu.ac.uk> On Thu, 9 Feb 2006, Thomas Healy wrote: > I purchased the Dave Thomas Book -- Programming Ruby -- and it is a good > reference but unfortunately... your description is very apt... (I > laughed when I read) it shows description of the street signs ... (I was Whilst I don't have the answer you want, there are other ways into learning ruby if you don't consider yourself a programmer. http://www.pragmaticprogrammer.com/titles/fr_ltp/index.html which I have not read. Meanwhile, we'll wait for the testers who know to answer your question properly. HTH Hugh From Malcolm.Beaton at conchango.com Thu Feb 9 09:37:57 2006 From: Malcolm.Beaton at conchango.com (Beaton, Malcolm) Date: Thu, 9 Feb 2006 14:37:57 -0000 Subject: [Wtr-general] Are there any References to Ruby/Watir written byTesters? Message-ID: <A5AC4D5F49F69D4BA71CEBD0E5C7DEA30E963C@eghinter33.int.conchango.net> I have also bounced off this one and found my apple scripting skills haven't helped me greatly but I did come across this post on the Agile Testing mailing list (hopefully attached) This may help you a little (I mailed him straight away to ask to be put on the list) If it doesn't come through as an attachment I'll cut and paste it in Malcolm Beaton M +44 (0) 777 071 3121 -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Hugh Sasse Sent: 09 February 2006 13:54 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Are there any References to Ruby/Watir written byTesters? On Thu, 9 Feb 2006, Thomas Healy wrote: > I purchased the Dave Thomas Book -- Programming Ruby -- and it is a good > reference but unfortunately... your description is very apt... (I > laughed when I read) it shows description of the street signs ... (I was Whilst I don't have the answer you want, there are other ways into learning ruby if you don't consider yourself a programmer. http://www.pragmaticprogrammer.com/titles/fr_ltp/index.html which I have not read. Meanwhile, we'll wait for the testers who know to answer your question properly. HTH Hugh _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _____________________________________________________________________ This e-mail has been scanned for viruses by MessageLabs. The information contained in this message is confidential and is intended for the addressee only. If you have received this message in error, please notify Conchango plc as soon as possible. The unauthorised use, disclosure, copying or alteration of this message is prohibited and may be unlawful. The internet cannot guarantee the integrity of this message and therefore Conchango plc will not be liable for the message if modified. Reg. Heritage House, Church Road, Egham, Surrey, TW20 9QD T 44 (0) 1784 222 222 F 44 (0) 1784 222 200 E talktous at conchango.com No. 2598884 -------------- next part -------------- A non-text attachment was scrubbed... Name: Re {Possible Spam } Agile-Testing Sample Scripts.msg Type: application/octet-stream Size: 27648 bytes Desc: Re {Possible Spam } Agile-Testing Sample Scripts.msg Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060209/7dc53eaa/attachment.obj From christopher.mcmahon at gmail.com Thu Feb 9 10:06:29 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 9 Feb 2006 09:06:29 -0600 Subject: [Wtr-general] Are there any References to Ruby/Watir written by Testers? In-Reply-To: <37c405480602082154k48dda951r@mail.gmail.com> References: <37c405480602082154k48dda951r@mail.gmail.com> Message-ID: <72799cd70602090706h55fdb009uf0b94f98699d62c2@mail.gmail.com> This got kind of long. I hope it's helpful... On 2/8/06, Paul Carvalho <tester.paul at gmail.com> wrote: > That's because all the references are > geared towards programmers and not testers. Consider the possibility that there is less and less of a difference between them in the future. That is, all around us, programmers are developing testing skills, and testers are developing programming skills. Learning Ruby/Watir is a great way to start talking to programmers in their own language. > I'm persistent, if nothing else, and sometimes > it pays off. Actually, if it weren't for this mailing list, I'm pretty sure > that I wouldn't have gotten as far as I have. (Thank you all for your time > and help, by the way.) You sound like you're good at your job. As for the mail list, there is a long, long tradition in open source software of mail lists for people to discuss their problems, issues, solutions, gossip, etc. about the project. You're right, this list is exceptionally helpful, and it looks like you're using it to good effect. In other words, communities like this are the way open source software happens. Look at it another way: whether open source or commercial, you have to make an investment in the software. For a commercial project, you invest a lot of cash, which gives you the right to call an 800 number and get reams of documentation; for an open source project, you invest your time with the community, learning, helping, contributing. If not enough people pay a company, the company dies; if not enough people invest time in the open source project, the project dies. And answering questions from beginners is one of the most important things that helps an open source project grow. > I'm pretty sure that I'm being paid to be a creative *tester*, > and not a creative programmer. Does Ruby/Watir help me do that? No, not > really. I still haven't figured out how to structure a decent test case in > Watir, let alone script it. But you're learning fast, eh? So are the rest of us. Watir is designed to be used in exploring and creating as well as in a write-static-tests sort of way. If you haven't discovered the "get_foo" methods and "flash" methods yet, ask some more questions about how to use Watir in IRB. (BTW, also consider scripting the test(s) first, then structuring them. That's what "refactoring" is, and it's a powerful way to learn.) > I believe that there currently is a big gap between the users of Ruby & > Watir and the rest of the Tester community who could probably be making use > of it. The Ruby and Watir languages just aren't translated into > Tester-speak. The Pragmatic guys (http://www.pragmaticprogrammer.com/) will be publishing a book by Brian Marick (www.testing.com) in a few months called "Scripting for Testers (with Ruby)". It aims to be very much like what you describe, a resource for testers with little or no programming experience designed to help them solve common testing problems with scripts written in Ruby. It's divideded into alternating sections "walking the walk" and "talking the talk" that describe solving real-world problems, and programming practice respectively. Hopefully it'll help fill the gap you describe. Finally, to answer sort of an underlying theme, people here regularly bring up the issue that Watir doesn't have the bells-and-whistles of commercial testing tools: script recorders, clickable GUIs, convenient stuff like that. In fact, there is active resistance (or at least apathy) on this project to building these things-- mostly because the people that are capable of doing this work generally think that these sorts of features are the wrong way to do testing. On the flip side, if you see something that you think Watir needs-- ask for it. That's how I started with the project. I had no Ruby experience, and just a little Perl. In my first couple of weeks on this list I asked for about 20 new features-- and I got 'em. (Mostly to do with support for frames.) I hope you keep on with it, I think you're on the right track. Let me know if you want more information about open source, beginner resources, whatever... -Chris From mb at michaelbolton.net Thu Feb 9 10:31:32 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Thu, 9 Feb 2006 10:31:32 -0500 Subject: [Wtr-general] Are there any References to Ruby/Watir writtenbyTesters? In-Reply-To: <8EA615B25AB5F849BF0193B80E6D4C49800D1F@MIDISERVER> Message-ID: <003001c62d8d$eb98b4d0$6801a8c0@Koko> > I purchased the Dave Thomas Book -- Programming Ruby -- and it is a good reference but unfortunately... your description is very apt... (I laughed when I read) it shows description of the street signs ... (I was not able to sum it up like that but I had similar feelings)... I have a brief programming background and relatively understand the OO reference but don't have the time to really *learn* Ruby. If that's really the case, you should reconsider using test automation in general and WATIR in particular. Imagine trying to create an automated spelling and grammar checker without really *learning* English. (Yes, the metaphor is a little mixed, but useful, I hope.) If you want automation to assist the testing effort effectively, you'll need to meet it on its own terms, and that means recognizing that automating tests is a software development project. See below for some things that have helped. > I keep looking for easy answers / prebuilt scripts or other things that will make my Watir QA tasks easier to complete. I have not found them yet and keep plugging away at my Watir scripts. Some people here gave me some feed back on a script I wrote the other day and some of the ideas helped in planning future scripts... Although, I guess I just did not get some of the modifications suggested. Questioning, rapid learning, and communicating problems effectively are important testing skills. Learning a programming language thoroughly will serve you well as a tester. Although you'll make mistakes--lots of them--,the process will give you insight into the kinds of mistakes that programmers make, which is an important beneficial side effect. > My focus is on making the scripts as readable as possible, making the scripts as easy to pick up six months from now and just pick up and go with them. That's /great/. and an important first step. Would that all programmers were always so pragmatic and focused on the future! It's easy, apparently, for programmers to forget that the program is only partially written for the machine; it's also written for the benefit of the poor sucker that has to maintain it. > What I really want to do is test, not write scripts or have to remember what the script does. I understand that, but if you want to use automation to assist you in testing, you can't really have one without the other. Again, to stretch a metaphor, it's like wanting to be a film critic without reading other film criticism or taking notes. > I agree... Watir / Ruby, good... process, good... this e-mail resource, good... learning curve, steep... the resource I could use is a repository of examples geared more to a QA tester like me... perhaps I will have to start to make a website for it... This would be a great step. You might also be interested in Brian Marick's forthcoming book, Scripting for Testers. Here are the things that helped for me: - See if you can find local partners, either in your shop or in your community, and pair with them. That was the fastest mode of learning for me. - Reading over the narrative in Programming Ruby can help, but I've got a lot of value out of reading over the class documentation for a particular class each day, in priority of usefulness for that class (so I started with String, Fixnum). - Relentless practice, especially by trying the class methods in IRB, has helped a lot. - Learning TDD--writing a test, writing just enough code to pass it, wrestling with the confusion, sorting it out, getting a success--has helped. - Why's Poignant Guide to Ruby (available online) appears to be the product of someone who dallied a little too much with the hallucinogens at some point, but it has helped. - writing tiny useful tools, exclusive of Watir, has helped a lot. The WOW! factor of accomplishing some useful little task, like searching a file for some text, or reformatting an error log to filter out the distractions, is unmatched. - learning regular expressions (partly through reading Mastering Regular Expressions, by Friedl) has helped a lot. - reading the forums (this one and the Ruby support forums) and participating in them, has helped. Finally, it's my intention to help with the Watir documentation, both internal and external (and I'm on the paved road to Hell, of course). If you have specific questions about something that's unclear or baffling to you, that will help to focus my efforts. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho Sent: Thursday, February 09, 2006 12:54 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Are there any References to Ruby/Watir written byTesters? Hello there, before everyone jumps all over me, please allow me to explain.. I have been evaluating Ruby and Watir for about a week now and I think it will do what we want it to. Not completely sure yet -- there are still some features to check out, but it's looking good. One thing that I have noticed is that it has been a struggle for me to do what I want with Ruby and Watir. That's because all the references are geared towards programmers and not testers. The Ruby Cheat Sheet is _almost_ close to being an exception. The only reference book I know is called "Programming Ruby, The Pragmatic Programmer's Guide"... *not* something like "Testing with Ruby, The Pragmatic Tester's Guide." You see, I know what I want to test, but the documentation is not structured in such a way as to help me accomplish that. It's kind of like wanting to drive to a different city and all I have for reference is a book with a description of all the road signs. So, if I didn't already know what direction to head in and the general rules of the road, the documentation alone certainly wouldn't help me get there. If I didn't have any prior programming experience and some familiarity with OO design, I'm pretty sure that I would have given up on evaluating Ruby & Watir after the first day. I'm persistent, if nothing else, and sometimes it pays off. Actually, if it weren't for this mailing list, I'm pretty sure that I wouldn't have gotten as far as I have. (Thank you all for your time and help, by the way.) The technical API reference is just about next to useless for me and I may as well be reading an Auto Mechanic's Guide in Esperanto. Quoting from the "Forward" of the "Pragmatic Programmer's Guide", "Ruby is designed to make programming not only easy, but also fun. It allows you to concentrate on the creative side of programming, with less stress." Hmm, ya, that's nice. I don't really care about the creative side of programming. I'm pretty sure that I'm being paid to be a creative *tester*, and not a creative programmer. Does Ruby/Watir help me do that? No, not really. I still haven't figured out how to structure a decent test case in Watir, let alone script it. I believe that there currently is a big gap between the users of Ruby & Watir and the rest of the Tester community who could probably be making use of it. The Ruby and Watir languages just aren't translated into Tester-speak. Does anyone know of any efforts, either planned or in-progress, to address this gap? If so, I would be very interested in participating in the review of the documentation. Heck, if I had the time and a lot more experience with Ruby & Watir, I'd write it myself! Please don't take this as a slight against Watir. I think that Watir is a tremendously important framework for Ruby, and without it I *know* that I wouldn't be evaluating Ruby right now. (Excellent job on the part of the developers and contributors who continue to improve and expand the framework. Please keep up the good work.) I just think that it would likely be more popular if the documentation was less programmer-centric. I know it would help me be more productive. Thoughts? Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/dfae13ae/attachment.html From thealy at midicorp.com Thu Feb 9 10:43:16 2006 From: thealy at midicorp.com (Thomas Healy) Date: Thu, 9 Feb 2006 10:43:16 -0500 Subject: [Wtr-general] Are there any References to Ruby/Watir written byTesters? Message-ID: <8EA615B25AB5F849BF0193B80E6D4C49800D27@MIDISERVER> I need to test some of our webproducts and websites in foreign languages and I'm having problems with testing using Asian characters (European characters seem ok)... I set the script to look for specific text like "?x?? ?????????? ???^?m??" --> (this is traditional Chinese for 'select "page forward" to continue') -- but it fails when run... Is there some sort of character setting I need to adjust in Watir? I have not tried the various possibilities but would it work better to change the search text to some encoding like Hexadecimal (\u9078\u53D6 \u300C\u4E0B\u4E00\u6B65\u300D \u4EE5\u7E7C\u7E8C\u3002) work better? Unsure what to do... Has anyone run into this yet? Thanks, Thom -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: Thursday, February 09, 2006 10:06 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Are there any References to Ruby/Watir written byTesters? This got kind of long. I hope it's helpful... On 2/8/06, Paul Carvalho <tester.paul at gmail.com> wrote: > That's because all the references are > geared towards programmers and not testers. Consider the possibility that there is less and less of a difference between them in the future. That is, all around us, programmers are developing testing skills, and testers are developing programming skills. Learning Ruby/Watir is a great way to start talking to programmers in their own language. > I'm persistent, if nothing else, and sometimes it pays off. Actually, > if it weren't for this mailing list, I'm pretty sure that I wouldn't > have gotten as far as I have. (Thank you all for your time and help, > by the way.) You sound like you're good at your job. As for the mail list, there is a long, long tradition in open source software of mail lists for people to discuss their problems, issues, solutions, gossip, etc. about the project. You're right, this list is exceptionally helpful, and it looks like you're using it to good effect. In other words, communities like this are the way open source software happens. Look at it another way: whether open source or commercial, you have to make an investment in the software. For a commercial project, you invest a lot of cash, which gives you the right to call an 800 number and get reams of documentation; for an open source project, you invest your time with the community, learning, helping, contributing. If not enough people pay a company, the company dies; if not enough people invest time in the open source project, the project dies. And answering questions from beginners is one of the most important things that helps an open source project grow. > I'm pretty sure that I'm being paid to be a creative *tester*, and not > a creative programmer. Does Ruby/Watir help me do that? No, not > really. I still haven't figured out how to structure a decent test > case in Watir, let alone script it. But you're learning fast, eh? So are the rest of us. Watir is designed to be used in exploring and creating as well as in a write-static-tests sort of way. If you haven't discovered the "get_foo" methods and "flash" methods yet, ask some more questions about how to use Watir in IRB. (BTW, also consider scripting the test(s) first, then structuring them. That's what "refactoring" is, and it's a powerful way to learn.) > I believe that there currently is a big gap between the users of Ruby > & Watir and the rest of the Tester community who could probably be > making use of it. The Ruby and Watir languages just aren't translated > into Tester-speak. The Pragmatic guys (http://www.pragmaticprogrammer.com/) will be publishing a book by Brian Marick (www.testing.com) in a few months called "Scripting for Testers (with Ruby)". It aims to be very much like what you describe, a resource for testers with little or no programming experience designed to help them solve common testing problems with scripts written in Ruby. It's divideded into alternating sections "walking the walk" and "talking the talk" that describe solving real-world problems, and programming practice respectively. Hopefully it'll help fill the gap you describe. Finally, to answer sort of an underlying theme, people here regularly bring up the issue that Watir doesn't have the bells-and-whistles of commercial testing tools: script recorders, clickable GUIs, convenient stuff like that. In fact, there is active resistance (or at least apathy) on this project to building these things-- mostly because the people that are capable of doing this work generally think that these sorts of features are the wrong way to do testing. On the flip side, if you see something that you think Watir needs-- ask for it. That's how I started with the project. I had no Ruby experience, and just a little Perl. In my first couple of weeks on this list I asked for about 20 new features-- and I got 'em. (Mostly to do with support for frames.) I hope you keep on with it, I think you're on the right track. Let me know if you want more information about open source, beginner resources, whatever... -Chris _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From brian at vallelunga.com Thu Feb 9 11:03:11 2006 From: brian at vallelunga.com (Brian Vallelunga) Date: Thu, 9 Feb 2006 11:03:11 -0500 Subject: [Wtr-general] Modifying Watir source Message-ID: <2362BCE2100B4B4491481E3C679919940B8CCE@brian.vallelunga.com> I have been using Watir for two days now and want to know about how to modify the source watir.rb file. I installed the one-click install of Watir. What did that do exactly? Does it install pre-compiled files, or is everything source-based? What I'm trying to do is modify the watir.rb file so that I can more easily use Watir with asp.net output. In much of my work, the name for a given text box will look something like this: ctl00$ctl00$TabPageContent$MainContent$ApplicationPage_UserDetails$nameT extBox What I'm really after is the last part of the name. In this case, "nameTextBox." While my "nameTextBox" won't change, the full name of the control will change if I rename anything higher up in the control tree, thus forcing me to do search and replaces for all of my watir scripts. So where do I actually go about modifying the Watir source? I downloaded the full source, but have no idea how to go about using my modified version rather than the installed version. It seems as though the key is in line 828 of watir.rb (version 1.4). Instead of matching the name or id attribute argument to the current object's name, I can have it match just the end of the string. Of course, I'm not sure how to go about doing that just yet, but I have a Ruby book on arrival today. Thanks for any help. Brian From thealy at midicorp.com Thu Feb 9 11:15:40 2006 From: thealy at midicorp.com (Thomas Healy) Date: Thu, 9 Feb 2006 11:15:40 -0500 Subject: [Wtr-general] Are there any References to Ruby/WatirwrittenbyTesters? Message-ID: <8EA615B25AB5F849BF0193B80E6D4C49800D28@MIDISERVER> Michael, "Imagine trying to create an automated spelling and grammar checker without really *learning* English." --> Actually, No... that is a programmers job... I am not making the spelling checker... I am checking that the spell checker catches all the mis-spellings on the page... ... I really don't concern myself with how it works... only THAT the spell checker works... In a similar vein... I am looking to create testing tools that checks a feature on a page... click here... look for text there... fill in that box... move this widget to an x/y spot on the page... etc... I am not so concerned with what the functions do or how they do them... my focus ... is that when I need to click a submit button I cut and past $ie.button(:name, "submit").click when I want to close the testing page, I source in and call a function I found the other day... def close_it # close all open ie windows all_closed = 'unknown' while (all_closed != 'yes') begin #use a regexp that will match any title so all ie windows are forced closed header = Regexp.new(//) @ie = IE.attach(:title, header) @ie.close # catch the exception raised when there's now window to attach to. rescue NoMatchingWindowFoundException all_closed = 'yes' end end end All I really want to do is use these "helper files" or examples to cut and paste into a script page... so when I want to test for a feature... I cut and paste in some specific script to do the task... As there does not seem to be a prebuilt list of them... I am finding I have to build them to get the job done... What I think I was looking for is that it would be nice if these types of files were already gathered up in a place already... Just a list of these helper files cut and pasted in the right order should get the work done... Like my Honda Element -- an internal combustion engine -- I use in the morning to get to work... I really don't want to worry too much about HOW it functions ... just THAT it functions... Thom ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Michael Bolton Sent: Thursday, February 09, 2006 10:32 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Are there any References to Ruby/WatirwrittenbyTesters? > I purchased the Dave Thomas Book -- Programming Ruby -- and it is a good reference but unfortunately... your description is very apt... (I laughed when I read) it shows description of the street signs ... (I was not able to sum it up like that but I had similar feelings)... I have a brief programming background and relatively understand the OO reference but don't have the time to really *learn* Ruby. If that's really the case, you should reconsider using test automation in general and WATIR in particular. Imagine trying to create an automated spelling and grammar checker without really *learning* English. (Yes, the metaphor is a little mixed, but useful, I hope.) If you want automation to assist the testing effort effectively, you'll need to meet it on its own terms, and that means recognizing that automating tests is a software development project. See below for some things that have helped. > I keep looking for easy answers / prebuilt scripts or other things that will make my Watir QA tasks easier to complete. I have not found them yet and keep plugging away at my Watir scripts. Some people here gave me some feed back on a script I wrote the other day and some of the ideas helped in planning future scripts... Although, I guess I just did not get some of the modifications suggested. Questioning, rapid learning, and communicating problems effectively are important testing skills. Learning a programming language thoroughly will serve you well as a tester. Although you'll make mistakes--lots of them--,the process will give you insight into the kinds of mistakes that programmers make, which is an important beneficial side effect. > My focus is on making the scripts as readable as possible, making the scripts as easy to pick up six months from now and just pick up and go with them. That's /great/. and an important first step. Would that all programmers were always so pragmatic and focused on the future! It's easy, apparently, for programmers to forget that the program is only partially written for the machine; it's also written for the benefit of the poor sucker that has to maintain it. > What I really want to do is test, not write scripts or have to remember what the script does. I understand that, but if you want to use automation to assist you in testing, you can't really have one without the other. Again, to stretch a metaphor, it's like wanting to be a film critic without reading other film criticism or taking notes. > I agree... Watir / Ruby, good... process, good... this e-mail resource, good... learning curve, steep... the resource I could use is a repository of examples geared more to a QA tester like me... perhaps I will have to start to make a website for it... This would be a great step. You might also be interested in Brian Marick's forthcoming book, Scripting for Testers. Here are the things that helped for me: - See if you can find local partners, either in your shop or in your community, and pair with them. That was the fastest mode of learning for me. - Reading over the narrative in Programming Ruby can help, but I've got a lot of value out of reading over the class documentation for a particular class each day, in priority of usefulness for that class (so I started with String, Fixnum). - Relentless practice, especially by trying the class methods in IRB, has helped a lot. - Learning TDD--writing a test, writing just enough code to pass it, wrestling with the confusion, sorting it out, getting a success--has helped. - Why's Poignant Guide to Ruby (available online) appears to be the product of someone who dallied a little too much with the hallucinogens at some point, but it has helped. - writing tiny useful tools, exclusive of Watir, has helped a lot. The WOW! factor of accomplishing some useful little task, like searching a file for some text, or reformatting an error log to filter out the distractions, is unmatched. - learning regular expressions (partly through reading Mastering Regular Expressions, by Friedl) has helped a lot. - reading the forums (this one and the Ruby support forums) and participating in them, has helped. Finally, it's my intention to help with the Watir documentation, both internal and external (and I'm on the paved road to Hell, of course). If you have specific questions about something that's unclear or baffling to you, that will help to focus my efforts. ---Michael B. ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho Sent: Thursday, February 09, 2006 12:54 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Are there any References to Ruby/Watir written byTesters? Hello there, before everyone jumps all over me, please allow me to explain.. I have been evaluating Ruby and Watir for about a week now and I think it will do what we want it to. Not completely sure yet -- there are still some features to check out, but it's looking good. One thing that I have noticed is that it has been a struggle for me to do what I want with Ruby and Watir. That's because all the references are geared towards programmers and not testers. The Ruby Cheat Sheet is _almost_ close to being an exception. The only reference book I know is called "Programming Ruby, The Pragmatic Programmer's Guide"... *not* something like "Testing with Ruby, The Pragmatic Tester's Guide." You see, I know what I want to test, but the documentation is not structured in such a way as to help me accomplish that. It's kind of like wanting to drive to a different city and all I have for reference is a book with a description of all the road signs. So, if I didn't already know what direction to head in and the general rules of the road, the documentation alone certainly wouldn't help me get there. If I didn't have any prior programming experience and some familiarity with OO design, I'm pretty sure that I would have given up on evaluating Ruby & Watir after the first day. I'm persistent, if nothing else, and sometimes it pays off. Actually, if it weren't for this mailing list, I'm pretty sure that I wouldn't have gotten as far as I have. (Thank you all for your time and help, by the way.) The technical API reference is just about next to useless for me and I may as well be reading an Auto Mechanic's Guide in Esperanto. Quoting from the "Forward" of the "Pragmatic Programmer's Guide", "Ruby is designed to make programming not only easy, but also fun. It allows you to concentrate on the creative side of programming, with less stress." Hmm, ya, that's nice. I don't really care about the creative side of programming. I'm pretty sure that I'm being paid to be a creative *tester*, and not a creative programmer. Does Ruby/Watir help me do that? No, not really. I still haven't figured out how to structure a decent test case in Watir, let alone script it. I believe that there currently is a big gap between the users of Ruby & Watir and the rest of the Tester community who could probably be making use of it. The Ruby and Watir languages just aren't translated into Tester-speak. Does anyone know of any efforts, either planned or in-progress, to address this gap? If so, I would be very interested in participating in the review of the documentation. Heck, if I had the time and a lot more experience with Ruby & Watir, I'd write it myself! Please don't take this as a slight against Watir. I think that Watir is a tremendously important framework for Ruby, and without it I *know* that I wouldn't be evaluating Ruby right now. (Excellent job on the part of the developers and contributors who continue to improve and expand the framework. Please keep up the good work.) I just think that it would likely be more popular if the documentation was less programmer-centric. I know it would help me be more productive. Thoughts? Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/f173fbe9/attachment.html From Mark_Cain at rl.gov Thu Feb 9 11:33:05 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Thu, 9 Feb 2006 08:33:05 -0800 Subject: [Wtr-general] Are there any References to Ruby/Watir written byTesters? Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D560@EX5V.rl.gov> My $.02 I have found the unittests invaluable for leaning a Watir as well as automation test case structure. I have ripped-off...borrowed...some much from that source, and customized for my need, I can't even begin to tell you! The learning curve can be steep down the automation path, but if you are like me and have to repeat running test cases that you know could be automated, when it is worth it! Especially if you don't get enough time to adequately test what you have to right now, using 'personal slaves' like Watir, Selenium, Ruby, etc, to help you do your job better, is working smarter not harder! A recurring theme throughout this tread is to start small-and oh how true that is. Start out small, if you have text fields on your page look at the unittests for text fields (textfileds*.rb and textAreafields*.rb), see how to use them and swipe whatever code you find useful-changing attribute names to match you're your target test. Get that working and then expand. Before you know it you will have a solid group of reusable tests. You can always 'refactor' your test as your skills improve. Two very useful Watir methods I have found are "show_all_objects" and "flash" you can find these listed in the Watir API doc installed with Watir. One last note, monitor this site and you will see postings of utilities, code snippets, better ways of doing things, breakthroughs others have, links to useful resources, etc. Whenever I see something I think might be useful now or later, I save it off, name it something useful I will remember later, and keep it a working folder-and use it all the time. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho Sent: Wednesday, February 08, 2006 9:54 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Are there any References to Ruby/Watir written byTesters? Hello there, before everyone jumps all over me, please allow me to explain.. I have been evaluating Ruby and Watir for about a week now and I think it will do what we want it to. Not completely sure yet -- there are still some features to check out, but it's looking good. One thing that I have noticed is that it has been a struggle for me to do what I want with Ruby and Watir. That's because all the references are geared towards programmers and not testers. The Ruby Cheat Sheet is _almost_ close to being an exception. The only reference book I know is called "Programming Ruby, The Pragmatic Programmer's Guide"... *not* something like "Testing with Ruby, The Pragmatic Tester's Guide." You see, I know what I want to test, but the documentation is not structured in such a way as to help me accomplish that. It's kind of like wanting to drive to a different city and all I have for reference is a book with a description of all the road signs. So, if I didn't already know what direction to head in and the general rules of the road, the documentation alone certainly wouldn't help me get there. If I didn't have any prior programming experience and some familiarity with OO design, I'm pretty sure that I would have given up on evaluating Ruby & Watir after the first day. I'm persistent, if nothing else, and sometimes it pays off. Actually, if it weren't for this mailing list, I'm pretty sure that I wouldn't have gotten as far as I have. (Thank you all for your time and help, by the way.) The technical API reference is just about next to useless for me and I may as well be reading an Auto Mechanic's Guide in Esperanto. Quoting from the "Forward" of the "Pragmatic Programmer's Guide", "Ruby is designed to make programming not only easy, but also fun. It allows you to concentrate on the creative side of programming, with less stress." Hmm, ya, that's nice. I don't really care about the creative side of programming. I'm pretty sure that I'm being paid to be a creative *tester*, and not a creative programmer. Does Ruby/Watir help me do that? No, not really. I still haven't figured out how to structure a decent test case in Watir, let alone script it. I believe that there currently is a big gap between the users of Ruby & Watir and the rest of the Tester community who could probably be making use of it. The Ruby and Watir languages just aren't translated into Tester-speak. Does anyone know of any efforts, either planned or in-progress, to address this gap? If so, I would be very interested in participating in the review of the documentation. Heck, if I had the time and a lot more experience with Ruby & Watir, I'd write it myself! Please don't take this as a slight against Watir. I think that Watir is a tremendously important framework for Ruby, and without it I *know* that I wouldn't be evaluating Ruby right now. (Excellent job on the part of the developers and contributors who continue to improve and expand the framework. Please keep up the good work.) I just think that it would likely be more popular if the documentation was less programmer-centric. I know it would help me be more productive. Thoughts? Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/478474c0/attachment.html From bret at pettichord.com Thu Feb 9 11:30:25 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 9 Feb 2006 10:30:25 -0600 Subject: [Wtr-general] Modifying Watir source In-Reply-To: <2362BCE2100B4B4491481E3C679919940B8CCE@brian.vallelunga.com> References: <2362BCE2100B4B4491481E3C679919940B8CCE@brian.vallelunga.com> Message-ID: <ade75c5b0602090830t631c8831i229682ccf7412105@mail.gmail.com> If you want to go ahead and change your copy of watir.rb, just go ahead and do it. Just edit your file. There is no compiling or anything that you need to do other than that. However, in the specific case you mention, Watir already has the functionality you want. Try ie.text_field(:name, /nameTextBox$/).set("whatever") Bret On 2/9/06, Brian Vallelunga <brian at vallelunga.com> wrote: > > I have been using Watir for two days now and want to know about how to > modify the source watir.rb file. I installed the one-click install of > Watir. What did that do exactly? Does it install pre-compiled files, or > is everything source-based? > > What I'm trying to do is modify the watir.rb file so that I can more > easily use Watir with asp.net output. In much of my work, the name for a > given text box will look something like this: > > ctl00$ctl00$TabPageContent$MainContent$ApplicationPage_UserDetails$nameT > extBox > > What I'm really after is the last part of the name. In this case, > "nameTextBox." While my "nameTextBox" won't change, the full name of the > control will change if I rename anything higher up in the control tree, > thus forcing me to do search and replaces for all of my watir scripts. > > So where do I actually go about modifying the Watir source? I downloaded > the full source, but have no idea how to go about using my modified > version rather than the installed version. > > It seems as though the key is in line 828 of watir.rb (version 1.4). > Instead of matching the name or id attribute argument to the current > object's name, I can have it match just the end of the string. Of > course, I'm not sure how to go about doing that just yet, but I have a > Ruby book on arrival today. > > Thanks for any help. > > Brian > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/16a6bf44/attachment.html From angrez at gmail.com Thu Feb 9 11:32:03 2006 From: angrez at gmail.com (Angrez Singh) Date: Thu, 9 Feb 2006 22:02:03 +0530 Subject: [Wtr-general] Modifying Watir source In-Reply-To: <2362BCE2100B4B4491481E3C679919940B8CCE@brian.vallelunga.com> References: <2362BCE2100B4B4491481E3C679919940B8CCE@brian.vallelunga.com> Message-ID: <e26bda3e0602090832k7a26d57dgec72bd4edffd87ae@mail.gmail.com> Hi Brian, Just a thought, how about using regular expressions for matching name of such controls, whose value changes upon the way they are embedded inside the other controls? In that way you don't have to change the watir.rb file. Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/4e0956fb/attachment.html From brian at vallelunga.com Thu Feb 9 11:45:59 2006 From: brian at vallelunga.com (Brian Vallelunga) Date: Thu, 9 Feb 2006 11:45:59 -0500 Subject: [Wtr-general] Modifying Watir source Message-ID: <2362BCE2100B4B4491481E3C679919940B8CD0@brian.vallelunga.com> Excellent! Thank you very much. This makes my life a whole lot easier. I realize the "/" signifies the start and end of a regex, but What does the $ mean? Brian ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Thursday, February 09, 2006 11:30 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Modifying Watir source If you want to go ahead and change your copy of watir.rb, just go ahead and do it. Just edit your file. There is no compiling or anything that you need to do other than that. However, in the specific case you mention, Watir already has the functionality you want. Try ie.text_field(:name, /nameTextBox$/).set("whatever") Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/e398296d/attachment.html From brian at vallelunga.com Thu Feb 9 12:47:32 2006 From: brian at vallelunga.com (Brian Vallelunga) Date: Thu, 9 Feb 2006 12:47:32 -0500 Subject: [Wtr-general] Declarative Watir scripts? Message-ID: <2362BCE2100B4B4491481E3C679919940B8CD3@brian.vallelunga.com> As I was typing in line 261 of very basic and repetitive Watir code, I that much of this scripting should be able to be done declaratively, especially when using the scripts to simply input values and check responses. Has anyone done anything like this? I envision an XML action list like: <watirActions> <action type='text_field' how='id' method='set' what='dateOfBirthTextBox' value='01/01/1980' /> <action type='select_list' how='id' method='select' what='stateDropDown' value='CA' /> <action type='button' how='value' method='click' what='Submit' /> <action type='expect_text' value='You live in California' /> <action type='expect_html' value='<b>Birthdate: 01/01/1980</b>' /> </watirActions> While this isn't much shorter than the actual script, it would allow for automation opportunities. I envision being able to point a program at an existing (completed) web page and have it analyze the page and generate most of this code. This sort of approach seems a natural extension of the Watir framework and I'm curious if anyone has attempted something like this? Thanks, Brian From sergio.pinon at us.g4s.com Thu Feb 9 13:00:00 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Thu, 9 Feb 2006 10:00:00 -0800 Subject: [Wtr-general] Declarative Watir scripts? Message-ID: <6554B86C58B86F43B66363ED5CF6ED05011116A6@bugatti.ems.securicor.com> Brian, I have been working on something exactly like this. And that tool you mentioned at the end of your posting would be perfect companion for it. Take a look and let me know how you think we can improve it. Right now I only use it for my company internally but I have no problems sharing it with others. Here is the source that I have been working from. Sergio -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Brian Vallelunga Sent: Thursday, February 09, 2006 9:48 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Declarative Watir scripts? As I was typing in line 261 of very basic and repetitive Watir code, I that much of this scripting should be able to be done declaratively, especially when using the scripts to simply input values and check responses. Has anyone done anything like this? I envision an XML action list like: <watirActions> <action type='text_field' how='id' method='set' what='dateOfBirthTextBox' value='01/01/1980' /> <action type='select_list' how='id' method='select' what='stateDropDown' value='CA' /> <action type='button' how='value' method='click' what='Submit' /> <action type='expect_text' value='You live in California' /> <action type='expect_html' value='<b>Birthdate: 01/01/1980</b>' /> </watirActions> While this isn't much shorter than the actual script, it would allow for automation opportunities. I envision being able to point a program at an existing (completed) web page and have it analyze the page and generate most of this code. This sort of approach seems a natural extension of the Watir framework and I'm curious if anyone has attempted something like this? Thanks, Brian _______________________________________________ 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: testing framework.zip Type: application/x-zip-compressed Size: 12027 bytes Desc: testing framework.zip Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060209/68ef27d0/attachment.bin From mb at michaelbolton.net Thu Feb 9 13:36:20 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Thu, 9 Feb 2006 13:36:20 -0500 Subject: [Wtr-general] Are there any References toRuby/WatirwrittenbyTesters? In-Reply-To: <8EA615B25AB5F849BF0193B80E6D4C49800D28@MIDISERVER> Message-ID: <009301c62da7$b8c6ea30$6801a8c0@Koko> Michael, >> "Imagine trying to create an automated spelling and grammar checker without really *learning* English." >Actually, No... that is a programmers job... I am not making the spelling checker... I am checking that the spell checker catches all the mis-spellings on the page... > ... I really don't concern myself with how it works... only THAT the spell checker works... Actually, no. I mentioned that the metaphor was a stretch. My point is this: test automation is an oracle--that is, a principle or mechanism by which we recognize a problem. The less you know about your oracle, about your principle or mechanism, the greater the chance that you will miss something important. If you didn't know, for example, that the spelling checker works merely by comparing each word in your document to a list of existing words, you might ascribe more intelligence to the spelling checker than you ought, and sir ten words wood get miss spelled, and ewe wood knot no a thing about it. > In a similar vein... I am looking to create testing tools that checks a feature on a page... click here... look for text there... fill in that box... move this widget to an x/y spot on the page... etc... How do you expect to do this /reliably/ if you don't know how to instruct the machine to do it? You can cut and paste all you like, but the more you do so, the more you abdicate the testing task--the performance and intelligent evaluation of the test--to the machine. In my view, that's exactly the problem with the way many testers do automation; they let the machine do the thinking for them. Bear in mind that I'm a noted automation skeptic for precisely this reason. If we're going to deploy automation, we should do it wisely and well. > Like my Honda Element -- an internal combustion engine -- I use in the morning to get to work... I really don't want to worry too much about HOW it functions ... just THAT it functions... I remember my mom using that metaphor with respect to her computer. A few years later, she started selling software. My response (which was apparently effective) was that she didn't need to learn how the engine functioned, but she did need to be comfortable with the controls on the dashboard, finding the gas tank, checking the oil, and making sure the wiper fluid was topped up. She needed to know how to control the car, not count on it to drive her to work. I'll own that we're talking about a bit more of a commitment here than you might want to make. My concern would be that if you don't know a sufficient amount about HOW it functions, you won't know THAT it's functioning in a way that /doesn't/ meet your needs, or that misleads you into thinking that you're doing better testing than you are. My father-in-law afforded a great example of this recently. He was using my power drill, and he had misplaced the bit such that the bit wasn't perpendicular to the chuck, and the clutch on the drill was making a terrible noise. Since he wasn't familiar with the proper operation of the drill, the damage that he was doing to the drill, the bit, the screw, the wall, and so on. This wasn't a matter of him knowing about the internals; it was a matter of knowing how to use the tool. WATIR is like a debugger, in that debuggers neither find nor fix your bugs; YOU do that. Rest assured, though, that learning Ruby is one of the more pleasant experiences you'll have learning a programming language. And you might want to review the list of helpful things that I posted in the original message. ---Michael B. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/99201b1f/attachment.html From Bill.Attebery at twtelecom.com Thu Feb 9 13:43:52 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Thu, 9 Feb 2006 11:43:52 -0700 Subject: [Wtr-general] Access denied problem is driving me nuts Message-ID: <D18A8D68994F3F45AAAC8E6277B710870192BDDC@edith.ad.twtelecom.com> This is in response to Access denied problem is driving me nuts dated Jan 19, 2006: I'm new to watir and ruby and am currently checking it's feasibility against some of our in-house applications, one of the apps uses frames and most of the workarounds that I found on the forums didn't seem to help or didn't meet my needs. I'm not sure what's going on under the hood exactly and why the 'cross-site scripting' would apply to my particular application since it seems that all the content is coming from the same location -- but my symptoms were the same. The latest workaround I found posted -- basically aliasing the domain in the hosts file worked like a charm. I also stumbled onto another while working with this -- if I put the domain of the webpage that's causing problems into my 'Trusted Sites' in IE settings, it also gets around the 'Access denied' problems with frames. I suspect this may be cleaner because anytime that domain is used it should be covered, whereas with the alias I suspect that if a fully qualified URL is used at some point (say by accessing an application link) that you could run into issues again. E.g. If my URL is "http://testserver.twtelecom.com:5005/<application>" and I put "testserver.twtelcom.com" into my trusted sites, I can access and work with the frames with no problems (at least, so far). Anyway, not sure if this works in all the 'cross-site scripting' situations, but just FYI if someone does get that wiki going. :-) Thanks for all the help -- great tool and great forum. Bill The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/0ad5a2be/attachment.html From christopher.mcmahon at gmail.com Thu Feb 9 13:45:13 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 9 Feb 2006 12:45:13 -0600 Subject: [Wtr-general] Are there any References toRuby/WatirwrittenbyTesters? In-Reply-To: <009301c62da7$b8c6ea30$6801a8c0@Koko> References: <8EA615B25AB5F849BF0193B80E6D4C49800D28@MIDISERVER> <009301c62da7$b8c6ea30$6801a8c0@Koko> Message-ID: <72799cd70602091045u4c0474ew1013afac9d5e054f@mail.gmail.com> > WATIR is like a debugger, in that debuggers neither find nor fix your bugs; > YOU do that. Rest assured, though, that learning Ruby is one of the more > pleasant experiences you'll have learning a programming language. And you > might want to review the list of helpful things that I posted in the > original message. It's also worth mentioning that you could do everything Watir does in raw Win32OLE commands, VB, C#, or anything else that knows how to talk to Windows under the GUI. Watir is just a convenient way to muck around with Win32OLE. And the Win32OLE interface is so unpleasant that almost no one uses it directly. -Chris From thealy at midicorp.com Thu Feb 9 13:51:24 2006 From: thealy at midicorp.com (Thomas Healy) Date: Thu, 9 Feb 2006 13:51:24 -0500 Subject: [Wtr-general] Declarative Watir scripts? Message-ID: <8EA615B25AB5F849BF0193B80E6D4C49800D34@MIDISERVER> Thanks Sergio... That is perfect... Exactly what I am looking for... A canned set of scripts to do web testing... No fuss, no muss... Regards, Thom -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Thursday, February 09, 2006 1:00 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Declarative Watir scripts? Brian, I have been working on something exactly like this. And that tool you mentioned at the end of your posting would be perfect companion for it. Take a look and let me know how you think we can improve it. Right now I only use it for my company internally but I have no problems sharing it with others. Here is the source that I have been working from. Sergio -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Brian Vallelunga Sent: Thursday, February 09, 2006 9:48 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Declarative Watir scripts? As I was typing in line 261 of very basic and repetitive Watir code, I that much of this scripting should be able to be done declaratively, especially when using the scripts to simply input values and check responses. Has anyone done anything like this? I envision an XML action list like: <watirActions> <action type='text_field' how='id' method='set' what='dateOfBirthTextBox' value='01/01/1980' /> <action type='select_list' how='id' method='select' what='stateDropDown' value='CA' /> <action type='button' how='value' method='click' what='Submit' /> <action type='expect_text' value='You live in California' /> <action type='expect_html' value='<b>Birthdate: 01/01/1980</b>' /> </watirActions> While this isn't much shorter than the actual script, it would allow for automation opportunities. I envision being able to point a program at an existing (completed) web page and have it analyze the page and generate most of this code. This sort of approach seems a natural extension of the Watir framework and I'm curious if anyone has attempted something like this? Thanks, Brian _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Thu Feb 9 13:50:34 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 9 Feb 2006 12:50:34 -0600 Subject: [Wtr-general] Access denied problem is driving me nuts In-Reply-To: <D18A8D68994F3F45AAAC8E6277B710870192BDDC@edith.ad.twtelecom.com> References: <D18A8D68994F3F45AAAC8E6277B710870192BDDC@edith.ad.twtelecom.com> Message-ID: <72799cd70602091050p4d2c3c6cp73a7def778815637@mail.gmail.com> > if I put the domain of the webpage that's causing problems into my > 'Trusted Sites' in IE settings, it also gets around the 'Access denied' > problems with frames. > For test purposes, I always have my IE set to the lowest possible security. This eliminates a lot of trouble. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/00e4989c/attachment.html From ChintakrindiMeghana at managementdynamics.com Thu Feb 9 13:58:04 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Thu, 9 Feb 2006 13:58:04 -0500 Subject: [Wtr-general] Using Watir/Ruby scripts Message-ID: <6CF3AA425295C7479483AC0018EDF98B01DADF8B@MI8NYCMAIL03.Mi8.com> Hi I hear that many companies uses shell scripts(using bourne shell or any other ...) in the testing cycle. So, my question is can we use watir/ruby scripts instead of these. Thanks Meghanath -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/109d46a6/attachment.html From PGarigue at EXTEND.COM Thu Feb 9 14:09:10 2006 From: PGarigue at EXTEND.COM (Pierre Garigue) Date: Thu, 9 Feb 2006 14:09:10 -0500 Subject: [Wtr-general] Using Watir/Ruby scripts Message-ID: <C629A6599EAF2B4C97CC314771BC292C04B69ABA@mail.extend.com> you can certainly use Ruby for testing other things than web sites. It detepends what you want to do regression testing on. have a look at http://rubyforge.org/ Cheers Pierre -----Original Message----- From: Chintakrindi Meghanath [mailto:ChintakrindiMeghana at managementdynamics.com] Sent: Thursday, February 09, 2006 1:58 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Using Watir/Ruby scripts Hi I hear that many companies uses shell scripts(using bourne shell or any other ...) in the testing cycle. So, my question is can we use watir/ruby scripts instead of these. Thanks Meghanath -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/6af98e12/attachment.html From billagee at gmail.com Thu Feb 9 14:32:58 2006 From: billagee at gmail.com (Bill Agee) Date: Thu, 9 Feb 2006 11:32:58 -0800 Subject: [Wtr-general] Declarative Watir scripts? In-Reply-To: <2362BCE2100B4B4491481E3C679919940B8CD3@brian.vallelunga.com> References: <2362BCE2100B4B4491481E3C679919940B8CD3@brian.vallelunga.com> Message-ID: <73e7817e0602091132u18a3c7dfkd3cc6fb9e12afd30@mail.gmail.com> On 2/9/06, Brian Vallelunga <brian at vallelunga.com> wrote: > As I was typing in line 261 of very basic and repetitive Watir code, I > that much of this scripting should be able to be done declaratively, > especially when using the scripts to simply input values and check > responses. Has anyone done anything like this? I currently use a little homebrew framework like this. I just have a big batch of XML files that contain elements like <button name="name" method="click" /> and so forth, contained inside <step> elements, and a driver script that parses the XML files and turns the contents into Watir statements. For complex cases that require more code (like popup handling) I just make special tags whose name correspond to methods that contain the special case code. However, I'm strongly considering a change, using Test::Unit instead of continuing with my own stuff. This is because I'm trying to figure out the best way to hand over the framework to the dev team to use, and my module for handling my XML files feels kind of kludgey. I also don't want people to have to discover limitations with my XML format and have to hack on that to handle new cases. Also, using a standard unit testing format rather than something I threw together will probably be more appealing to the dev staff where I work. :) On the other hand, not using the XML config files will probably make for a steeper learning curve. The tradeoffs are interesting. There's also WET (http://wet.qantom.org/overview.html) which I haven't looked at in depth, but might be applicable for what you want. Thanks Bill From thealy at midicorp.com Thu Feb 9 14:35:03 2006 From: thealy at midicorp.com (Thomas Healy) Date: Thu, 9 Feb 2006 14:35:03 -0500 Subject: [Wtr-general] Specific Functions Message-ID: <8EA615B25AB5F849BF0193B80E6D4C49800D38@MIDISERVER> Does anyone know how to detect if a video is playing on a webpage (and the path for the video -- duration of the video)... We frequently change this event, depending on the client, and I need to be able to log what is happening on the page I check... I am very aware of the AV object we use on the page... Our av object ("AV") we create has the properties AV.htmlCtrls.play, .pause, .stop, etc... It also have the property .path... But how would I capture this to log? Thanks, Thom -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Thomas Healy Sent: Thursday, February 09, 2006 1:51 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Declarative Watir scripts? Thanks Sergio... That is perfect... Exactly what I am looking for... A canned set of scripts to do web testing... No fuss, no muss... Regards, Thom -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sergio Pinon Sent: Thursday, February 09, 2006 1:00 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Declarative Watir scripts? Brian, I have been working on something exactly like this. And that tool you mentioned at the end of your posting would be perfect companion for it. Take a look and let me know how you think we can improve it. Right now I only use it for my company internally but I have no problems sharing it with others. Here is the source that I have been working from. Sergio -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Brian Vallelunga Sent: Thursday, February 09, 2006 9:48 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Declarative Watir scripts? As I was typing in line 261 of very basic and repetitive Watir code, I that much of this scripting should be able to be done declaratively, especially when using the scripts to simply input values and check responses. Has anyone done anything like this? I envision an XML action list like: <watirActions> <action type='text_field' how='id' method='set' what='dateOfBirthTextBox' value='01/01/1980' /> <action type='select_list' how='id' method='select' what='stateDropDown' value='CA' /> <action type='button' how='value' method='click' what='Submit' /> <action type='expect_text' value='You live in California' /> <action type='expect_html' value='<b>Birthdate: 01/01/1980</b>' /> </watirActions> While this isn't much shorter than the actual script, it would allow for automation opportunities. I envision being able to point a program at an existing (completed) web page and have it analyze the page and generate most of this code. This sort of approach seems a natural extension of the Watir framework and I'm curious if anyone has attempted something like this? Thanks, Brian _______________________________________________ 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 ChintakrindiMeghana at managementdynamics.com Thu Feb 9 14:38:49 2006 From: ChintakrindiMeghana at managementdynamics.com (Chintakrindi Meghanath ) Date: Thu, 9 Feb 2006 14:38:49 -0500 Subject: [Wtr-general] Using Watir/Ruby scripts Message-ID: <6CF3AA425295C7479483AC0018EDF98B01DADF8C@MI8NYCMAIL03.Mi8.com> Hi Thanks, my next question is what are the advantages using ruby/watir scripts rather than conventional shell scripts Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Pierre Garigue Sent: Thursday, February 09, 2006 2:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Using Watir/Ruby scripts you can certainly use Ruby for testing other things than web sites. It detepends what you want to do regression testing on. have a look at http://rubyforge.org/ Cheers Pierre -----Original Message----- From: Chintakrindi Meghanath [mailto:ChintakrindiMeghana at managementdynamics.com] Sent: Thursday, February 09, 2006 1:58 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Using Watir/Ruby scripts Hi I hear that many companies uses shell scripts(using bourne shell or any other ...) in the testing cycle. So, my question is can we use watir/ruby scripts instead of these. Thanks Meghanath -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/1dc1d87e/attachment.html From PGarigue at EXTEND.COM Thu Feb 9 14:51:49 2006 From: PGarigue at EXTEND.COM (Pierre Garigue) Date: Thu, 9 Feb 2006 14:51:49 -0500 Subject: [Wtr-general] Using Watir/Ruby scripts Message-ID: <C629A6599EAF2B4C97CC314771BC292C04CAC2B1@mail.extend.com> For example people have been using Perl rather than Bash for system admin for years. Traditionally people using Bash have use a lot of other languages such as sed and awk to do their work. the main advantages of using a langauge like Perl or Ruby are: * portability over operating systems (if you know how to write then to be so) * access to modules for doing any kind of things directly within the language. Cheers Pierre -----Original Message----- From: Chintakrindi Meghanath [mailto:ChintakrindiMeghana at managementdynamics.com] Sent: Thursday, February 09, 2006 2:39 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Using Watir/Ruby scripts Hi Thanks, my next question is what are the advantages using ruby/watir scripts rather than conventional shell scripts Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Pierre Garigue Sent: Thursday, February 09, 2006 2:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Using Watir/Ruby scripts you can certainly use Ruby for testing other things than web sites. It detepends what you want to do regression testing on. have a look at http://rubyforge.org/ Cheers Pierre -----Original Message----- From: Chintakrindi Meghanath [mailto:ChintakrindiMeghana at managementdynamics.com] Sent: Thursday, February 09, 2006 1:58 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Using Watir/Ruby scripts Hi I hear that many companies uses shell scripts(using bourne shell or any other ...) in the testing cycle. So, my question is can we use watir/ruby scripts instead of these. Thanks Meghanath -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/5890408e/attachment.html From hgs at dmu.ac.uk Thu Feb 9 15:00:28 2006 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Thu, 9 Feb 2006 20:00:28 +0000 (WET) Subject: [Wtr-general] Declarative Watir scripts? In-Reply-To: <73e7817e0602091132u18a3c7dfkd3cc6fb9e12afd30@mail.gmail.com> References: <2362BCE2100B4B4491481E3C679919940B8CD3@brian.vallelunga.com> <73e7817e0602091132u18a3c7dfkd3cc6fb9e12afd30@mail.gmail.com> Message-ID: <Pine.GSO.4.64.0602091953400.20514@brains.eng.cse.dmu.ac.uk> On Thu, 9 Feb 2006, Bill Agee wrote: > On the other hand, not using the XML config files will probably make > for a steeper learning curve. The tradeoffs are interesting. Why is this, do you think? OK, XML syntax is pretty standard, but the semantics will have to be learned. At least with Ruby you can add new methods which wrap behaviour, if you wish to simplify common cases. Which aspects of the Ruby syntax present difficulties for the newcomer? I could probably have told you a few years back, but now I'm fairly used to it, and in the domain of testing, I cannot consider this to be obvious. But it may be that commonly confusing cases may be re-written to be clear. Hugh From rosecao at us.ibm.com Thu Feb 9 15:04:49 2006 From: rosecao at us.ibm.com (Rose Cao) Date: Thu, 9 Feb 2006 13:04:49 -0700 Subject: [Wtr-general] Ruby on AIX In-Reply-To: <f57e5a0e0602081935o120cbe83m@mail.gmail.com> Message-ID: <OF605DB5A5.1E75645F-ON87257110.006D9840-87257110.006E0BB5@us.ibm.com> Eduardo, You are right. I too realized it after posting the email to this mailing list. Yes, I am working on another way to solve the problems now. a. have some kind of scheduling tool which can do event-based scheduling on Windows server b. have home-growing scheduling (Have some kind of Lotus Notes agent to read the notification of the completion of other jobs, then trigger the script). F.Y.I, I successfully scheduled the scripts in Windows through winBatch file which is time-based scheduling right now. Thanks, Rose Eduardo Rocha <eduardorochabr at g mail.com> To Sent by: wtr-general at rubyforge.org wtr-general-bounc cc es at rubyforge.org Subject Re: [Wtr-general] Ruby on AIX 02/08/2006 08:35 PM Please respond to wtr-general Rose, Unfortunately, even if you successfully installs ruby on AIX, Watir currently only runs on Windows. []'s Eduardo 2006/2/8, Rose Cao <rosecao at us.ibm.com>: > > > The scripts are running on Windows. But it is personal desktop. In order to > schedule the scripts on server, need install Ruby to server which is AIX > box. I found one binary Ruby > @http://www.bullfreeware.com/download/aix52/ruby-1.8.2.0.bff. > For caution, can anyone give some suggestions on use of the AIX version of > Ruby? Or are there any documents on it? > > Thanks, > Rose > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/cf17d1f8/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/20060209/cf17d1f8/attachment.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: pic23485.gif Type: image/gif Size: 1255 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060209/cf17d1f8/attachment-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/20060209/cf17d1f8/attachment-0002.gif From hgs at dmu.ac.uk Thu Feb 9 15:20:23 2006 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Thu, 9 Feb 2006 20:20:23 +0000 (WET) Subject: [Wtr-general] Ruby on AIX In-Reply-To: <OF605DB5A5.1E75645F-ON87257110.006D9840-87257110.006E0BB5@us.ibm.com> References: <OF605DB5A5.1E75645F-ON87257110.006D9840-87257110.006E0BB5@us.ibm.com> Message-ID: <Pine.GSO.4.64.0602092017210.20514@brains.eng.cse.dmu.ac.uk> On Thu, 9 Feb 2006, Rose Cao wrote: > Eduardo, > > You are right. I too realized it after posting the email to this mailing > list. [...] > > The scripts are running on Windows. But it is personal desktop. In order > to > > schedule the scripts on server, need install Ruby to server which is AIX > > box. I found one binary Ruby You could use ruby to setup a network server on the Windows box, and have anything on the AIX box connect to it to kick off the tests. Hugh From bret at pettichord.com Thu Feb 9 15:42:49 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 9 Feb 2006 14:42:49 -0600 Subject: [Wtr-general] Access denied problem is driving me nuts In-Reply-To: <D18A8D68994F3F45AAAC8E6277B710870192BDDC@edith.ad.twtelecom.com> References: <D18A8D68994F3F45AAAC8E6277B710870192BDDC@edith.ad.twtelecom.com> Message-ID: <ade75c5b0602091242r76070302y8ee629203eb4a8cf@mail.gmail.com> Thanks for sharing your solution. Very helpful. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/3d30aba1/attachment.html From tester.paul at gmail.com Thu Feb 9 16:13:55 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Thu, 9 Feb 2006 16:13:55 -0500 Subject: [Wtr-general] How do you find a specific string in an HTML page? Message-ID: <37c405480602091313u7f1bf1f2w@mail.gmail.com> Hi there, I am trying to find a way to find a particular string in an HTML page and save it to a variable. It seems simple enough, but I can't find the commands to help me do it yet. Our Dot-Net app assigns Unique ID's to various objects within the system. For example, if you create a new Customer in an Order-Taking system, the new Customer is assigned a unique ID (let's call it "customerID"). When I look at the HTML page, I see that UID in various places. For example: (a) within a "div" tag (within a custom attribute unrecognised by Watir) (b) within an "a href" link (part of the URL - e.g. " http://www.../../ShowCustomer.aspx?mode=edit&customerID=1234asdf-5678hjlk") I know that I can use the contains_text() to look for text on the page. I can also use ie.frame("frameName").html.to_s to capture the contents of the frame. So how can I tell Watir to find the "customerID=" phrase and then capture the next [fixed-number] set of characters into a string variable? Thanks in advance. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/67bfa264/attachment.html From sergio.pinon at us.g4s.com Thu Feb 9 16:23:03 2006 From: sergio.pinon at us.g4s.com (Sergio Pinon) Date: Thu, 9 Feb 2006 13:23:03 -0800 Subject: [Wtr-general] How do you find a specific string in an HTML page? Message-ID: <6554B86C58B86F43B66363ED5CF6ED05011116D6@bugatti.ems.securicor.com> I always like to use the javascript objects. So one way is to be able to get the javascript underlying object from the div reference in WATIR. Then when you get that just call the getAttribute() method on that object and pull out the attribute that you would like. Another way would be to use the XML Xpath against the DOM to pull the data that you want. I am not too familiar with this but I know it can be done. Sergio ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho Sent: Thursday, February 09, 2006 1:14 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] How do you find a specific string in an HTML page? Hi there, I am trying to find a way to find a particular string in an HTML page and save it to a variable. It seems simple enough, but I can't find the commands to help me do it yet. Our Dot-Net app assigns Unique ID's to various objects within the system. For example, if you create a new Customer in an Order-Taking system, the new Customer is assigned a unique ID (let's call it "customerID"). When I look at the HTML page, I see that UID in various places. For example: (a) within a "div" tag (within a custom attribute unrecognised by Watir) (b) within an "a href" link (part of the URL - e.g. "http://www.../../ShowCustomer.aspx?mode=edit&customerID=1234asdf-5678hj lk") I know that I can use the contains_text() to look for text on the page. I can also use ie.frame("frameName").html.to_s to capture the contents of the frame. So how can I tell Watir to find the "customerID=" phrase and then capture the next [fixed-number] set of characters into a string variable? Thanks in advance. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/7c666539/attachment.html From rosecao at us.ibm.com Thu Feb 9 16:31:34 2006 From: rosecao at us.ibm.com (Rose Cao) Date: Thu, 9 Feb 2006 14:31:34 -0700 Subject: [Wtr-general] Ruby on AIX In-Reply-To: <Pine.GSO.4.64.0602092017210.20514@brains.eng.cse.dmu.ac.uk> Message-ID: <OFD4235FCA.B2956EC5-ON87257110.00754FF6-87257110.0075FD39@us.ibm.com> Yes, this is one of the options need be considered. Thanks, Rose Hugh Sasse <hgs at dmu.ac.uk> Sent by: To wtr-general-bounc wtr-general at rubyforge.org es at rubyforge.org cc Subject 02/09/2006 01:20 Re: [Wtr-general] Ruby on AIX PM Please respond to wtr-general On Thu, 9 Feb 2006, Rose Cao wrote: > Eduardo, > > You are right. I too realized it after posting the email to this mailing > list. [...] > > The scripts are running on Windows. But it is personal desktop. In order > to > > schedule the scripts on server, need install Ruby to server which is AIX > > box. I found one binary Ruby You could use ruby to setup a network server on the Windows box, and have anything on the AIX box connect to it to kick off the tests. Hugh _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/bd8f993a/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/20060209/bd8f993a/attachment.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: pic19954.gif Type: image/gif Size: 1255 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060209/bd8f993a/attachment-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/20060209/bd8f993a/attachment-0002.gif From billagee at gmail.com Thu Feb 9 17:04:31 2006 From: billagee at gmail.com (Bill Agee) Date: Thu, 9 Feb 2006 14:04:31 -0800 Subject: [Wtr-general] Declarative Watir scripts? In-Reply-To: <Pine.GSO.4.64.0602091953400.20514@brains.eng.cse.dmu.ac.uk> References: <2362BCE2100B4B4491481E3C679919940B8CD3@brian.vallelunga.com> <73e7817e0602091132u18a3c7dfkd3cc6fb9e12afd30@mail.gmail.com> <Pine.GSO.4.64.0602091953400.20514@brains.eng.cse.dmu.ac.uk> Message-ID: <73e7817e0602091404h404bde17w31e791d59a5208c8@mail.gmail.com> On 2/9/06, Hugh Sasse <hgs at dmu.ac.uk> wrote: > On Thu, 9 Feb 2006, Bill Agee wrote: > > > On the other hand, not using the XML config files will probably make > > for a steeper learning curve. The tradeoffs are interesting. > > Why is this, do you think? OK, XML syntax is pretty standard, but > the semantics will have to be learned. At least with Ruby you can > add new methods which wrap behaviour, if you wish to simplify common > cases. Which aspects of the Ruby syntax present difficulties for > the newcomer? I could probably have told you a few years back, but > now I'm fairly used to it, and in the domain of testing, I cannot > consider this to be obvious. But it may be that commonly confusing > cases may be re-written to be clear. I was mainly thinking about non-programmers; for testers without programming experience, using an XML testing "language" to build tests could result in more success up front (which I think is important in sustaining interest in automated testing, and keeping people from abandoning automation suites/frameworks/etc). Along the same psychological lines, learning by modifying existing cases written in XML could feel less intimidating than learning by reviewing raw Ruby scripts. But I agree that Ruby is pretty painless to learn. So much so that those wanting to use a Ruby framework for testing are better off knowing enough of the language to compose test cases in Ruby, without too much abstraction (whether into XML or some other format). Thanks Bill From mb at michaelbolton.net Thu Feb 9 21:33:03 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Thu, 9 Feb 2006 21:33:03 -0500 Subject: [Wtr-general] How do you find a specific string in an HTML page? In-Reply-To: <37c405480602091313u7f1bf1f2w@mail.gmail.com> Message-ID: <00b701c62dea$53bb0340$2b65a8c0@Koko> Regular expressionliness is next to godliness. # This next line will set its_there to true if, in the html for the page, it sees # the string "customerID=" followed by any seventeen characters, and # (courtesy of the parens) will set $1 to whatever those seventeen # characters are. its_there = ie.html =~ /customerID=(.{17})/ # and if its_there is true, myvariable will get the value assigned to it if(its_there) myvariable = $1 end There may be a more elegant way to do it (say, by getting the inner_text of the link and parsing that), but the basic principle is that regular expressions are your friends. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Carvalho Sent: February 9, 2006 4:14 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] How do you find a specific string in an HTML page? Hi there, I am trying to find a way to find a particular string in an HTML page and save it to a variable. It seems simple enough, but I can't find the commands to help me do it yet. Our Dot-Net app assigns Unique ID's to various objects within the system. For example, if you create a new Customer in an Order-Taking system, the new Customer is assigned a unique ID (let's call it "customerID"). When I look at the HTML page, I see that UID in various places. For example: (a) within a "div" tag (within a custom attribute unrecognised by Watir) (b) within an "a href" link (part of the URL - e.g. "http://www.../../ShowCustomer.aspx?mode=edit <http://www.../../ShowCustomer.aspx?mode=edit&customerID=1234asdf-5678hjlk> &customerID=1234asdf-5678hjlk") I know that I can use the contains_text() to look for text on the page. I can also use ie.frame("frameName").html.to_s to capture the contents of the frame. So how can I tell Watir to find the "customerID=" phrase and then capture the next [fixed-number] set of characters into a string variable? Thanks in advance. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/fe364546/attachment.html From mb at michaelbolton.net Thu Feb 9 21:40:01 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Thu, 9 Feb 2006 21:40:01 -0500 Subject: [Wtr-general] Using Watir/Ruby scripts In-Reply-To: <6CF3AA425295C7479483AC0018EDF98B01DADF8C@MI8NYCMAIL03.Mi8.com> Message-ID: <00e201c62deb$4a86f1c0$2b65a8c0@Koko> Tonight's example: parsing an HTML document to find a regular expression. I'm not aware of any simple way to get a shell script to download a page, follow a link, grab a graphic from a page, etc., etc., etc. The purpose of any powerful language is to make stuff easier. Shell scripts are often immensely practical, but they tend to be conceptually simpler and less powerful. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chintakrindi Meghanath Sent: February 9, 2006 2:39 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Using Watir/Ruby scripts Hi Thanks, my next question is what are the advantages using ruby/watir scripts rather than conventional shell scripts Thanks Meghanath -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Pierre Garigue Sent: Thursday, February 09, 2006 2:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Using Watir/Ruby scripts you can certainly use Ruby for testing other things than web sites. It detepends what you want to do regression testing on. have a look at http://rubyforge.org/ Cheers Pierre -----Original Message----- From: Chintakrindi Meghanath [mailto:ChintakrindiMeghana at managementdynamics.com] Sent: Thursday, February 09, 2006 1:58 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Using Watir/Ruby scripts Hi I hear that many companies uses shell scripts(using bourne shell or any other ...) in the testing cycle. So, my question is can we use watir/ruby scripts instead of these. Thanks Meghanath -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/056f1f4a/attachment.html From akumar.kgp at gmail.com Fri Feb 10 00:00:55 2006 From: akumar.kgp at gmail.com (Ashish Kumar) Date: Thu, 9 Feb 2006 21:00:55 -0800 Subject: [Wtr-general] How to use Watir with Web controls Message-ID: <a1dfb4ca0602092100x5fe85acfs3cc3f7ea3e4b0e8a@mail.gmail.com> Hi, We are experimenting with Watir, and stuck at a point where we need to click on a ToolbarCheckButton which is an IE Webcontrol. On the client side, tabs look like this: <TBNS:ToolbarCheckGroup ID="MainCheckGroup" forceSelection="True"> <TBNS:ToolbarCheckButton ID="btn1" onkeydown="if (event.keyCode==13 ){event.returnValue=false}" _autopostback="true" selected="True">Tab 1</TBNS:ToolbarCheckButton> <TBNS:ToolbarCheckButton ID="btn2" onkeydown="if (event.keyCode==13 ){event.returnValue=false}" _autopostback="true" selected="False">Tab 2</TBNS:ToolbarCheckButton> </TBNS:ToolbarCheckGroup> So the question is whether there is any way to write a watir script to click on such tabs? Thanks & Regards, Ashish -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060209/74048073/attachment.html From ati.ozgur at gmail.com Fri Feb 10 03:02:05 2006 From: ati.ozgur at gmail.com (Atilla Ozgur) Date: Fri, 10 Feb 2006 10:02:05 +0200 Subject: [Wtr-general] WindowHelper In-Reply-To: <8ca48b420602081351n61b3ab23jf7973abb119aae64@mail.gmail.com> References: <8ca48b420602081351n61b3ab23jf7973abb119aae64@mail.gmail.com> Message-ID: <b9570ed20602100002y7031f7f7m7e04e0c574ca@mail.gmail.com> As I know it does not accept regular expressions . It should be a good enhancement to do so. I will look at it in the weekend. On 2/8/06, Terry Peppers <peppers at gmail.com> wrote: > I asked a real foolish question a couple of weeks ago with regard to how you > can get Watir to enter in username and password credentials into a user auth > dialog - that I should apologize for. I figured the silence was really a nod > to RTFM so I did more digging in the 'unitTests' directory and found the ' > WindowLogonExample.rb' and 'WindowLogonExtra.rb' files that apparently were > named too well for me to notice the first time around. > > So I'm @ a bit of a stumbling block. > > In the 'WindowLogonExtra.rb' - which is the script called by one of the > threads in the ' WindowLogonExample.rb' - the code is short and sweet. > > <begin_code> > require 'watir/WindowHelper' > > helper = WindowHelper.new > helper.logon('Connect to clio.lyris.com ') > <end_code> > > > I modified the code so it reads the following: > > <begin_code> > require 'watir/WindowHelper' > > r = Regexp.new("Connect to stage.*") > > helper = WindowHelper.new > helper.logon("#{r}", name="foo", password="bar") > <end_code> > > We have multiple staging sites, and I'd like not to clutter up the code with > a huge if/else or case statement that accounts for all of the different > domains. I basically want to login to any auth window that matches the > Regex. Unfortunately, it looks like the script just hangs since the > WindowHelper can't seem to find the window. > > Does anyone know if I'm doing something wrong? Can the 'logon' method not > accept a Regular Expression for the 'title' parameter? Is this a AutoIt > deficiency? > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From zeljko.filipin at gmail.com Fri Feb 10 03:19:00 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Fri, 10 Feb 2006 09:19:00 +0100 Subject: [Wtr-general] Modifying Watir source In-Reply-To: <2362BCE2100B4B4491481E3C679919940B8CD0@brian.vallelunga.com> References: <2362BCE2100B4B4491481E3C679919940B8CD0@brian.vallelunga.com> Message-ID: <f81b1250602100019h3c4b00a2r@mail.gmail.com> $ is end of string. So, /nameTextBox$/ would match Details$nameTextBox and not nameTextBoxMainContent or something alike. Take a look at http://phrogz.net/ProgrammingRuby/, search for Regular Expressions. -- http://www.testingreflections.com/blog/3071 From uday_bhobe at hotmail.com Fri Feb 10 09:01:51 2006 From: uday_bhobe at hotmail.com (Uday Bhobe) Date: Fri, 10 Feb 2006 14:01:51 +0000 Subject: [Wtr-general] Popup window was blocked Message-ID: <BAY107-F30E6490251EDE47AC023BCFB020@phx.gbl> Hi, I tried to post this message yesterday, but for some reason it doesn't seem to have made it. I am facing a problem "A popup window was blocked" with a link that is trying to open a new IE browser window. I have disabled the popup blocker in IE, yet am facing this problem. Manual clicking of the link works. But it does not work from Watir (I am trying through irb). I have verified through "flash" that I have the right link (it's happening with all the links that create a new IE window_. I searched the list for help on this problemm, and managed to find an earlier discussion. But I did not understand the solution, although it seems to be to do with the Yahoo Messenger (will I have to uninstall the Yahoo Messenger?) Thanks, Uday From thealy at midicorp.com Fri Feb 10 10:03:52 2006 From: thealy at midicorp.com (Thomas Healy) Date: Fri, 10 Feb 2006 10:03:52 -0500 Subject: [Wtr-general] Popup window was blocked Message-ID: <8EA615B25AB5F849BF0193B80E6D4C49800D3D@MIDISERVER> Uday, I don't know if it helps but when I had pop-up blocker problems on my system, I found 4 pop-up blockers to turn off... One is in IE... One was in the Norton's, one was in a Google tool bar and one was a rogue pop-up blocker program on my system. When I found all of them... The programs worked. Bottom line is that IF it is a pop-up blocker problem... There are frequently multiple pop-up blockers active on a system. Thom -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Uday Bhobe Sent: Friday, February 10, 2006 9:02 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Popup window was blocked Hi, I tried to post this message yesterday, but for some reason it doesn't seem to have made it. I am facing a problem "A popup window was blocked" with a link that is trying to open a new IE browser window. I have disabled the popup blocker in IE, yet am facing this problem. Manual clicking of the link works. But it does not work from Watir (I am trying through irb). I have verified through "flash" that I have the right link (it's happening with all the links that create a new IE window_. I searched the list for help on this problemm, and managed to find an earlier discussion. But I did not understand the solution, although it seems to be to do with the Yahoo Messenger (will I have to uninstall the Yahoo Messenger?) Thanks, Uday _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From witlessbird at bitsandpixels.org Fri Feb 10 10:02:40 2006 From: witlessbird at bitsandpixels.org (Dmitri Dolguikh) Date: Fri, 10 Feb 2006 10:02:40 -0500 Subject: [Wtr-general] Goto(url) Message-ID: <1aa3b8a50602100702m44af94e8n10ba86dca172fb71@mail.gmail.com> Hi list, I'm finding that using goto on Watir::IE is not reliable: when goto is called first time it is *always* successful (provided the url was valid of course). However on subsequent calls it may or may not fail. I tried adding sleep and Watir::IE.wait calls between goto's without consistent results. In fact, for code like this @ie.goto(url1) @ie.goto(url2) second goto call is almost guaranteed to fail. Any ideas, anybody? Thanks, -Dmitri From bret at pettichord.com Fri Feb 10 10:26:06 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Feb 2006 09:26:06 -0600 Subject: [Wtr-general] Goto(url) In-Reply-To: <1aa3b8a50602100702m44af94e8n10ba86dca172fb71@mail.gmail.com> References: <1aa3b8a50602100702m44af94e8n10ba86dca172fb71@mail.gmail.com> Message-ID: <ade75c5b0602100726j5971b55dlcf605e5cc6b17e63@mail.gmail.com> This works fine for me. What errors are you getting? On 2/10/06, Dmitri Dolguikh <witlessbird at bitsandpixels.org> wrote: > > Hi list, > > I'm finding that using goto on Watir::IE is not reliable: when goto is > called first time it is *always* successful (provided the url was > valid of course). However on subsequent calls it may or may not fail. > I tried adding sleep and Watir::IE.wait calls between goto's without > consistent results. > > In fact, for code like this > > @ie.goto(url1) > @ie.goto(url2) > > second goto call is almost guaranteed to fail. > > > Any ideas, anybody? > > Thanks, > -Dmitri > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060210/cdc62610/attachment.html From witlessbird at bitsandpixels.org Fri Feb 10 10:41:26 2006 From: witlessbird at bitsandpixels.org (Dmitri Dolguikh) Date: Fri, 10 Feb 2006 10:41:26 -0500 Subject: [Wtr-general] Goto(url) In-Reply-To: <ade75c5b0602100726j5971b55dlcf605e5cc6b17e63@mail.gmail.com> References: <1aa3b8a50602100702m44af94e8n10ba86dca172fb71@mail.gmail.com> <ade75c5b0602100726j5971b55dlcf605e5cc6b17e63@mail.gmail.com> Message-ID: <1aa3b8a50602100741i4f425256tab6bc64afdb45e87@mail.gmail.com> Hmmm, I'm getting assertion failure (in my code) :). Nothing on the console. It looks like goto just times out, hence the assertion failure since the content I'm expecting is not there. Also, I noticed that url in the location bar doesn't get updated. Another interesting thing is that when I run this test alone, it passes. When it's being executed as a part of a suite (and not the first test in the suite) goto call times out. Thanks, -Dmitri On 2/10/06, Bret Pettichord <bret at pettichord.com> wrote: > This works fine for me. What errors are you getting? > > > On 2/10/06, Dmitri Dolguikh <witlessbird at bitsandpixels.org > wrote: > > > > Hi list, > > > > I'm finding that using goto on Watir::IE is not reliable: when goto is > > called first time it is *always* successful (provided the url was > > valid of course). However on subsequent calls it may or may not fail. > > I tried adding sleep and Watir::IE.wait calls between goto's without > > consistent results. > > > > In fact, for code like this > > > > @ie.goto(url1) > > @ie.goto(url2) > > > > second goto call is almost guaranteed to fail. > > > > > > Any ideas, anybody? > > > > Thanks, > > -Dmitri > > > > _______________________________________________ > > 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 Feb 10 11:09:17 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Feb 2006 10:09:17 -0600 Subject: [Wtr-general] Goto(url) In-Reply-To: <1aa3b8a50602100741i4f425256tab6bc64afdb45e87@mail.gmail.com> References: <1aa3b8a50602100702m44af94e8n10ba86dca172fb71@mail.gmail.com> <ade75c5b0602100726j5971b55dlcf605e5cc6b17e63@mail.gmail.com> <1aa3b8a50602100741i4f425256tab6bc64afdb45e87@mail.gmail.com> Message-ID: <ade75c5b0602100809o57dcd6bfmf8ce4bc819d3df40@mail.gmail.com> If you can find a way to reproduce this with a single test please send it and i'll take a look at it. I'm wondering if Watir shouldn't automatically be calling IE#wait before returning from IE#goto. Of course, you could call it explicitly as a workaround. Bret On 2/10/06, Dmitri Dolguikh <witlessbird at bitsandpixels.org> wrote: > > Hmmm, > > I'm getting assertion failure (in my code) :). Nothing on the console. > It looks like goto just times out, hence the assertion failure since > the content I'm expecting is not there. > > Also, I noticed that url in the location bar doesn't get updated. > Another interesting thing is that when I run this test alone, it > passes. When it's being executed as a part of a suite (and not the > first test in the suite) goto call times out. > > Thanks, > -Dmitri > > > On 2/10/06, Bret Pettichord <bret at pettichord.com> wrote: > > This works fine for me. What errors are you getting? > > > > > > On 2/10/06, Dmitri Dolguikh <witlessbird at bitsandpixels.org > wrote: > > > > > > Hi list, > > > > > > I'm finding that using goto on Watir::IE is not reliable: when goto is > > > called first time it is *always* successful (provided the url was > > > valid of course). However on subsequent calls it may or may not fail. > > > I tried adding sleep and Watir::IE.wait calls between goto's without > > > consistent results. > > > > > > In fact, for code like this > > > > > > @ie.goto(url1) > > > @ie.goto(url2) > > > > > > second goto call is almost guaranteed to fail. > > > > > > > > > Any ideas, anybody? > > > > > > Thanks, > > > -Dmitri > > > > > > _______________________________________________ > > > Wtr-general mailing list > > > Wtr-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060210/85dbf9e6/attachment.html From mb at michaelbolton.net Fri Feb 10 11:18:18 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Fri, 10 Feb 2006 11:18:18 -0500 Subject: [Wtr-general] Goto(url) In-Reply-To: <1aa3b8a50602100702m44af94e8n10ba86dca172fb71@mail.gmail.com> Message-ID: <00f001c62e5d$9a7edf40$6801a8c0@Koko> When you say "fail", what Bad Thing happens? What Good Thing fails to happen? Do you get an error message? ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Dmitri Dolguikh Sent: February 10, 2006 10:03 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Goto(url) Hi list, I'm finding that using goto on Watir::IE is not reliable: when goto is called first time it is *always* successful (provided the url was valid of course). However on subsequent calls it may or may not fail. I tried adding sleep and Watir::IE.wait calls between goto's without consistent results. In fact, for code like this @ie.goto(url1) @ie.goto(url2) second goto call is almost guaranteed to fail. Any ideas, anybody? Thanks, -Dmitri _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From witlessbird at bitsandpixels.org Fri Feb 10 11:49:39 2006 From: witlessbird at bitsandpixels.org (Dmitri Dolguikh) Date: Fri, 10 Feb 2006 11:49:39 -0500 Subject: [Wtr-general] Goto(url) In-Reply-To: <00f001c62e5d$9a7edf40$6801a8c0@Koko> References: <1aa3b8a50602100702m44af94e8n10ba86dca172fb71@mail.gmail.com> <00f001c62e5d$9a7edf40$6801a8c0@Koko> Message-ID: <1aa3b8a50602100849x2df17b48xff9984dda9f66dd0@mail.gmail.com> I'm able to reproduce the problem within the same test by using the following chain of events (right now using our webapp): @ie = IE.new @ie.goto(someUrl) @ie.link(...).click @ie.text_field(:name, "username").set('someName') @ie.image(:src, /login.gif/).fireEvent("onmouseup") @ie.close @ie = IE.new @ie.goto(someUrl) @ie.goto(someUrlTwo) #this call times out assert_not_nil(/patternToLookFor/.match(@ie.html) I'll have to verify that I can reproduce the problem using some publicly accessibly site. Thanks, -Dmitri On 2/10/06, Michael Bolton <mb at michaelbolton.net> wrote: > When you say "fail", what Bad Thing happens? What Good Thing fails to > happen? Do you get an error message? > > ---Michael B. > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Dmitri Dolguikh > Sent: February 10, 2006 10:03 AM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] Goto(url) > > Hi list, > > I'm finding that using goto on Watir::IE is not reliable: when goto is > called first time it is *always* successful (provided the url was > valid of course). However on subsequent calls it may or may not fail. > I tried adding sleep and Watir::IE.wait calls between goto's without > consistent results. > > In fact, for code like this > > @ie.goto(url1) > @ie.goto(url2) > > second goto call is almost guaranteed to fail. > > > Any ideas, anybody? > > Thanks, > -Dmitri > > _______________________________________________ > 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 Feb 10 11:58:08 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Feb 2006 10:58:08 -0600 Subject: [Wtr-general] WindowHelper In-Reply-To: <b9570ed20602100002y7031f7f7m7e04e0c574ca@mail.gmail.com> References: <8ca48b420602081351n61b3ab23jf7973abb119aae64@mail.gmail.com> <b9570ed20602100002y7031f7f7m7e04e0c574ca@mail.gmail.com> Message-ID: <ade75c5b0602100858r2ba61e7ej41c6f3cb75d850dc@mail.gmail.com> I would like to deprecate or remove WindowHelper from Watir 1.5. So i'd rather see enhancements directed towards using watir/dialog.rb (which still needs a lot more work, including replacing autoit). Bret On 2/10/06, Atilla Ozgur <ati.ozgur at gmail.com> wrote: > > As I know it does not accept regular expressions . It should be a good > enhancement to do so. I will look at it in the weekend. > > On 2/8/06, Terry Peppers <peppers at gmail.com> wrote: > > I asked a real foolish question a couple of weeks ago with regard to how > you > > can get Watir to enter in username and password credentials into a user > auth > > dialog - that I should apologize for. I figured the silence was really a > nod > > to RTFM so I did more digging in the 'unitTests' directory and found the > ' > > WindowLogonExample.rb' and 'WindowLogonExtra.rb' files that apparently > were > > named too well for me to notice the first time around. > > > > So I'm @ a bit of a stumbling block. > > > > In the 'WindowLogonExtra.rb' - which is the script called by one of the > > threads in the ' WindowLogonExample.rb' - the code is short and sweet. > > > > <begin_code> > > require 'watir/WindowHelper' > > > > helper = WindowHelper.new > > helper.logon('Connect to clio.lyris.com ') > > <end_code> > > > > > > I modified the code so it reads the following: > > > > <begin_code> > > require 'watir/WindowHelper' > > > > r = Regexp.new("Connect to stage.*") > > > > helper = WindowHelper.new > > helper.logon("#{r}", name="foo", password="bar") > > <end_code> > > > > We have multiple staging sites, and I'd like not to clutter up the code > with > > a huge if/else or case statement that accounts for all of the different > > domains. I basically want to login to any auth window that matches the > > Regex. Unfortunately, it looks like the script just hangs since the > > WindowHelper can't seem to find the window. > > > > Does anyone know if I'm doing something wrong? Can the 'logon' method > not > > accept a Regular Expression for the 'title' parameter? Is this a AutoIt > > deficiency? > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060210/82eb92d6/attachment.html From bret at pettichord.com Fri Feb 10 12:00:20 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Feb 2006 11:00:20 -0600 Subject: [Wtr-general] Goto(url) In-Reply-To: <1aa3b8a50602100849x2df17b48xff9984dda9f66dd0@mail.gmail.com> References: <1aa3b8a50602100702m44af94e8n10ba86dca172fb71@mail.gmail.com> <00f001c62e5d$9a7edf40$6801a8c0@Koko> <1aa3b8a50602100849x2df17b48xff9984dda9f66dd0@mail.gmail.com> Message-ID: <ade75c5b0602100900n1fd8e9aeg2920be0a90151d24@mail.gmail.com> What does 'times out' mean? Does the script hang at that point? Do you get a timeout error? Does adding @ie.wait between the two calls to @ie.goto fix the problem? Bret On 2/10/06, Dmitri Dolguikh <witlessbird at bitsandpixels.org> wrote: > > I'm able to reproduce the problem within the same test by using the > following chain of events (right now using our webapp): > > @ie = IE.new > @ie.goto(someUrl) > @ie.link(...).click > @ie.text_field(:name, "username").set('someName') > @ie.image(:src, /login.gif/).fireEvent("onmouseup") > > @ie.close > @ie = IE.new > @ie.goto(someUrl) > > @ie.goto(someUrlTwo) #this call times out > assert_not_nil(/patternToLookFor/.match(@ie.html) > > I'll have to verify that I can reproduce the problem using some > publicly accessibly site. > > Thanks, > -Dmitri > > On 2/10/06, Michael Bolton <mb at michaelbolton.net> wrote: > > When you say "fail", what Bad Thing happens? What Good Thing fails to > > happen? Do you get an error message? > > > > ---Michael B. > > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Dmitri Dolguikh > > Sent: February 10, 2006 10:03 AM > > To: wtr-general at rubyforge.org > > Subject: [Wtr-general] Goto(url) > > > > Hi list, > > > > I'm finding that using goto on Watir::IE is not reliable: when goto is > > called first time it is *always* successful (provided the url was > > valid of course). However on subsequent calls it may or may not fail. > > I tried adding sleep and Watir::IE.wait calls between goto's without > > consistent results. > > > > In fact, for code like this > > > > @ie.goto(url1) > > @ie.goto(url2) > > > > second goto call is almost guaranteed to fail. > > > > > > Any ideas, anybody? > > > > Thanks, > > -Dmitri > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060210/dd430af8/attachment.html From bret at pettichord.com Fri Feb 10 12:01:34 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Feb 2006 11:01:34 -0600 Subject: [Wtr-general] Declarative Watir scripts? In-Reply-To: <Pine.GSO.4.64.0602091953400.20514@brains.eng.cse.dmu.ac.uk> References: <2362BCE2100B4B4491481E3C679919940B8CD3@brian.vallelunga.com> <73e7817e0602091132u18a3c7dfkd3cc6fb9e12afd30@mail.gmail.com> <Pine.GSO.4.64.0602091953400.20514@brains.eng.cse.dmu.ac.uk> Message-ID: <ade75c5b0602100901m756695afxf3d0f5ae9017f0aa@mail.gmail.com> I wanted to make a general comment. It is very common for people to create the kinds of frameworks under discussion here for testing. I've seen it done for almost every testing tool. The problem has been that it is hard to build frameworks like these in such classic testing languages as TSL. When i say hard, what i mean is: 1) it takes more advanced programming skills (to make up for the limited language) and 2) it is more likely to have bugs including the dreaded silent horrors that allow test failures to go unnoticed. This was a very big reason for why i wanted to use a real programming language like Ruby as the test script language. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060210/473fb88a/attachment.html From witlessbird at bitsandpixels.org Fri Feb 10 12:06:58 2006 From: witlessbird at bitsandpixels.org (Dmitri Dolguikh) Date: Fri, 10 Feb 2006 12:06:58 -0500 Subject: [Wtr-general] Goto(url) In-Reply-To: <ade75c5b0602100900n1fd8e9aeg2920be0a90151d24@mail.gmail.com> References: <1aa3b8a50602100702m44af94e8n10ba86dca172fb71@mail.gmail.com> <00f001c62e5d$9a7edf40$6801a8c0@Koko> <1aa3b8a50602100849x2df17b48xff9984dda9f66dd0@mail.gmail.com> <ade75c5b0602100900n1fd8e9aeg2920be0a90151d24@mail.gmail.com> Message-ID: <1aa3b8a50602100906v1c9664b4qa0c247036eb75413@mail.gmail.com> Sorry, I should have clarified that. 'times out' means that 'goto' call doesn't return for a couple of minutes; When it does eventually, the browser stays on the page it was prior to the call. Also, as I mentioned before the location bar doesn't get updated with the url passed into goto method. -Dmitri On 2/10/06, Bret Pettichord <bret at pettichord.com> wrote: > What does 'times out' mean? Does the script hang at that point? Do you get a > timeout error? > > Does adding @ie.wait between the two calls to @ie.goto fix the problem? > > Bret > > On 2/10/06, Dmitri Dolguikh <witlessbird at bitsandpixels.org> wrote: > > > > I'm able to reproduce the problem within the same test by using the > > following chain of events (right now using our webapp): > > > > @ie = IE.new > > @ie.goto(someUrl) > > @ie.link(...).click > > @ie.text_field(:name, "username").set('someName') > > @ie.image(:src, /login.gif/).fireEvent("onmouseup") > > > > @ie.close > > @ie = IE.new > > @ie.goto(someUrl) > > > > @ie.goto(someUrlTwo) #this call times out > > assert_not_nil(/patternToLookFor/.match(@ie.html ) > > > > I'll have to verify that I can reproduce the problem using some > > publicly accessibly site. > > > > Thanks, > > -Dmitri > > > > On 2/10/06, Michael Bolton <mb at michaelbolton.net > wrote: > > > When you say "fail", what Bad Thing happens? What Good Thing fails to > > > happen? Do you get an error message? > > > > > > ---Michael B. > > > > > > -----Original Message----- > > > From: wtr-general-bounces at rubyforge.org > > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of > Dmitri Dolguikh > > > Sent: February 10, 2006 10:03 AM > > > To: wtr-general at rubyforge.org > > > Subject: [Wtr-general] Goto(url) > > > > > > Hi list, > > > > > > I'm finding that using goto on Watir::IE is not reliable: when goto is > > > called first time it is *always* successful (provided the url was > > > valid of course). However on subsequent calls it may or may not fail. > > > I tried adding sleep and Watir::IE.wait calls between goto's without > > > consistent results. > > > > > > In fact, for code like this > > > > > > @ie.goto(url1) > > > @ie.goto(url2) > > > > > > second goto call is almost guaranteed to fail. > > > > > > > > > Any ideas, anybody? > > > > > > Thanks, > > > -Dmitri > > > > > > _______________________________________________ > > > 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 Fri Feb 10 12:08:35 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Feb 2006 11:08:35 -0600 Subject: [Wtr-general] Declarative Watir scripts? In-Reply-To: <73e7817e0602091404h404bde17w31e791d59a5208c8@mail.gmail.com> References: <2362BCE2100B4B4491481E3C679919940B8CD3@brian.vallelunga.com> <73e7817e0602091132u18a3c7dfkd3cc6fb9e12afd30@mail.gmail.com> <Pine.GSO.4.64.0602091953400.20514@brains.eng.cse.dmu.ac.uk> <73e7817e0602091404h404bde17w31e791d59a5208c8@mail.gmail.com> Message-ID: <ade75c5b0602100908u55b8ba1fi1eb5397c9f455fe6@mail.gmail.com> On 2/9/06, Bill Agee <billagee at gmail.com> wrote: > > I was mainly thinking about non-programmers; for testers without > programming experience, using an XML testing "language" to build tests > could result in more success up front (which I think is important in > sustaining interest in automated testing, and keeping people from > abandoning automation suites/frameworks/etc). Along the same > psychological lines, learning by modifying existing cases written in > XML could feel less intimidating than learning by reviewing raw Ruby > scripts. Watir's design primarily resulted from teaching a test automation tutorial to testers over the past several years. By now, i've personally taught over a 100 people. In general, the Watir API has been modified until it made sense to these people. Althougth i did not try an XML-based syntax, i suspect that few testers would find it easier to use. In my view XML is a good language to tie together tools and protocols, but not so good for people. One big advantage of "raw ruby" is that it can be typed in IRB and testers can immediately see what each line of code does as it executes. This has always been how i've taught Watir to people. Years and years ago i taught young children to learn how to program using Logo with its interpreter, which is very much like Ruby/IRB. I strongly believe that this is the best way for most people to learn programming. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060210/09565c1b/attachment.html From Bill.Attebery at twtelecom.com Fri Feb 10 12:35:24 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Fri, 10 Feb 2006 10:35:24 -0700 Subject: [Wtr-general] Select List Question Message-ID: <D18A8D68994F3F45AAAC8E6277B710870192BDDD@edith.ad.twtelecom.com> In our in house webpage we found that some of the select lists use a attribute TYPE="SELECT" when we tried to get a handle on these SELECT_LIST objects watir failed with the cannot find object error. We did some investigating and removed this attribute from the html, and watir then found the object with no problems. So my question is, is this a bug or a known issue and if so are there any workarounds or code updates that will resolve it? If you need more info please let me know. Here's the HTML snippet with the offending attribute in red. <tr> <td class="label"> <DIV CLASS="required" pii="null" name="po_order_header.order_source.label" id="po_order_header.order_source.label" title="Order Source">Order Source</DIV> </td><td class="field"><select pii="null" id="po_order_header.order_source" TYPE="SELECT" Name="po_order_header.order_source" tabindex="15" onchange="formModified();orderSourceChanged()" onblur="validate()" required="true"><OPTION VALUE="" title=""></OPTION><OPTION VALUE="AuthRep" title="">Authorized Representative</OPTION><OPTION VALUE="CapAnalyst" title="">Capacity Analyst</OPTION><OPTION VALUE="City" title="">City</OPTION><OPTION VALUE="Collection" title="">Collections</OPTION></select> </td> </tr> Thanks, Bill The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060210/db943812/attachment.html From tester.paul at gmail.com Fri Feb 10 14:05:43 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Fri, 10 Feb 2006 14:05:43 -0500 Subject: [Wtr-general] Testing a Web App with Biztalk Message-ID: <37c405480602101105i5f58c962r@mail.gmail.com> Hi there, I searched the archives but I wasn't able to find any references to Ruby or Watir scripts for testing Dot.Net web apps that use Biztalk. Biztalk is the workflow engine below the app layer (and beside the database server). It doesn't have any UI presence on the web pages, but it controls the states of the various objects in our system. For example, in an Order system, an Order may go through the states: New, Pending, Filled, Paid, Completed. (I dunno, I'm just making this example up off the top of my head.) When I click a button or fill in a form, it will cause the workflow engine to do its thing and update the object states in the background. When I am manually testing, I just click on various UI elements back and forth until I see the desired state for the object (e.g. "order") that I am tracking. So my question is: How do I get Ruby or Watir to wait around until an object is in a desired state before it can continue? A secondary question is: How can I tell my Ruby or Watir script that if it waits too long, it should probably just give up and stop the test there? Please let me know if anyone has any experience scripting web apps with Biztalk or this kind of setup? Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060210/1b581209/attachment.html From angrez at gmail.com Fri Feb 10 14:42:40 2006 From: angrez at gmail.com (Angrez Singh) Date: Sat, 11 Feb 2006 01:12:40 +0530 Subject: [Wtr-general] Select List Question In-Reply-To: <D18A8D68994F3F45AAAC8E6277B710870192BDDD@edith.ad.twtelecom.com> References: <D18A8D68994F3F45AAAC8E6277B710870192BDDD@edith.ad.twtelecom.com> Message-ID: <e26bda3e0602101142t651c601ejdb9e76fa6a8ff14e@mail.gmail.com> Hi Bill, While location the select list element WATiR codes use "select-one" or "select-multiple" for matching the type of the select list. Also the "type"attribute of select list is "readonly" as per DOM specification: http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-94282980 So if you are assigning value to "type" attribute browser should not take the value or rather should ignore the "type". But if it is using that value for returning the type of the select list, then WATiR code will not be able to find the control because the value that you have given for type attribute i.e."select" doesn't matches with "select-one" or "select-multiple". So thats why if first fails but after removing the type attribute it succeeds. So I think its IE that is not behaving according to the DOM standards. WATiR code is working fine. Hope that helps, Regards, Angrez On 2/10/06, Attebery, Bill <Bill.Attebery at twtelecom.com> wrote: > > In our in house webpage we found that some of the select lists use a > attribute* TYPE="SELECT"* when we tried to get a handle on these > SELECT_LIST objects watir failed with the cannot find object error. We did > some investigating and removed this attribute from the html, and watir then > found the object with no problems. So my question is, is this a bug or a > known issue and if so are there any workarounds or code updates that will > resolve it? If you need more info please let me know. > > Here's the HTML snippet with the offending attribute in red. > > <tr> > <td class="label"> > <DIV CLASS="required" pii="null" > name="po_order_header.order_source.label" > id="po_order_header.order_source.label" title="Order Source">Order > Source</DIV> > > </td><td class="field"><select pii="null" > id="po_order_header.order_source"* **TYPE="SELECT" * Name="po_order_header.order_source" > tabindex="15" onchange="formModified();orderSourceChanged()" > onblur="validate()" required="true"><OPTION VALUE="" > title=""></OPTION><OPTION VALUE="AuthRep" title="">Authorized > Representative</OPTION><OPTION VALUE="CapAnalyst" title="">Capacity > Analyst</OPTION><OPTION VALUE="City" title="">City</OPTION><OPTION > VALUE="Collection" title="">Collections</OPTION></select> > > </td> > </tr> > > Thanks, > Bill > The content contained in this electronic message is not intended to > constitute formation of a contract binding TWTC. TWTC will be > contractually bound only upon execution, by an authorized officer, of > a contract including agreed terms and conditions or by express > application of its tariffs. > > This message is intended only for the use of the individual or entity > to which it is addressed. If the reader of this message is not the > intended recipient, or the employee or agent responsible for > delivering the message to the intended recipient, you are hereby > notified that any dissemination, distribution or copying of this > message is strictly prohibited. If you have received this > communication in error, please notify us immediately by replying to > the sender of this E-Mail or by telephone. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060211/348d4f20/attachment.html From bret at pettichord.com Fri Feb 10 14:48:28 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Feb 2006 13:48:28 -0600 Subject: [Wtr-general] Goto(url) In-Reply-To: <1aa3b8a50602100906v1c9664b4qa0c247036eb75413@mail.gmail.com> References: <1aa3b8a50602100702m44af94e8n10ba86dca172fb71@mail.gmail.com> <00f001c62e5d$9a7edf40$6801a8c0@Koko> <1aa3b8a50602100849x2df17b48xff9984dda9f66dd0@mail.gmail.com> <ade75c5b0602100900n1fd8e9aeg2920be0a90151d24@mail.gmail.com> <1aa3b8a50602100906v1c9664b4qa0c247036eb75413@mail.gmail.com> Message-ID: <ade75c5b0602101148i2f65b1cbk64e3ca3ee0e873@mail.gmail.com> Does adding @ie.wait between the two calls to @ie.goto fix the problem? (Do i hear an echo?) On 2/10/06, Dmitri Dolguikh <witlessbird at bitsandpixels.org> wrote: > > Sorry, I should have clarified that. > > 'times out' means that 'goto' call doesn't return for a couple of > minutes; When it does eventually, the browser stays on the page it was > prior to the call. Also, as I mentioned before the location bar > doesn't get updated with the url passed into goto method. > > -Dmitri > > On 2/10/06, Bret Pettichord <bret at pettichord.com> wrote: > > What does 'times out' mean? Does the script hang at that point? Do you > get a > > timeout error? > > > > Does adding @ie.wait between the two calls to @ie.goto fix the problem? > > > > Bret > > > > On 2/10/06, Dmitri Dolguikh <witlessbird at bitsandpixels.org> wrote: > > > > > > I'm able to reproduce the problem within the same test by using the > > > following chain of events (right now using our webapp): > > > > > > @ie = IE.new > > > @ie.goto(someUrl) > > > @ie.link(...).click > > > @ie.text_field(:name, "username").set('someName') > > > @ie.image(:src, /login.gif/).fireEvent("onmouseup") > > > > > > @ie.close > > > @ie = IE.new > > > @ie.goto(someUrl) > > > > > > @ie.goto(someUrlTwo) #this call times out > > > assert_not_nil(/patternToLookFor/.match(@ie.html ) > > > > > > I'll have to verify that I can reproduce the problem using some > > > publicly accessibly site. > > > > > > Thanks, > > > -Dmitri > > > > > > On 2/10/06, Michael Bolton <mb at michaelbolton.net > wrote: > > > > When you say "fail", what Bad Thing happens? What Good Thing fails > to > > > > happen? Do you get an error message? > > > > > > > > ---Michael B. > > > > > > > > -----Original Message----- > > > > From: wtr-general-bounces at rubyforge.org > > > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of > > Dmitri Dolguikh > > > > Sent: February 10, 2006 10:03 AM > > > > To: wtr-general at rubyforge.org > > > > Subject: [Wtr-general] Goto(url) > > > > > > > > Hi list, > > > > > > > > I'm finding that using goto on Watir::IE is not reliable: when goto > is > > > > called first time it is *always* successful (provided the url was > > > > valid of course). However on subsequent calls it may or may not > fail. > > > > I tried adding sleep and Watir::IE.wait calls between goto's without > > > > consistent results. > > > > > > > > In fact, for code like this > > > > > > > > @ie.goto(url1) > > > > @ie.goto(url2) > > > > > > > > second goto call is almost guaranteed to fail. > > > > > > > > > > > > Any ideas, anybody? > > > > > > > > Thanks, > > > > -Dmitri > > > > > > > > _______________________________________________ > > > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060210/71f3144c/attachment.html From christopher.mcmahon at gmail.com Fri Feb 10 15:23:31 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 10 Feb 2006 14:23:31 -0600 Subject: [Wtr-general] Testing a Web App with Biztalk In-Reply-To: <37c405480602101105i5f58c962r@mail.gmail.com> References: <37c405480602101105i5f58c962r@mail.gmail.com> Message-ID: <72799cd70602101223t168d8c79sc1e7a809540d1f98@mail.gmail.com> On 2/10/06, Paul Carvalho <tester.paul at gmail.com> wrote: > Hi there, I searched the archives but I wasn't able to find any references > to Ruby or Watir scripts for testing Dot.Net web apps that use Biztalk. > Biztalk is the workflow engine below the app layer (and beside the database > server). It doesn't have any UI presence on the web pages, but it controls > the states of the various objects in our system. As a matter of fact, I'm building a test framework in Ruby for a BTS-based Integration system right now. In a nutshell: investigate what protocols the SendPorts on the BTS server are using; you'll almost certainly be able to drive individual BTS SendPorts through Ruby scripts (assuming that that's what you decide that you want to do.) For a great treatement of testing these sorts of systems, see http://eaipatterns.com/docs/TestDrivenEAI.pdf. > So my question is: How do I get Ruby or Watir to wait around until an > object is in a desired state before it can continue? > > A secondary question is: How can I tell my Ruby or Watir script that if it > waits too long, it should probably just give up and stop the test there? This sort of question is a lot easier to answer if you post some of the code that you've used to try to do these things. There are a zillion ways to do both of them, and you should see if you can find one, first. > Please let me know if anyone has any experience scripting web apps with > Biztalk or this kind of setup? I suggest that to start, you think about this as two separate test efforts: one for scripting web apps (presumably with Watir); another for scripting BizTalk tests (presumably with Ruby). Brian Marick has several articles and papers about testing "behind the GUI". You should probably read them, as well. This one is probably the most relevant: http://www.testing.com/writings/behind-the-screens.pdf. (BTW, I suspect that as you write more tests for each test effort, they will eventually begin to inform each other; but don't bite off too much at the beginning.) I've been talking to BizTalk with Ruby every day since the summer, so feel free to ask me specific questions about what you're up to. Bret and others have said plainly in the past that non-Watir subjects are welcome on this list, as long as they have to do with Ruby and/or with testing. Finally, at the risk of annoying you and others, I'm going to suggest that you (all) read Eric Raymond's "How to Ask Questions the Smart Way". http://www.catb.org/~esr/faqs/smart-questions.html A warning, though: Raymond is pretty raw, uses four-letter words, might insult your intelligence in parts. Please take that last recommendation in the spirit it was intended-- this is a great essay, and a seminal part of open-source culture. -Chris From mb at michaelbolton.net Fri Feb 10 16:20:13 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Fri, 10 Feb 2006 16:20:13 -0500 Subject: [Wtr-general] Select List Question In-Reply-To: <D18A8D68994F3F45AAAC8E6277B710870192BDDD@edith.ad.twtelecom.com> Message-ID: <018301c62e87$c8235820$6801a8c0@Koko> What did your Watir script's code look like? (Do I need to write a macro for this question?) Watir doesn't find objects; you ask it to help you find them. It's successful in helping you precisely to the extent that you've asked it in a way that it can understand. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Attebery, Bill Sent: February 10, 2006 12:35 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Select List Question In our in house webpage we found that some of the select lists use a attribute TYPE="SELECT" when we tried to get a handle on these SELECT_LIST objects watir failed with the cannot find object error. We did some investigating and removed this attribute from the html, and watir then found the object with no problems. So my question is, is this a bug or a known issue and if so are there any workarounds or code updates that will resolve it? If you need more info please let me know. Here's the HTML snippet with the offending attribute in red. <tr> <td class="label"> <DIV CLASS="required" pii="null" name="po_order_header.order_source.label" id="po_order_header.order_source.label" title="Order Source">Order Source</DIV> </td><td class="field"><select pii="null" id="po_order_header.order_source" TYPE="SELECT" Name="po_order_header.order_source" tabindex="15" onchange="formModified();orderSourceChanged()" onblur="validate()" required="true"><OPTION VALUE="" title=""></OPTION><OPTION VALUE="AuthRep" title="">Authorized Representative</OPTION><OPTION VALUE="CapAnalyst" title="">Capacity Analyst</OPTION><OPTION VALUE="City" title="">City</OPTION><OPTION VALUE="Collection" title="">Collections</OPTION></select> </td> </tr> Thanks, Bill The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060210/7c12f913/attachment.html From bret at pettichord.com Fri Feb 10 18:38:53 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 10 Feb 2006 17:38:53 -0600 Subject: [Wtr-general] Testing a Web App with Biztalk In-Reply-To: <37c405480602101105i5f58c962r@mail.gmail.com> References: <37c405480602101105i5f58c962r@mail.gmail.com> Message-ID: <ade75c5b0602101538m52381cc3u90782ee3d3798e14@mail.gmail.com> On 2/10/06, Paul Carvalho <tester.paul at gmail.com> wrote: > > So my question is: How do I get Ruby or Watir to wait around until an > object is in a desired state before it can continue? > > A secondary question is: How can I tell my Ruby or Watir script that if it > waits too long, it should probably just give up and stop the test there? Here is one way (this does both): def until_with_timeout(timeout) # block start_time = Time.now until yield or Time.now - start_time > timeout do sleep 0.05 end end This is how you use it: until_with_timeout(30) do is_biztalk_object_ready? end I'm just adding this method to Watir, since watir also has to do this kind of thing sometimes. You may also want to look at the Ruby Timeout library. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060210/9ff63344/attachment.html From witlessbird at bitsandpixels.org Fri Feb 10 23:44:41 2006 From: witlessbird at bitsandpixels.org (Dmitri Dolguikh) Date: Sat, 11 Feb 2006 00:44:41 -0400 Subject: [Wtr-general] Goto(url) In-Reply-To: <ade75c5b0602101148i2f65b1cbk64e3ca3ee0e873@mail.gmail.com> References: <1aa3b8a50602100702m44af94e8n10ba86dca172fb71@mail.gmail.com> <00f001c62e5d$9a7edf40$6801a8c0@Koko> <1aa3b8a50602100849x2df17b48xff9984dda9f66dd0@mail.gmail.com> <ade75c5b0602100900n1fd8e9aeg2920be0a90151d24@mail.gmail.com> <1aa3b8a50602100906v1c9664b4qa0c247036eb75413@mail.gmail.com> <ade75c5b0602101148i2f65b1cbk64e3ca3ee0e873@mail.gmail.com> Message-ID: <1aa3b8a50602102044g7517fa6fx3e5264b3fd12a7a8@mail.gmail.com> I tried that before I started this thread - it didn't help. -Dmitri On 2/10/06, Bret Pettichord <bret at pettichord.com> wrote: > Does adding @ie.wait between the two calls to @ie.goto fix the problem? (Do > i hear an echo?) > > > > > On 2/10/06, Dmitri Dolguikh <witlessbird at bitsandpixels.org> wrote: > > Sorry, I should have clarified that. > > > > 'times out' means that 'goto' call doesn't return for a couple of > > minutes; When it does eventually, the browser stays on the page it was > > prior to the call. Also, as I mentioned before the location bar > > doesn't get updated with the url passed into goto method. > > > > -Dmitri > > > > On 2/10/06, Bret Pettichord <bret at pettichord.com> wrote: > > > What does 'times out' mean? Does the script hang at that point? Do you > get a > > > timeout error? > > > > > > Does adding @ie.wait between the two calls to @ie.goto fix the problem? > > > > > > Bret > > > > > > On 2/10/06, Dmitri Dolguikh < witlessbird at bitsandpixels.org> wrote: > > > > > > > > I'm able to reproduce the problem within the same test by using the > > > > following chain of events (right now using our webapp): > > > > > > > > @ie = IE.new > > > > @ie.goto(someUrl) > > > > @ie.link(...).click > > > > @ie.text_field(:name, "username").set('someName') > > > > @ie.image(:src, /login.gif/).fireEvent("onmouseup") > > > > > > > > @ie.close > > > > @ie = IE.new > > > > @ie.goto(someUrl) > > > > > > > > @ie.goto(someUrlTwo) #this call times out > > > > assert_not_nil(/patternToLookFor/.match(@ie.html ) > > > > > > > > I'll have to verify that I can reproduce the problem using some > > > > publicly accessibly site. > > > > > > > > Thanks, > > > > -Dmitri > > > > > > > > On 2/10/06, Michael Bolton < mb at michaelbolton.net > wrote: > > > > > When you say "fail", what Bad Thing happens? What Good Thing fails > to > > > > > happen? Do you get an error message? > > > > > > > > > > ---Michael B. > > > > > > > > > > -----Original Message----- > > > > > From: wtr-general-bounces at rubyforge.org > > > > > [mailto:wtr-general-bounces at rubyforge.org] On > Behalf Of > > > Dmitri Dolguikh > > > > > Sent: February 10, 2006 10:03 AM > > > > > To: wtr-general at rubyforge.org > > > > > Subject: [Wtr-general] Goto(url) > > > > > > > > > > Hi list, > > > > > > > > > > I'm finding that using goto on Watir::IE is not reliable: when goto > is > > > > > called first time it is *always* successful (provided the url was > > > > > valid of course). However on subsequent calls it may or may not > fail. > > > > > I tried adding sleep and Watir:: IE.wait calls between goto's > without > > > > > consistent results. > > > > > > > > > > In fact, for code like this > > > > > > > > > > @ie.goto(url1) > > > > > @ie.goto(url2) > > > > > > > > > > second goto call is almost guaranteed to fail. > > > > > > > > > > > > > > > Any ideas, anybody? > > > > > > > > > > Thanks, > > > > > -Dmitri > > > > > > > > > > _______________________________________________ > > > > > 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 > > From uday_bhobe at hotmail.com Sat Feb 11 02:51:00 2006 From: uday_bhobe at hotmail.com (Uday Bhobe) Date: Sat, 11 Feb 2006 07:51:00 +0000 Subject: [Wtr-general] Popup window was blocked Message-ID: <BAY107-F28DA104C679788C297E767FB050@phx.gbl> Thanks a ton Thom! It worked ... I found and disabled the google and yahoo popup blockers in IE. Uday -------------------------------------------------------------------------------- Uday, I don't know if it helps but when I had pop-up blocker problems on my system, I found 4 pop-up blockers to turn off... One is in IE... One was in the Norton's, one was in a Google tool bar and one was a rogue pop-up blocker program on my system. When I found all of them... The programs worked. Bottom line is that IF it is a pop-up blocker problem... There are frequently multiple pop-up blockers active on a system. Thom -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Uday Bhobe Sent: Friday, February 10, 2006 9:02 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Popup window was blocked Hi, I tried to post this message yesterday, but for some reason it doesn't seem to have made it. I am facing a problem "A popup window was blocked" with a link that is trying to open a new IE browser window. I have disabled the popup blocker in IE, yet am facing this problem. Manual clicking of the link works. But it does not work from Watir (I am trying through irb). I have verified through "flash" that I have the right link (it's happening with all the links that create a new IE window_. I searched the list for help on this problemm, and managed to find an earlier discussion. But I did not understand the solution, although it seems to be to do with the Yahoo Messenger (will I have to uninstall the Yahoo Messenger?) Thanks, Uday _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------------------------------------------------------------------------- Previous message: [Wtr-general] Goto(url) Next message: [Wtr-general] Select List Question Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] -------------------------------------------------------------------------------- More information about the Wtr-general mailing list From marcus.tettmar at gmail.com Sat Feb 11 03:22:28 2006 From: marcus.tettmar at gmail.com (Marcus Tettmar) Date: Sat, 11 Feb 2006 08:22:28 +0000 Subject: [Wtr-general] ANN: Watir WebRecorder Message-ID: <dd78cfb30602110022u2b7ed089xae0cad39dde46e62@mail.gmail.com> Hi, I have created a free Watir version of our WebRecorder product that creates Ruby/Watir code. http://www.mjtnet.com/watir_webrecorder.htm Watir WebRecorder is an IE based tabbed browser which records activity and builds a Watir script. For more information and to download v0.1 please see: http://www.mjtnet.com/watir_webrecorder.htm Some background: WebRecorder was originally developed in 2004 to create Macro Scheduler code. We have found it very useful for speeding up the initial development of web automation and testing scripts. Recently I have been getting to know Ruby and noticed there was no Watir recorder so decided to create a Watir version of WebRecorder. WebRecorder handles nested frames, popups and new browser windows and records all kinds of form field objects, links and image clicks as well as server authentication login boxes. One thing missing from the Watir version right now is an easy way to record code to extract data from the page. It also doesn't support file downloads yet. The other thing that is missing is support for Area tags. While WebRecorder can record clicks on Area maps I couldn't find any support to play them back in Watir. I have read about the xpath extension so will look at including this in due course. I would welcome any feedback and bug reports. -- Marcus Tettmar mtettmar at mjtnet.com http://www.mjtnet.com/ Macro Scheduler & WebRecorder for Windows & Web Automation and Testing. WebRecorder for Ruby/Watir now available. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060211/4baab896/attachment.html From PGarigue at EXTEND.COM Mon Feb 13 17:07:46 2006 From: PGarigue at EXTEND.COM (Pierre Garigue) Date: Mon, 13 Feb 2006 17:07:46 -0500 Subject: [Wtr-general] is this worth looking into? Message-ID: <C629A6599EAF2B4C97CC314771BC292C04CAC2E8@mail.extend.com> http://rspec.rubyforge.org/files/TUTORIAL.html I'm pretty sure the subject could have been presented in a less theoretic way. But is seems like a way of getting away from the 'assert' way of doing thing. Instead one has methods to test the results. example 1.should_equal 1 Cheers Pierre Garigue From Bill.Attebery at twtelecom.com Mon Feb 13 17:55:28 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Mon, 13 Feb 2006 15:55:28 -0700 Subject: [Wtr-general] Select List Question Message-ID: <D18A8D68994F3F45AAAC8E6277B7108704BE0D9D@edith.ad.twtelecom.com> Response to Angrez Singh from message below Thanks for the information it was helpful. It seems (if I'm understanding this correctly) that we have some non-standard HTML and that the developers shouldn't be trying to set the type attribute in the <Select> element explicitly, they should be using the multiple attribute if desired. I wonder though why when using the page directly IE seems to ignore this attribute and I can use the select list just fine, but when trying to use watir on the page it gets hung up on this attribute (i.e. the attribute prevents Watir from finding my object), if IE was truly the culprit wouldn't it have the problem when using the page outside of Watir as well? I was hopeful that even though the HTML is not standard that since IE appears to ignore this attribute, that maybe Watir should too? I tried changing the attribute to "select-one" and "select-multiple" in the page also, but Watir still couldn't find the object. Response to Michael Bolton from message below Thanks for the response, here is the Watir snippet that you requested with the irb response. Basically just trying to see if I can get a handle on the select list object in the page (tried with both :name and :id - only :id shown below, but the result is the same either way). When I do this and the attribute is included in the HTML, I get the error. If I remove the attribute from the HTML Watir finds the object with no problem. (I can use the select method to set the value once the attribute is removed as well) $ie.select_list(:id, /order_source/).flash Watir::Exception::UnknownObjectException: Unable to locate object, using id and (?-mix:order_source) from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2020:in `flash' from (irb):16 from ?:0 irb(main):017:0> $ie.select_list(:id, /order_source/).flash Watir::Exception::UnknownObjectException: Unable to locate object, using id and (?-mix:order_source) from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2020:in `flash' from (irb):17 from ?:0 irb(main):019:0> $ie.select_list(:id, /order_source/).flash => nil(note: select list object flashes in IE as expected) Re: [Wtr-general] Select List Question Michael Bolton Fri, 10 Feb 2006 13:25:47 -0800 Title: Select List Question What did your Watir script's code look like? (Do I need to write a macro for this question?) Watir doesn't find objects; you ask it to help you find them. It's successful in helping you precisely to the extent that you've asked it in a way that it can understand. ---Michael B. Re: [Wtr-general] Select List Question Angrez Singh Fri, 10 Feb 2006 11:46:10 -0800 Hi Bill, While location the select list element WATiR codes use "select-one" or "select-multiple" for matching the type of the select list. Also the "type" attribute of select list is "readonly" as per DOM specification: http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-94282980 <http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html> So if you are assigning value to "type" attribute browser should not take the value or rather should ignore the "type" . But if it is using that value for returning the type of the select list, then WATiR code will not be able to find the control because the value that you have given for type attribute i.e. "select" doesn't matches with "select-one" or "select-multiple". So thats why if first fails but after removing the type attribute it succeeds. So I think its IE that is not behaving according to the DOM standards. WATiR code is working fine. Hope that helps, Regards, Angrez On 2/10/06, Attebery, Bill <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: In our in house webpage we found that some of the select lists use a attribute TYPE="SELECT" when we tried to get a handle on these SELECT_LIST objects watir failed with the cannot find object error. We did some investigating and removed this attribute from the html, and watir then found the object with no problems. So my question is, is this a bug or a known issue and if so are there any workarounds or code updates that will resolve it? If you need more info please let me know. Here's the HTML snippet with the offending attribute in red. <tr> <td class="label"> <DIV CLASS="required" pii="null" name="po_order_header.order_source.label" id="po_order_header.order_source.label" title="Order Source">Order Source</DIV> </td><td class="field"><select pii="null" id="po_order_header.order_source" TYPE="SELECT" Name="po_order_header.order_source" tabindex="15" required="true"><OPTION VALUE="" title=""></OPTION><OPTION VALUE="AuthRep" title="">Authorized Representative</OPTION><OPTION VALUE="CapAnalyst" title="">Capacity Analyst</OPTION><OPTION VALUE="City" title="">City</OPTION><OPTION VALUE="Collection" title="">Collections</OPTION></select> </td> </tr> Thanks, Bill The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060213/51bd6fc5/attachment.html From bret at pettichord.com Mon Feb 13 20:15:13 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 13 Feb 2006 19:15:13 -0600 Subject: [Wtr-general] Select List Question In-Reply-To: <D18A8D68994F3F45AAAC8E6277B710870192BDDD@edith.ad.twtelecom.com> References: <D18A8D68994F3F45AAAC8E6277B710870192BDDD@edith.ad.twtelecom.com> Message-ID: <ade75c5b0602131715u32b64794je00f5b91cf4f742e@mail.gmail.com> Bill, Thank you for your clear report. This sounds like a new problem to me. Using the current development tarball version, could you please include the line below right after you require 'watir'. require 'watir' Watir::SelectList::INPUT_TYPES << "select" I think there is a good chance this will correct your problem. But i also think your programmers are creating odd html. I can find no references to TYPE="SELECT" being correct. Bret On 2/10/06, Attebery, Bill <Bill.Attebery at twtelecom.com> wrote: > > In our in house webpage we found that some of the select lists use a > attribute* TYPE="SELECT"* when we tried to get a handle on these > SELECT_LIST objects watir failed with the cannot find object error. We did > some investigating and removed this attribute from the html, and watir then > found the object with no problems. So my question is, is this a bug or a > known issue and if so are there any workarounds or code updates that will > resolve it? If you need more info please let me know. > > Here's the HTML snippet with the offending attribute in red. > > <tr> > <td class="label"> > <DIV CLASS="required" pii="null" > name="po_order_header.order_source.label" > id="po_order_header.order_source.label" title="Order Source">Order > Source</DIV> > > </td><td class="field"><select pii="null" > id="po_order_header.order_source"* **TYPE="SELECT" * Name="po_order_header.order_source" > tabindex="15" onchange="formModified();orderSourceChanged()" > onblur="validate()" required="true"><OPTION VALUE="" > title=""></OPTION><OPTION VALUE="AuthRep" title="">Authorized > Representative</OPTION><OPTION VALUE="CapAnalyst" title="">Capacity > Analyst</OPTION><OPTION VALUE="City" title="">City</OPTION><OPTION > VALUE="Collection" title="">Collections</OPTION></select> > > </td> > </tr> > > Thanks, > Bill > The content contained in this electronic message is not intended to > constitute formation of a contract binding TWTC. TWTC will be > contractually bound only upon execution, by an authorized officer, of > a contract including agreed terms and conditions or by express > application of its tariffs. > > This message is intended only for the use of the individual or entity > to which it is addressed. If the reader of this message is not the > intended recipient, or the employee or agent responsible for > delivering the message to the intended recipient, you are hereby > notified that any dissemination, distribution or copying of this > message is strictly prohibited. If you have received this > communication in error, please notify us immediately by replying to > the sender of this E-Mail or by telephone. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060213/8c0f429e/attachment.html From paul.rogers at shaw.ca Mon Feb 13 22:06:46 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 13 Feb 2006 20:06:46 -0700 Subject: [Wtr-general] fire-fox and mozilla Message-ID: <27ed63727ebd11.27ebd1127ed637@shaw.ca> Several people have been looking at this - has anyone made any progress? Is any way better than another? I may have some time available soon Paul From Bill.Attebery at twtelecom.com Tue Feb 14 00:49:19 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Mon, 13 Feb 2006 22:49:19 -0700 Subject: [Wtr-general] Select List Question Message-ID: <D18A8D68994F3F45AAAC8E6277B710870192BDE7@edith.ad.twtelecom.com> An embedded message was scrubbed... From: "Attebery, Bill" <Bill.Attebery at twtelecom.com> Subject: RE: [Wtr-general] Select List Question Date: Mon, 13 Feb 2006 22:49:19 -0700 Size: 17780 Url: http://rubyforge.org/pipermail/wtr-general/attachments/20060213/ba57d455/attachment.eml -------------- next part -------------- The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. From bret at pettichord.com Tue Feb 14 01:38:45 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 14 Feb 2006 00:38:45 -0600 Subject: [Wtr-general] Watir not waiting for page to load In-Reply-To: <001d01c6310a$d0ddd230$6500a8c0@tintin> References: <ade75c5b0602082028y32e7969ek9146981a4d73b214@mail.gmail.com> <001d01c6310a$d0ddd230$6500a8c0@tintin> Message-ID: <ade75c5b0602132238q1c915af1j3d631684086e74c6@mail.gmail.com> I think Jonathan has touched on the key element for a problem that Dmitri has also been running into... On 2/13/06, Jonathan Kohl <jkohl at telusplanet.net> wrote: > > I figured out how to repeat the problem, and how to work around it. > > If I enter in the test site as I do manually: > ie.goto("http://test-web") > The script dies because it tries to find an object before the page has > loaded. If I put the full path to the app: > > ie.goto("http://test-web/cgi-bin/testapp.do") > it works. The first one worked before our new switching was put in the > office. "http://test-web" resolves to: http://test-web/cgi-bin/testapp.do. > > Any thoughts? I checked the IE#goto method and it calls IE#wait, but it is acting like it isn't actually waiting for the page to load. I think i know why. The body of IE#wait is wrapped in a begin/rescue/end block and this has always made me nervous. It's too easy to suppress important errors. In your case (and Dmitri's), i'm willing to bet that @ie.document doesn't yet exist (so it throws a WIN32OLERuntimeError, which is silently suppressed, exiting the wait method BEFORE the page has even started to load! I've been uncomfortable with this begin/rescue/end block, and now that i have good reason to take it out, i've done it. I've just committed this change and have also added an explicit wait for the @ie.document to exist. The core tests run ok, but because we really don't have unit tests for the wait logic, there is a greater than usual chance that this introduces (or unblocks) other defects. Let me know of any problems. Thanks for the detailed investigation and report. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060214/f65c774a/attachment.html From bret at pettichord.com Tue Feb 14 01:40:01 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 14 Feb 2006 00:40:01 -0600 Subject: [Wtr-general] Select List Question In-Reply-To: <D18A8D68994F3F45AAAC8E6277B710870192BDE7@edith.ad.twtelecom.com> References: <D18A8D68994F3F45AAAC8E6277B710870192BDE7@edith.ad.twtelecom.com> Message-ID: <ade75c5b0602132240y76a60ff3j933b9e8f4b9622d7@mail.gmail.com> Huh? On 2/13/06, Attebery, Bill <Bill.Attebery at twtelecom.com> wrote: > > The content contained in this electronic message is not intended to > constitute formation of a contract binding TWTC. TWTC will be > contractually bound only upon execution, by an authorized officer, of > a contract including agreed terms and conditions or by express > application of its tariffs. > > This message is intended only for the use of the individual or entity > to which it is addressed. If the reader of this message is not the > intended recipient, or the employee or agent responsible for > delivering the message to the intended recipient, you are hereby > notified that any dissemination, distribution or copying of this > message is strictly prohibited. If you have received this > communication in error, please notify us immediately by replying to > the sender of this E-Mail or by telephone. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060214/1a04a618/attachment.html From bret at pettichord.com Tue Feb 14 01:59:50 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 14 Feb 2006 00:59:50 -0600 Subject: [Wtr-general] Goto(url) In-Reply-To: <1aa3b8a50602102044g7517fa6fx3e5264b3fd12a7a8@mail.gmail.com> References: <1aa3b8a50602100702m44af94e8n10ba86dca172fb71@mail.gmail.com> <00f001c62e5d$9a7edf40$6801a8c0@Koko> <1aa3b8a50602100849x2df17b48xff9984dda9f66dd0@mail.gmail.com> <ade75c5b0602100900n1fd8e9aeg2920be0a90151d24@mail.gmail.com> <1aa3b8a50602100906v1c9664b4qa0c247036eb75413@mail.gmail.com> <ade75c5b0602101148i2f65b1cbk64e3ca3ee0e873@mail.gmail.com> <1aa3b8a50602102044g7517fa6fx3e5264b3fd12a7a8@mail.gmail.com> Message-ID: <ade75c5b0602132259i4b9d601fm84dfd4eca6a5511e@mail.gmail.com> This problem should now be fixed. For details, see my recent note in response to Jonathan Kohl. Bret On 2/10/06, Dmitri Dolguikh <witlessbird at bitsandpixels.org> wrote: > > I tried that before I started this thread - it didn't help. > -Dmitri > > On 2/10/06, Bret Pettichord <bret at pettichord.com> wrote: > > Does adding @ie.wait between the two calls to @ie.goto fix the problem? > (Do > > i hear an echo?) > > > > > > > > > > On 2/10/06, Dmitri Dolguikh <witlessbird at bitsandpixels.org> wrote: > > > Sorry, I should have clarified that. > > > > > > 'times out' means that 'goto' call doesn't return for a couple of > > > minutes; When it does eventually, the browser stays on the page it was > > > prior to the call. Also, as I mentioned before the location bar > > > doesn't get updated with the url passed into goto method. > > > > > > -Dmitri > > > > > > On 2/10/06, Bret Pettichord <bret at pettichord.com> wrote: > > > > What does 'times out' mean? Does the script hang at that point? Do > you > > get a > > > > timeout error? > > > > > > > > Does adding @ie.wait between the two calls to @ie.goto fix the > problem? > > > > > > > > Bret > > > > > > > > On 2/10/06, Dmitri Dolguikh < witlessbird at bitsandpixels.org> wrote: > > > > > > > > > > I'm able to reproduce the problem within the same test by using > the > > > > > following chain of events (right now using our webapp): > > > > > > > > > > @ie = IE.new > > > > > @ie.goto(someUrl) > > > > > @ie.link(...).click > > > > > @ie.text_field(:name, "username").set('someName') > > > > > @ie.image(:src, /login.gif/).fireEvent("onmouseup") > > > > > > > > > > @ie.close > > > > > @ie = IE.new > > > > > @ie.goto(someUrl) > > > > > > > > > > @ie.goto(someUrlTwo) #this call times out > > > > > assert_not_nil(/patternToLookFor/.match(@ie.html ) > > > > > > > > > > I'll have to verify that I can reproduce the problem using some > > > > > publicly accessibly site. > > > > > > > > > > Thanks, > > > > > -Dmitri > > > > > > > > > > On 2/10/06, Michael Bolton < mb at michaelbolton.net > wrote: > > > > > > When you say "fail", what Bad Thing happens? What Good Thing > fails > > to > > > > > > happen? Do you get an error message? > > > > > > > > > > > > ---Michael B. > > > > > > > > > > > > -----Original Message----- > > > > > > From: wtr-general-bounces at rubyforge.org > > > > > > [mailto:wtr-general-bounces at rubyforge.org] On > > Behalf Of > > > > Dmitri Dolguikh > > > > > > Sent: February 10, 2006 10:03 AM > > > > > > To: wtr-general at rubyforge.org > > > > > > Subject: [Wtr-general] Goto(url) > > > > > > > > > > > > Hi list, > > > > > > > > > > > > I'm finding that using goto on Watir::IE is not reliable: when > goto > > is > > > > > > called first time it is *always* successful (provided the url > was > > > > > > valid of course). However on subsequent calls it may or may not > > fail. > > > > > > I tried adding sleep and Watir:: IE.wait calls between goto's > > without > > > > > > consistent results. > > > > > > > > > > > > In fact, for code like this > > > > > > > > > > > > @ie.goto(url1) > > > > > > @ie.goto(url2) > > > > > > > > > > > > second goto call is almost guaranteed to fail. > > > > > > > > > > > > > > > > > > Any ideas, anybody? > > > > > > > > > > > > Thanks, > > > > > > -Dmitri > > > > > > > > > > > > _______________________________________________ > > > > > > 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 > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060214/a3906985/attachment.html From angrez at gmail.com Tue Feb 14 02:28:38 2006 From: angrez at gmail.com (Angrez Singh) Date: Tue, 14 Feb 2006 12:58:38 +0530 Subject: [Wtr-general] fire-fox and mozilla In-Reply-To: <27ed63727ebd11.27ebd1127ed637@shaw.ca> References: <27ed63727ebd11.27ebd1127ed637@shaw.ca> Message-ID: <e26bda3e0602132328j28b5fc31j898139afa533d957@mail.gmail.com> Hi Paul, I have been working on this for some time now. I have refactored the code that was clustered in the 'watir.rb' so that much of it can be re-used. The interface for accessing the elements will remain the same. I used 'JSSh' for interacting with the browser. So far I am able to do the following things: 1. Successful run of all the unit tests written for IE. Just to check that refactoring the code doesn't break the existing thing. 2. TextField, Hidden, Button, Select list (with a little problem) can now be accessed in Firefox as well. All the unit-tests for these elements are running fine. TODO: 1. Add support for other elements as well. 2. Currently you need to start Mozilla manually and tell JSSh to listen on port 9997 (default port). Need to automate this. 3. Not all selection mechanism are available in Mozilla (afterText, beforeText etc). Need to figure out a way to do this, if its that important. At the end of this month or first week of March, I'll be releasing a version that will support the following things: 1. Support for Text Fields, Hidden, Buttons, Select List, Links, Radio & Checkboxes, Image, File Field elements. 2. Javascript pop ups (using AutoIt3) & Windows pop ups. Tables, Frames , Forms & rest of the elements that are left will be available in the future releases. Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060214/bb61fba3/attachment.html From yannick.francois at gmail.com Tue Feb 14 05:31:47 2006 From: yannick.francois at gmail.com (Yannick Francois) Date: Tue, 14 Feb 2006 11:31:47 +0100 Subject: [Wtr-general] fire-fox and mozilla In-Reply-To: <e26bda3e0602132328j28b5fc31j898139afa533d957@mail.gmail.com> References: <27ed63727ebd11.27ebd1127ed637@shaw.ca> <e26bda3e0602132328j28b5fc31j898139afa533d957@mail.gmail.com> Message-ID: <caf9a2850602140231i3ae16ce6j@mail.gmail.com> Thanks for this work, I'm impatient to be in march to test it :-) 2006/2/14, Angrez Singh <angrez at gmail.com>: > > Hi Paul, > > I have been working on this for some time now. I have refactored the code > that was clustered in the 'watir.rb' so that much of it can be re-used. > The interface for accessing the elements will remain the same. I used 'JSSh' > for interacting with the browser. So far I am able to do the following > things: > > 1. Successful run of all the unit tests written for IE. Just to check > that refactoring the code doesn't break the existing thing. > 2. TextField, Hidden, Button, Select list (with a little problem) can now > be accessed in Firefox as well. All the unit-tests for these elements are > running fine. > > TODO: > 1. Add support for other elements as well. > 2. Currently you need to start Mozilla manually and tell JSSh to listen on > port 9997 (default port). Need to automate this. > 3. Not all selection mechanism are available in Mozilla (afterText, > beforeText etc). Need to figure out a way to do this, if its that important. > > > At the end of this month or first week of March, I'll be releasing a > version that will support the following things: > 1. Support for Text Fields, Hidden, Buttons, Select List, Links, Radio & > Checkboxes, Image, File Field elements. > 2. Javascript pop ups (using AutoIt3) & Windows pop ups. > > Tables, Frames , Forms & rest of the elements that are left will be > available in the future releases. > > Regards, > Angrez > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060214/7ead4898/attachment.html From witlessbird at bitsandpixels.org Tue Feb 14 07:45:38 2006 From: witlessbird at bitsandpixels.org (Dmitri Dolguikh) Date: Tue, 14 Feb 2006 07:45:38 -0500 Subject: [Wtr-general] Goto(url) In-Reply-To: <ade75c5b0602132259i4b9d601fm84dfd4eca6a5511e@mail.gmail.com> References: <1aa3b8a50602100702m44af94e8n10ba86dca172fb71@mail.gmail.com> <00f001c62e5d$9a7edf40$6801a8c0@Koko> <1aa3b8a50602100849x2df17b48xff9984dda9f66dd0@mail.gmail.com> <ade75c5b0602100900n1fd8e9aeg2920be0a90151d24@mail.gmail.com> <1aa3b8a50602100906v1c9664b4qa0c247036eb75413@mail.gmail.com> <ade75c5b0602101148i2f65b1cbk64e3ca3ee0e873@mail.gmail.com> <1aa3b8a50602102044g7517fa6fx3e5264b3fd12a7a8@mail.gmail.com> <ade75c5b0602132259i4b9d601fm84dfd4eca6a5511e@mail.gmail.com> Message-ID: <1aa3b8a50602140445g343fc96aq43f7b131f73b8e88@mail.gmail.com> Awesome. Thanks, guys. -Dmitri On 2/14/06, Bret Pettichord <bret at pettichord.com> wrote: > This problem should now be fixed. For details, see my recent note in > response to Jonathan Kohl. > > > Bret > > On 2/10/06, Dmitri Dolguikh < witlessbird at bitsandpixels.org> wrote: > > I tried that before I started this thread - it didn't help. > > -Dmitri > > > > On 2/10/06, Bret Pettichord <bret at pettichord.com> wrote: > > > Does adding @ie.wait between the two calls to @ie.goto fix the problem? > (Do > > > i hear an echo?) > > > > > > > > > > > > > > > On 2/10/06, Dmitri Dolguikh <witlessbird at bitsandpixels.org> wrote: > > > > Sorry, I should have clarified that. > > > > > > > > 'times out' means that 'goto' call doesn't return for a couple of > > > > minutes; When it does eventually, the browser stays on the page it was > > > > prior to the call. Also, as I mentioned before the location bar > > > > doesn't get updated with the url passed into goto method. > > > > > > > > -Dmitri > > > > > > > > On 2/10/06, Bret Pettichord <bret at pettichord.com > wrote: > > > > > What does 'times out' mean? Does the script hang at that point? Do > you > > > get a > > > > > timeout error? > > > > > > > > > > Does adding @ie.wait between the two calls to @ ie.goto fix the > problem? > > > > > > > > > > Bret > > > > > > > > > > On 2/10/06, Dmitri Dolguikh < witlessbird at bitsandpixels.org> wrote: > > > > > > > > > > > > I'm able to reproduce the problem within the same test by using > the > > > > > > following chain of events (right now using our webapp): > > > > > > > > > > > > @ie = IE.new > > > > > > @ie.goto(someUrl) > > > > > > @ie.link(...).click > > > > > > @ie.text_field(:name, "username").set('someName') > > > > > > @ie.image(:src, > /login.gif/).fireEvent("onmouseup") > > > > > > > > > > > > @ie.close > > > > > > @ie = IE.new > > > > > > @ie.goto(someUrl) > > > > > > > > > > > > @ie.goto(someUrlTwo) #this call times out > > > > > > assert_not_nil(/patternToLookFor/.match(@ie.html > ) > > > > > > > > > > > > I'll have to verify that I can reproduce the problem using some > > > > > > publicly accessibly site. > > > > > > > > > > > > Thanks, > > > > > > -Dmitri > > > > > > > > > > > > On 2/10/06, Michael Bolton < mb at michaelbolton.net > wrote: > > > > > > > When you say "fail", what Bad Thing happens? What Good Thing > fails > > > to > > > > > > > happen? Do you get an error message? > > > > > > > > > > > > > > ---Michael B. > > > > > > > > > > > > > > -----Original Message----- > > > > > > > From: wtr-general-bounces at rubyforge.org > > > > > > > [mailto:wtr-general-bounces at rubyforge.org] On > > > Behalf Of > > > > > Dmitri Dolguikh > > > > > > > Sent: February 10, 2006 10:03 AM > > > > > > > To: wtr-general at rubyforge.org > > > > > > > Subject: [Wtr-general] Goto(url) > > > > > > > > > > > > > > Hi list, > > > > > > > > > > > > > > I'm finding that using goto on Watir::IE is not reliable: when > goto > > > is > > > > > > > called first time it is *always* successful (provided the url > was > > > > > > > valid of course). However on subsequent calls it may or may not > > > fail. > > > > > > > I tried adding sleep and Watir:: IE.wait calls between goto's > > > without > > > > > > > consistent results. > > > > > > > > > > > > > > In fact, for code like this > > > > > > > > > > > > > > @ie.goto(url1) > > > > > > > @ie.goto(url2) > > > > > > > > > > > > > > second goto call is almost guaranteed to fail. > > > > > > > > > > > > > > > > > > > > > Any ideas, anybody? > > > > > > > > > > > > > > Thanks, > > > > > > > -Dmitri > > > > > > > > > > > > > > _______________________________________________ > > > > > > > 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 > > > > > > > > > > _______________________________________________ > > 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 Feb 14 09:04:59 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 14 Feb 2006 08:04:59 -0600 Subject: [Wtr-general] Status Report and Update Message-ID: <ade75c5b0602140604ld346e12u12bdf9cd7a0ef381@mail.gmail.com> I've been behind on a lot of things, but i am starting to get caught up. This report touches several areas: modal web dialog support, fixing the wait logic, unit testing approaches, moving to Subversion, modal windows dialogs, and reliability. The biggest thing i've been behind on is the support for modal web dialogs in watir. But i have that working now mostly. I've committed the code, and the test. See modal_dialog_test.rb for an example. This is rough code. But it works. And i'm happy to get bug reports on it and fix them. And i know i need to change the interface, and am happy to recieve suggestions. People have been asking about this for a long time. I've been "real close" since last summer. This required programming in C. I was able to get Yaxin Wang to do most of it -- he's a collegue at ThoughtWorks. But to finish it up, i needed to get my own C programming environment set up and make a couple of changes. And this took a lot of time, what with a job change -- from ThoughtWorks to DataCert -- and all. It's been more than just a job change. For the first time in five years, i'm no longer a consultant. And i don't really need to speak or teach or write any more. And i don't need to be a public contributor to open-source software. I became a consultant, to a large degree, so that these kinds of things would be part of my job. I like doing them. But they had in their own way become a chore. So i've been enjoying doing these things only out of joy, rather than obligation. And the C programming hurdle just took me a long time to get over. At the same time, i've retained my commitment to completing the modal web dialog support. I knew i was close, we needed it at almost all our clients when i was at ThoughtWorks, and in fact i need it now if i am to use Watir at my new job (which i need to do). Indeed, after a while, i stopped letting myself work on practically anything else Watir-related other than this. Now that it is committed, i can get back to a number of long deferred items. Last night, i checked in a "fix" to a problem that Jonathan and Dmitri had both reported regarding synchronization problems using goto. I say "fix," because i now realize that i've introduced another problem: we can now see exceptions and/or hangs when, say, doing an ie.button().click that closes the browser window. I've been uncomfortable with the lack of unit tests for the wait method. Now that i know i have to rework this code, it gives me new impetus to write these tests. I see several approaches. Almost all of our unit tests are what might better be termed feature tests because they test Watir in the full context of a browser. The only significant difference from full-scale system tests is that the app they test is "mocked" by a set of interlinked html files. They work very well for many feature tests, but tend to be quite fast and thus they don't really exercise the wait logic. You might call what we have "unit integration tests." There is another style of unit testing called "unit isolation tests" that makes a much more severe use of mock objects. In the case of testing IE#wait (this is the standard way in Ruby to refer to the wait method of the IE class -- it is a documenting convention and not an executable syntax), this would mean mocking out the other things that method interacts with: the document object, the busy method, the framesets. The great thing about interaction testing is that it can easily provide deterministic tests for code that may have to operate in a non-deterministic environment. Right now, the only Watir test that uses the isolation testing approach is ie_test.rb (using ie_mock.rb). This was written by Elisabeth Hendrickson and Indianapolis Mike Kelly. Another approach to testing the wait logic would be embed javascript-based delays in different events of a standard test html page. A third approach would be to create a webrick app and put the intentional delays on the server side. One of the long-deferred items has been our move to Subversion and OpenQA. One of the great things about SVN (which is how Subversion is appreviated) is that every commit point is a release. This means that anyone can easily download the particular software configuration as it was after any particular commit. This may be convenient if i continue to introduce bugs as i rework the wait code: i could ask a user to try release X to see whether it works with their test suite. With CVS, creating releases is a time-consuming and manual process, and we don't do it much. I strongly believe that getting this wait logic right and not forcing users to think about it has been a characteristic distinguishing Watir from other tools. Selenium doesn't do this. It has separate Click and ClickAndWait methods. You use the latter if the click initiates a page load, and the former if it doesn't. The problem i helped fix (we use Selenium at DataCert) is that sometimes the ClickAndWait would unexpectedly hit a client-side error that would prevent the page load from happening. This caused the test to hang, while the ClickAndWait method waited for a page load that was never going to happen. We fixed this by adding a timeout, but i do believe that Watir's approach is superior. It waits a little while, looks to see if a page load has started, and if so, waits for it to finish. I will be reworking Watir's support for Windows Dialogs shortly. I've been embarrassed by all the problems we've had with the WinClicker and have instead been working down a new path that doesn't require an inverted flow of control nor passing control to an external script. You can see my current progress in dialog_test.rb. This has been an area where we've had awkward and unreliable solutions, often characterized by hard-coded sleeps. To me, one of the worst possible bugs in a testing tool is when sometimes it will run a test fine, but will fail at other times, with no apparent difference in the behavior of the software under test. Last year, one of users shared a side-by-side comparison of Watir with Silk and one of the columns was a reliability score. Watir tests worked 20 out of 20 times, but the various Silk tests were getting scores of 17 or 18 out of 20. More later... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060214/590c869b/attachment.html From Bill.Attebery at twtelecom.com Tue Feb 14 09:03:32 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Tue, 14 Feb 2006 07:03:32 -0700 Subject: [Wtr-general] Select List Question Message-ID: <D18A8D68994F3F45AAAC8E6277B710870192BDE8@edith.ad.twtelecom.com> Sorry Bret, I sent the email from a web version of outlook and it apparently sent it as an attachment or something. Basically, I tried to install from the tarball but I'm not sure that I'm doing it quite right. I extracted it into the C: directory -- but I wasn't sure if I was supposed to actually do it into my existing watir directory (C:\Program Files\watir), and looking at the code you sent to try, I did a search of the files extracted from the tarball and in my existing ruby and watir directories but found no reference to INPUT_TYPES (I was trying to understand what the code was doing, my best guess is that I was adding the value "select" to a constant array) -- should I have found it? If I don't install the tarball into my existing watir directory, do I need to do anything special to make sure ruby uses the correct directory when executing a script? Also, I agree that the HTML doesn't seem up to snuff, I'm going to take that up with the developer to see if we can get it cleaned up. Thanks again for the help and prompt feedback. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Monday, February 13, 2006 11:40 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Select List Question Huh? On 2/13/06, Attebery, Bill <Bill.Attebery at twtelecom.com> wrote: The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060214/7d3433ba/attachment.html From Mark_Cain at rl.gov Tue Feb 14 10:34:46 2006 From: Mark_Cain at rl.gov (Cain, Mark) Date: Tue, 14 Feb 2006 07:34:46 -0800 Subject: [Wtr-general] Python to Ruby Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D56F@EX5V.rl.gov> Does anyone know of a tool that can take an existing Python script and convert it to Ruby? Or has anyone had any experience converting Python to Ruby? I have some internal scripts that I would like to convert to Ruby and don't want to reinvent to wheel doing it. Thanks, ____________________ Mark L. Cain LMIT - E*STARS(r) ~ Lead Test Engineer 1981 Snyder, MSIN: G3-62, Richland, WA 99354 Mark_Cain at RL.gov 509.376.5458 "640 Kilobytes of computer memory ought to be enough for anybody." - Bill Gates, 1981 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060214/e831fafd/attachment.html From bret at pettichord.com Tue Feb 14 10:34:30 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 14 Feb 2006 09:34:30 -0600 Subject: [Wtr-general] Select List Question In-Reply-To: <D18A8D68994F3F45AAAC8E6277B710870192BDE8@edith.ad.twtelecom.com> References: <D18A8D68994F3F45AAAC8E6277B710870192BDE8@edith.ad.twtelecom.com> Message-ID: <ade75c5b0602140734j5757217at8767477aa18d5512@mail.gmail.com> On 2/14/06, Attebery, Bill <Bill.Attebery at twtelecom.com> wrote: > > Basically, I tried to install from the tarball but I'm not sure that I'm > doing it quite right. > I extracted it into the C: directory -- but I wasn't sure if I was > supposed to actually do it into my existing watir directory (C:\Program > Files\watir), and looking at the code you sent to try, I did a search of the > files extracted from the tarball and in my existing ruby and watir > directories but found no reference to INPUT_TYPES (I was trying to > understand what the code was doing, my best guess is that I was adding the > value "select" to a constant array) -- should I have found it? If I don't > install the tarball into my existing watir directory, do I need to do > anything special to make sure ruby uses the correct directory when executing > a script? > There is a command line installer in there (install.rb) but i think it is broken. The Watir library (the important part) is actually installed in your ruby directory, by default C:\ruby\lib\ruby\1.8. You can hand-copy watir.rband the files in the watir subdirectory ( i.e. watir\watir\*.*) from the tarball in the mean time. Your guess about the code is correct. (I know it sounds odd that you can add a value to a constant array, but in Ruby you can.) You should have been able to find it in watir.rb. Here is the original code in the tarball that you need: class SelectList < InputElement INPUT_TYPES = ["select-one", "select-multiple"] ... Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060214/68aad4af/attachment.html From Bill.Attebery at twtelecom.com Tue Feb 14 11:03:05 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Tue, 14 Feb 2006 09:03:05 -0700 Subject: [Wtr-general] Select List Question Message-ID: <D18A8D68994F3F45AAAC8E6277B710870192BDE9@edith.ad.twtelecom.com> I think I'm catching on -- the c:\Program Files\Watir directory holds the docs, help, examples and test scripts and the watir source goes to the Ruby directories (seems obvious now, took a while for THAT light to go on ;-) I'm still not sure I'm getting the correct tarball -- on ruby forge I went to http://rubyforge.org/cgi-bin/viewcvs.cgi/?root=wtr and downloaded the root tarball. I read the Installer_readme.txt and followed those instructions to run the Installer.exe and follow the wizard. I found a watir folder and watir.rb (dated 8/20/2005 - more evidence I'm not getting the correct file) under C:\ruby\lib\ruby\site_ruby\1.8 (I don't see any water files in c:\ruby\lib\ruby\1.8) -- in the watir.rb file this is what I found for the SelectList class (no INPUT_TYPE -- I see where it would go and follow how you were putting it there I think, it just looks like I have the wrong/old? file). Can you instruct me as to where I should be going to get the latest development tarball. class SelectList < Element # returns an initialized instance of a SelectList object # * ieController - an instance of an IEController # * how - symbol - how we access the select box # * what - what we use to access the select box, name, id etc def initialize( ieController, how , what ) @ieController = ieController @how = how @what = what @o = @ieController.getObject(@how, @what, ["select-one", "select-multiple"]) super( @o ) end attr :o ... _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Tuesday, February 14, 2006 8:35 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Select List Question On 2/14/06, Attebery, Bill <Bill.Attebery at twtelecom.com> wrote: Basically, I tried to install from the tarball but I'm not sure that I'm doing it quite right. I extracted it into the C: directory -- but I wasn't sure if I was supposed to actually do it into my existing watir directory (C:\Program Files\watir), and looking at the code you sent to try, I did a search of the files extracted from the tarball and in my existing ruby and watir directories but found no reference to INPUT_TYPES (I was trying to understand what the code was doing, my best guess is that I was adding the value "select" to a constant array) -- should I have found it? If I don't install the tarball into my existing watir directory, do I need to do anything special to make sure ruby uses the correct directory when executing a script? There is a command line installer in there (install.rb) but i think it is broken. The Watir library (the important part) is actually installed in your ruby directory, by default C:\ruby\lib\ruby\1.8. You can hand-copy watir.rb and the files in the watir subdirectory (i.e. watir\watir\*.*) from the tarball in the mean time. Your guess about the code is correct. (I know it sounds odd that you can add a value to a constant array, but in Ruby you can.) You should have been able to find it in watir.rb. Here is the original code in the tarball that you need: class SelectList < InputElement INPUT_TYPES = ["select-one", "select-multiple"] ... Bret The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060214/1da99c54/attachment.html From carl.l.shaulis at convergys.com Tue Feb 14 11:56:31 2006 From: carl.l.shaulis at convergys.com (carl.l.shaulis at convergys.com) Date: Tue, 14 Feb 2006 10:56:31 -0600 Subject: [Wtr-general] Unable to click on this link Message-ID: <OF2294C278.6784D5C2-ON86257115.005BFAA6-86257115.005D10FA@nd.convergys.com> Good morning: I have taxed my two brain cells on how to click this link. Unfortunately the developers did not include SPAN id or title. I have figured out that this link is in table 20 Row 10 Column1, but I can not get the link to work with this syntax. table = @ie.table(:index, 20).flash # Table.new(@ie.table(:index, 20)).printPretty myTable = @ie.table(:index, 20) test1 = myTable[10][1].click Using SpySmith the content of this link looks like this. Active Element: [A], Index: [417] <A class=universalLink href='javascript:switchSite("_bo_site:13024438");'> <SPAN class=b>Ingleside</SPAN> </A> The developers have the href becoming something unique every time I import my data, so I can not use a regular expression and grab the business object ID in the href. There are 9 similar links on this page and I need this specific one. The only thing that seems unique to me is the Active Element Index. I tried this syntax to see if I could at least locate the link by that index, but no such luck. assert_equal( "test1" , @ie.link(:index, 417).id ) assert_equal( "test2" , @ie.link(:index, 417).name ) How might you approach clicking on this link? The next thing I am going to try is capture an array of all the links on the page, then click on the appropriate array index. Seems to me there should be a more straight forward way and unfortunately this is legacy code and developers will not fix the HTML. ;O( Any thoughts would be most appreciated! Thanks, Carl Carl L. Shaulis Convergys - Senior Analyst 512-634-0607 -- "NOTICE: The information contained in this electronic mail transmission is intended by Convergys Corporation for the use of the named individual or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone (collect), so that the sender's address records can be corrected." From Bill.Attebery at twtelecom.com Tue Feb 14 12:03:03 2006 From: Bill.Attebery at twtelecom.com (Attebery, Bill) Date: Tue, 14 Feb 2006 10:03:03 -0700 Subject: [Wtr-general] Select List Question Message-ID: <D18A8D68994F3F45AAAC8E6277B7108704BE0DA1@edith.ad.twtelecom.com> Ok Bret, I got it -- the installer isn't working (as you said), I followed your instrux and copied the files manually. Now I see your change and it works like a champ!!! Thanks for all the help and insight!!!! _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Attebery, Bill Sent: Tuesday, February 14, 2006 9:03 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Select List Question I think I'm catching on -- the c:\Program Files\Watir directory holds the docs, help, examples and test scripts and the watir source goes to the Ruby directories (seems obvious now, took a while for THAT light to go on ;-) I'm still not sure I'm getting the correct tarball -- on ruby forge I went to http://rubyforge.org/cgi-bin/viewcvs.cgi/?root=wtr and downloaded the root tarball. I read the Installer_readme.txt and followed those instructions to run the Installer.exe and follow the wizard. I found a watir folder and watir.rb (dated 8/20/2005 - more evidence I'm not getting the correct file) under C:\ruby\lib\ruby\site_ruby\1.8 (I don't see any water files in c:\ruby\lib\ruby\1.8) -- in the watir.rb file this is what I found for the SelectList class (no INPUT_TYPE -- I see where it would go and follow how you were putting it there I think, it just looks like I have the wrong/old? file). Can you instruct me as to where I should be going to get the latest development tarball. class SelectList < Element # returns an initialized instance of a SelectList object # * ieController - an instance of an IEController # * how - symbol - how we access the select box # * what - what we use to access the select box, name, id etc def initialize( ieController, how , what ) @ieController = ieController @how = how @what = what @o = @ieController.getObject(@how, @what, ["select-one", "select-multiple"]) super( @o ) end attr :o ... _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Tuesday, February 14, 2006 8:35 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Select List Question On 2/14/06, Attebery, Bill <Bill.Attebery at twtelecom.com> wrote: Basically, I tried to install from the tarball but I'm not sure that I'm doing it quite right. I extracted it into the C: directory -- but I wasn't sure if I was supposed to actually do it into my existing watir directory (C:\Program Files\watir), and looking at the code you sent to try, I did a search of the files extracted from the tarball and in my existing ruby and watir directories but found no reference to INPUT_TYPES (I was trying to understand what the code was doing, my best guess is that I was adding the value "select" to a constant array) -- should I have found it? If I don't install the tarball into my existing watir directory, do I need to do anything special to make sure ruby uses the correct directory when executing a script? There is a command line installer in there (install.rb) but i think it is broken. The Watir library (the important part) is actually installed in your ruby directory, by default C:\ruby\lib\ruby\1.8. You can hand-copy watir.rb and the files in the watir subdirectory (i.e. watir\watir\*.*) from the tarball in the mean time. Your guess about the code is correct. (I know it sounds odd that you can add a value to a constant array, but in Ruby you can.) You should have been able to find it in watir.rb. Here is the original code in the tarball that you need: class SelectList < InputElement INPUT_TYPES = ["select-one", "select-multiple"] ... Bret The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060214/03665356/attachment.html From carl.l.shaulis at convergys.com Tue Feb 14 12:30:05 2006 From: carl.l.shaulis at convergys.com (carl.l.shaulis at convergys.com) Date: Tue, 14 Feb 2006 11:30:05 -0600 Subject: [Wtr-general] Unable to click on this link In-Reply-To: <OF2294C278.6784D5C2-ON86257115.005BFAA6-86257115.005D10FA@nd.convergys.com> Message-ID: <OFCF30819E.5DB90809-ON86257115.005FE080-86257115.00602367@nd.convergys.com> Hey WATIR experts, I used this syntax to find my desired link. index = 1 @ie.links.each do |link| assert_equal( @ie.link(:index, index).href , link.href ) puts index puts "link " + @ie.link(:index, index).href index+=1 end I did get this to work. mylink = @ie.link(:index, 26).href puts "My target link is " + mylink @ie.goto(mylink) If there is a better solution please shout out! Thanks, Carl Carl L. Shaulis Convergys - Senior Analyst 512-634-0607 Carl L Shaulis/CIMG/CVG@ CVG To Sent by: wtr-general at rubyforge.org wtr-general-bounc cc es at rubyforge.org Subject [Wtr-general] Unable to click on 02/14/2006 10:56 this link AM Please respond to wtr-general at rubyf orge.org Good morning: I have taxed my two brain cells on how to click this link. Unfortunately the developers did not include SPAN id or title. I have figured out that this link is in table 20 Row 10 Column1, but I can not get the link to work with this syntax. table = @ie.table(:index, 20).flash # Table.new(@ie.table(:index, 20)).printPretty myTable = @ie.table(:index, 20) test1 = myTable[10][1].click Using SpySmith the content of this link looks like this. Active Element: [A], Index: [417] <A class=universalLink href='javascript:switchSite("_bo_site:13024438");'> <SPAN class=b>Ingleside</SPAN> </A> The developers have the href becoming something unique every time I import my data, so I can not use a regular expression and grab the business object ID in the href. There are 9 similar links on this page and I need this specific one. The only thing that seems unique to me is the Active Element Index. I tried this syntax to see if I could at least locate the link by that index, but no such luck. assert_equal( "test1" , @ie.link(:index, 417).id ) assert_equal( "test2" , @ie.link(:index, 417).name ) How might you approach clicking on this link? The next thing I am going to try is capture an array of all the links on the page, then click on the appropriate array index. Seems to me there should be a more straight forward way and unfortunately this is legacy code and developers will not fix the HTML. ;O( Any thoughts would be most appreciated! Thanks, Carl Carl L. Shaulis Convergys - Senior Analyst 512-634-0607 -- "NOTICE: The information contained in this electronic mail transmission is intended by Convergys Corporation for the use of the named individual or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone (collect), so that the sender's address records can be corrected." _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From tester.paul at gmail.com Tue Feb 14 14:15:39 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 14 Feb 2006 14:15:39 -0500 Subject: [Wtr-general] Unable to click on this link In-Reply-To: <OF2294C278.6784D5C2-ON86257115.005BFAA6-86257115.005D10FA@nd.convergys.com> References: <OF2294C278.6784D5C2-ON86257115.005BFAA6-86257115.005D10FA@nd.convergys.com> Message-ID: <37c405480602141115t9713a36j@mail.gmail.com> Ha! Funny you should ask.. I just solved the same problem last week.. It took me a few days to figure it out, so I'm happy to share it with you. On 14/02/06, carl.l.shaulis at convergys.com <carl.l.shaulis at convergys.com> wrote: > > Using SpySmith the content of this link looks like this. > > Active Element: [A], Index: [417] > <A class=universalLink href='javascript:switchSite("_bo_site:13024438");'> > <SPAN class=b>Ingleside</SPAN> </A> > > When I run the show_spans() command on the desired frame, I see something like the following: ---- Found 12 span tags 1 id=_ctl0_BorrowerList1_lblBorrowerListTitle class= 2 id= class= 3 id= class=HeaderHiliteClass 4 id= class= 5 id= class=GroupClass 6 id= class= 7 id= class=GroupClass 8 id= class= 9 id= class=GroupClass 10 id= class= 11 id= class= 12 id= class= ---- Unfortunately the Span method only (currently) allows for the following 3 "how" attributes: :index, :id, :name, but I would need something like the ":text" attribute to identify it by the text contained within the Span tags. I decided to capture the text contents to a hash/dictionary array to associate them with their index numbers. That way I can use the Span method by :index to flash and click the desired span tags. Here's my code: ---- # variables $C_Tree_h = Hash.new() last_item = $ie.frame("ContextTree").spans.length - 3 # This frame always has 3 extra Spans at the end # Populate the Hash/Dictionary with the index numbers and text contents of every other Span in this Frame 3.step(last_item, 2) { |x| $C_Tree_h[x] = $ie.frame("ContextTree").span(:index, x).text() } # then navigate to the desired spot with: $ie.frame("ContextTree").span(:index, $C_Tree_h.index("Span Tag Text")).click ---- The first 3 lines (ignoring the comments) are setup and I only need to run them once on the frame when I enter the page. The last command I can run as many times as I want to navigate the Context Tree with the unidentifiable Span tags. I plan to make a method out of these lines to clean up the code a bit, but I'm currently busy testing another project. I'll get to it later. Hope that helps. Cheers. Paul. P.S., FEATURE REQUEST: If I could make a request to improve the Span method, it would be to add ":text" to the "how". That would be sweet! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060214/797cdf84/attachment.html From chris.schmechel at gmail.com Tue Feb 14 17:05:00 2006 From: chris.schmechel at gmail.com (Chris Schmechel) Date: Tue, 14 Feb 2006 14:05:00 -0800 Subject: [Wtr-general] Verify HTTP 200 OK response Message-ID: <7a754c960602141405w75b37064lfe90bb9399ab497e@mail.gmail.com> Hi, Is there a way in Watir to verify whether a page succesfully loaded from a HTTP perspective (ie. I got a 200 OK return code)? I'm executing ie.button().click method and I get redirected to an external page. I need to validate that page loaded correctly. Thanks again! Chris Schmechel From bret at pettichord.com Tue Feb 14 21:23:26 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 14 Feb 2006 20:23:26 -0600 Subject: [Wtr-general] Unable to click on this link In-Reply-To: <37c405480602141115t9713a36j@mail.gmail.com> References: <OF2294C278.6784D5C2-ON86257115.005BFAA6-86257115.005D10FA@nd.convergys.com> <37c405480602141115t9713a36j@mail.gmail.com> Message-ID: <ade75c5b0602141823i67d2e516l45206d83090f9e54@mail.gmail.com> On 2/14/06, Paul Carvalho <tester.paul at gmail.com> wrote: > > P.S., FEATURE REQUEST: > If I could make a request to improve the Span method, it would be to add > ":text" to the "how". That would be sweet! This has been in HEAD for months. We're overdue for a new release. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060214/3e6d23a6/attachment.html From satti at qantom.com Tue Feb 14 23:15:12 2006 From: satti at qantom.com (Sathya Shankar) Date: Wed, 15 Feb 2006 09:45:12 +0530 Subject: [Wtr-general] Verify HTTP 200 OK response In-Reply-To: <7a754c960602141405w75b37064lfe90bb9399ab497e@mail.gmail.com> References: <7a754c960602141405w75b37064lfe90bb9399ab497e@mail.gmail.com> Message-ID: <43F2AAD0.4090307@qantom.com> Chris Schmechel wrote: >Hi, > >Is there a way in Watir to verify whether a page succesfully >loaded from a HTTP perspective (ie. I got a 200 OK return >code)? > >I'm executing ie.button().click method and I get redirected to >an external page. I need to validate that page loaded correctly. > > Use Net::HTTP class of Ruby to check the response by navigating to the page. require 'net/http' h = Net::HTTP.new('www.foo.com', 80) resp, data = h.get('/index.html', nil ) puts "Code = #{resp.code}" if #(resp.code) == 200 puts "The page has loaded" else puts "The page Error!!!" end >Thanks again! > >Chris Schmechel > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > -- In most parts of the world they drive on the left of the road. In Bangalore we drive on what?s left of the road. Sathya Shankar M G Software Testing Engineer Qantom Software http://www.qantom.com Ph : 26799269 Xtn. 123 sip : satti at sip411.com From christopher.mcmahon at gmail.com Tue Feb 14 23:33:06 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 14 Feb 2006 22:33:06 -0600 Subject: [Wtr-general] Verify HTTP 200 OK response In-Reply-To: <43F2AAD0.4090307@qantom.com> References: <7a754c960602141405w75b37064lfe90bb9399ab497e@mail.gmail.com> <43F2AAD0.4090307@qantom.com> Message-ID: <72799cd70602142033m76a95a24v9a573a68d9b32810@mail.gmail.com> On 2/14/06, Sathya Shankar <satti at qantom.com> wrote: > Chris Schmechel wrote: > Use Net::HTTP class of Ruby to check the response by navigating to the page. > > require 'net/http' > h = Net::HTTP.new('www.foo.com', 80) > resp, data = h.get('/index.html', nil ) > puts "Code = #{resp.code}" > if #(resp.code) == 200 > puts "The page has loaded" > else > puts "The page Error!!!" > end Nice. I'm starting to really like net/http. I use it a lot, and it's really convenient. -Chris From chris.schmechel at gmail.com Wed Feb 15 11:11:38 2006 From: chris.schmechel at gmail.com (Chris Schmechel) Date: Wed, 15 Feb 2006 08:11:38 -0800 Subject: [Wtr-general] Verify HTTP 200 OK response Message-ID: <7a754c960602150811w177e2343t15b978ef846d5597@mail.gmail.com> Ok, but I don't really want to navigate to the page using both IE and Net:HTTP classes. I've already navigated to the main page via ie.goto() and I'm using ie.button().click to navigate to the resulting page. Is there an equivalent method in Watir or something I can query in the DOM to return the HTTP status after the ie.button().click method finishes? It would be nice to have something similar to $mech->status in Perl. I'm only aware of the ie.contains_text() method which isn't quite right. Thanks again, Chris Schmechel On 2/14/06, Sathya Shankar <satti at qantom.com> wrote: > Chris Schmechel wrote: > Use Net::HTTP class of Ruby to check the response by navigating to the page. > > require 'net/http' > h = Net::HTTP.new('www.foo.com', 80) > resp, data = h.get('/index.html', nil ) > puts "Code = #{resp.code}" > if #(resp.code) == 200 > puts "The page has loaded" > else > puts "The page Error!!!" > end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060215/7791b749/attachment.html From billagee at gmail.com Wed Feb 15 13:40:58 2006 From: billagee at gmail.com (Bill Agee) Date: Wed, 15 Feb 2006 10:40:58 -0800 Subject: [Wtr-general] Verify HTTP 200 OK response In-Reply-To: <7a754c960602150811w177e2343t15b978ef846d5597@mail.gmail.com> References: <7a754c960602150811w177e2343t15b978ef846d5597@mail.gmail.com> Message-ID: <73e7817e0602151040w1ceba477v16c055234cefcf24@mail.gmail.com> On 2/15/06, Chris Schmechel <chris.schmechel at gmail.com> wrote: .... > > Is there an equivalent method in Watir or something I can query in the DOM > to return the HTTP status after the ie.button().click method finishes? It > would be nice to have something similar to $mech->status in Perl. I'm only > aware of the ie.contains_text() method which isn't quite right. Hi Chris! >From a glance at watir.rb it looks like some error checking is done internally as you navigate, using the 'check_for_http_error' method. However as far as I can tell, that checks for "shdoclc.dll" in the current URL, which may not be what you want. In this sort of case, after a click, I just go ahead and start asserting for the existence of values I know should be on the resulting page. Then if any of the asserts fail I know the point where something went wrong. I guess alternately if the web app uses a custom 404 page that overrides IE's default you could assert/check that the 404 page text is not present. There could be some part of Watir I haven't seen where more HTTP status code checking lives, or maybe there's a quick way to use the IE OLE interface directly to get the status. I glanced over the MSDN reference but nothing 'clicked' as far as an easy way to do it. Thanks Bill From philipreedtech at gmail.com Wed Feb 15 14:26:52 2006 From: philipreedtech at gmail.com (philip reed) Date: Wed, 15 Feb 2006 14:26:52 -0500 Subject: [Wtr-general] Verify HTTP 200 OK response In-Reply-To: <73e7817e0602151040w1ceba477v16c055234cefcf24@mail.gmail.com> References: <7a754c960602150811w177e2343t15b978ef846d5597@mail.gmail.com> <73e7817e0602151040w1ceba477v16c055234cefcf24@mail.gmail.com> Message-ID: <f462129b0602151126j1853a367ye9668c0b819ac821@mail.gmail.com> This is somewhat of a digression, but in Firefox I use a nice plugin to troubleshoot HTTP stuff called LiveHTTPHeaders <http://livehttpheaders.mozdev.org/>. Perhaps it's unrealistic to think that something like that exists for MSIE, but if it did then there would probably be some way to hack it to give browser based output as you seek. Anyway, it's just a thought. - Philip On 2/15/06, Bill Agee <billagee at gmail.com> wrote: > On 2/15/06, Chris Schmechel <chris.schmechel at gmail.com> wrote: > .... > > -- Philip Reed, Developer Positronic Design http://www.positronicdesign.com From tester.paul at gmail.com Wed Feb 15 14:33:51 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Wed, 15 Feb 2006 14:33:51 -0500 Subject: [Wtr-general] How can I display a message while a Watir script is Sleeping? Message-ID: <37c405480602151133n4cc8be48n@mail.gmail.com> Hi there, this may seem trivial to some, but I haven't had any success trying to figure out how to do this on my own, and I didn't have any success checking the message archives. Here's what I'd like to do.. I have a point in one script where it has to wait a few minutes for some stuff to happen in the background. I'd like to display some sort of message on screen to explain that the test is still in progress but that it is waiting for some event to happen. A pop-up window with an [OK] button would be nice. I couldn't find anything in the Ruby technical docs that would help me *create* a pop-up window. Can this be done with Ruby? Do I have to make a call to a Javascript function to do this? Can someone please point me in the right direction here? Thanks. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060215/644d7bc3/attachment.html From bret at pettichord.com Thu Feb 16 02:11:18 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 16 Feb 2006 01:11:18 -0600 Subject: [Wtr-general] ANN: Watir WebRecorder In-Reply-To: <dd78cfb30602110022u2b7ed089xae0cad39dde46e62@mail.gmail.com> References: <dd78cfb30602110022u2b7ed089xae0cad39dde46e62@mail.gmail.com> Message-ID: <ade75c5b0602152311i1bdd6175w26928263b7dcc0f0@mail.gmail.com> This looks useful. I wanted to report a couple of bugs, comment on some of the limits you mention of WebRecorder and/or Watir, and clarify my position on recorders, including a general concern about claims made about WebRecorder. First the bugs. 1. When i recorded a script i saw a lot of calls to IE#wait. I don't believe they are necessary in any of the cases i saw. In fact, my position is pretty much that users shouldn't have to make calls to IE#wait in their scripts. If they do, it is a bug in Watir. I'd suggest removing them and reporting any cases where they seem necessary to you as bugs. 2. Not really a bug, but i think the "require 'test/unit/ui/console/testrunner'" is also unnecessary. One thing missing from the Watir version right now is an easy way to record > code to extract data from the page. OK. It also doesn't support file downloads yet. I plan to rewrite Watir's support for this. The current implentation is buggy. The other thing that is missing is support for Area tags. While WebRecorder > can record clicks on Area maps I couldn't find any support to play them back > in Watir. True. I haven't seen much demand for this, so i don't think any one is working on it. Regarding my views of recorders... I think that recorders can be useful aids to programmers. But i think you need to know how to write and modify the code that is being generated. One problem is that recorders often lead people into thinking that they don't have to be a programmer to use the tool. In fact, your website makes this very claim. This is what i object to. Not to recorders themselves. A second concern is that it simply is much harder to make a reliable recorder than it to make a reliable execution tool. This is why Watir is an execution tool, only. The problem is that there are always all kinds of controls that a tool can execute against but can't record. For example, i tried to use WebRecorder against a random website that had some javascript links (probably div tags, i didn't even look) and they didn't get recorded. I didn't even report that as a bug, because i didn't expect it to work. Every test tool i've ever used that had a recorder had more reliability problems with the recorders than the execution. I see them as two separate things. But that isn't the view of the non-programming user. To even understand the limits of a recorder, you have to know something about html -- in other words you have to be, in some sense, a programmer. Anyway, my point is that if i were to bundle a recorder (any recorder) with Watir, people would try it first, learn that it wasn't reliable and then conclude that Watir wasn't reliable. In other words, it would reduce the percieved reliability of Watir. If the recorder is a separate tool, that doesn't make any claims about allowing non-programmers to create Watir scripts, then i'm cool with it. Am i being harsh with WebRecorder? The Watir WebRecorder page says "WebRecorder is designed to speed up the creation of web testing and web automation scripts." I'm cool with that. But commercial WebRecorder it is billed as "No Programming Skills Required". I haven't looked at this version of the tool, but i'm pretty skeptical about this claim. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060216/0292d006/attachment.html From zeljko.filipin at gmail.com Thu Feb 16 02:17:18 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Thu, 16 Feb 2006 08:17:18 +0100 Subject: [Wtr-general] How can I display a message while a Watir script is Sleeping? In-Reply-To: <37c405480602151133n4cc8be48n@mail.gmail.com> References: <37c405480602151133n4cc8be48n@mail.gmail.com> Message-ID: <f81b1250602152317g4e1068fbrcd5c9ba8635b5c5f@mail.gmail.com> The easiest way I can think of is to output something in the console. # some ruby/watir codeputs "Please wait a few minutes for some stuff to happen in the background."# more ruby/watir code On 2/15/06, Paul Carvalho <tester.paul at gmail.com> wrote:> Hi there, this may seem trivial to some, but I haven't had any success> trying to figure out how to do this on my own, and I didn't have any success> checking the message archives. Here's what I'd like to do..>> I have a point in one script where it has to wait a few minutes for some> stuff to happen in the background. I'd like to display some sort of message> on screen to explain that the test is still in progress but that it is> waiting for some event to happen. A pop-up window with an [OK] button would> be nice.>> I couldn't find anything in the Ruby technical docs that would help me> *create* a pop-up window. Can this be done with Ruby? Do I have to make a> call to a Javascript function to do this?>> Can someone please point me in the right direction here? Thanks.>> Paul.>>> _______________________________________________> Wtr-general mailing list> Wtr-general at rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general>> --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/ From marcus.tettmar at gmail.com Thu Feb 16 03:55:19 2006 From: marcus.tettmar at gmail.com (Marcus Tettmar) Date: Thu, 16 Feb 2006 08:55:19 +0000 Subject: [Wtr-general] ANN: Watir WebRecorder In-Reply-To: <ade75c5b0602152311i1bdd6175w26928263b7dcc0f0@mail.gmail.com> References: <dd78cfb30602110022u2b7ed089xae0cad39dde46e62@mail.gmail.com> <ade75c5b0602152311i1bdd6175w26928263b7dcc0f0@mail.gmail.com> Message-ID: <dd78cfb30602160055v701d8a3ag642f0c15286a6c65@mail.gmail.com> Hi Bret, On 2/16/06, Bret Pettichord <bret at pettichord.com> wrote: > > 1. When i recorded a script i saw a lot of calls to IE#wait. I don't > believe they are necessary in any of the cases i saw. In fact, my position > is pretty much that users shouldn't have to make calls to IE#wait in their > scripts. If they do, it is a bug in Watir. I'd suggest removing them and > reporting any cases where they seem necessary to you as bugs. In 0.3 under Tools/Options you can switch off "Insert Waits". I have found that they are sometimes useful so I have made it optional. At present you also need it to record/automate server auth logins. Goto waits forever if a login box pops up because the page hasn't finished loading until after the password has been issued. So there are options to use ie.navigate instead of Goto and therefore an ie.wait is needed after it. But in the latest version 0.3 these things are optional. So you can switch this off. 2. Not really a bug, but i think the "require > 'test/unit/ui/console/testrunner'" is also unnecessary. I'll check that out. The other thing that is missing is support for Area tags. While WebRecorder > can record clicks on Area maps I couldn't find any support to play them back > in Watir. > True. I haven't seen much demand for this, so i don't think any one is > working on it. > In the past I have had to automate web sites that used an Area for the navigation menu. So it was necessary to record it. But it is true that they don't seem to be that prevalent. Regarding my views of recorders... > > I think that recorders can be useful aids to programmers. But i think you > need to know how to write and modify the code that is being generated. > I agree. One problem is that recorders often lead people into thinking that they > don't have to be a programmer to use the tool. > I'm not so sure. I cannot be alone in using Microsoft Office's macro recorder to get a jump start on creating VBA code. If I can't remember how to do something, or want to get the bare bones of the code from which to work I will nearly always record the main process with the VBA recorder. But then I will tidy up the code and make changes to it. I am very experienced in VBA yet I find the recorder extremely useful. I am aware of many other VBA programmers who do the same. At the same time the complete beginner can quickly build basic macros without knowing any code. They won't get as far as the programmer but both are happy and both find the tool useful within the limitations of their abilities. He knows that a programmer would get more out of it. In fact, your website makes this very claim. This is what i object to. Not > to recorders themselves. > In respect of the Watir WebRecorder I wasn't aware that we were making this claim at all. In regards to Macro Scheduler's WebRecorder it is true that we say no programming skills required. But this version outputs very different code and is for a very different type of user. In terms of the code it outputs the people that use it don't need to modify it. I can cite customers with no programming experience at all using MacroScript WebRecorder to create dozens of useful web automation scripts without really understanding the code it is creating. So in their case I can stand by our claims. A second concern is that it simply is much harder to make a reliable > recorder than it to make a reliable execution tool. This is why Watir is an > execution tool, only. The problem is that there are always all kinds of > controls that a tool can execute against but can't record. For example, i > tried to use WebRecorder against a random website that had some javascript > links (probably div tags, i didn't even look) and they didn't get recorded. > I didn't even report that as a bug, because i didn't expect it to work. > Every test tool i've ever used that had a recorder had more reliability > problems with the recorders than the execution. I see them as two separate > things. But that isn't the view of the non-programming user. To even > understand the limits of a recorder, you have to know something about html > -- in other words you have to be, in some sense, a programmer. Anyway, my > point is that if i were to bundle a recorder (any recorder) with Watir, > people would try it first, learn that it wasn't reliable and then conclude > that Watir wasn't reliable. In other words, it would reduce the percieved > reliability of Watir. > I haven't gotten around to creating a help file for the Watir version yet, but will do so soon. When I do I can write in some caveats. The MacroScript version explains that not everything can be recorded, but to contact us if they find anything that can't so that we can see if we can improve it. Otherwise we never get to know about these sites and while we spend time looking at random sites we can't find everything. As you say it is hard, perhaps impossible, to make a recorder for all web sites that will manage to record everything. There's simply a limit to what the developer can think of to test and the number of web sites and the ways they work is infinite. So far our users appear to be aware of that and let us know when they find something it fails with. We are either able to find a solution and make a modification for them (and the product gets better) or we have to explain the reason why it can't be recorded. Re the issue you found - possibly Div tags - Watir WebRecorder doesn't record Div tags. MacroScript WebRecorder doesn't by default but has an option where you can specify extra tags you'd like it to record. So it probably gets round this problem. In time we could add the same sort of functionality to Watir WebRecorder if people are interested. If the recorder is a separate tool, that doesn't make any claims about > allowing non-programmers to create Watir scripts, then i'm cool with it. > How about I add a big warning box that appears on startup with a big disclaimer saying that knowledge of Ruby/Watir is necessary and that the recorder has limitations and may not be able to record everything? Am i being harsh with WebRecorder? The Watir WebRecorder page says > "WebRecorder is designed to speed up the creation of web testing and web > automation scripts." I'm cool with that. But commercial WebRecorder it is > billed as "No Programming Skills Required". I haven't looked at this version > of the tool, but i'm pretty skeptical about this claim. > As I said, I can stand by that claim just on the basis of the sort of people that are using Macro Scheduler and MacroScript WebRecorder. That said while in many cases no programming skills are required, they do help! Many people with no prior programming skills have used WebRecorder/Macro Scheduler to create pretty amazing scripts (but have gained programming skills along the way). With Watir WebRecorder however, I would expect people using Watir WebRecorder to understand Watir/Ruby to start with. I will try to make that clearer. -- Marcus Tettmar http://www.mjtnet.com/ Macro Scheduler & WebRecorder for Windows & Web Automation and Testing. WebRecorder for Ruby/Watir now available. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060216/bfc458cd/attachment.html From marcus.tettmar at gmail.com Thu Feb 16 06:06:32 2006 From: marcus.tettmar at gmail.com (Marcus Tettmar) Date: Thu, 16 Feb 2006 11:06:32 +0000 Subject: [Wtr-general] ANN: Watir WebRecorder In-Reply-To: <dd78cfb30602160055v701d8a3ag642f0c15286a6c65@mail.gmail.com> References: <dd78cfb30602110022u2b7ed089xae0cad39dde46e62@mail.gmail.com> <ade75c5b0602152311i1bdd6175w26928263b7dcc0f0@mail.gmail.com> <dd78cfb30602160055v701d8a3ag642f0c15286a6c65@mail.gmail.com> Message-ID: <dd78cfb30602160306p3952399dka646a5069786e55f@mail.gmail.com> As a follow up I have just uploaded version 0.4 of Watir WebRecorder which now has support for Divs and TDs which have onclick handlers. It also displays a disclaimer on startup regarding its limitations and that any failure to record something is no reflection on the abilities of Watir. I've also added a disclaimer to the Watir WebRecorder page on our site and have had the Macro Scheduler WebRecorder page modified to say "No Advanced Programming Skills Required" rather than "No Programming Skills Required". I hope this goes some way towards satisfying any concerns. http://www.mjtnet.com/watir_webrecorder.htm Regards, Marcus On 2/16/06, Marcus Tettmar <marcus.tettmar at gmail.com> wrote: > > Hi Bret, > > On 2/16/06, Bret Pettichord <bret at pettichord.com> wrote: > > > > 1. When i recorded a script i saw a lot of calls to IE#wait. I don't > > believe they are necessary in any of the cases i saw. In fact, my position > > is pretty much that users shouldn't have to make calls to IE#wait in their > > scripts. If they do, it is a bug in Watir. I'd suggest removing them and > > reporting any cases where they seem necessary to you as bugs. > > > In 0.3 under Tools/Options you can switch off "Insert Waits". I have > found that they are sometimes useful so I have made it optional. At present > you also need it to record/automate server auth logins. Goto waits forever > if a login box pops up because the page hasn't finished loading until after > the password has been issued. So there are options to use ie.navigateinstead of Goto and therefore an > ie.wait is needed after it. But in the latest version 0.3 these things > are optional. So you can switch this off. > > 2. Not really a bug, but i think the "require > > 'test/unit/ui/console/testrunner'" is also unnecessary. > > > I'll check that out. > > The other thing that is missing is support for Area tags. While > > WebRecorder can record clicks on Area maps I couldn't find any support to > > play them back in Watir. > > > > True. I haven't seen much demand for this, so i don't think any one is > > working on it. > > > > In the past I have had to automate web sites that used an Area for the > navigation menu. So it was necessary to record it. But it is true that > they don't seem to be that prevalent. > > > Regarding my views of recorders... > > > > I think that recorders can be useful aids to programmers. But i think > > you need to know how to write and modify the code that is being generated. > > > > I agree. > > One problem is that recorders often lead people into thinking that they > > don't have to be a programmer to use the tool. > > > > I'm not so sure. I cannot be alone in using Microsoft Office's macro > recorder to get a jump start on creating VBA code. If I can't remember how > to do something, or want to get the bare bones of the code from which to > work I will nearly always record the main process with the VBA recorder. > But then I will tidy up the code and make changes to it. I am very > experienced in VBA yet I find the recorder extremely useful. I am aware of > many other VBA programmers who do the same. At the same time the complete > beginner can quickly build basic macros without knowing any code. They > won't get as far as the programmer but both are happy and both find the tool > useful within the limitations of their abilities. He knows that a > programmer would get more out of it. > > In fact, your website makes this very claim. This is what i object to. Not > > to recorders themselves. > > > > In respect of the Watir WebRecorder I wasn't aware that we were making > this claim at all. In regards to Macro Scheduler's WebRecorder it is true > that we say no programming skills required. But this version outputs very > different code and is for a very different type of user. In terms of the > code it outputs the people that use it don't need to modify it. I can cite > customers with no programming experience at all using MacroScript > WebRecorder to create dozens of useful web automation scripts without really > understanding the code it is creating. So in their case I can stand by our > claims. > > A second concern is that it simply is much harder to make a reliable > > recorder than it to make a reliable execution tool. This is why Watir is an > > execution tool, only. The problem is that there are always all kinds of > > controls that a tool can execute against but can't record. For example, i > > tried to use WebRecorder against a random website that had some javascript > > links (probably div tags, i didn't even look) and they didn't get recorded. > > I didn't even report that as a bug, because i didn't expect it to work. > > Every test tool i've ever used that had a recorder had more reliability > > problems with the recorders than the execution. I see them as two separate > > things. But that isn't the view of the non-programming user. To even > > understand the limits of a recorder, you have to know something about html > > -- in other words you have to be, in some sense, a programmer. Anyway, my > > point is that if i were to bundle a recorder (any recorder) with Watir, > > people would try it first, learn that it wasn't reliable and then conclude > > that Watir wasn't reliable. In other words, it would reduce the percieved > > reliability of Watir. > > > > I haven't gotten around to creating a help file for the Watir version yet, > but will do so soon. When I do I can write in some caveats. The > MacroScript version explains that not everything can be recorded, but to > contact us if they find anything that can't so that we can see if we can > improve it. Otherwise we never get to know about these sites and while we > spend time looking at random sites we can't find everything. > > As you say it is hard, perhaps impossible, to make a recorder for all web > sites that will manage to record everything. There's simply a limit to what > the developer can think of to test and the number of web sites and the ways > they work is infinite. So far our users appear to be aware of that and let > us know when they find something it fails with. We are either able to find > a solution and make a modification for them (and the product gets better) or > we have to explain the reason why it can't be recorded. > > Re the issue you found - possibly Div tags - Watir WebRecorder doesn't > record Div tags. MacroScript WebRecorder doesn't by default but has an > option where you can specify extra tags you'd like it to record. So it > probably gets round this problem. In time we could add the same sort of > functionality to Watir WebRecorder if people are interested. > > If the recorder is a separate tool, that doesn't make any claims about > > allowing non-programmers to create Watir scripts, then i'm cool with it. > > > > How about I add a big warning box that appears on startup with a big > disclaimer saying that knowledge of Ruby/Watir is necessary and that the > recorder has limitations and may not be able to record everything? > > Am i being harsh with WebRecorder? The Watir WebRecorder page says > > "WebRecorder is designed to speed up the creation of web testing and web > > automation scripts." I'm cool with that. But commercial WebRecorder it is > > billed as "No Programming Skills Required". I haven't looked at this version > > of the tool, but i'm pretty skeptical about this claim. > > > > As I said, I can stand by that claim just on the basis of the sort of > people that are using Macro Scheduler and MacroScript WebRecorder. That > said while in many cases no programming skills are required, they do help! > Many people with no prior programming skills have used WebRecorder/Macro > Scheduler to create pretty amazing scripts (but have gained programming > skills along the way). > > With Watir WebRecorder however, I would expect people using Watir > WebRecorder to understand Watir/Ruby to start with. I will try to make that > clearer. > > -- > Marcus Tettmar > http://www.mjtnet.com/ > Macro Scheduler & WebRecorder for Windows & Web Automation and Testing. > WebRecorder for Ruby/Watir now available. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060216/a4851330/attachment.html From manishs at reconnex.net Thu Feb 16 09:10:09 2006 From: manishs at reconnex.net (Manish Sapariya) Date: Thu, 16 Feb 2006 19:40:09 +0530 Subject: [Wtr-general] how to access links in table cells Message-ID: <43F487C1.1090506@reconnex.net> Hi, I have a table, which has few columns with simple text and few columns with links. I want to do a search on text columns, and click in the link for one of the column for a given row. I can search the row successfully using text, but I can't click on that row. When I check the class of the row[i].class, it shows as TableCell. How do I click link object in that particular cell. THanks for help. REgards, Manish From chris.schmechel at gmail.com Thu Feb 16 18:12:07 2006 From: chris.schmechel at gmail.com (Chris Schmechel) Date: Thu, 16 Feb 2006 15:12:07 -0800 Subject: [Wtr-general] Urgent Javascript Problem Message-ID: <7a754c960602161512k741882eehe1721c3f289574d8@mail.gmail.com> Hi, I can get to the link to invoke the JS popWarn div via: @ie.link(:id,"buylink").click and then I try the following: @ie.text_field(:name,"email").set(*"*null at null.com") and I get the following error: WIN32OLERuntimerror: focus OLE error code:800A083E iin htmlfile Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept focus. Anything I can to do submit the e-mail and/or get around this? Thanks again, Chris Schmechel <!-- Warning Popup Layer --> <div id="popWarn"> <div id="popWarn_top"></div> <div id="popWarn_middle"> <div class="padder10"> <h4>I Pity The Fool</h4> <h5>You will give us your email now.</h5> Your computer will explode if you do not comply with our every wish immediately. <form action="/redirect.php" id="redirect" name="redirect" method="post" onSubmit="return emailCheck(this.email.value )"> <input type="text" name="email" id="email"> <input type="hidden" name="dest" value=" http://newlink"> <br> <button id="redirect_submit" type="submit">Buy</button> </form> </div> </div> <div id="popWarn_bottom"></div> </div> <!-- end popup layer --> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060216/9238b891/attachment.html From BPaatsch at activevoice.com Thu Feb 16 20:39:09 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Thu, 16 Feb 2006 19:39:09 -0600 Subject: [Wtr-general] too many callbacks are defined. (DL::DLError) in winClicker.rb Message-ID: <DB8B2DF09344624C84867DA023FA4ADE44A0F7@activevoice2.necam.prv> I get following error running my loop to delete usres. Everytime I delete a user I get a IE windows popup with OK|Cancle. Does anybody know a solution to my problem? Thanks, Bernd c:/ruby/lib/ruby/site_ruby/1.8/watir/winClicker.rb:315:in `callback': too many callbacks are defined. (DL::DLError) from c:/ruby/lib/ruby/site_ruby/1.8/watir/winClicker.rb:315:in `getChild Handle' from c:/ruby/lib/ruby/site_ruby/1.8/watir/winClicker.rb:290:in `clickWin dowsButton' from ./wacSubscriber.rb:442:in `exec_test' Code: goNext = true # can go next #take snapshot where I am: memory_now = nil memory_now = disp.text_field(:name, @tagSubName).getContents memory_old = "" # empty string while goNext do head = nil test = nil win = nil head = $ie.frame(frm.wacFrameHead) win = WinClicker.new() if (memory_now != memory_old) then # have not reached the end, delete # need to handle the iexplorer popup window head.link(:id, gen.wacDelete ).getOLEObject.click win.clickWindowsButton("Microsoft Internet Explorer", "OK" , maxWaitTime=30 ) head.link(:id, gen.wacNext ).click memory_old = memory_now memory_now = disp.text_field(:name, @tagSubName).getContents elsif (memory_now == memory_old) then # reached the end goNext = false else puts "ERROR" end end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060216/df084511/attachment.html From bret at pettichord.com Thu Feb 16 23:35:01 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 16 Feb 2006 22:35:01 -0600 Subject: [Wtr-general] Verify HTTP 200 OK response In-Reply-To: <7a754c960602150811w177e2343t15b978ef846d5597@mail.gmail.com> References: <7a754c960602150811w177e2343t15b978ef846d5597@mail.gmail.com> Message-ID: <ade75c5b0602162035v68414bbv5409f6cf55dd1853@mail.gmail.com> On 2/15/06, Chris Schmechel <chris.schmechel at gmail.com> wrote: > > Ok, but I don't really want to navigate to the page using both IE and > Net:HTTP classes. > I've already navigated to the main page via ie.goto() and I'm using > ie.button().click to navigate > to the resulting page. > > Is there an equivalent method in Watir or something I can query in the DOM > to return the HTTP status after the ie.button().click method finishes? It > would > be nice to have something similar to $mech->status in Perl. I'm only > aware of > the ie.contains_text() method which isn't quite right. > Unlike $mech, which is a browser simulator, Watir is a browser automator. The headers are not in the DOM -- they are directly handled by the browser, which in this case is IE. Some one needs to figure out how to get IE to reveal this information. Here's a tool that makes them visible, thus proving that it is programatically available. But the tool is closed source. http://www.blunck.info/iehttpheaders.html If any one knows more about how we could get this information into Watir, please speak up. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060216/14fd0af3/attachment.html From bret at pettichord.com Thu Feb 16 23:37:58 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 16 Feb 2006 22:37:58 -0600 Subject: [Wtr-general] Urgent Javascript Problem In-Reply-To: <7a754c960602161512k741882eehe1721c3f289574d8@mail.gmail.com> References: <7a754c960602161512k741882eehe1721c3f289574d8@mail.gmail.com> Message-ID: <ade75c5b0602162037t1d09af5bta0769637a1c0d64f@mail.gmail.com> Try @ie.text_field(:name,"email").value = *"*null at null.com" On 2/16/06, Chris Schmechel <chris.schmechel at gmail.com> wrote: > > and then I try the following: > @ie.text_field(:name,"email").set(*"*null at null.com") > > and I get the following error: > > WIN32OLERuntimerror: focus > OLE error code:800A083E iin htmlfile > Can't move focus to the control because it is invisible, not enabled, > or of a type that does not accept focus. > > Anything I can to do submit the e-mail and/or get around this? > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060216/6334b47d/attachment.html From bret at pettichord.com Thu Feb 16 23:40:17 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 16 Feb 2006 22:40:17 -0600 Subject: [Wtr-general] how to access links in table cells In-Reply-To: <43F487C1.1090506@reconnex.net> References: <43F487C1.1090506@reconnex.net> Message-ID: <ade75c5b0602162040n79b4d91bw574a2dac95148185@mail.gmail.com> Please provide html and code. On 2/16/06, Manish Sapariya <manishs at reconnex.net> wrote: > > Hi, > I have a table, which has few columns with simple > text and few columns with links. > > I want to do a search on text columns, and click in > the link for one of the column for a given row. > > I can search the row successfully using text, but > I can't click on that row. > > When I check the class of the row[i].class, it > shows as TableCell. > How do I click link object in that particular > cell. > > THanks for help. > REgards, > Manish > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060216/44f8b0d6/attachment.html From bret at pettichord.com Thu Feb 16 23:50:03 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 16 Feb 2006 22:50:03 -0600 Subject: [Wtr-general] How can I display a message while a Watir script is Sleeping? In-Reply-To: <37c405480602151133n4cc8be48n@mail.gmail.com> References: <37c405480602151133n4cc8be48n@mail.gmail.com> Message-ID: <ade75c5b0602162050j75904e8eg53d21fbee5412442@mail.gmail.com> On 2/15/06, Paul Carvalho <tester.paul at gmail.com> wrote: > > I couldn't find anything in the Ruby technical docs that would help me > *create* a pop-up window. Can this be done with Ruby? Do I have to make a > call to a Javascript function to do this? You definitely don't want to create a javascript popup window. They stop browser processing and thus would undermine your objective. You can use Ruby to create GUI's of all kinds. The Ruby FX library is probably a good place to go if you really want to do this. But realize that to create a message box that doesn't block, you will have to create event-driven, multi-threaded code. Personally, i think the right direction is to follow Zeljko's suggest that you use "puts". Another thing you can do is just to puts dots (".") as you progress as a sign of life. This is already what test::unit does. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060216/c587ebf7/attachment.html From bret at pettichord.com Fri Feb 17 00:44:02 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 16 Feb 2006 23:44:02 -0600 Subject: [Wtr-general] is this worth looking into? In-Reply-To: <C629A6599EAF2B4C97CC314771BC292C04CAC2E8@mail.extend.com> References: <C629A6599EAF2B4C97CC314771BC292C04CAC2E8@mail.extend.com> Message-ID: <ade75c5b0602162144j176978c3g1c65eb1aa082572e@mail.gmail.com> Rspec is a library that takes test-driven development a step away from testing per se and towards behavioral specification. The intent is to write this spec in ruby (hence rspec) and then to implement the code thereafter. I find it to be interesting work, but am not so sure there is much place to use it with Watir. Maybe there is; maybe you could spec an app in Rspec, then hook it up to Watir and then create the app that makes the Watir/Rspec scripts pass. Maybe. But i guess i was wondering whether anyone had actually tried out this tool line. Bret On 2/13/06, Pierre Garigue <PGarigue at extend.com> wrote: > > http://rspec.rubyforge.org/files/TUTORIAL.html > > I'm pretty sure the subject could have been presented in a less theoretic > way. But is seems like > a way of getting away from the 'assert' way of doing thing. Instead one > has methods to > test the results. > > example > > 1.should_equal 1 > > Cheers > Pierre Garigue > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060216/e9f58410/attachment.html From chris.schmechel at gmail.com Fri Feb 17 01:36:00 2006 From: chris.schmechel at gmail.com (Chris Schmechel) Date: Thu, 16 Feb 2006 22:36:00 -0800 Subject: [Wtr-general] How to dismiss File Download - Security Warning popup Message-ID: <7a754c960602162236r6f5977cfyd286141b4098e8e8@mail.gmail.com> I'm running a script and executing the following command: ie.button(:name,"submit").click and I'm redirected to a web page that begins a download of an executable. I'm working on XP SP2 so the File Download - Security Warning (ie. that's the title) popup comes up: Do you want to run or save this file? and the choices are Run, Save, and Cancel. I'd like to click the cancel button. How can I do this from my Watir script? Thanks again, Chris Schmechel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060216/2415dd0e/attachment.html From manishs at reconnex.net Fri Feb 17 01:56:12 2006 From: manishs at reconnex.net (Manish Sapariya) Date: Fri, 17 Feb 2006 12:26:12 +0530 Subject: [Wtr-general] Recording http request response headers Message-ID: <43F5738C.5070006@reconnex.net> By any chance is it possible to log every request and response data into log file when my watir script is executed? I wanted to figure out the some request urls for doing load testing using jMeter. Is there any other tool which people out here are using to do load/stress testing? Thanks, Manish From marcus.tettmar at gmail.com Fri Feb 17 03:44:32 2006 From: marcus.tettmar at gmail.com (Marcus Tettmar) Date: Fri, 17 Feb 2006 08:44:32 +0000 Subject: [Wtr-general] Verify HTTP 200 OK response In-Reply-To: <ade75c5b0602162035v68414bbv5409f6cf55dd1853@mail.gmail.com> References: <7a754c960602150811w177e2343t15b978ef846d5597@mail.gmail.com> <ade75c5b0602162035v68414bbv5409f6cf55dd1853@mail.gmail.com> Message-ID: <dd78cfb30602170044g1273a9ffp5af2adda0aa52834@mail.gmail.com> As far as I am aware you have to implement a passthrough Asynchronous Pluggable Protocol (APP): http://msdn.microsoft.com/workshop/networking/pluggable/pluggable.asp http://tinyurl.com/9xqvt* *Not sure if this is what the iehttpheaders plug in does - it may just cheat and get the URL of the new page and request the headers afterwards with HttpQueryInfo. Marcus On 2/17/06, Bret Pettichord <bret at pettichord.com> wrote: > > On 2/15/06, Chris Schmechel <chris.schmechel at gmail.com> wrote: > > > > Ok, but I don't really want to navigate to the page using both IE and > > Net:HTTP classes. > > I've already navigated to the main page via ie.goto() and I'm using > > ie.button().click to navigate > > to the resulting page. > > > > Is there an equivalent method in Watir or something I can query in the > > DOM > > to return the HTTP status after the ie.button().click method > > finishes? It would > > be nice to have something similar to $mech->status in Perl. I'm only > > aware of > > the ie.contains_text() method which isn't quite right. > > > > Unlike $mech, which is a browser simulator, Watir is a browser automator. > The headers are not in the DOM -- they are directly handled by the browser, > which in this case is IE. Some one needs to figure out how to get IE to > reveal this information. > > Here's a tool that makes them visible, thus proving that it is > programatically available. But the tool is closed source. > > http://www.blunck.info/iehttpheaders.html > > If any one knows more about how we could get this information into Watir, > please speak up. > > Bret > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -- Marcus Tettmar http://www.mjtnet.com/ Macro Scheduler & WebRecorder for Windows & Web Automation and Testing. WebRecorder for Ruby/Watir now available. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060217/911e8973/attachment.html From witlessbird at bitsandpixels.org Fri Feb 17 10:42:16 2006 From: witlessbird at bitsandpixels.org (Dmitri Dolguikh) Date: Fri, 17 Feb 2006 10:42:16 -0500 Subject: [Wtr-general] watir from HEAD installation notes Message-ID: <1aa3b8a50602170742t1b050657g2911f67d2fbe472@mail.gmail.com> Hey list, I ran into an issues when installing watir from HEAD: the permissions on wind32ole.so and IEDialog.dll have to modified to include 'execute' permission. Perhaps this tidbit should be included in 'installing from source' instructions? -Dmitri From PGarigue at EXTEND.COM Fri Feb 17 11:09:29 2006 From: PGarigue at EXTEND.COM (Pierre Garigue) Date: Fri, 17 Feb 2006 11:09:29 -0500 Subject: [Wtr-general] is this worth looking into? Message-ID: <C629A6599EAF2B4C97CC314771BC292C04B69AFD@mail.extend.com> <http://www.trug.ca/Darrick_Wiebe> Darrick Wiebe at our Toronto Ruby group is busy ( http://www.trug.ca/Darrick_Wiebe) douing some work with it trying to make it more English-like. Maybe I can bug him about getting together and look at how this would be used with Watir Cheer Pierre -----Original Message----- From: Bret Pettichord [mailto:bret at pettichord.com] Sent: Friday, February 17, 2006 12:44 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] is this worth looking into? Rspec is a library that takes test-driven development a step away from testing per se and towards behavioral specification. The intent is to write this spec in ruby (hence rspec) and then to implement the code thereafter. I find it to be interesting work, but am not so sure there is much place to use it with Watir. Maybe there is; maybe you could spec an app in Rspec, then hook it up to Watir and then create the app that makes the Watir/Rspec scripts pass. Maybe. But i guess i was wondering whether anyone had actually tried out this tool line. Bret On 2/13/06, Pierre Garigue < <mailto:PGarigue at extend.com> PGarigue at extend.com> wrote: http://rspec.rubyforge.org/files/TUTORIAL.html I'm pretty sure the subject could have been presented in a less theoretic way. But is seems like a way of getting away from the 'assert' way of doing thing. Instead one has methods to test the results. example 1.should_equal 1 Cheers Pierre Garigue _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060217/0623e70b/attachment.html From bret at pettichord.com Fri Feb 17 11:33:26 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 17 Feb 2006 10:33:26 -0600 Subject: [Wtr-general] is this worth looking into? In-Reply-To: <C629A6599EAF2B4C97CC314771BC292C04B69AFD@mail.extend.com> References: <C629A6599EAF2B4C97CC314771BC292C04B69AFD@mail.extend.com> Message-ID: <ade75c5b0602170833l58441e59vdc0276bd8ac3d5ec@mail.gmail.com> I haven't been clear. I wouldn't suggest Rspec as something that would help Watir users. I don't feel strongly about this, and would be happy to hear from people who have actually used them together. But i am not actually encouraging this as a useful exercise. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060217/d8a2bf6c/attachment.html From oblomov.consulting at googlemail.com Fri Feb 17 11:43:27 2006 From: oblomov.consulting at googlemail.com (George Hawthorne) Date: Fri, 17 Feb 2006 16:43:27 +0000 Subject: [Wtr-general] multiple sessions Message-ID: <880925dd0602170843m38c26351p@mail.gmail.com> Hello. Thanks for this excellent resource. After a couple of weeks of Watir use I've hit a niggly problem. I want to run multiple concurrent instances of the browser, each logged into the site-under-test as a different user. This sort of thing... @ie1 = IE.new @ie1.goto(test_site) log in as Edgar click some buttons... @ie2 = IE.new @ie2.goto(test_site) log in as Cordelia click some buttons... The snag is that the site-under-test authenticates on a per-session basis so when @ie2 goes to the site it doesn't see the log-in page. It can't log in as Cordelia because it is already logged in as Edgar. Logging off @ie2 causes @ie1 to be logged off too. A possible workaround is to start a new session for each user by launching iexplore.exe. If I manually open browser instances by clicking on iexplore.exe I can have umpteen users logged on concurrently, so this should work. I can do this within my script using: `start "#{'iexplore.exe'}" "#{'http://www...etc'}"` and then use IE.attach. This works fine for the first instance (though it threw an error until I put a 'sleep' between start and attach), but when I try to open a second browser instance using `start...` it closes the first instance. How can I get my Watir script to act in the same way that manually clicking on iexplore.exe does? Can anyone point me towards a possible solution? Thanks, George From bret at pettichord.com Fri Feb 17 11:44:05 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 17 Feb 2006 10:44:05 -0600 Subject: [Wtr-general] watir from HEAD installation notes In-Reply-To: <1aa3b8a50602170742t1b050657g2911f67d2fbe472@mail.gmail.com> References: <1aa3b8a50602170742t1b050657g2911f67d2fbe472@mail.gmail.com> Message-ID: <ade75c5b0602170844m33e3f466rb42a5f5b05e17878@mail.gmail.com> Thanks for the report. Where are the 'installing from source' instructions? (I didn't know we had them.) What we really need to do is fix the command line installer (which is broken across the board) and then make sure it sets the permissions. BTW, these files are new and are what gives Watir the ability to work with modal web dialogs (which is still undergoing further development). Bret On 2/17/06, Dmitri Dolguikh <witlessbird at bitsandpixels.org> wrote: > > Hey list, > > I ran into an issues when installing watir from HEAD: the permissions > on wind32ole.so and IEDialog.dll have to modified to include 'execute' > permission. > > Perhaps this tidbit should be included in 'installing from source' > instructions? > > -Dmitri > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060217/a57ea127/attachment.html From bret at pettichord.com Fri Feb 17 11:47:22 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 17 Feb 2006 10:47:22 -0600 Subject: [Wtr-general] Recording http request response headers In-Reply-To: <43F5738C.5070006@reconnex.net> References: <43F5738C.5070006@reconnex.net> Message-ID: <ade75c5b0602170847h47e0bd37pbf857992ed0a495b@mail.gmail.com> The best approach would be to use a logging proxy. Any recommendations out there? On 2/17/06, Manish Sapariya <manishs at reconnex.net> wrote: > > By any chance is it possible to log every > request and response data into log file > when my watir script is executed? > > I wanted to figure out the some request urls > for doing load testing using jMeter. > > Is there any other tool which people out here > are using to do load/stress testing? > > Thanks, > Manish > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060217/7b90aa1a/attachment.html From BPaatsch at activevoice.com Fri Feb 17 12:02:50 2006 From: BPaatsch at activevoice.com (Paatsch, Bernd) Date: Fri, 17 Feb 2006 11:02:50 -0600 Subject: [Wtr-general] Error message using WinClicker, why? Message-ID: <DB8B2DF09344624C84867DA023FA4ADE44A0F8@activevoice2.necam.prv> Hello, I get following error running my loop to delete usres. Everytime I delete a user I get a IE windows popup with OK|Cancle. Does anybody know a solution to my problem? Thanks, Bernd c:/ruby/lib/ruby/site_ruby/1.8/watir/winClicker.rb:315:in `callback': too many callbacks are defined. (DL::DLError) from c:/ruby/lib/ruby/site_ruby/1.8/watir/winClicker.rb:315:in `getChild Handle' from c:/ruby/lib/ruby/site_ruby/1.8/watir/winClicker.rb:290:in `clickWin dowsButton' from ./wacSubscriber.rb:442:in `exec_test' Code: goNext = true # can go next #take snapshot where I am: memory_now = nil memory_now = disp.text_field(:name, @tagSubName).getContents memory_old = "" # empty string while goNext do head = nil test = nil win = nil head = $ie.frame(frm.wacFrameHead) win = WinClicker.new() if (memory_now != memory_old) then # have not reached the end, delete # need to handle the iexplorer popup window head.link(:id, gen.wacDelete ).getOLEObject.click win.clickWindowsButton("Microsoft Internet Explorer", "OK" , maxWaitTime=30 ) head.link(:id, gen.wacNext ).click memory_old = memory_now memory_now = disp.text_field(:name, @tagSubName).getContents elsif (memory_now == memory_old) then # reached the end goNext = false else puts "ERROR" end end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060217/4b283bcf/attachment.html From witlessbird at bitsandpixels.org Fri Feb 17 12:53:50 2006 From: witlessbird at bitsandpixels.org (Dmitri Dolguikh) Date: Fri, 17 Feb 2006 12:53:50 -0500 Subject: [Wtr-general] watir from HEAD installation notes In-Reply-To: <ade75c5b0602170844m33e3f466rb42a5f5b05e17878@mail.gmail.com> References: <1aa3b8a50602170742t1b050657g2911f67d2fbe472@mail.gmail.com> <ade75c5b0602170844m33e3f466rb42a5f5b05e17878@mail.gmail.com> Message-ID: <1aa3b8a50602170953l6ef7c652o7a4e3f2f8d600ee3@mail.gmail.com> On 2/17/06, Bret Pettichord <bret at pettichord.com> wrote: > Thanks for the report. > > Where are the 'installing from source' instructions? (I didn't know we had > them.) What I really meant is Step 2 - Install Watir:Development Version instructions :) > > What we really need to do is fix the command line installer (which is broken > across the board) and then make sure it sets the permissions. that certainly is a better solution :) -Dmitri From chris.schmechel at gmail.com Fri Feb 17 18:59:26 2006 From: chris.schmechel at gmail.com (Chris Schmechel) Date: Fri, 17 Feb 2006 15:59:26 -0800 Subject: [Wtr-general] Update on Clicking Windows File Download - Security Warning Dialog Box Message-ID: <7a754c960602171559k286a830ala195563308768393@mail.gmail.com> I was able to write a Perl Win32::GuiTest to do the following: @window = FindWindowLike(0,"File Download",""); SetForegroundWindow($window[0]); SendKeys("{SPACE}"); which I can call via system("perl dismiss.pl") in Ruby. I can't seem to get the synchronization right though as I call ie.form().button().click right beforehand. Suggestions? I'm aware of the AutoIT interface but I've had more luck with the perl script working correctly when I execute it manually. Thanks, Chris Schmechel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060217/b682a60e/attachment.html From billagee at gmail.com Fri Feb 17 21:15:00 2006 From: billagee at gmail.com (Bill Agee) Date: Fri, 17 Feb 2006 18:15:00 -0800 Subject: [Wtr-general] Update on Clicking Windows File Download - Security Warning Dialog Box In-Reply-To: <7a754c960602171559k286a830ala195563308768393@mail.gmail.com> References: <7a754c960602171559k286a830ala195563308768393@mail.gmail.com> Message-ID: <73e7817e0602171815lcb1749fn4538f4dcf664ff06@mail.gmail.com> On 2/17/06, Chris Schmechel <chris.schmechel at gmail.com> wrote: > > I was able to write a Perl Win32::GuiTest to do the following: > > @window = FindWindowLike(0,"File Download",""); > SetForegroundWindow($window[0]); > SendKeys("{SPACE}"); > It seems pretty common for people to call a helper script like the one above in order to unblock IE after a browser action that spawns a popup. I ran into at least one case where running a small helper Ruby script similar to the above was the only way to dismiss a certain pesky popup window. One pattern to solve this is: - start a ruby thread inside it, click the link/button or whatever that causes IE to block - sleep a bit in between the thread definitions (or write some code that will wait until the popup window you're watching for appears) - start another thread inside it, use system() to execute your helper script, which hopefully dismisses the popup - join both threads and resume program flow, assuming the popup has been dismissed and the call to IE that spawned the popup has now returned Thanks Bill From manishs at reconnex.net Sat Feb 18 08:40:31 2006 From: manishs at reconnex.net (Manish Sapariya) Date: Sat, 18 Feb 2006 19:10:31 +0530 Subject: [Wtr-general] how to access links in table cells In-Reply-To: <ade75c5b0602162040n79b4d91bw574a2dac95148185@mail.gmail.com> References: <43F487C1.1090506@reconnex.net> <ade75c5b0602162040n79b4d91bw574a2dac95148185@mail.gmail.com> Message-ID: <43F723CF.6080904@reconnex.net> Hi, Please find attached html and my watir code. I could get the flash working on the link, but when i click the link it actually deletes other entries. Is there a better way than what I am doing? Thanks and Regards, Manish On 02/17/2006 10:10 AM, Bret Pettichord wrote: > Please provide html and code. > > On 2/16/06, *Manish Sapariya* <manishs at reconnex.net > <mailto:manishs at reconnex.net>> wrote: > > Hi, > I have a table, which has few columns with simple > text and few columns with links. > > I want to do a search on text columns, and click in > the link for one of the column for a given row. > > I can search the row successfully using text, but > I can't click on that row. > > When I check the class of the row[i].class, it > shows as TableCell. > How do I click link object in that particular > cell. > > THanks for help. > REgards, > Manish > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org <mailto:Wtr-general at rubyforge.org> > http://rubyforge.org/mailman/listinfo/wtr-general > > >------------------------------------------------------------------------ > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060218/3c89ec39/attachment.html -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: deletecode.rb Url: http://rubyforge.org/pipermail/wtr-general/attachments/20060218/3c89ec39/attachment.pl From dave at burt.id.au Sat Feb 18 09:16:45 2006 From: dave at burt.id.au (Dave Burt) Date: Sun, 19 Feb 2006 01:16:45 +1100 Subject: [Wtr-general] Recording http request response headers References: <43F5738C.5070006@reconnex.net> <ade75c5b0602170847h47e0bd37pbf857992ed0a495b@mail.gmail.com> Message-ID: <004701c63495$f3121da0$6602a8c0@telperion> > The best approach would be to use a logging proxy. Any recommendations out there? Maybe MouseHole could be useful, although it's not designed for quite this purpose. I guess you could add logging fairly easily. http://rubyforge.org/projects/mousehole Cheers, Dave From christopher.mcmahon at gmail.com Sat Feb 18 16:23:35 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Sat, 18 Feb 2006 15:23:35 -0600 Subject: [Wtr-general] Update on Clicking Windows File Download - Security Warning Dialog Box In-Reply-To: <7a754c960602171559k286a830ala195563308768393@mail.gmail.com> References: <7a754c960602171559k286a830ala195563308768393@mail.gmail.com> Message-ID: <72799cd70602181323j69b3164ev464c72c30074503@mail.gmail.com> > which I can call via system("perl dismiss.pl") in Ruby. I can't seem to > get the synchronization right though as I call ie.form().button().click > right beforehand. > > Suggestions? I'm aware of the AutoIT interface but I've had more luck with > the > perl script working correctly when I execute it manually. I like this solution, I've had it in my back pocket for some time now. Instead of calling the Perl script from Ruby, call the Ruby script from Perl, like so: use Win32::GuiTest qw(FindWindowLike GetWindowText SetForegroundWindow SendKeys); system (1, "C:\\ruby\\bin\\ruby.exe script.rb"); while (1) { #INFINITE LOOP sleep 5; #CHECK FOR NEW WINDOW EVERY 5 SEC my @windows = FindWindowLike(0, "^Microsoft Internet Explorer" ); for (@windows) { SetForegroundWindow($_); #BRING THE RIGHT WINDOW IN FOCUS SendKeys("{ENTER}"); } } That "system (1, foo) is magic-- it returns control to the calling (Perl) script. This way your Perl script loops, happily finding and dismissing windows, while your Ruby script runs around generating them. -Chris From mb at michaelbolton.net Sun Feb 19 10:36:52 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Sun, 19 Feb 2006 10:36:52 -0500 Subject: [Wtr-general] how to access links in table cells In-Reply-To: <43F723CF.6080904@reconnex.net> Message-ID: <003301c6356a$4fda4d30$6501a8c0@Koko> Let's look at this code step by step: >while (true) First of all, whatever it does, you apparently intend to do it forever. Do you really intend that? What criterion or line of code would get you out of this infinite loop? If you're /depending/ on a crash, that might do it. > if($ie.frame("mainFrame").table(:id, 'nav-menu').exists? ) > puts "I found the table" > end Next, if you found the table, you announce that you found the table; then you drop out of the conditional and proceed to the next steps. If you /didn't/ find the table, you drop out of the conditional, and proceed to the next steps. Other than printing a message to the screen, whether you find what you're looking for or not, /the code tries to do exactly the same thing/. > searchExists=0 > i=3 i is a magic number here. It has the value 3, and yet has nothing else associated with it--certainly no indication of what it's for, or why it's 3. Why IS it 3? > t = $ie.frame("mainFrame").table(:id, 'nav-menu') If you find a table with an id attribute of 'nav-menu', you do something. If you don't find such a table, you should get a nil on the .each method, without an apparent error handler or alternative path of action. Are you sure you want that to happen? > t.each do |row| > puts "iterating #{i} row" Since i is equal to 3, this will always report that you're on row 3, /even when you're not on row 3/. Might you be deleting something inadvertently because you're not where you think you are? > #puts "search Name = #{searchName}" Where does the searchName value come from? Is it a local variable that you've assigned somewhere else? > #puts "11th Column = #{row[11].text}" > #puts "3rd Column = #{row[3].text}" Let's assume that we're the first time through your rows.each loop. This next line should give you the text in the 8th column. Is that what's happening? > puts "8th Column = #{row[8].text}" > if (row[8].text == "deschedule" ) > puts "This is scheduled" > # i = i + 1 > end Let's continue assume that we're on the first time through your rows.each loop. > i = i + 4 The variable i, mysteriously 3, is now mysteriously 7. Why? > if (row[3].text =~ /#{searchName}/ ) Still assuming that we're on the first trip through the loop, the local variable that you've assigned somewhere else will now be matched to the third column in the first row. > searchExist=1 > puts "Search Name = #{row[3].text}" > puts "11th Column = #{row[11].text}" > p row[11].class > p row[11].methods > row[11].click STILL assuming that we're on the first trip through the loop, this link will click on the the eleventh column, which is the same as clicking the "delete" link, if I read table.html correctly. > $ie.frame("mainFrame").link(:index, i).flash > $ie.frame("mainFrame").link(:index, i).flash On the first trip through the loop, these lines will flash the seventh link in the mainFrame frame, twice. Does that happen? On the next trip through the loop, these lines will flash the eleventh link (see the i = i + 4 line above); the third trip, the they'll flash the 15th link, and so on. > $ie.frame("mainFrame").link(:index, i).click This will click on the seventh (eleventh, fifteenth...) links... > break; ...except it won't because you only go through the each loop once. > end > end I added an extra end, because the "while(true)" in the snippet you provided was unbalanced. I think you might want to refactor this code. ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Manish Sapariya Sent: February 18, 2006 8:41 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] how to access links in table cells Hi, Please find attached html and my watir code. I could get the flash working on the link, but when i click the link it actually deletes other entries. Is there a better way than what I am doing? Thanks and Regards, Manish On 02/17/2006 10:10 AM, Bret Pettichord wrote: > Please provide html and code. > > On 2/16/06, *Manish Sapariya* <manishs at reconnex.net > <mailto:manishs at reconnex.net>> wrote: > > Hi, > I have a table, which has few columns with simple > text and few columns with links. > > I want to do a search on text columns, and click in > the link for one of the column for a given row. > > I can search the row successfully using text, but > I can't click on that row. > > When I check the class of the row[i].class, it > shows as TableCell. > How do I click link object in that particular > cell. > > THanks for help. > REgards, > Manish > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org <mailto: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 marco.neri at police.vic.gov.au Sun Feb 19 20:29:07 2006 From: marco.neri at police.vic.gov.au (Neri, Marco) Date: Mon, 20 Feb 2006 12:29:07 +1100 Subject: [Wtr-general] (nested?) table access - need help. Message-ID: <AE918470A1BAB34B97D28AA43952D5E7010B4563@wt14px03.vicpolice.internal> Hi The developers on the application I'm testing have replaced a (menu) table of url links with rad panel control ( a 3rd party js control from telerik ). Using table = @ie.table(:index , i) in a loop, in the console I can see tabletype: id: PersonLinks_collapsableLinks name: value: disabled: false rows: 34 cols: 1 Using row = @ie.table(:id , 'PersonLinks_collapsableLinks')[3] puts(row[1].to_s) In the console I see ( ) Names (6) Addresses (15) Phone Numbers (6) Photos (21) Physical Descriptions (4) Scars, Marks, Tattoos (10) Miscellaneous IDs (1) Contacts (1) Dossier Known Associates (0) Criminal History Does this suggest that the one cell contains all of the items listed above ? What I was wanting to be able to do was access individual cell and then use .fire_Event("onClick") on it to trigger the menu items. I managed to get this to work for the 1st level of the menu ( details ). table = @ie.table(:id , 'PersonLinks_collapsableLinks') table[3][0].flash table[3][0].fire_event("onClick") The control then expands out the 2nd level of the menu with all of the items listed above. By counting the <tr> in the src for the table I can see why the 34 rows. This must also count up the nested tables? How can I access the nested table in order to access the row/cell within that? I can't use id as that tag hasn't been defined for the nested table ? thanks Src for the table is : </script><span id="PersonLinks_collapsableLinksStyleSheetHolder" style="display:none"></span><script type="text/javascript">RadPanelbarAppendStyleSheet('PersonLinks_collapsa bleLinks', '/LEAP/Web/UI/Style/panelbar.css');</script><table id="PersonLinks_collapsableLinks" cellspacing="0" cellpadding="0" class="Panelbar" style="width:100%;visibility: hidden"> <tr> <td id="SUMMARY" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="HeaderSelected" style="width:100%;"> <tr> <td id="SUMMARY_Text" style="width:100%;">Summary</td> </tr> </table></td> </tr><tr> <td id="DETAILS" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="HeaderCollapsed" style="width:100%;"> <tr> <td id="DETAILS_Text" style="width:100%;">Details</td> </tr> </table></td> </tr><tr style="display: none"><td valign="top" id="DETAILS_Panel" style="white-space: nowrap; width: 100%; display: none"><table cellspacing="0" cellpadding="0" width="100%"> <tr> <td id="NAMES" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="NAMES_Text" style="width:100%;">Names (6)</td> </tr> </table></td> </tr><tr> <td id="ADDRESSES" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="ADDRESSES_Text" style="width:100%;">Addresses (15)</td> </tr> </table></td> </tr><tr> <td id="PHONES" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="PHONES_Text" style="width:100%;">Phone Numbers (6)</td> </tr> </table></td> </tr><tr> <td id="IMAGES" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="IMAGES_Text" style="width:100%;">Photos (21)</td> </tr> </table></td> </tr><tr> <td id="DESCRIPTIONS" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="DESCRIPTIONS_Text" style="width:100%;">Physical Descriptions (4)</td> </tr> </table></td> </tr><tr> <td id="TATTOOS" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="TATTOOS_Text" style="width:100%;">Scars, Marks, Tattoos (10)</td> </tr> </table></td> </tr><tr> <td id="MISCELLANEOUSIDS" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="MISCELLANEOUSIDS_Text" style="width:100%;">Miscellaneous IDs (1)</td> </tr> </table></td> </tr><tr> <td id="CONTACTS" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="CONTACTS_Text" style="width:100%;">Contacts (1)</td> </tr> </table></td> </tr><tr> <td id="DOSSIER" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="DOSSIER_Text" style="width:100%;">Dossier</td> </tr> </table></td> </tr><tr> <td id="KNOWNASSOCIATES" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="KNOWNASSOCIATES_Text" style="width:100%;">Known Associates (0)</td> </tr> </table></td> </tr><tr> <td id="CRIMINALHISTORY" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="CRIMINALHISTORY_Text" style="width:100%;">Criminal History</td> </tr> </table></td> </tr> </table></td></tr><tr> <td id="INVOLVEMENTS" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="HeaderCollapsed" style="width:100%;"> <tr> <td id="INVOLVEMENTS_Text" style="width:100%;">Involvements</td> </tr> </table></td> </tr><tr style="display: none"><td valign="top" id="INVOLVEMENTS_Panel" style="white-space: nowrap; width: 100%; display: none"><table cellspacing="0" cellpadding="0" width="100%"> <tr> <td id="INTERESTFLAGS" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="INTERESTFLAGS_Text" style="width:100%;">Interest Flags (8)</td> </tr> </table></td> </tr><tr> <td id="NAMEWHEREABOUTS" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="NAMEWHEREABOUTS_Text" style="width:100%;">Whereabouts (2)</td> </tr> </table></td> </tr> </table></td></tr> </table> ======================================================= The information contained in this email and any files attached may be confidential information to the intended recipient and may be the subject of legal professional privilege or public interest immunity. If you are not the intended recipient, any use, disclosure or copying is unauthorised. If you have received this document in error please telephone 1300 307 082 ******************************************************************* This footnote also confirms that this email message has been swept for the presence of computer viruses. ******************************************************************* From christopher_brown at engin.com.au Mon Feb 20 00:43:42 2006 From: christopher_brown at engin.com.au (Brown, Christopher) Date: Mon, 20 Feb 2006 16:43:42 +1100 Subject: [Wtr-general] xpath support doesn't work for me Message-ID: <B0D561E4E514F447AA08B65C957C8CB402390264@MI_EXCH1> Hi After a few months of Ruby and Watir sitting around idle, I've decided to give Watir a serious workout and ran into the problem with URLs inside div elements. I eventually got to the info on xpath and element_by_xpath. After following the thread on this topic from Dec 2005, I've done the following: 1. downloaded and installed the latest stable versioin of Ruby 2. downloaded the latest tar file from the repository and extracted the contents to my Watir install dir, 3. replaced Ruby files element.rb and functions.rb with versions from the Watir repository 4. replaced watir.rb in C:\ruby\lib\ruby\site_ruby\1.8 with the latest version from the Watir installation. I suspect step 4 is not the right thing to do. Can anyone confirm this? What should I be doing about watir.rb in the Ruby installation dir? Anyway, when I run my test script I get the following error message c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `initialize': LoadLibrary: c:\ruby\lib\ruby\site_ruby\1.8\watir\IEDialog\Release\IEDialog.dll (RuntimeError) from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require' from G:/workspace/web_pages/trial.rb:1 This is my first Ruby script so any advice on getting this working will be much appreciated. Regards Chris From angrez at gmail.com Mon Feb 20 00:59:06 2006 From: angrez at gmail.com (Angrez Singh) Date: Mon, 20 Feb 2006 11:29:06 +0530 Subject: [Wtr-general] xpath support doesn't work for me In-Reply-To: <B0D561E4E514F447AA08B65C957C8CB402390264@MI_EXCH1> References: <B0D561E4E514F447AA08B65C957C8CB402390264@MI_EXCH1> Message-ID: <e26bda3e0602192159k186b06c7i586273e39cd7cd3f@mail.gmail.com> Hi Brown, Anyway, when I run my test script I get the following error message > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `initialize': LoadLibrary: > c:\ruby\lib\ruby\site_ruby\1.8\watir\IEDialog\Release\IEDialog.dll > (RuntimeError) > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `new' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273 > from > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > `require__' > from > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > `require' > from G:/workspace/web_pages/trial.rb:1 The error that you are getting has nothing to do with the XPath support. Could you please try to run the xpath unit tests provided with the TAR ball to make sure that XPath is working? Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060220/8c9297bc/attachment.html From witlessbird at bitsandpixels.org Mon Feb 20 08:00:03 2006 From: witlessbird at bitsandpixels.org (Dmitri Dolguikh) Date: Mon, 20 Feb 2006 08:00:03 -0500 Subject: [Wtr-general] xpath support doesn't work for me In-Reply-To: <e26bda3e0602192159k186b06c7i586273e39cd7cd3f@mail.gmail.com> References: <B0D561E4E514F447AA08B65C957C8CB402390264@MI_EXCH1> <e26bda3e0602192159k186b06c7i586273e39cd7cd3f@mail.gmail.com> Message-ID: <1aa3b8a50602200500p344dcaabub722eafad55d20f3@mail.gmail.com> Make sure that you: - copied IEDialog.dll from downloaded watir into c:\ruby\lib\ruby\site_ruby\1.8\watir\IEDialog\Release\IEDialog.dll - modify permissions on IEDialog.dll to include execute Cheers, -Dmitri On 2/20/06, Angrez Singh <angrez at gmail.com> wrote: > Hi Brown, > > > > Anyway, when I run my test script I get the following error message > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in > `initialize': LoadLibrary: > > > c:\ruby\lib\ruby\site_ruby\1.8\watir\IEDialog\Release\IEDialog.dll > > (RuntimeError) > > from > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `new' > > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273 > > from > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > > `require__' > > from > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > > `require' > > from G:/workspace/web_pages/trial.rb:1 > > The error that you are getting has nothing to do with the XPath support. > Could you please try to run the xpath unit tests provided with the TAR ball > to make sure that XPath is working? > > Regards, > Angrez > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From PGarigue at EXTEND.COM Mon Feb 20 11:10:26 2006 From: PGarigue at EXTEND.COM (Pierre Garigue) Date: Mon, 20 Feb 2006 11:10:26 -0500 Subject: [Wtr-general] xpath support doesn't work for me Message-ID: <C629A6599EAF2B4C97CC314771BC292C04CAC335@mail.extend.com> I posted this on one group and I realized I should have posted it here. This is a rather interesting tool <http://chrispederick.com/work/webdeveloper/> http://chrispederick.com/work/webdeveloper/ Even though it's for Firefox I use it to see the value of the form fields. I then use that information when I write my scripts. -Pierre -----Original Message----- From: Angrez Singh [mailto:angrez at gmail.com] Sent: Monday, February 20, 2006 12:59 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] xpath support doesn't work for me Hi Brown, Anyway, when I run my test script I get the following error message c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `initialize': LoadLibrary: c:\ruby\lib\ruby\site_ruby\1.8\watir\IEDialog\Release\IEDialog.dll (RuntimeError) from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require' from G:/workspace/web_pages/trial.rb:1 The error that you are getting has nothing to do with the XPath support. Could you please try to run the xpath unit tests provided with the TAR ball to make sure that XPath is working? Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060220/b4f5140e/attachment.html From carl.l.shaulis at convergys.com Mon Feb 20 13:18:19 2006 From: carl.l.shaulis at convergys.com (carl.l.shaulis at convergys.com) Date: Mon, 20 Feb 2006 12:18:19 -0600 Subject: [Wtr-general] Changing testing environments Message-ID: <OF227E7212.E8B4B78A-ON8625711B.00634D67-8625711B.00648E0D@nd.convergys.com> Good afternoon: We created a testing suite using test environment A. Various strategic sleeps were put in place to optimize the execution of WATIR scripts against this test environment. For the most part these test suites execute with some reliability. On Friday I attempted to run the same set of scripts on my development environment. Of course the scripts would break (primarily failed assertions) because my laptop is not as powerful as the testing machines. How do y'all handle the issue of pointing your tests to different environments and not having the scripts execute with reliability? Should we create scripts in the worst case environment and assume they will function on the production ready hardware? I believe the primary problem is the latency associated with Pop ups. Does anyone use any tricks to make their scripts more reliable? Despite everyone's hard work on WATIR, I am finding this to be an extreme limitation and I am once again questioning my choice of WATIR as our preferred testing solutions. Will any of the new activities for the next release address this concern? Am I isolated in having this concern? Any thoughts or suggestions would be appreciated. Thanks, Carl -- "NOTICE: The information contained in this electronic mail transmission is intended by Convergys Corporation for the use of the named individual or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone (collect), so that the sender's address records can be corrected." From tester.paul at gmail.com Mon Feb 20 14:47:56 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Mon, 20 Feb 2006 14:47:56 -0500 Subject: [Wtr-general] Error Accessing Frames Message-ID: <37c405480602201147j69661d18v@mail.gmail.com> Hi there, I just noticed something with our latest software build that has unexpectedly weirded out my Watir scripts. I noticed that when I run my scripts, I get an error similar to the following now: ---- ## End of test: Login . Finished in 9.706 seconds. 1 tests, 1 assertions, 0 failures, 0 errors W, [20-Feb-2006 14:29:03#3276] WARN -- : frame error in waitdocument OLE error code:80070005 in <Unknown> Access is denied. HRESULT error code:0x80020009 Exception occurred. c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1405:in `method_missing' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1405:in `wait' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1404:in `upto' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1404:in `wait' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2014:in `click' LD_1_Sign_In(wip).rb:71:in `test_Sign_In' c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:70:in `__send__' c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:70:in `run' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:in `run' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `each' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `run' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:in `run' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `each' c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `run' c:/ruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:44:in `run_suite' c:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:65:in `start_mediator' c:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:39:in `start' c:/ruby/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:27:in `run' c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:194:in `run' c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:14:in `run' c:/ruby/lib/ruby/1.8/test/unit.rb:285 c:/ruby/lib/ruby/1.8/test/unit.rb:283 >Exit code: 0 ---- (FYI: Line 71 in my script = $ie.button(:name, /LoginButton/).click ) I haven't changed anything in the scripts, so I figure it must be the app that has changed. I went to an IRB prompt and executed the following: ---- irb(main):006:0> ie.show_frames() there are 4 frames frame index: 1 --Access Denied-- frame index: 2 name: ContextTree frame index: 3 name: MainWindow frame index: 4 --Access Denied-- => 0..3 ---- That's interesting. I don't remember the "Access Denied" frames before. I pointed the browser to an older build and reran the same command: ---- irb(main):007:0> ie.show_frames() there are 4 frames frame index: 1 name: LeftStatic frame index: 2 name: ContextTree frame index: 3 name: MainWindow frame index: 4 name: RightStatic => 0..3 ---- Okay, so I tried re-running the same script on this older build and it runs without error (as expected). I asked one of the developers if there was a CSS change to the current build and he said that we're now loading the Left and Right frames dynamically instead of statically. I'm not really sure what that means, but I know something is breaking Ruby/Watir. (I'm running Watir 1.4.1 on Ruby 182-15.) Technically, these 'warnings' don't interfere with the test scripts because they still work as expected. I just don't like the noise. Does anyone have any suggestions as to what would cause Ruby or Watir to fail to recognise the frame names like this? Is there some way that I can suppress these warnings? Since I'm not trying to access these frames anyways, I'd rather not be bothered by them. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060220/138c9d5a/attachment.html From saudaziz at gmail.com Mon Feb 20 15:38:25 2006 From: saudaziz at gmail.com (saud aziz) Date: Mon, 20 Feb 2006 12:38:25 -0800 Subject: [Wtr-general] Watir Vs. Selenium Message-ID: <24d0cb380602201238l2df77322t5086bab54029536c@mail.gmail.com> Can you guys give me some good reasons (besdies the fact that Selenium doesn't support frames) why i should choose Watir and not Selenium? I have been using Watir on and off on small things and Since Selenium seems to have improved a lot, as far as IDE and Ruby Driven mode is concerned, from the last time i checked, i am more inclined towards it than Watir. Especially since it also has .NEt Driver along with other set of drivers that you can choose and write your scripts in. In short, i see Selenium as more robust and extensible Functional Testing tool than Watir. Anyone got any comments on that? -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060220/f265a231/attachment.html From christopher.mcmahon at gmail.com Mon Feb 20 15:47:05 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 20 Feb 2006 14:47:05 -0600 Subject: [Wtr-general] Watir Vs. Selenium In-Reply-To: <24d0cb380602201238l2df77322t5086bab54029536c@mail.gmail.com> References: <24d0cb380602201238l2df77322t5086bab54029536c@mail.gmail.com> Message-ID: <72799cd70602201247j804af18h9cd3d70e40016b0e@mail.gmail.com> On 2/20/06, saud aziz <saudaziz at gmail.com> wrote: > Can you guys give me some good reasons (besdies the fact that Selenium > doesn't support frames) why i should choose Watir and not Selenium? Watir is less fussy than Selenium as to constraints on the environment (proxies, etc.) It's convenient to have the rest of the Ruby language available: ODBC, test/unit, etc. all behave just like you want them too, without having to jump through any hoops. There's two reasons... They certainly both have warts, but they are both just as certainly very useful tools. Try out the latest Selenium and let us know what you think. -Chris From christopher_brown at engin.com.au Mon Feb 20 15:51:55 2006 From: christopher_brown at engin.com.au (Brown, Christopher) Date: Tue, 21 Feb 2006 07:51:55 +1100 Subject: [Wtr-general] xpath support doesn't work for me Message-ID: <B0D561E4E514F447AA08B65C957C8CB402390265@MI_EXCH1> Hi Angrez I appear to have completely stuffed up my installation. The xpath tests all fail with errors like the following 79) Error: test_columns(TC_Tables_XPath): WIN32OLERuntimeError: Unknown property or method `navigate' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. C:/Program Files/Watir/unittests/../watir.rb:1324:in `method_missing' C:/Program Files/Watir/unittests/../watir.rb:1324:in `goto' C:/Program Files/Watir/unittests/../unittests/table_xpath_test.rb:15:in `gotoTablePage' C:/Program Files/Watir/unittests/../unittests/table_xpath_test.rb:11:in `setup' Could you elaborate on the installation procedure I need to follow? I have Watir 1.4.1 and the tar file from CVS. I also have Ruby 1.8.2 installed> I don't think I need to re-install Ruby but I've tried installing Watir from scratch. When I run all_tests.rb I get a series of dots with a couple of Fs (fail?), followed by a lot of activity, then it appears to freeze; when I close IE I get a load of Es and Fs followed by messages simialr to the one above. I'm sure when I first installed this everything was straightforward and worked first time. Anyway, what should I be doing with the contents of the tar file? Do I simply copy everything from the tar file to the Watir installation directory? Thanks for your time Regards Chris -----Original Message----- From: Angrez Singh [mailto:angrez at gmail.com] Sent: Monday, February 20, 2006 4:59 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] xpath support doesn't work for me Hi Brown, Anyway, when I run my test script I get the following error message c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `initialize': LoadLibrary: c:\ruby\lib\ruby\site_ruby\1.8\watir\IEDialog\Release\IEDialog.dll (RuntimeError) from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require' from G:/workspace/web_pages/trial.rb:1 The error that you are getting has nothing to do with the XPath support. Could you please try to run the xpath unit tests provided with the TAR ball to make sure that XPath is working? Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060221/896ff299/attachment.html From saudaziz at gmail.com Mon Feb 20 17:36:23 2006 From: saudaziz at gmail.com (saud aziz) Date: Mon, 20 Feb 2006 14:36:23 -0800 Subject: [Wtr-general] xpath support doesn't work for me In-Reply-To: <C629A6599EAF2B4C97CC314771BC292C04CAC335@mail.extend.com> References: <C629A6599EAF2B4C97CC314771BC292C04CAC335@mail.extend.com> Message-ID: <24d0cb380602201436r29943eeene8e6f20c533675bf@mail.gmail.com> yeah, one for IE exists as well: http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en On 2/20/06, Pierre Garigue <PGarigue at extend.com> wrote: > > I posted this on one group and I realized I should have posted it here. > > > > This is a rather interesting tool > > http://chrispederick.com/work/webdeveloper/ > > Even though it's for Firefox I use it to see the value of the form > fields. I then use that information when I write my scripts. > > -Pierre > > -----Original Message----- > *From:* Angrez Singh [mailto:angrez at gmail.com] > *Sent:* Monday, February 20, 2006 12:59 AM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] xpath support doesn't work for me > > Hi Brown, > > Anyway, when I run my test script I get the following error message > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `initialize': > > LoadLibrary: > > c:\ruby\lib\ruby\site_ruby\1.8\watir\IEDialog\Release\IEDialog.dll > > (RuntimeError) > > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `new' > > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273 > > from > > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > > `require__' > > from > > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > > `require' > > from G:/workspace/web_pages/trial.rb:1 > > > The error that you are getting has nothing to do with the XPath support. > Could you please try to run the xpath unit tests provided with the TAR ball > to make sure that XPath is working? > > Regards, > Angrez > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060220/01fffed0/attachment.html From bret at pettichord.com Mon Feb 20 18:20:50 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 20 Feb 2006 17:20:50 -0600 Subject: [Wtr-general] Watir Vs. Selenium In-Reply-To: <24d0cb380602201238l2df77322t5086bab54029536c@mail.gmail.com> References: <24d0cb380602201238l2df77322t5086bab54029536c@mail.gmail.com> Message-ID: <ade75c5b0602201520g2f125c0n59794362c748da28@mail.gmail.com> I too am excited to hear about the improvements to the Ruby driver for Selenium. Some of the things that i plan to work is deepening the integration between Watir and Selenium. E.g.: (1) a parser that executes Selenium scripts using Watir, (2), a Watir-compatable ruby driver that executes Watir scripting using Selenium. One area where i think Watir will remain stronger than Selenium is in the area of concurrency testing. It is easy for me to execute a test against multiple browsers with Watir (well, actually it is kinda hard if i want them to be logged in as different users, but it is still possible). I haven not heard of anyone being able to get Selenium to execute concurrency or low-level load tests with any degree of coordination. In fact, we have a bunch of Selenium tests at my work place and i've been working on using Watir to fill the gap we have regarding concurrency testing (e.g. two users trying to edit the same record at the same time.) I would think of the robustness of the two tools as similar. Why do you say Selenium is more robust? I also think that it is easier to extend Watir, because you can just use Ruby. Selenium does allow you to write additional commands in javascript, but it does not have the general level of extensibility that Watir and Ruby have. Bret On 2/20/06, saud aziz <saudaziz at gmail.com> wrote: > > Can you guys give me some good reasons (besdies the fact that Selenium > doesn't support frames) why i should choose Watir and not Selenium? > > I have been using Watir on and off on small things and Since Selenium > seems to have improved a lot, as far as IDE and Ruby Driven mode is > concerned, from the last time i checked, i am more inclined towards it than > Watir. Especially since it also has .NEt Driver along with other set of > drivers that you can choose and write your scripts in. In short, i see > Selenium as more robust and extensible Functional Testing tool than Watir. > Anyone got any comments on that? > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060220/0da4c58e/attachment.html From saudaziz at gmail.com Mon Feb 20 19:09:31 2006 From: saudaziz at gmail.com (saud aziz) Date: Mon, 20 Feb 2006 16:09:31 -0800 Subject: [Wtr-general] Watir Vs. Selenium In-Reply-To: <ade75c5b0602201520g2f125c0n59794362c748da28@mail.gmail.com> References: <24d0cb380602201238l2df77322t5086bab54029536c@mail.gmail.com> <ade75c5b0602201520g2f125c0n59794362c748da28@mail.gmail.com> Message-ID: <24d0cb380602201609s3460cf6ic9537454dfe479b4@mail.gmail.com> The reason i find Selenium more robust is simply because using Ruby driver, i believe, i could get the same sort of functionality as i could with watir as script would be written in Ruby. For instance, i could assign multiple variables different values extracted from Excel sheet to login by having function in Ruby to do that, just as i could do that in watir. But i can run this script on multiple browsers (IE, Safari and Firefox) and see how they all behave. Recently a bug was discovered in our production environment where a case related to Login functionality was reproducible only under Safari 1.0. No other browser happened to behave in the way it handled that functionality. Now granted Selenium doesn't support safari 1.0, but at least i would be able to code once and run the script on multiple platforms under different broswers to weed out such bugs. On 2/20/06, Bret Pettichord <bret at pettichord.com> wrote: > > I too am excited to hear about the improvements to the Ruby driver for > Selenium. > > Some of the things that i plan to work is deepening the integration > between Watir and Selenium. E.g.: (1) a parser that executes Selenium > scripts using Watir, (2), a Watir-compatable ruby driver that executes Watir > scripting using Selenium. > > One area where i think Watir will remain stronger than Selenium is in the > area of concurrency testing. It is easy for me to execute a test against > multiple browsers with Watir (well, actually it is kinda hard if i want them > to be logged in as different users, but it is still possible). I haven not > heard of anyone being able to get Selenium to execute concurrency or > low-level load tests with any degree of coordination. In fact, we have a > bunch of Selenium tests at my work place and i've been working on using > Watir to fill the gap we have regarding concurrency testing ( e.g. two > users trying to edit the same record at the same time.) > > I would think of the robustness of the two tools as similar. Why do you > say Selenium is more robust? I also think that it is easier to extend Watir, > because you can just use Ruby. Selenium does allow you to write additional > commands in javascript, but it does not have the general level of > extensibility that Watir and Ruby have. > > Bret > > On 2/20/06, saud aziz <saudaziz at gmail.com> wrote: > > > > Can you guys give me some good reasons (besdies the fact that Selenium > > doesn't support frames) why i should choose Watir and not Selenium? > > > > I have been using Watir on and off on small things and Since Selenium > > seems to have improved a lot, as far as IDE and Ruby Driven mode is > > concerned, from the last time i checked, i am more inclined towards it than > > Watir. Especially since it also has .NEt Driver along with other set of > > drivers that you can choose and write your scripts in. In short, i see > > Selenium as more robust and extensible Functional Testing tool than Watir. > > Anyone got any comments on that? > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060220/f6a40be5/attachment.html From saudaziz at gmail.com Mon Feb 20 19:23:54 2006 From: saudaziz at gmail.com (saud aziz) Date: Mon, 20 Feb 2006 16:23:54 -0800 Subject: [Wtr-general] ANN: Watir WebRecorder In-Reply-To: <ade75c5b0602152311i1bdd6175w26928263b7dcc0f0@mail.gmail.com> References: <dd78cfb30602110022u2b7ed089xae0cad39dde46e62@mail.gmail.com> <ade75c5b0602152311i1bdd6175w26928263b7dcc0f0@mail.gmail.com> Message-ID: <24d0cb380602201623h7c44ae69waa0c80f912c851e6@mail.gmail.com> Cannot agree more. I actually liked Scott Hanselman's approach (WatirMaker) to recording "chunks" better and have extended it for myself to record all the steps i would normally take while doing Exploratory testing. Very much helpful and since i can edit and add any sort of functionality to it whenever and wherever i want and can. It has it's own set of issues but works pretty much like what Marcus has and is a bit less crowded as far as code is concerned (Doesn't reference forms and works for me as under .NET 1.1 you can have only 1). One thing i didn't like in Marcus's macro recorder is that if you are testing a page with sets of fields, it doesn't allow you to TAB through those fields and complains to use Mouse. For me that is not good as that is one less test case i could do while i was recording the script. Additionally, with that 'chunk editor' (as you put it so nicely in one other place Bret), Scott had RichText box control instead of Listbox. And i don't have do right click-modify/insert, and can do just about anything right in that text box. Plus, it also shows up as Syntax highlighter ;=), which looks pretty cool. So in short, Scott's implementation works really good and since it's in .NET, i can, therefore, easily modify it to suit my need(s). Thanks once again to Scott. Saud On 2/15/06, Bret Pettichord <bret at pettichord.com> wrote: > > This looks useful. I wanted to report a couple of bugs, comment on some of > the limits you mention of WebRecorder and/or Watir, and clarify my position > on recorders, including a general concern about claims made about > WebRecorder. > > First the bugs. > > 1. When i recorded a script i saw a lot of calls to IE#wait. I don't > believe they are necessary in any of the cases i saw. In fact, my position > is pretty much that users shouldn't have to make calls to IE#wait in their > scripts. If they do, it is a bug in Watir. I'd suggest removing them and > reporting any cases where they seem necessary to you as bugs. > > 2. Not really a bug, but i think the "require > 'test/unit/ui/console/testrunner'" is also unnecessary. > > One thing missing from the Watir version right now is an easy way to > > record code to extract data from the page. > > > OK. > > It also doesn't support file downloads yet. > > > I plan to rewrite Watir's support for this. The current implentation is > buggy. > > The other thing that is missing is support for Area tags. While > > WebRecorder can record clicks on Area maps I couldn't find any support to > > play them back in Watir. > > > True. I haven't seen much demand for this, so i don't think any one is > working on it. > > Regarding my views of recorders... > > I think that recorders can be useful aids to programmers. But i think you > need to know how to write and modify the code that is being generated. One > problem is that recorders often lead people into thinking that they don't > have to be a programmer to use the tool. In fact, your website makes this > very claim. This is what i object to. Not to recorders themselves. > > A second concern is that it simply is much harder to make a reliable > recorder than it to make a reliable execution tool. This is why Watir is an > execution tool, only. The problem is that there are always all kinds of > controls that a tool can execute against but can't record. For example, i > tried to use WebRecorder against a random website that had some javascript > links (probably div tags, i didn't even look) and they didn't get recorded. > I didn't even report that as a bug, because i didn't expect it to work. > Every test tool i've ever used that had a recorder had more reliability > problems with the recorders than the execution. I see them as two separate > things. But that isn't the view of the non-programming user. To even > understand the limits of a recorder, you have to know something about html > -- in other words you have to be, in some sense, a programmer. Anyway, my > point is that if i were to bundle a recorder (any recorder) with Watir, > people would try it first, learn that it wasn't reliable and then conclude > that Watir wasn't reliable. In other words, it would reduce the percieved > reliability of Watir. > > If the recorder is a separate tool, that doesn't make any claims about > allowing non-programmers to create Watir scripts, then i'm cool with it. > > Am i being harsh with WebRecorder? The Watir WebRecorder page says > "WebRecorder is designed to speed up the creation of web testing and web > automation scripts." I'm cool with that. But commercial WebRecorder it is > billed as "No Programming Skills Required". I haven't looked at this version > of the tool, but i'm pretty skeptical about this claim. > > Bret > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060220/8e6a7d7d/attachment.html From gztest2005 at 126.com Mon Feb 20 20:56:40 2006 From: gztest2005 at 126.com (=?x-gbk?Q?=B9=D8=BA=D3?=) Date: Tue, 21 Feb 2006 09:56:40 +0800 Subject: [Wtr-general] Make Watir support Chinese chars In-Reply-To: <mailman.43936.1139500964.7182.wtr-general@rubyforge.org> References: <mailman.43936.1139500964.7182.wtr-general@rubyforge.org> Message-ID: <43FA7358.30500@126.com> This is due to a bug in Ruby when processing Chinese chars string. Someone has submit a patch for it. http://rubyforge.org/tracker/index.php?func=detail&aid=3232&group_id=104&atid=489 dennis wtr-general-request at rubyforge.org wrote: >I need to test some of our webproducts and websites in foreign languages and I'm having problems with testing using Asian characters (European characters seem ok)... I set the script to look for specific text like "?x?? ?????????? ???^?m??" --> (this is traditional Chinese for 'select "page forward" to continue') -- but it fails when run... Is there some sort of character setting I need to adjust in Watir? I have not tried the various possibilities but would it work better to change the search text to some encoding like Hexadecimal (\u9078\u53D6 \u300C\u4E0B\u4E00\u6B65\u300D \u4EE5\u7E7C\u7E8C\u3002) work better? > >Unsure what to do... Has anyone run into this yet? > >Thanks, > >Thom > > From christopher_brown at engin.com.au Mon Feb 20 23:33:54 2006 From: christopher_brown at engin.com.au (Brown, Christopher) Date: Tue, 21 Feb 2006 15:33:54 +1100 Subject: [Wtr-general] xpath support doesn't work for me Message-ID: <B0D561E4E514F447AA08B65C957C8CB402390269@MI_EXCH1> Angrez, I seem to be going backwards here! I cannot get a clean installation of Watir. I have Ruby 1.8.2-15 installed. Everything I do to get Watir going produces failures and errors. I don't know how to capture the details in windows. After some trial error I've managed to get Watir 1.4.1 installed but all_tests.rb freezes. The file loaded into IE is C:\Program Files\Watir\unittests\html\images1.html. The last thing I see in my command prompt is shown below These objects all have the same id This form is has a submit button that is an image This is in a form. The form has hidden objects. The first has a name - hid1 The second has an id- hidden_1 Click This Button to see the values in these boxes .There are 4 forms Form name: id: method: get action: pass.html Form name: test2 id: method: get action: pass2.html Form name: buttonsubmit id: method: get action: pass.html Form name: has_a_hidden id: method: get action: ..................F..F Any suggestions? Cheers Chris -----Original Message----- From: Angrez Singh [mailto:angrez at gmail.com] Sent: Monday, February 20, 2006 4:59 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] xpath support doesn't work for me Hi Brown, Anyway, when I run my test script I get the following error message c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `initialize': LoadLibrary: c:\ruby\lib\ruby\site_ruby\1.8\watir\IEDialog\Release\IEDialog.dll (RuntimeError) from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require' from G:/workspace/web_pages/trial.rb:1 The error that you are getting has nothing to do with the XPath support. Could you please try to run the xpath unit tests provided with the TAR ball to make sure that XPath is working? Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060221/af9696bc/attachment.html From christopher_brown at engin.com.au Tue Feb 21 00:14:41 2006 From: christopher_brown at engin.com.au (Brown, Christopher) Date: Tue, 21 Feb 2006 16:14:41 +1100 Subject: [Wtr-general] xpath support doesn't work for me Message-ID: <B0D561E4E514F447AA08B65C957C8CB40239026A@MI_EXCH1> Okay, I've installed Watir 1.4.1 then run install.rb from the tar bundle (bad move?). When I run xpath_tests.rb I get errors like the following 87) Error: test_textarea_field_exists(TC_TextArea_XPath): WIN32OLERuntimeError: Unknown property or method `navigate' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. C:/Temp/watir/unittests/../watir.rb:1324:in `method_missing' C:/Temp/watir/unittests/../watir.rb:1324:in `goto' C:/Temp/watir/unittests/../unittests/textAreafields_xpath_test.rb:11:in `gotoPage' C:/Temp/watir/unittests/../unittests/textAreafields_xpath_test.rb:15:in `test_textarea_field_exists' 88 tests, 0 assertions, 0 failures, 87 errors Regards Chris -----Original Message----- From: Angrez Singh [mailto:angrez at gmail.com] Sent: Monday, February 20, 2006 4:59 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] xpath support doesn't work for me Hi Brown, Anyway, when I run my test script I get the following error message c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `initialize': LoadLibrary: c:\ruby\lib\ruby\site_ruby\1.8\watir\IEDialog\Release\IEDialog.dll (RuntimeError) from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require' from G:/workspace/web_pages/trial.rb:1 The error that you are getting has nothing to do with the XPath support. Could you please try to run the xpath unit tests provided with the TAR ball to make sure that XPath is working? Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060221/5c04ac49/attachment.html From chrismo at clabs.org Tue Feb 21 09:34:52 2006 From: chrismo at clabs.org (Chris Morris) Date: Tue, 21 Feb 2006 08:34:52 -0600 Subject: [Wtr-general] AutAT Message-ID: <43FB250C.2070301@clabs.org> Just saw this link come across the pragprog mailing list - I've not been monitoring the list very closely, so y'all may know about it already, but thought I'd mention it. http://boss.bekk.no/autat/ It's an Eclipse plugin that rides on top of Canoo WebTest, Watir or jWebUnit. -- Chris http://clabs.org/blogki From angrez at gmail.com Tue Feb 21 12:07:38 2006 From: angrez at gmail.com (Angrez Singh) Date: Tue, 21 Feb 2006 22:37:38 +0530 Subject: [Wtr-general] xpath support doesn't work for me In-Reply-To: <B0D561E4E514F447AA08B65C957C8CB40239026A@MI_EXCH1> References: <B0D561E4E514F447AA08B65C957C8CB40239026A@MI_EXCH1> Message-ID: <e26bda3e0602210907g768fea1dg701789acabbd6152@mail.gmail.com> Hi Brown, Some of the test cases don't work if you install Watir in a directory that contains space in their names. For e.g. c:\Program Files. Just try to install it in c:\watir & let me know if the test cases fails as well. The error you are getting is because IE gets close & scripts are still running. I don't know why this happens but the error "The object invoked has disconnected from its clients." comes only when you are using an IE instance that is not there. Just try installing in some other directory that don't have space in its name & let me know if the test cases succeeded or not. Regards, Angrez On 2/21/06, Brown, Christopher <christopher_brown at engin.com.au> wrote: > > Okay, > > I've installed Watir 1.4.1 then run install.rb from the tar bundle (bad > move?). When I run xpath_tests.rb I get errors like the following > > 87) Error: > test_textarea_field_exists(TC_TextArea_XPath): > WIN32OLERuntimeError: Unknown property or method `navigate' > HRESULT error code:0x80010108 > The object invoked has disconnected from its clients. > C:/Temp/watir/unittests/../watir.rb:1324:in `method_missing' > C:/Temp/watir/unittests/../watir.rb:1324:in `goto' > > C:/Temp/watir/unittests/../unittests/textAreafields_xpath_test.rb:11:in > `gotoPage' > > C:/Temp/watir/unittests/../unittests/textAreafields_xpath_test.rb:15:in > `test_textarea_field_exists' > > 88 tests, 0 assertions, 0 failures, 87 errors > > Regards > > Chris > > -----Original Message----- > *From:* Angrez Singh [mailto:angrez at gmail.com] > *Sent:* Monday, February 20, 2006 4:59 PM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] xpath support doesn't work for me > > Hi Brown, > > Anyway, when I run my test script I get the following error message > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `initialize': > > LoadLibrary: > > c:\ruby\lib\ruby\site_ruby\1.8\watir\IEDialog\Release\IEDialog.dll > > (RuntimeError) > > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `new' > > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273 > > from > > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > > `require__' > > from > > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > > `require' > > from G:/workspace/web_pages/trial.rb:1 > > > The error that you are getting has nothing to do with the XPath support. > Could you please try to run the xpath unit tests provided with the TAR ball > to make sure that XPath is working? > > Regards, > Angrez > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060221/0be09bb1/attachment.html From bret at pettichord.com Tue Feb 21 13:13:45 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 21 Feb 2006 12:13:45 -0600 Subject: [Wtr-general] ANN: Watir WebRecorder In-Reply-To: <dd78cfb30602160306p3952399dka646a5069786e55f@mail.gmail.com> References: <dd78cfb30602110022u2b7ed089xae0cad39dde46e62@mail.gmail.com> <ade75c5b0602152311i1bdd6175w26928263b7dcc0f0@mail.gmail.com> <dd78cfb30602160055v701d8a3ag642f0c15286a6c65@mail.gmail.com> <dd78cfb30602160306p3952399dka646a5069786e55f@mail.gmail.com> Message-ID: <ade75c5b0602211013k5b784abod39ec09db4b03af1@mail.gmail.com> These changes look good. On 2/16/06, Marcus Tettmar <marcus.tettmar at gmail.com> wrote: > > As a follow up I have just uploaded version 0.4 of Watir WebRecorder which > now has support for Divs and TDs which have onclick handlers. It also > displays a disclaimer on startup regarding its limitations and that any > failure to record something is no reflection on the abilities of Watir. > I've also added a disclaimer to the Watir WebRecorder page on our site and > have had the Macro Scheduler WebRecorder page modified to say "No Advanced > Programming Skills Required" rather than "No Programming Skills Required". > I hope this goes some way towards satisfying any concerns. > > http://www.mjtnet.com/watir_webrecorder.htm > > Regards, > Marcus > > On 2/16/06, Marcus Tettmar <marcus.tettmar at gmail.com> wrote: > > > > Hi Bret, > > > > On 2/16/06, Bret Pettichord < bret at pettichord.com> wrote: > > > > > > 1. When i recorded a script i saw a lot of calls to IE#wait. I don't > > > believe they are necessary in any of the cases i saw. In fact, my position > > > is pretty much that users shouldn't have to make calls to IE#wait in their > > > scripts. If they do, it is a bug in Watir. I'd suggest removing them and > > > reporting any cases where they seem necessary to you as bugs. > > > > > > In 0.3 under Tools/Options you can switch off "Insert Waits". I have > > found that they are sometimes useful so I have made it optional. At present > > you also need it to record/automate server auth logins. Goto waits forever > > if a login box pops up because the page hasn't finished loading until after > > the password has been issued. So there are options to use ie.navigateinstead of Goto and therefore an > > ie.wait is needed after it. But in the latest version 0.3 these things > > are optional. So you can switch this off. > > > > 2. Not really a bug, but i think the "require > > > 'test/unit/ui/console/testrunner'" is also unnecessary. > > > > > > I'll check that out. > > > > The other thing that is missing is support for Area tags. While > > > WebRecorder can record clicks on Area maps I couldn't find any support to > > > play them back in Watir. > > > > > > > True. I haven't seen much demand for this, so i don't think any one is > > > working on it. > > > > > > > In the past I have had to automate web sites that used an Area for the > > navigation menu. So it was necessary to record it. But it is true that > > they don't seem to be that prevalent. > > > > > > Regarding my views of recorders... > > > > > > I think that recorders can be useful aids to programmers. But i think > > > you need to know how to write and modify the code that is being generated. > > > > > > > I agree. > > > > One problem is that recorders often lead people into thinking that they > > > don't have to be a programmer to use the tool. > > > > > > > I'm not so sure. I cannot be alone in using Microsoft Office's macro > > recorder to get a jump start on creating VBA code. If I can't remember how > > to do something, or want to get the bare bones of the code from which to > > work I will nearly always record the main process with the VBA recorder. > > But then I will tidy up the code and make changes to it. I am very > > experienced in VBA yet I find the recorder extremely useful. I am aware of > > many other VBA programmers who do the same. At the same time the complete > > beginner can quickly build basic macros without knowing any code. They > > won't get as far as the programmer but both are happy and both find the tool > > useful within the limitations of their abilities. He knows that a > > programmer would get more out of it. > > > > In fact, your website makes this very claim. This is what i object to. > > > Not to recorders themselves. > > > > > > > In respect of the Watir WebRecorder I wasn't aware that we were making > > this claim at all. In regards to Macro Scheduler's WebRecorder it is true > > that we say no programming skills required. But this version outputs very > > different code and is for a very different type of user. In terms of the > > code it outputs the people that use it don't need to modify it. I can cite > > customers with no programming experience at all using MacroScript > > WebRecorder to create dozens of useful web automation scripts without really > > understanding the code it is creating. So in their case I can stand by our > > claims. > > > > A second concern is that it simply is much harder to make a reliable > > > recorder than it to make a reliable execution tool. This is why Watir is an > > > execution tool, only. The problem is that there are always all kinds of > > > controls that a tool can execute against but can't record. For example, i > > > tried to use WebRecorder against a random website that had some javascript > > > links (probably div tags, i didn't even look) and they didn't get recorded. > > > I didn't even report that as a bug, because i didn't expect it to work. > > > Every test tool i've ever used that had a recorder had more reliability > > > problems with the recorders than the execution. I see them as two separate > > > things. But that isn't the view of the non-programming user. To even > > > understand the limits of a recorder, you have to know something about html > > > -- in other words you have to be, in some sense, a programmer. Anyway, my > > > point is that if i were to bundle a recorder (any recorder) with Watir, > > > people would try it first, learn that it wasn't reliable and then conclude > > > that Watir wasn't reliable. In other words, it would reduce the percieved > > > reliability of Watir. > > > > > > > I haven't gotten around to creating a help file for the Watir version > > yet, but will do so soon. When I do I can write in some caveats. The > > MacroScript version explains that not everything can be recorded, but to > > contact us if they find anything that can't so that we can see if we can > > improve it. Otherwise we never get to know about these sites and while we > > spend time looking at random sites we can't find everything. > > > > As you say it is hard, perhaps impossible, to make a recorder for all > > web sites that will manage to record everything. There's simply a limit to > > what the developer can think of to test and the number of web sites and the > > ways they work is infinite. So far our users appear to be aware of that and > > let us know when they find something it fails with. We are either able to > > find a solution and make a modification for them (and the product gets > > better) or we have to explain the reason why it can't be recorded. > > > > Re the issue you found - possibly Div tags - Watir WebRecorder doesn't > > record Div tags. MacroScript WebRecorder doesn't by default but has an > > option where you can specify extra tags you'd like it to record. So it > > probably gets round this problem. In time we could add the same sort of > > functionality to Watir WebRecorder if people are interested. > > > > If the recorder is a separate tool, that doesn't make any claims about > > > allowing non-programmers to create Watir scripts, then i'm cool with it. > > > > > > > How about I add a big warning box that appears on startup with a big > > disclaimer saying that knowledge of Ruby/Watir is necessary and that the > > recorder has limitations and may not be able to record everything? > > > > Am i being harsh with WebRecorder? The Watir WebRecorder page says > > > "WebRecorder is designed to speed up the creation of web testing and web > > > automation scripts." I'm cool with that. But commercial WebRecorder it is > > > billed as "No Programming Skills Required". I haven't looked at this version > > > of the tool, but i'm pretty skeptical about this claim. > > > > > > > As I said, I can stand by that claim just on the basis of the sort of > > people that are using Macro Scheduler and MacroScript WebRecorder. That > > said while in many cases no programming skills are required, they do help! > > Many people with no prior programming skills have used WebRecorder/Macro > > Scheduler to create pretty amazing scripts (but have gained programming > > skills along the way). > > > > With Watir WebRecorder however, I would expect people using Watir > > WebRecorder to understand Watir/Ruby to start with. I will try to make that > > clearer. > > > > -- > > Marcus Tettmar > > http://www.mjtnet.com/ > > Macro Scheduler & WebRecorder for Windows & Web Automation and Testing. > > WebRecorder for Ruby/Watir now available. > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060221/4d8681a8/attachment.html From philipreedtech at gmail.com Tue Feb 21 13:40:53 2006 From: philipreedtech at gmail.com (philip reed) Date: Tue, 21 Feb 2006 13:40:53 -0500 Subject: [Wtr-general] WaTiR and ZenCart? Message-ID: <f462129b0602211040h6f13a85n7945edd937a66f7b@mail.gmail.com> Does anyone know of any projects using WaTiR to test the open-source shopping cart ZenCart <http://zencart.org/> ? I attempted the obvious searches on both Wtr-general list archives and found nothing. A couple of months back I searched the ZC site for anything about automated testing, also to no avail. My company is a heavy implementer of ZC, so at some point if such libraries don't already exist, I will likely be building ZenCart interaction code (e.g., to to save the user/tester from having to figure out all the specific form interaction). I'm open to suggestions about how to package these for maximal utility to other WaTiR and ZC developers. Digression: Bret has long been sort of a hero of mine in the broad field of test automation, and I vaguely knew a year or two ago that "a bunch of people have been doing cool stuff with Ruby and testing." But I had no idea that the finished product worked this well! I've been using WaTiR for maybe two weeks and have been very impressed at how well it works. I even got it working out of the box on my crummy Windows ME laptop! (Don't ask.) Congratulations and thanks to everyone involved in the WaTiR project. Thanks, Philip -- Philip Reed, Developer Positronic Design http://www.positronicdesign.com From christopher_brown at engin.com.au Tue Feb 21 16:36:26 2006 From: christopher_brown at engin.com.au (Brown, Christopher) Date: Wed, 22 Feb 2006 08:36:26 +1100 Subject: [Wtr-general] xpath support doesn't work for me Message-ID: <B0D561E4E514F447AA08B65C957C8CB40239026B@MI_EXCH1> Hi Angrez , I've done as suggested and moved Watir from C:\Program Files\Watir to C:\Watir but I still get the same errors. Am I correct in thinking that the xpath stuff actually resides in the Ruby installation and that the xpath_tests.rb is attempting to use Anyway, these are the failures I get when I run core_tests.rb before trying to install the xpath stuff: 1) Failure: test_http_errors(TC_Navigate) [C:/Watir/unittests/../unittests/navigate_test.rb:51]: <Watir::Exception::NavigationException> exception expected but none was thrown. 2) Failure: test_links_and_images_in_table(TC_Tables) [C:/Watir/unittests/../unittests/table_test.rb:165]: <"106"> expected but was <"28">. 154 tests, 946 assertions, 2 failures, 0 errors After this I've tried a few things: 1. copying the unittest files from the CVS tarball to the Watir installation directory without overwriting existing files 2. copying the unittest files from the CVS tarball to the Watir installation directory and overwriting existing files Just thought, the versions of element.rb and fnctions.rb come from the tarball. If I get the files directly from the CVS repository and try some unit testing I get the following from core_tests.rb c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require__': nosuch file to load -- watir/dialog (LoadError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from C:/Watir/unittests/../unittests/dialog_test.rb:6 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from C:/Watir/unittests/core_tests.rb:7 from C:/Watir/unittests/core_tests.rb:7 Just compared my Ruby installation with the watir contents in the tarball. Gonna copy the following to my Ruby installation: IEDialog folder, win32ole folder, datahandler.rb, dialog.rb, and tidy.dll. I now get 'The object invoked has disconnected from its clients.'! I don't think I need the rexml folder since its already installed with the version of Ruby. Anyway, I've tried copying everything from th etarball to Ruby's watir directory and get c:/ruby/lib/ruby/site_ruby/1.8/watir/camel_case.rb:5: undefined method `wait' for module `Watir::Container' (NameError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3744 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from C:/Watir/unittests/../unittests/setup.rb:4 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from C:/Watir/unittests/core_tests.rb:4 I don't know what else to try right now. Thanks again for your time Chris -----Original Message----- From: Angrez Singh [mailto:angrez at gmail.com] Sent: Wednesday, February 22, 2006 4:08 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] xpath support doesn't work for me Hi Brown, Some of the test cases don't work if you install Watir in a directory that contains space in their names. For e.g. c:\Program Files. Just try to install it in c:\watir & let me know if the test cases fails as well. The error you are getting is because IE gets close & scripts are still running. I don't know why this happens but the error "The object invoked has disconnected from its clients." comes only when you are using an IE instance that is not there. Just try installing in some other directory that don't have space in its name & let me know if the test cases succeeded or not. Regards, Angrez On 2/21/06, Brown, Christopher < christopher_brown at engin.com.au <mailto:christopher_brown at engin.com.au> > wrote: Okay, I've installed Watir 1.4.1 then run install.rb from the tar bundle (bad move?). When I run xpath_tests.rb I get errors like the following 87) Error: test_textarea_field_exists(TC_TextArea_XPath): WIN32OLERuntimeError: Unknown property or method `navigate' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. C:/Temp/watir/unittests/../watir.rb:1324:in `method_missing' C:/Temp/watir/unittests/../watir.rb:1324:in `goto' C:/Temp/watir/unittests/../unittests/textAreafields_xpath_test.rb:11:in `gotoPage' C:/Temp/watir/unittests/../unittests/textAreafields_xpath_test.rb:15:in `test_textarea_field_exists' 88 tests, 0 assertions, 0 failures, 87 errors Regards Chris -----Original Message----- From: Angrez Singh [mailto: angrez at gmail.com <mailto:angrez at gmail.com> ] Sent: Monday, February 20, 2006 4:59 PM To: wtr-general at rubyforge.org <mailto:wtr-general at rubyforge.org> Subject: Re: [Wtr-general] xpath support doesn't work for me Hi Brown, Anyway, when I run my test script I get the following error message c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `initialize': LoadLibrary: c:\ruby\lib\ruby\site_ruby\1.8\watir\IEDialog\Release\IEDialog.dll (RuntimeError) from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require' from G:/workspace/web_pages/trial.rb:1 The error that you are getting has nothing to do with the XPath support. Could you please try to run the xpath unit tests provided with the TAR ball to make sure that XPath is working? Regards, Angrez _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org <mailto:Wtr-general at rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general <http://rubyforge.org/mailman/listinfo/wtr-general> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060222/d40a3c5c/attachment.html From christopher_brown at engin.com.au Tue Feb 21 17:02:15 2006 From: christopher_brown at engin.com.au (Brown, Christopher) Date: Wed, 22 Feb 2006 09:02:15 +1100 Subject: [Wtr-general] xpath support doesn't work for me Message-ID: <B0D561E4E514F447AA08B65C957C8CB40239026C@MI_EXCH1> Something I'd overlooked was to copy watir.rb. I grabbed 1.282 but still get the following when I run xpath_tests.rb c:/ruby/lib/ruby/site_ruby/1.8/watir/camel_case.rb:5: undefined method `wait' for module `Watir::SupportsSubElements' (NameError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:4049 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from C:/Watir/unittests/../unittests/setup.rb:4 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from C:/Watir/unittests/xpath_tests.rb:4 -----Original Message----- From: Brown, Christopher [mailto:christopher_brown at engin.com.au] Sent: Wednesday, February 22, 2006 8:36 AM To: 'wtr-general at rubyforge.org' Subject: Re: [Wtr-general] xpath support doesn't work for me Hi Angrez , I've done as suggested and moved Watir from C:\Program Files\Watir to C:\Watir but I still get the same errors. Am I correct in thinking that the xpath stuff actually resides in the Ruby installation and that the xpath_tests.rb is attempting to use Anyway, these are the failures I get when I run core_tests.rb before trying to install the xpath stuff: 1) Failure: test_http_errors(TC_Navigate) [C:/Watir/unittests/../unittests/navigate_test.rb:51]: <Watir::Exception::NavigationException> exception expected but none was thrown. 2) Failure: test_links_and_images_in_table(TC_Tables) [C:/Watir/unittests/../unittests/table_test.rb:165]: <"106"> expected but was <"28">. 154 tests, 946 assertions, 2 failures, 0 errors After this I've tried a few things: 1. copying the unittest files from the CVS tarball to the Watir installation directory without overwriting existing files 2. copying the unittest files from the CVS tarball to the Watir installation directory and overwriting existing files Just thought, the versions of element.rb and fnctions.rb come from the tarball. If I get the files directly from the CVS repository and try some unit testing I get the following from core_tests.rb c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require__': nosuch file to load -- watir/dialog (LoadError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from C:/Watir/unittests/../unittests/dialog_test.rb:6 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from C:/Watir/unittests/core_tests.rb:7 from C:/Watir/unittests/core_tests.rb:7 Just compared my Ruby installation with the watir contents in the tarball. Gonna copy the following to my Ruby installation: IEDialog folder, win32ole folder, datahandler.rb, dialog.rb, and tidy.dll. I now get 'The object invoked has disconnected from its clients.'! I don't think I need the rexml folder since its already installed with the version of Ruby. Anyway, I've tried copying everything from th etarball to Ruby's watir directory and get c:/ruby/lib/ruby/site_ruby/1.8/watir/camel_case.rb:5: undefined method `wait' for module `Watir::Container' (NameError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3744 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from C:/Watir/unittests/../unittests/setup.rb:4 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from C:/Watir/unittests/core_tests.rb:4 I don't know what else to try right now. Thanks again for your time Chris -----Original Message----- From: Angrez Singh [mailto:angrez at gmail.com] Sent: Wednesday, February 22, 2006 4:08 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] xpath support doesn't work for me Hi Brown, Some of the test cases don't work if you install Watir in a directory that contains space in their names. For e.g. c:\Program Files. Just try to install it in c:\watir & let me know if the test cases fails as well. The error you are getting is because IE gets close & scripts are still running. I don't know why this happens but the error "The object invoked has disconnected from its clients." comes only when you are using an IE instance that is not there. Just try installing in some other directory that don't have space in its name & let me know if the test cases succeeded or not. Regards, Angrez On 2/21/06, Brown, Christopher < christopher_brown at engin.com.au <mailto:christopher_brown at engin.com.au> > wrote: Okay, I've installed Watir 1.4.1 then run install.rb from the tar bundle (bad move?). When I run xpath_tests.rb I get errors like the following 87) Error: test_textarea_field_exists(TC_TextArea_XPath): WIN32OLERuntimeError: Unknown property or method `navigate' HRESULT error code:0x80010108 The object invoked has disconnected from its clients. C:/Temp/watir/unittests/../watir.rb:1324:in `method_missing' C:/Temp/watir/unittests/../watir.rb:1324:in `goto' C:/Temp/watir/unittests/../unittests/textAreafields_xpath_test.rb:11:in `gotoPage' C:/Temp/watir/unittests/../unittests/textAreafields_xpath_test.rb:15:in `test_textarea_field_exists' 88 tests, 0 assertions, 0 failures, 87 errors Regards Chris -----Original Message----- From: Angrez Singh [mailto: angrez at gmail.com <mailto:angrez at gmail.com> ] Sent: Monday, February 20, 2006 4:59 PM To: wtr-general at rubyforge.org <mailto:wtr-general at rubyforge.org> Subject: Re: [Wtr-general] xpath support doesn't work for me Hi Brown, Anyway, when I run my test script I get the following error message c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `initialize': LoadLibrary: c:\ruby\lib\ruby\site_ruby\1.8\watir\IEDialog\Release\IEDialog.dll (RuntimeError) from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1273 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require' from G:/workspace/web_pages/trial.rb:1 The error that you are getting has nothing to do with the XPath support. Could you please try to run the xpath unit tests provided with the TAR ball to make sure that XPath is working? Regards, Angrez _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org <mailto:Wtr-general at rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general <http://rubyforge.org/mailman/listinfo/wtr-general> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060222/67953547/attachment.html From dave at burt.id.au Tue Feb 21 18:46:33 2006 From: dave at burt.id.au (Dave Burt) Date: Wed, 22 Feb 2006 10:46:33 +1100 Subject: [Wtr-general] Make Watir support Chinese chars In-Reply-To: <43FA7358.30500@126.com> References: <mailman.43936.1139500964.7182.wtr-general@rubyforge.org> <43FA7358.30500@126.com> Message-ID: <3ad74bc80602211546n443b1175k92baaf1669aa31e3@mail.gmail.com> Hi, Has $KCODE been mentioned yet on this list? > I need to test some of our webproducts and websites in foreign > languages and I'm having problems with testing using Asian > characters (European characters seem ok)... I set the script to look > for specific text like "?x?? ?????????? ???^?m??" --> (this is > traditional Chinese for 'select "page forward" to continue') -- but it fails > when run... Is there some sort of character setting I need to adjust in > Watir? I have not tried the various possibilities but would it work > better to change the search text to some encoding like Hexadecimal > (\u9078\u53D6 \u300C\u4E0B\u4E00\u6B65\u300D > \u4EE5\u7E7C\u7E8C\u3002) work better? You need to tell Ruby the character set you're using in your script using the KCODE directive. For example, put the following line at the top of your script for UTF-8: $KCODE = 'UTF-8' Other recognised values are "EUC" and "Shift-JIS". You'll still probably run into some issues with regexps and so on, but that should get Ruby to understand your script. I hope this helps. Cheers, Dave From bret at pettichord.com Tue Feb 21 21:42:35 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 21 Feb 2006 20:42:35 -0600 Subject: [Wtr-general] Make Watir support Chinese chars In-Reply-To: <3ad74bc80602211546n443b1175k92baaf1669aa31e3@mail.gmail.com> References: <mailman.43936.1139500964.7182.wtr-general@rubyforge.org> <43FA7358.30500@126.com> <3ad74bc80602211546n443b1175k92baaf1669aa31e3@mail.gmail.com> Message-ID: <ade75c5b0602211842n5eee13dan1e917b69966c4c4a@mail.gmail.com> I was able to get Watir to read and write Asian characters encoded using UTF-8 by doing the following. 1. Use Ruby 1.8.3. The version of WIN32OLE included here has new support for alternate codesets. 2. Add the following line to the top of the script: WIN32OLE.codepage = WIN32OLE::CP_UTF8 I believe that Dave's advice regards what you need in order to embed Asian characters in Ruby Scripts themselves. I didn't do this myself. Instead, i used data-driven testing and read and wrote the data to excel spreadsheets. I found that Excel had better support for Asian characters than the code editors i use for Ruby. Bret On 2/21/06, Dave Burt <dave at burt.id.au> wrote: > > Hi, > > Has $KCODE been mentioned yet on this list? > > > I need to test some of our webproducts and websites in foreign > > languages and I'm having problems with testing using Asian > > characters (European characters seem ok)... I set the script to look > > for specific text like "?x?? ?????????? ???^?m??" --> (this is > > traditional Chinese for 'select "page forward" to continue') -- but it > fails > > when run... Is there some sort of character setting I need to adjust in > > Watir? I have not tried the various possibilities but would it work > > better to change the search text to some encoding like Hexadecimal > > (\u9078\u53D6 \u300C\u4E0B\u4E00\u6B65\u300D > > \u4EE5\u7E7C\u7E8C\u3002) work better? > > You need to tell Ruby the character set you're using in your script > using the KCODE directive. For example, put the following line at the > top of your script for UTF-8: > > $KCODE = 'UTF-8' > > Other recognised values are "EUC" and "Shift-JIS". > > You'll still probably run into some issues with regexps and so on, but > that should get Ruby to understand your script. > > I hope this helps. > > Cheers, > Dave > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060221/fb349c61/attachment.html From dave at burt.id.au Tue Feb 21 23:22:00 2006 From: dave at burt.id.au (Dave Burt) Date: Wed, 22 Feb 2006 15:22:00 +1100 Subject: [Wtr-general] Make Watir support Chinese chars In-Reply-To: <ade75c5b0602211842n5eee13dan1e917b69966c4c4a@mail.gmail.com> References: <mailman.43936.1139500964.7182.wtr-general@rubyforge.org> <43FA7358.30500@126.com> <3ad74bc80602211546n443b1175k92baaf1669aa31e3@mail.gmail.com> <ade75c5b0602211842n5eee13dan1e917b69966c4c4a@mail.gmail.com> Message-ID: <3ad74bc80602212022p5f215a94oca331b4ebd8462d7@mail.gmail.com> Hi, Bret wrote: > 1. Use Ruby 1.8.3. The version of WIN32OLE included here has new support for > alternate > codesets. > 2. Add the following line to the top of the script: > WIN32OLE.codepage = WIN32OLE::CP_UTF8 That's great news, that WIN32OLE issue was really annoying. > I believe that Dave's advice regards what you need in order to embed Asian > characters in Ruby Scripts themselves. Yes, that's right. Cheers, Dave From angrez at gmail.com Tue Feb 21 23:23:17 2006 From: angrez at gmail.com (Angrez Singh) Date: Wed, 22 Feb 2006 09:53:17 +0530 Subject: [Wtr-general] xpath support doesn't work for me In-Reply-To: <B0D561E4E514F447AA08B65C957C8CB40239026B@MI_EXCH1> References: <B0D561E4E514F447AA08B65C957C8CB40239026B@MI_EXCH1> Message-ID: <e26bda3e0602212023q4787195by67239c425cd4ab86@mail.gmail.com> Hi Brown, > I've done as suggested and moved Watir from C:\Program Files\Watir to > C:\Watir but I still get the same errors. > > Am I correct in thinking that the xpath stuff actually resides in the Ruby > installation and that the xpath_tests.rb is attempting to use > Nope XPath uses only REXML part of Ruby installation. Rest code resides in watir.rb file. Anyway, these are the failures I get when I run core_tests.rb before trying > to install the xpath stuff: > > 1) Failure: > test_http_errors(TC_Navigate) > [C:/Watir/unittests/../unittests/navigate_test.rb:51]: > <Watir::Exception::NavigationException> exception expected but none was > thrown. > > 2) Failure: > test_links_and_images_in_table(TC_Tables) > [C:/Watir/unittests/../unittests/table_test.rb:165]: > <"106"> expected but was > <"28">. > > 154 tests, 946 assertions, 2 failures, 0 errors > I think some of the unit tests are not up to date so need to change those & thats why you are getting this error. > > Just compared my Ruby installation with the watir contents in the tarball. > Gonna copy the following to my Ruby installation: IEDialog folder, win32ole > folder, datahandler.rb, dialog.rb, and tidy.dll. I now get 'The object > invoked has disconnected from its clients.'! > If I understood right, you copied these files to [ruby installation directory]/ruby/lib/ruby/site_ruby/1.8 . I don't think I need the rexml folder since its already installed with the > version of Ruby. > Yes, you don't need Rexml folder. You can just copy the files to the Rexml folder that comes with Ruby installation. I'll try installation of Watir using the tar ball on my local machine & let you know. Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060222/4be706b1/attachment.html From christopher_brown at engin.com.au Tue Feb 21 23:35:26 2006 From: christopher_brown at engin.com.au (Brown, Christopher) Date: Wed, 22 Feb 2006 15:35:26 +1100 Subject: [Wtr-general] xpath support doesn't work for me Message-ID: <B0D561E4E514F447AA08B65C957C8CB40239026E@MI_EXCH1> Hi Angrez, -----Original Message----- From: Angrez Singh [mailto:angrez at gmail.com] Sent: Wednesday, February 22, 2006 3:23 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] xpath support doesn't work for me Hi Brown, I've done as suggested and moved Watir from C:\Program Files\Watir to C:\Watir but I still get the same errors. Am I correct in thinking that the xpath stuff actually resides in the Ruby installation and that the xpath_tests.rb is attempting to use Nope XPath uses only REXML part of Ruby installation. Rest code resides in watir.rb file. [Chris Brown] Okay. That makes sense. Anyway, these are the failures I get when I run core_tests.rb before trying to install the xpath stuff: 1) Failure: test_http_errors(TC_Navigate) [C:/Watir/unittests/../unittests/navigate_test.rb:51]: <Watir::Exception::NavigationException> exception expected but none was thrown. 2) Failure: test_links_and_images_in_table(TC_Tables) [C:/Watir/unittests/../unittests/table_test.rb:165]: <"106"> expected but was <"28">. 154 tests, 946 assertions, 2 failures, 0 errors I think some of the unit tests are not up to date so need to change those & thats why you are getting this error. [Chris Brown] Okay. Just compared my Ruby installation with the watir contents in the tarball. Gonna copy the following to my Ruby installation: IEDialog folder, win32ole folder, datahandler.rb, dialog.rb, and tidy.dll. I now get 'The object invoked has disconnected from its clients.'! If I understood right, you copied these files to [ruby installation directory]/ruby/lib/ruby/site_ruby/1.8 . [Chris Brown] Yes. I don't think I need the rexml folder since its already installed with the version of Ruby. Yes, you don't need Rexml folder. You can just copy the files to the Rexml folder that comes with Ruby installation. [Chris Brown] I don't understand the second sentence. I copied element.rb and functions.rb from the repository into the Ruby installation directory. I'll try installation of Watir using the tar ball on my local machine & let you know. [Chris Brown] Goo dluck :) Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060222/0a954d97/attachment.html From bret at pettichord.com Wed Feb 22 01:05:17 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 22 Feb 2006 00:05:17 -0600 Subject: [Wtr-general] WaTiR and ZenCart? In-Reply-To: <f462129b0602211040h6f13a85n7945edd937a66f7b@mail.gmail.com> References: <f462129b0602211040h6f13a85n7945edd937a66f7b@mail.gmail.com> Message-ID: <ade75c5b0602212205g73964a61l6b147af60329e984@mail.gmail.com> On 2/21/06, philip reed <philipreedtech at gmail.com> wrote: > > My company is a heavy implementer of ZC, so at some point if such > libraries don't already exist, I will likely be building ZenCart > interaction code (e.g., to to save the user/tester from having to > figure out all the specific form interaction). I'm open to > suggestions about how to package these for maximal utility to other > WaTiR and ZC developers. I suggest that you package this as a Ruby library, and then let us know when it is available. We have been including user contributions in the Watir distribution and could include this with it. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060222/dd17ba93/attachment.html From bret at pettichord.com Wed Feb 22 01:05:17 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 22 Feb 2006 00:05:17 -0600 Subject: [Wtr-general] WaTiR and ZenCart? In-Reply-To: <f462129b0602211040h6f13a85n7945edd937a66f7b@mail.gmail.com> References: <f462129b0602211040h6f13a85n7945edd937a66f7b@mail.gmail.com> Message-ID: <ade75c5b0602212205g73964a61l6b147af60329e984@mail.gmail.com> On 2/21/06, philip reed <philipreedtech at gmail.com> wrote: > > My company is a heavy implementer of ZC, so at some point if such > libraries don't already exist, I will likely be building ZenCart > interaction code (e.g., to to save the user/tester from having to > figure out all the specific form interaction). I'm open to > suggestions about how to package these for maximal utility to other > WaTiR and ZC developers. I suggest that you package this as a Ruby library, and then let us know when it is available. We have been including user contributions in the Watir distribution and could include this with it. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060222/dd17ba93/attachment-0001.html From kiranb4u at yahoo.com Wed Feb 22 06:12:50 2006 From: kiranb4u at yahoo.com (Kiran Kumar..) Date: Wed, 22 Feb 2006 03:12:50 -0800 (PST) Subject: [Wtr-general] Save the results.. Message-ID: <20060222111250.74138.qmail@web33206.mail.mud.yahoo.com> Hi, Where and how i can save the results got from running the Watir scripts..Please help me out Regards Kiran.. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From zeljko.filipin at gmail.com Wed Feb 22 06:28:19 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 22 Feb 2006 12:28:19 +0100 Subject: [Wtr-general] Save the results.. In-Reply-To: <20060222111250.74138.qmail@web33206.mail.mud.yahoo.com> References: <20060222111250.74138.qmail@web33206.mail.mud.yahoo.com> Message-ID: <f81b1250602220328t6734caf1w9df0a420e19d9c59@mail.gmail.com> 1. go to command prompt2. type ruby my_watir_script.rb > my_watir_script_results.txt 3. all output will be stored in my_watir_script_results.txt4. you can do it even shorter my_watir_script > my_watir_script_results.txt For more information, visit http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx or google for something like "command prompt redirect output to file" On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote:> Hi,>> Where and how i can save the results got from running the Watir> scripts..Please help me out>> Regards> Kiran..>> __________________________________________________> 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> --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/ From kiranb4u at yahoo.com Wed Feb 22 07:11:21 2006 From: kiranb4u at yahoo.com (Kiran Kumar..) Date: Wed, 22 Feb 2006 04:11:21 -0800 (PST) Subject: [Wtr-general] Save the results.. In-Reply-To: <f81b1250602220328t6734caf1w9df0a420e19d9c59@mail.gmail.com> Message-ID: <20060222121121.57245.qmail@web33208.mail.mud.yahoo.com> Hi, Thanx for the same.. Is there any wild character in ruby so that i can use. The scenerio goes like this for example intial my Inbox may show as Inbox(1) and after some time it may have Inbox(2). So i want to write a script for clicking on Inbox. Regards Kiran.. --- Zeljko Filipin <zeljko.filipin at gmail.com> wrote: > 1. go to command prompt2. type > ruby my_watir_script.rb > my_watir_script_results.txt > 3. all output will be stored in my_watir_script_results.txt4. you can > do it even shorter > my_watir_script > my_watir_script_results.txt > For more information, visit > http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx > or google for something like "command prompt redirect output to file" > On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote:> Hi,>> Where > and how i can save the results got from running the Watir> > scripts..Please help me out>> Regards> Kiran..>> > __________________________________________________> 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> > > --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/ > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From zeljko.filipin at gmail.com Wed Feb 22 07:17:58 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 22 Feb 2006 13:17:58 +0100 Subject: [Wtr-general] Save the results.. In-Reply-To: <20060222121121.57245.qmail@web33208.mail.mud.yahoo.com> References: <f81b1250602220328t6734caf1w9df0a420e19d9c59@mail.gmail.com> <20060222121121.57245.qmail@web33208.mail.mud.yahoo.com> Message-ID: <f81b1250602220417x1c849410w927ec03298cc1760@mail.gmail.com> ie.link(:text, /inbox/).click For more information, visit http://www.regular-expressions.info/ruby.html or google for something like "ruby regular expression". I am glad I could help. :) On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote:> Hi,>> Thanx for the same.. Is there any wild character in ruby so that i can> use.> The scenerio goes like this for example intial my Inbox may show as> Inbox(1) and after some time it may have Inbox(2). So i want to write a> script for clicking on Inbox.>> Regards> Kiran..>> --- Zeljko Filipin <zeljko.filipin at gmail.com> wrote:>> > 1. go to command prompt2. type> > ruby my_watir_script.rb > my_watir_script_results.txt> > 3. all output will be stored in my_watir_script_results.txt4. you can> > do it even shorter> > my_watir_script > my_watir_script_results.txt> > For more information, visit> >> http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx> > or google for something like "command prompt redirect output to file"> > On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote:> Hi,>> Where> > and how i can save the results got from running the Watir>> > scripts..Please help me out>> Regards> Kiran..>>> > __________________________________________________> 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>> >> >> --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/> > _______________________________________________> > Wtr-general mailing list> > Wtr-general at rubyforge.org> > http://rubyforge.org/mailman/listinfo/wtr-general> >>>> __________________________________________________> 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> --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/ From zeljko.filipin at gmail.com Wed Feb 22 07:25:17 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 22 Feb 2006 13:25:17 +0100 Subject: [Wtr-general] Save the results.. In-Reply-To: <f81b1250602220417x1c849410w927ec03298cc1760@mail.gmail.com> References: <f81b1250602220328t6734caf1w9df0a420e19d9c59@mail.gmail.com> <20060222121121.57245.qmail@web33208.mail.mud.yahoo.com> <f81b1250602220417x1c849410w927ec03298cc1760@mail.gmail.com> Message-ID: <f81b1250602220425rfee3f24n711ecd27fe1c1470@mail.gmail.com> Also, you should read WATIR User Guide(http://wtr.rubyforge.org/watir_user_guide.html), there is chapternamed Using Regular Expressions. Watir home page (http://wtr.rubyforge.org/) is also very useful. From kiranb4u at yahoo.com Wed Feb 22 07:35:52 2006 From: kiranb4u at yahoo.com (Kiran Kumar..) Date: Wed, 22 Feb 2006 04:35:52 -0800 (PST) Subject: [Wtr-general] Save the results.. In-Reply-To: <f81b1250602220417x1c849410w927ec03298cc1760@mail.gmail.com> Message-ID: <20060222123552.4067.qmail@web33211.mail.mud.yahoo.com> Hi, Thanx for the same. What is the command to maximize the browser window.Please let me know.. Regards Kiran.. --- Zeljko Filipin <zeljko.filipin at gmail.com> wrote: > ie.link(:text, /inbox/).click > For more information, visit > http://www.regular-expressions.info/ruby.html > or google for something like "ruby regular expression". > I am glad I could help. :) > On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote:> Hi,>> Thanx > for the same.. Is there any wild character in ruby so that i can> > use.> The scenerio goes like this for example intial my Inbox may > show as> Inbox(1) and after some time it may have Inbox(2). So i want > to write a> script for clicking on Inbox.>> Regards> Kiran..>> --- > Zeljko Filipin <zeljko.filipin at gmail.com> wrote:>> > 1. go to command > prompt2. type> > ruby my_watir_script.rb > > my_watir_script_results.txt> > 3. all output will be stored in > my_watir_script_results.txt4. you can> > do it even shorter> > > my_watir_script > my_watir_script_results.txt> > For more > information, visit> >> > http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx> > > or google for something like "command prompt redirect output to > file"> > On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote:> Hi,>> > Where> > and how i can save the results got from running the Watir>> > > scripts..Please help me out>>! > Regards> Kiran..>>> > > __________________________________________________> 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>> >> >> > --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/> > > _______________________________________________> > Wtr-general > mailing list> > Wtr-general at rubyforge.org> > > http://rubyforge.org/mailman/listinfo/wtr-general> >>>> > __________________________________________________> 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> > > --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/ > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From angrez at gmail.com Wed Feb 22 07:44:54 2006 From: angrez at gmail.com (Angrez Singh) Date: Wed, 22 Feb 2006 18:14:54 +0530 Subject: [Wtr-general] Save the results.. In-Reply-To: <20060222123552.4067.qmail@web33211.mail.mud.yahoo.com> References: <f81b1250602220417x1c849410w927ec03298cc1760@mail.gmail.com> <20060222123552.4067.qmail@web33211.mail.mud.yahoo.com> Message-ID: <e26bda3e0602220444l62c2dd98me24160c9fd991574@mail.gmail.com> $ie.maximize -Angrez On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote: > > Hi, > Thanx for the same. What is the command to maximize the browser > window.Please let me know.. > Regards > Kiran.. > > --- Zeljko Filipin <zeljko.filipin at gmail.com> wrote: > > > ie.link(:text, /inbox/).click > > For more information, visit > > http://www.regular-expressions.info/ruby.html > > or google for something like "ruby regular expression". > > I am glad I could help. :) > > On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote:> Hi,>> Thanx > > for the same.. Is there any wild character in ruby so that i can> > > use.> The scenerio goes like this for example intial my Inbox may > > show as> Inbox(1) and after some time it may have Inbox(2). So i want > > to write a> script for clicking on Inbox.>> Regards> Kiran..>> --- > > Zeljko Filipin <zeljko.filipin at gmail.com> wrote:>> > 1. go to command > > prompt2. type> > ruby my_watir_script.rb > > > my_watir_script_results.txt> > 3. all output will be stored in > > my_watir_script_results.txt4. you can> > do it even shorter> > > > my_watir_script > my_watir_script_results.txt> > For more > > information, visit> >> > > > > http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx > > > > > or google for something like "command prompt redirect output to > > file"> > On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote:> Hi,>> > > Where> > and how i can save the results got from running the Watir>> > > > scripts..Please help me out>>! > > Regards> Kiran..>>> > > > __________________________________________________> 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>> >> >> > > > --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/> > > > _______________________________________________> > Wtr-general > > mailing list> > Wtr-general at rubyforge.org> > > > http://rubyforge.org/mailman/listinfo/wtr-general> >>>> > > __________________________________________________> 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> > > > > > --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/ > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > __________________________________________________ > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060222/0103b0fd/attachment.html From zeljko.filipin at gmail.com Wed Feb 22 07:52:02 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Wed, 22 Feb 2006 13:52:02 +0100 Subject: [Wtr-general] Save the results.. In-Reply-To: <20060222123552.4067.qmail@web33211.mail.mud.yahoo.com> References: <f81b1250602220417x1c849410w927ec03298cc1760@mail.gmail.com> <20060222123552.4067.qmail@web33211.mail.mud.yahoo.com> Message-ID: <f81b1250602220452x104b438eqa0cabbe91d184f9e@mail.gmail.com> ie.maximize At http://wtr.rubyforge.org/rdoc/classes/Watir/IE.html (part ofhttp://wtr.rubyforge.org/rdoc/) you can find what watir can do with iebrowser. Also, search mail archive (try "maximize", I just found that I havealready answered this question before) athttp://www.mail-archive.com/wtr-general%40rubyforge.org/ On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote:> Hi,> Thanx for the same. What is the command to maximize the browser> window.Please let me know..> Regards> Kiran..>> --- Zeljko Filipin <zeljko.filipin at gmail.com> wrote:>> > ie.link(:text, /inbox/).click> > For more information, visit> > http://www.regular-expressions.info/ruby.html> > or google for something like "ruby regular expression".> > I am glad I could help. :)> > On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote:> Hi,>> Thanx> > for the same.. Is there any wild character in ruby so that i can>> > use.> The scenerio goes like this for example intial my Inbox may> > show as> Inbox(1) and after some time it may have Inbox(2). So i want> > to write a> script for clicking on Inbox.>> Regards> Kiran..>> ---> > Zeljko Filipin <zeljko.filipin at gmail.com> wrote:>> > 1. go to command> > prompt2. type> > ruby my_watir_script.rb >> > my_watir_script_results.txt> > 3. all output will be stored in> > my_watir_script_results.txt4. you can> > do it even shorter> >> > my_watir_script > my_watir_script_results.txt> > For more> > information, visit> >>> >> http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx>> > > or google for something like "command prompt redirect output to> > file"> > On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote:> Hi,>>> > Where> > and how i can save the results got from running the Watir>>> > > scripts..Please help me out>>!> > Regards> Kiran..>>> >> > __________________________________________________> 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>> >> >>> >> --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/>> > > _______________________________________________> > Wtr-general> > mailing list> > Wtr-general at rubyforge.org> >> > http://rubyforge.org/mailman/listinfo/wtr-general> >>>>> > __________________________________________________> 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>> >> >> --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/> > _______________________________________________> > Wtr-general mailing list> > Wtr-general at rubyforge.org> > http://rubyforge.org/mailman/listinfo/wtr-general> >>>> __________________________________________________> 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> --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/ From Neumann at encoway.de Wed Feb 22 08:12:59 2006 From: Neumann at encoway.de (Neumann, Carsten - ENCOWAY) Date: Wed, 22 Feb 2006 14:12:59 +0100 Subject: [Wtr-general] Save the results.. Message-ID: <0E46E3619326224CB40CC30C2E36364EA5FF81@zde008.lenze.com> Hi, can be found in the Watir API reference: ie.maximize() Regards, Carsten Neumann ********************************** -----Urspr?ngliche Nachricht----- Von: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] Im Auftrag von Kiran Kumar.. Gesendet: Mittwoch, 22. Februar 2006 13:36 An: wtr-general at rubyforge.org Betreff: Re: [Wtr-general] Save the results.. Hi, Thanx for the same. What is the command to maximize the browser window.Please let me know.. Regards Kiran.. --- Zeljko Filipin <zeljko.filipin at gmail.com> wrote: > ie.link(:text, /inbox/).click > For more information, visit > http://www.regular-expressions.info/ruby.html > or google for something like "ruby regular expression". > I am glad I could help. :) > On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote:> Hi,>> Thanx > for the same.. Is there any wild character in ruby so that i can> > use.> The scenerio goes like this for example intial my Inbox may > show as> Inbox(1) and after some time it may have Inbox(2). So i want > to write a> script for clicking on Inbox.>> Regards> Kiran..>> --- > Zeljko Filipin <zeljko.filipin at gmail.com> wrote:>> > 1. go to command > prompt2. type> > ruby my_watir_script.rb > > my_watir_script_results.txt> > 3. all output will be stored in > my_watir_script_results.txt4. you can> > do it even shorter> > > my_watir_script > my_watir_script_results.txt> > For more > information, visit> >> > http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx> > > or google for something like "command prompt redirect output to > file"> > On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote:> Hi,>> > Where> > and how i can save the results got from running the Watir>> > > scripts..Please help me out>>! > Regards> Kiran..>>> > > __________________________________________________> 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>> >> >> > --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/> > > _______________________________________________> > Wtr-general > mailing list> > Wtr-general at rubyforge.org> > > http://rubyforge.org/mailman/listinfo/wtr-general> >>>> > __________________________________________________> 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> > > --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/ > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > __________________________________________________ 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 xi.chen at kalido.com Wed Feb 22 08:35:59 2006 From: xi.chen at kalido.com (Xi Chen) Date: Wed, 22 Feb 2006 13:35:59 -0000 Subject: [Wtr-general] Multi IE explorer Message-ID: <2CCD8390D18C304D9DAC0F92DBA1E2753656AD@kal-uk-s-mail.kalido.local> Hi I have looked at FAQ about invoking separate IE instances using Watir. However I found it doesn't work. For example I tried to open up 10 different browser with a textfield in each of them. I tried to write some text in the text_field. All the text are writen into the textfield in the last IE. Anyone please help? Xi Chen From saudaziz at gmail.com Wed Feb 22 12:13:53 2006 From: saudaziz at gmail.com (saud aziz) Date: Wed, 22 Feb 2006 09:13:53 -0800 Subject: [Wtr-general] Script hangs and does nothing Message-ID: <24d0cb380602220913r3d926578uaa0049f0c3d02456@mail.gmail.com> Hi guys, When i try to run the following script, it just hangs and never clicks through the respective image buttons on site. Can someone run and tell me if it works for them? Or how i could possibly modify it to make it run? Another thing noticeable is that when you run this from command prompt, it sometimes doesn't even display the buttons that you are supposed to click on at all. So for instance on page ' http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx' you might not find button that says get started and you can make it appear only if you press refresh/reload for browser. I am running latest version of Watir and Ruby available to General Public. Any help is much appreciated. require 'watir' include Watir require 'test/unit' class TC_recorded < Test::Unit::TestCase def test_recorded ie = IE.new ie.goto('https://www.seattlesymphony.org/') #ie.link(:url, ' http://www.seattlesymphony.org/symphony/buy/subs/').click #ie.goto('javascript:bakeCookie()') #ie.button(:alt, 'New Subscription').click ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx') ie.image(:name, 'template:ib_GetStarted').click ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1') ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150') ie.button(:alt, 'Select This Series').click ie.radio(:name, 'Section','73').set() ie.button(:alt, 'Add This Series To My Cart').click ie.button(:alt, 'Browse Series').click ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2' ) ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx' ) ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3' ) ie.link(:url, ' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx').click ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2' ) ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176' ) ie.button(:alt, 'Select This Series').click ie.radio(:name, 'Section','62').set() ie.button(:alt, 'Add This Series To My Cart').click ie.button(:alt, 'Continue To Next Step').click end end Any help is much appreciated. obviously it is not even complete script, but if you can get past 'ie.button(:alt, 'Select This Series').click' this step, then it would be great to know. For me it just hangs and does nothing, no errors, nada. -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060222/b100a36a/attachment.html From saudaziz at gmail.com Wed Feb 22 12:58:40 2006 From: saudaziz at gmail.com (saud aziz) Date: Wed, 22 Feb 2006 09:58:40 -0800 Subject: [Wtr-general] Multi IE explorer In-Reply-To: <2CCD8390D18C304D9DAC0F92DBA1E2753656AD@kal-uk-s-mail.kalido.local> References: <2CCD8390D18C304D9DAC0F92DBA1E2753656AD@kal-uk-s-mail.kalido.local> Message-ID: <24d0cb380602220958y2ca72ab8x69b149a02f983212@mail.gmail.com> I believe it depends on how you write your code. For instance, the following will launch an IE session, and then get data out of excel file and dump it in respective session: def test_getExcelBugs excel = WIN32OLE::new('excel.Application') workbook = excel.Workbooks.Open ('C:\ruby\watir\watir-v1_4\examples\logging\_Bugs.xls') worksheet = workbook.Worksheets(1) worksheet.Select excel['Visible'] = true line = '2' data = Array.new while worksheet.Range("a#{line}:j#{line}")['Value'] #data << worksheet.Range("a#{line}:j#{line}")['Value'] #data.each { |x| print x, "\n\n\n".chomp } #Set variables start project_Number = worksheet.Range("a#{line}")['Value'] add_ShortDescription = worksheet.Range("b#{line}")['Value'] $logger.log("") $ie = IE.new $ie.goto(project_Number) $ie.button(:name, "Submit1").click $ie.text_field(:name, "ShortDescription").set(add_ShortDescription) line.succ! end Since i took out some of the confidential stuff, the function looks considerably short due to that :=) On 2/22/06, Xi Chen <xi.chen at kalido.com> wrote: > > Hi > > I have looked at FAQ about invoking separate IE instances using Watir. > However I found it doesn't work. For example I tried to open up 10 > different browser with a textfield in each of them. I tried to write > some text in the text_field. All the text are writen into the textfield > in the last IE. > > Anyone please help? > > > Xi Chen > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060222/a64e03f6/attachment.html From bret at pettichord.com Wed Feb 22 22:04:23 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 22 Feb 2006 21:04:23 -0600 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <24d0cb380602220913r3d926578uaa0049f0c3d02456@mail.gmail.com> References: <24d0cb380602220913r3d926578uaa0049f0c3d02456@mail.gmail.com> Message-ID: <ade75c5b0602221904t65f237e4s8a1cb266c2ec9328@mail.gmail.com> Are you running 1.4.1 or HEAD (the tarball)? On 2/22/06, saud aziz <saudaziz at gmail.com> wrote: > > Hi guys, > > When i try to run the following script, it just hangs and never clicks > through the respective image buttons on site. Can someone run and tell me if > it works for them? Or how i could possibly modify it to make it run? Another > thing noticeable is that when you run this from command prompt, it sometimes > doesn't even display the buttons that you are supposed to click on at all. > So for instance on page ' > http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx' you > might not find button that says get started and you can make it appear only > if you press refresh/reload for browser. > > I am running latest version of Watir and Ruby available to General Public. > Any help is much appreciated. > > require 'watir' > include Watir > require 'test/unit' > class TC_recorded < Test::Unit::TestCase > def test_recorded > ie = IE.new > ie.goto('https://www.seattlesymphony.org/'<https://www.seattlesymphony.org/%27> > ) > #ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/').click<http://www.seattlesymphony.org/symphony/buy/subs/%27%29.click> > #ie.goto('javascript:bakeCookie()') > #ie.button(:alt, 'New Subscription').click > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx%27> > ) > ie.image(:name, 'template:ib_GetStarted').click > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150' > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150%27> > ) > ie.button(:alt, 'Select This Series').click > ie.radio(:name, 'Section','73').set() > ie.button(:alt, 'Add This Series To My Cart').click > ie.button(:alt, 'Browse Series').click > ie.goto(' > http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3' > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3%27> > ) > ie.link(:url, ' > http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx').click<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27%29.click> > ie.goto(' > http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176%27> > ) > ie.button(:alt, 'Select This Series').click > ie.radio(:name, 'Section','62').set() > ie.button(:alt, 'Add This Series To My Cart').click > ie.button(:alt, 'Continue To Next Step').click > end > end > > Any help is much appreciated. obviously it is not even complete script, > but if you can get past 'ie.button(:alt, 'Select This Series').click' > this step, then it would be great to know. For me it just hangs and does > nothing, no errors, nada. > > > > > > -- > Saud Aziz > > "Whenever you find yourself on the side of the majority, it is time to > pause and reflect." - Mark Twain > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060222/4c251fc6/attachment.html From paul.rogers at shaw.ca Wed Feb 22 23:59:51 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 22 Feb 2006 21:59:51 -0700 Subject: [Wtr-general] Script hangs and does nothing Message-ID: <36270df3625ab7.3625ab736270df@shaw.ca> some of your ie.goto(...) have spaces before the http like ' http://...' For me, that causes the browser to go to a search page Paul Content-Type: multipart/alternative; boundary="----=_Part_8777_7782702.1140663863455" ------=_Part_8777_7782702.1140663863455 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Are you running 1.4.1 or HEAD (the tarball)? On 2/22/06, saud aziz <saudaziz at gmail.com> wrote: > > Hi guys, > > When i try to run the following script, it just hangs and never clicks > through the respective image buttons on site. Can someone run and tell me= if > it works for them? Or how i could possibly modify it to make it run? Anot= her > thing noticeable is that when you run this from command prompt, it someti= mes > doesn't even display the buttons that you are supposed to click on at all= . > So for instance on page ' > http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx' you > might not find button that says get started and you can make it appear on= ly > if you press refresh/reload for browser. > > I am running latest version of Watir and Ruby available to General Public= . > Any help is much appreciated. > > require 'watir' > include Watir > require 'test/unit' > class TC_recorded < Test::Unit::TestCase > def test_recorded > ie =3D IE.new > ie.goto('https://www.seattlesymphony.org/'<https://www.seattlesym= phony.org/%27> > ) > #ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/= ').click<http://www.seattlesymphony.org/symphony/buy/subs/%27%29.click> > #ie.goto('javascript:bakeCookie()') > #ie.button(:alt, 'New Subscription').click > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/= index.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.a= spx%27> > ) > ie.image(:name, 'template:ib_GetStarted').click > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/= package.aspx?id=3D1'<http://www.seattlesymphony.org/symphony/buy/subs/newsu= b/package.aspx?id=3D1%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/= detail.aspx?id=3D150' > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id= =3D150%27> > ) > ie.button(:alt, 'Select This Series').click > ie.radio(:name, 'Section','73').set() > ie.button(:alt, 'Add This Series To My Cart').click > ie.button(:alt, 'Browse Series').click > ie.goto(' > http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?= id=3D2'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package= .aspx?id=3D2%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/= alt/categories.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsu= b/alt/categories.aspx%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/= alt/package.aspx?id=3D3' > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx= ?id=3D3%27> > ) > ie.link(:url, ' > http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.as= px').click<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/cate= gories.aspx%27%29.click> > ie.goto(' > http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?= id=3D2'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package= .aspx?id=3D2%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/= alt/detail.aspx?id=3D176'<http://www.seattlesymphony.org/symphony/buy/subs/= newsub/alt/detail.aspx?id=3D176%27> > ) > ie.button(:alt, 'Select This Series').click > ie.radio(:name, 'Section','62').set() > ie.button(:alt, 'Add This Series To My Cart').click > ie.button(:alt, 'Continue To Next Step').click > end > end > > Any help is much appreciated. obviously it is not even complete script, > but if you can get past 'ie.button(:alt, 'Select This Series').click' > this step, then it would be great to know. For me it just hangs and does > nothing, no errors, nada. > > > > > > -- > Saud Aziz > > "Whenever you find yourself on the side of the majority, it is time to > pause and reflect." - Mark Twain > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > ------=_Part_8777_7782702.1140663863455 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Are you running 1.4.1 or HEAD (the tarball)?<br><br><div><span class=3D"gma= il_quote">On 2/22/06, <b class=3D"gmail_sendername">saud aziz</b> <<a hr= ef=3D"mailto:saudaziz at gmail.com">saudaziz at gmail.com</a>> wrote:</span><b= lockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 20= 4, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hi guys,<br><br>When i try to run the following script, it just hangs and n= ever clicks through the respective image buttons on site. Can someone run a= nd tell me if it works for them? Or how i could possibly modify it to make = it run? Another thing noticeable is that when you run this from command pro= mpt, it sometimes doesn't even display the buttons that you are supposed to= click on at all. So for instance on page ' <a href=3D"http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.as= px" target=3D"_blank" onclick=3D"return top.js.OpenExtLink(window,event,thi= s)">http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx</a>'= you might not find button that says get started and you can make it appear= only if you press refresh/reload for browser. <br><br>I am running latest version of Watir and Ruby available to General = Public. Any help is much appreciated.<br><br>require 'watir' <br>include Wa= tir <br>require 'test/unit' <br>class TC_recorded < Test::Unit::TestCase= =20 <br>    def test_recorded <br>     =    ie =3D IE.new<br>        ie= .goto('<a href=3D"https://www.seattlesymphony.org/%27" target=3D"_blank" on= click=3D"return top.js.OpenExtLink(window,event,this)">https://www.seattles= ymphony.org/' </a>)<br>        #ie.link(:url, '<a href= =3D"http://www.seattlesymphony.org/symphony/buy/subs/%27%29.click" target= =3D"_blank" onclick=3D"return top.js.OpenExtLink(window,event,this)"> http://www.seattlesymphony.org/symphony/buy/subs/').click</a><br> &nbs= p;      #ie.goto('javascript:bakeCookie()')<br>&nb= sp;       #ie.button(:alt, 'New Subscription'= ).click<br>        ie.goto('<a href=3D"h= ttp://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx%27" targe= t=3D"_blank" onclick=3D"return top.js.OpenExtLink(window,event,this)"> http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx'</a>)<br= >        ie.image(:name, 'template:ib_Ge= tStarted').click<br>        ie.goto('<a = href=3D"http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.asp= x?id=3D1%27" target=3D"_blank" onclick=3D"return top.js.OpenExtLink(window,= event,this)"> http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=3D1= '</a>)<br>        ie.goto('<a href=3D"ht= tp://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=3D150%= 27" target=3D"_blank" onclick=3D"return top.js.OpenExtLink(window,event,thi= s)"> http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=3D15= 0' </a>)<br>        ie.button(:alt, 'Select= This Series').click<br>        ie.radio= (:name, 'Section','73').set()<br>       = ie.button(:alt, 'Add This Series To My Cart').click<br>   &= nbsp;    ie.button(:alt, 'Browse Series').click <br>        ie.goto('<a href=3D"http://w= ww.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3D2%27"= target=3D"_blank" onclick=3D"return top.js.OpenExtLink(window,event,this)"= >http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?i= d=3D2' </a>)<br>        ie.goto('<a href=3D"htt= p://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27= " target=3D"_blank" onclick=3D"return top.js.OpenExtLink(window,event,this)= "> http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx= '</a>)<br>        ie.goto('<a href=3D"ht= tp://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id= =3D3%27" target=3D"_blank" onclick=3D"return top.js.OpenExtLink(window,even= t,this)"> http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id= =3D3' </a>)<br>        ie.link(:url, '<a href= =3D"http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.= aspx%27%29.click" target=3D"_blank" onclick=3D"return top.js.OpenExtLink(wi= ndow,event,this)">http://www.seattlesymphony.org/symphony/buy/subs/newsub/a= lt/categories.aspx').click </a><br>       =20 ie.goto('<a href=3D"http://www.seattlesymphony.org/symphony/buy/subs/newsub= /alt/package.aspx?id=3D2%27" target=3D"_blank" onclick=3D"return top.js.Ope= nExtLink(window,event,this)">http://www.seattlesymphony.org/symphony/buy/su= bs/newsub/alt/package.aspx?id=3D2' </a>)<br>        ie.goto('<a href=3D"htt= p://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=3D1= 76%27" target=3D"_blank" onclick=3D"return top.js.OpenExtLink(window,event,= this)"> http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id= =3D176'</a>)<br>        ie.button(:alt, = 'Select This Series').click<br>        i= e.radio(:name, 'Section','62').set()<br>      = ;  ie.button(:alt, 'Add This Series To My Cart').click <br>        ie.button(:alt, 'Continue To= Next Step').click<br>   end<br>end<br><br>Any help is much appre= ciated. obviously it is not even complete script, but if you can get past '= ie.button(:alt, 'Select This Series').click'  this step, then it would= be great to know. For me it just hangs and does nothing, no errors, nada. <br><span class=3D"sg"><br><br><br><br clear=3D"all"><br>-- <br>Saud Aziz<b= r><br>"Whenever you find yourself on the side of the majority, it is t= ime to pause and reflect." - Mark Twain<br><br><br><br> </span><br>_______________________________________________<br>Wtr-general m= ailing list<br><a onclick=3D"return top.js.OpenExtLink(window,event,this)" = href=3D"mailto:Wtr-general at rubyforge.org">Wtr-general at rubyforge.org</a><br> <a onclick=3D"return top.js.OpenExtLink(window,event,this)" href=3D"http://= rubyforge.org/mailman/listinfo/wtr-general" target=3D"_blank">http://rubyfo= rge.org/mailman/listinfo/wtr-general</a><br><br></blockquote></div><br> ------=_Part_8777_7782702.1140663863455-- -------------- next part -------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From kiranb4u at yahoo.com Thu Feb 23 00:19:06 2006 From: kiranb4u at yahoo.com (Kiran Kumar..) Date: Wed, 22 Feb 2006 21:19:06 -0800 (PST) Subject: [Wtr-general] Save the results.. In-Reply-To: <f81b1250602220328t6734caf1w9df0a420e19d9c59@mail.gmail.com> Message-ID: <20060223051906.13397.qmail@web33213.mail.mud.yahoo.com> Hi, Thanx for the same. But i can write into a file only the output i.e what and all i specify in puts, but i need the error message also be written in the file. How to achieve this. I'm unable to maximize the window. Here with i'm sneding a piece of code which has the maximize function in it.Please look into it and correct the same.. require 'watir' # the watir controller include Watir # open the IE browser ie =IE.new require 'win32ole' excel = WIN32OLE::new('excel.Application') workbook = excel.Workbooks.Open('E:\Watir Examples\Kiran\gX_lgn_td1.xls') worksheet = workbook.Worksheets(1) #get hold of the first worksheet #variables: test_site = worksheet.Range('a1')['Value'] # Opens the site. ie.goto(test_site) #maximizing the browser ie.maximize( ) Regards Kiran.. --- Zeljko Filipin <zeljko.filipin at gmail.com> wrote: > 1. go to command prompt2. type > ruby my_watir_script.rb > my_watir_script_results.txt > 3. all output will be stored in my_watir_script_results.txt4. you can > do it even shorter > my_watir_script > my_watir_script_results.txt > For more information, visit > http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx > or google for something like "command prompt redirect output to file" > On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote:> Hi,>> Where > and how i can save the results got from running the Watir> > scripts..Please help me out>> Regards> Kiran..>> > __________________________________________________> 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> > > --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/ > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From dave at burt.id.au Thu Feb 23 06:05:40 2006 From: dave at burt.id.au (Dave Burt) Date: Thu, 23 Feb 2006 22:05:40 +1100 Subject: [Wtr-general] Multi IE explorer References: <2CCD8390D18C304D9DAC0F92DBA1E2753656AD@kal-uk-s-mail.kalido.local> Message-ID: <006201c63869$156d3d40$6602a8c0@telperion> Xi Chen wrote: > I have looked at FAQ about invoking separate IE instances using Watir. > However I found it doesn't work. For example I tried to open up 10 > different browser with a textfield in each of them. I tried to write > some text in the text_field. All the text are writen into the textfield > in the last IE. Hi, If you show us your code, we can tell you what's wrong with it, why it's not working. Here's one way you might have gone wrong: $ie = Watir::IE.new $ie.goto "google.com" $ie.text_field(:name, "q").set "1" $ie = Watir::IE.new # <--- same variable, reference to first window lost $ie.goto "google.com" $ie.text_field(:name, "q").set "2" # both end up at google.com.au with "bar" in the text field. This works fine: ie_array = Array.new(3) { Watir::IE.new } # open 3 IE windows ie_array.each_with_index do |ie, i| ie.goto "google.com" ie.text_field(:name, "q").set i end Cheers, Dave From mb at michaelbolton.net Thu Feb 23 10:17:36 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Thu, 23 Feb 2006 10:17:36 -0500 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <24d0cb380602220913r3d926578uaa0049f0c3d02456@mail.gmail.com> Message-ID: <001301c6388c$4b586920$6901a8c0@Koko> Leave out the spaces after the open single quotes. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of saud aziz Sent: February 22, 2006 12:14 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Script hangs and does nothing Hi guys, When i try to run the following script, it just hangs and never clicks through the respective image buttons on site. Can someone run and tell me if it works for them? Or how i could possibly modify it to make it run? Another thing noticeable is that when you run this from command prompt, it sometimes doesn't even display the buttons that you are supposed to click on at all. So for instance on page ' http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx' you might not find button that says get started and you can make it appear only if you press refresh/reload for browser. I am running latest version of Watir and Ruby available to General Public. Any help is much appreciated. require 'watir' include Watir require 'test/unit' class TC_recorded < Test::Unit::TestCase def test_recorded ie = IE.new ie.goto('https://www.seattlesymphony.org/') #ie.link(:url, ' <http://www.seattlesymphony.org/symphony/buy/subs/').click> http://www.seattlesymphony.org/symphony/buy/subs/').click #ie.goto('javascript:bakeCookie()') #ie.button(:alt, 'New Subscription').click ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx'> http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx') ie.image(:name, 'template:ib_GetStarted').click ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1'> http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1') ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx ?id=150' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150' > ) ie.button(:alt, 'Select This Series').click ie.radio(:name, 'Section','73').set() ie.button(:alt, 'Add This Series To My Cart').click ie.button(:alt, 'Browse Series').click ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package .aspx?id=2') ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx '> http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx' ) ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package .aspx?id=3' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id =3'> ) ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx ').click ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package .aspx?id=2') ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id= 176'> http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=1 76') ie.button(:alt, 'Select This Series').click ie.radio(:name, 'Section','62').set() ie.button(:alt, 'Add This Series To My Cart').click ie.button(:alt, 'Continue To Next Step').click end end Any help is much appreciated. obviously it is not even complete script, but if you can get past 'ie.button(:alt, 'Select This Series').click' this step, then it would be great to know. For me it just hangs and does nothing, no errors, nada. -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060223/bd63a9f1/attachment.html From mb at michaelbolton.net Thu Feb 23 11:21:49 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Thu, 23 Feb 2006 11:21:49 -0500 Subject: [Wtr-general] Save the results.. In-Reply-To: <20060223051906.13397.qmail@web33213.mail.mud.yahoo.com> Message-ID: <011e01c63895$3fda6e00$6901a8c0@Koko> What happens when you try this in IRB? When I try it in IRB, my session looks like this: irb(main):001:0> require 'watir' => true irb(main):002:0> ie = IE.new NameError: uninitialized constant IE from (irb):2 from :0 So then I use the proper syntax: irb(main):003:0> ie = Watir::IE.new => #<Watir::IE:0x2b2ea38 @typingspeed=0.08, @enable_spinner=false, @empty_tag_name="DUMMY", @speed=:slow, @ole_object=ni l, @url_list=[], @defaultSleepTime=0.1, @ie=#<WIN32OLE:0x2b2e960>, @logger=#<Watir::DefaultLogger:0x2b2e8e8 @datetime_fo rmat="%d-%b-%Y %H:%M:%S", @progname=nil, @logdev=#<Logger::LogDevice:0x2b2e888 @shift_age=nil, @filename=nil, @dev=#<IO: 0x278e7d0>, @shift_size=nil>, @level=2>, @activeObjectHighLightColor="yellow", @error_checkers=[#<Proc:0x02ac6518 at c:/rub y/lib/ruby/site_ruby/1.8/watir.rb:1075>]> ...and my browser appears. My browser starts maximized. Interestingly, until I point it to a site, trying to minimize it returns an error: irb(main):004:0> ie.minimize WIN32OLERuntimeError: document OLE error code:80004005 in <Unknown> <No Description> HRESULT error code:0x80020009 Exception occurred. from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1201:in `method_missing' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1201:in `title' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1274:in `set_window_state' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1258:in `minimize' from (irb):4 from :0 irb(main):005:0> ie.goto('http://www.google.ca') => 0.29 irb(main):006:0> ie.minimize => 1 irb(main):007:0> ie.minimize => 1 irb(main):008:0> ie.maximize => 1 irb(main):009:0> That feels like a bug to me, but I don't think it's the problem you're running into, unless your call to test_site is failing--which it will, if that's literally what you're typing, since you haven't initialized that variable. If test_site is just a stand-in for your actual test site, perhaps the goto() call is failing for some reason. Are you checking for a non-zero value on return? ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Kiran Kumar.. Sent: February 23, 2006 12:19 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Save the results.. Hi, Thanx for the same. But i can write into a file only the output i.e what and all i specify in puts, but i need the error message also be written in the file. How to achieve this. I'm unable to maximize the window. Here with i'm sneding a piece of code which has the maximize function in it.Please look into it and correct the same.. require 'watir' # the watir controller include Watir # open the IE browser ie =IE.new require 'win32ole' excel = WIN32OLE::new('excel.Application') workbook = excel.Workbooks.Open('E:\Watir Examples\Kiran\gX_lgn_td1.xls') worksheet = workbook.Worksheets(1) #get hold of the first worksheet #variables: test_site = worksheet.Range('a1')['Value'] # Opens the site. ie.goto(test_site) #maximizing the browser ie.maximize( ) Regards Kiran.. --- Zeljko Filipin <zeljko.filipin at gmail.com> wrote: > 1. go to command prompt2. type > ruby my_watir_script.rb > my_watir_script_results.txt > 3. all output will be stored in my_watir_script_results.txt4. you can > do it even shorter > my_watir_script > my_watir_script_results.txt > For more information, visit > http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en- us/redirection.mspx > or google for something like "command prompt redirect output to file" > On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote:> Hi,>> Where > and how i can save the results got from running the Watir> > scripts..Please help me out>> Regards> Kiran..>> > __________________________________________________> 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> > > --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/ > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > __________________________________________________ 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 saudaziz at gmail.com Thu Feb 23 12:10:22 2006 From: saudaziz at gmail.com (saud aziz) Date: Thu, 23 Feb 2006 09:10:22 -0800 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <001301c6388c$4b586920$6901a8c0@Koko> References: <24d0cb380602220913r3d926578uaa0049f0c3d02456@mail.gmail.com> <001301c6388c$4b586920$6901a8c0@Koko> Message-ID: <24d0cb380602230910o5170176ch30f0428f3122d8a1@mail.gmail.com> Bret, I am using the one provided at: http://rubyforge.org/frs/download.php/5677/watir-1.4.1.exe Paul and Michael, i don't know where that space is coming from, it sure doesn't appear in the script that i have. On 2/23/06, Michael Bolton <mb at michaelbolton.net> wrote: > > Leave out the spaces after the open single quotes. > > ---Michael B. > > ------------------------------ > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *saud aziz > *Sent:* February 22, 2006 12:14 PM > *To:* wtr-general at rubyforge.org > *Subject:* [Wtr-general] Script hangs and does nothing > > Hi guys, > > When i try to run the following script, it just hangs and never clicks > through the respective image buttons on site. Can someone run and tell me if > it works for them? Or how i could possibly modify it to make it run? Another > thing noticeable is that when you run this from command prompt, it sometimes > doesn't even display the buttons that you are supposed to click on at all. > So for instance on page ' http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx > ' you might not find button that says get started and you can make it > appear only if you press refresh/reload for browser. > > I am running latest version of Watir and Ruby available to General Public. > Any help is much appreciated. > > require 'watir' > include Watir > require 'test/unit' > class TC_recorded < Test::Unit::TestCase > def test_recorded > ie = IE.new > ie.goto('https://www.seattlesymphony.org/'<https://www.seattlesymphony.org/%27> > ) > #ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/').click<http://www.seattlesymphony.org/symphony/buy/subs/%27%29.click> > #ie.goto('javascript:bakeCookie()') > #ie.button(:alt, 'New Subscription').click > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx%27> > ) > ie.image(:name, 'template:ib_GetStarted').click > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150' > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150%27> > ) > ie.button(:alt, 'Select This Series').click > ie.radio(:name, 'Section','73').set() > ie.button(:alt, 'Add This Series To My Cart').click > ie.button(:alt, 'Browse Series').click > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2' > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3' > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3%27> > ) > ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx').click > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27%29.click> > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2' > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176%27> > ) > ie.button(:alt, 'Select This Series').click > ie.radio(:name, 'Section','62').set() > ie.button(:alt, 'Add This Series To My Cart').click > ie.button(:alt, 'Continue To Next Step').click > end > end > > Any help is much appreciated. obviously it is not even complete script, > but if you can get past 'ie.button(:alt, 'Select This Series').click' > this step, then it would be great to know. For me it just hangs and does > nothing, no errors, nada. > > > > > > -- > Saud Aziz > > "Whenever you find yourself on the side of the majority, it is time to > pause and reflect." - Mark Twain > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060223/8391f8e8/attachment.html From bret at pettichord.com Thu Feb 23 12:38:37 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 23 Feb 2006 11:38:37 -0600 Subject: [Wtr-general] Save the results.. In-Reply-To: <20060223051906.13397.qmail@web33213.mail.mud.yahoo.com> References: <f81b1250602220328t6734caf1w9df0a420e19d9c59@mail.gmail.com> <20060223051906.13397.qmail@web33213.mail.mud.yahoo.com> Message-ID: <ade75c5b0602230938u2678cf29qa9326605a5319ef6@mail.gmail.com> Kiran, Since your script references an xls file that we don't have, none of us are going to be a be able to get it to work. Either send the file, or better yet, isolate your problem to a single script that you can send us. We also don't know what "doesn't work" means. Are you getting error messages? What are they? Bret On 2/22/06, Kiran Kumar.. <kiranb4u at yahoo.com> wrote: > > Hi, > Thanx for the same. But i can write into a file only the output i.e > what and all i specify in puts, but i need the error message also be > written in the file. How to achieve this. > > I'm unable to maximize the window. > Here with i'm sneding a piece of code which has the maximize function > in it.Please look into it and correct the same.. > > > require 'watir' # the watir controller > include Watir > # open the IE browser > ie =IE.new > > require 'win32ole' > excel = WIN32OLE::new('excel.Application') > workbook = excel.Workbooks.Open('E:\Watir > Examples\Kiran\gX_lgn_td1.xls') > worksheet = workbook.Worksheets(1) #get hold of the first worksheet > > #variables: > test_site = worksheet.Range('a1')['Value'] > > # Opens the site. > ie.goto(test_site) > > #maximizing the browser > ie.maximize( ) > > Regards > Kiran.. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060223/d87c932a/attachment.html From mb at michaelbolton.net Thu Feb 23 15:21:05 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Thu, 23 Feb 2006 15:21:05 -0500 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <24d0cb380602230910o5170176ch30f0428f3122d8a1@mail.gmail.com> Message-ID: <005b01c638b6$b4e22280$6801a8c0@Koko> Did you cut and paste the code into your message, or did you retype it? ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of saud aziz Sent: February 23, 2006 12:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Script hangs and does nothing Bret, I am using the one provided at: http://rubyforge.org/frs/download.php/5677/watir-1.4.1.exe <http://rubyforge.org/frs/download.php/5677/watir-1.4.1.exe> Paul and Michael, i don't know where that space is coming from, it sure doesn't appear in the script that i have. On 2/23/06, Michael Bolton <mb at michaelbolton.net <mailto:mb at michaelbolton.net> > wrote: Leave out the spaces after the open single quotes. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of saud aziz Sent: February 22, 2006 12:14 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Script hangs and does nothing Hi guys, When i try to run the following script, it just hangs and never clicks through the respective image buttons on site. Can someone run and tell me if it works for them? Or how i could possibly modify it to make it run? Another thing noticeable is that when you run this from command prompt, it sometimes doesn't even display the buttons that you are supposed to click on at all. So for instance on page ' http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx <http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx> ' you might not find button that says get started and you can make it appear only if you press refresh/reload for browser. I am running latest version of Watir and Ruby available to General Public. Any help is much appreciated. require 'watir' include Watir require 'test/unit' class TC_recorded < Test::Unit::TestCase def test_recorded ie = IE.new ie.goto('https://www.seattlesymphony.org/' <https://www.seattlesymphony.org/%27> ) #ie.link(:url, ' <http://www.seattlesymphony.org/symphony/buy/subs/%27%29.click> http://www.seattlesymphony.org/symphony/buy/subs/').click #ie.goto('javascript:bakeCookie()') #ie.button(:alt, 'New Subscription').click ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx%27> http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx') ie.image(:name, 'template:ib_GetStarted').click ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1%2 7> http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1') ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx ?id=150' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150% 27> ) ie.button(:alt, 'Select This Series').click ie.radio(:name, 'Section','73').set() ie.button(:alt, 'Add This Series To My Cart').click ie.button(:alt, 'Browse Series').click ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package .aspx?id=2' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id =2%27> ) ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx %27> http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx' ) ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package .aspx?id=3' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id =3%27> ) ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx ').click <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx %27%29.click> ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package .aspx?id=2' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id =2%27> ) ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id= 176%27> http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=1 76') ie.button(:alt, 'Select This Series').click ie.radio(:name, 'Section','62').set() ie.button(:alt, 'Add This Series To My Cart').click ie.button(:alt, 'Continue To Next Step').click end end Any help is much appreciated. obviously it is not even complete script, but if you can get past 'ie.button(:alt, 'Select This Series').click' this step, then it would be great to know. For me it just hangs and does nothing, no errors, nada. -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org <mailto:Wtr-general at rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060223/041534a3/attachment.html From saudaziz at gmail.com Thu Feb 23 15:56:01 2006 From: saudaziz at gmail.com (saud aziz) Date: Thu, 23 Feb 2006 12:56:01 -0800 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <005b01c638b6$b4e22280$6801a8c0@Koko> References: <24d0cb380602230910o5170176ch30f0428f3122d8a1@mail.gmail.com> <005b01c638b6$b4e22280$6801a8c0@Koko> Message-ID: <24d0cb380602231256h7020508cxa9aecf75dcb4aad9@mail.gmail.com> Cut/paste. Here is another try: require 'watir' include Watir require 'test/unit' class TC_recorded < Test::Unit::TestCase def test_recorded ie = IE.new ie.goto('https://www.seattlesymphony.org/') #ie.link(:url, ' http://www.seattlesymphony.org/symphony/buy/subs/').click #ie.goto('javascript:bakeCookie()') #ie.button(:alt, 'New Subscription').click ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx') ie.image(:id, 'template_ib_GetStarted').click ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1') ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150') ie.button(:alt, 'Select This Series').click ie.radio(:name, 'Section','73').set() ie.button(:alt, 'Add This Series To My Cart').click ie.button(:alt, 'Browse Series').click ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2' ) ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx' ) ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3' ) ie.link(:url, ' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx').click ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2' ) ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176' ) ie.button(:alt, 'Select This Series').click ie.radio(:name, 'Section','62').set() ie.button(:alt, 'Add This Series To My Cart').click ie.button(:alt, 'Continue To Next Step').click end end On 2/23/06, Michael Bolton <mb at michaelbolton.net> wrote: > > Did you cut and paste the code into your message, or did you retype it? > > ---Michael B. > > ------------------------------ > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *saud aziz > *Sent:* February 23, 2006 12:10 PM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] Script hangs and does nothing > > Bret, I am using the one provided at: http://rubyforge.org/frs/download.php/5677/watir-1.4.1.exe > > > Paul and Michael, i don't know where that space is coming from, it sure > doesn't appear in the script that i have. > > On 2/23/06, Michael Bolton <mb at michaelbolton.net > wrote: > > > > Leave out the spaces after the open single quotes. > > > > ---Michael B. > > > > ------------------------------ > > *From:* wtr-general-bounces at rubyforge.org [mailto: > > wtr-general-bounces at rubyforge.org] *On Behalf Of *saud aziz > > *Sent:* February 22, 2006 12:14 PM > > *To:* wtr-general at rubyforge.org > > *Subject:* [Wtr-general] Script hangs and does nothing > > > > Hi guys, > > > > When i try to run the following script, it just hangs and never clicks > > through the respective image buttons on site. Can someone run and tell me if > > it works for them? Or how i could possibly modify it to make it run? Another > > thing noticeable is that when you run this from command prompt, it sometimes > > doesn't even display the buttons that you are supposed to click on at all. > > So for instance on page ' http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx > > ' you might not find button that says get started and you can make it > > appear only if you press refresh/reload for browser. > > > > I am running latest version of Watir and Ruby available to General > > Public. Any help is much appreciated. > > > > require 'watir' > > include Watir > > require 'test/unit' > > class TC_recorded < Test::Unit::TestCase > > def test_recorded > > ie = IE.new > > ie.goto('https://www.seattlesymphony.org/'<https://www.seattlesymphony.org/%27> > > ) > > #ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/').click<http://www.seattlesymphony.org/symphony/buy/subs/%27%29.click> > > #ie.goto('javascript:bakeCookie()') > > #ie.button(:alt, 'New Subscription').click > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx%27> > > ) > > ie.image(:name, 'template:ib_GetStarted').click > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1%27> > > ) > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150' > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150%27> > > ) > > ie.button(:alt, 'Select This Series').click > > ie.radio(:name, 'Section','73').set() > > ie.button(:alt, 'Add This Series To My Cart').click > > ie.button(:alt, 'Browse Series').click > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2' > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > > ) > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27> > > ) > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3' > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3%27> > > ) > > ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx').click > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27%29.click> > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2' > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > > ) > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176%27> > > ) > > ie.button(:alt, 'Select This Series').click > > ie.radio(:name, 'Section','62').set() > > ie.button(:alt, 'Add This Series To My Cart').click > > ie.button(:alt, 'Continue To Next Step').click > > end > > end > > > > Any help is much appreciated. obviously it is not even complete script, > > but if you can get past 'ie.button(:alt, 'Select This Series').click' > > this step, then it would be great to know. For me it just hangs and does > > nothing, no errors, nada. > > > > > > > > > > > > -- > > Saud Aziz > > > > "Whenever you find yourself on the side of the majority, it is time to > > pause and reflect." - Mark Twain > > > > > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > -- > Saud Aziz > > "Whenever you find yourself on the side of the majority, it is time to > pause and reflect." - Mark Twain > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060223/ead2d584/attachment.html From saudaziz at gmail.com Thu Feb 23 15:57:20 2006 From: saudaziz at gmail.com (saud aziz) Date: Thu, 23 Feb 2006 12:57:20 -0800 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <24d0cb380602231256h7020508cxa9aecf75dcb4aad9@mail.gmail.com> References: <24d0cb380602230910o5170176ch30f0428f3122d8a1@mail.gmail.com> <005b01c638b6$b4e22280$6801a8c0@Koko> <24d0cb380602231256h7020508cxa9aecf75dcb4aad9@mail.gmail.com> Message-ID: <24d0cb380602231257j40739351qd69bc5689f5d5526@mail.gmail.com> yeah, that space has something to do with gmail. They aren't in code. On 2/23/06, saud aziz <saudaziz at gmail.com> wrote: > > Cut/paste. Here is another try: > > require 'watir' > include Watir > require 'test/unit' > class TC_recorded < Test::Unit::TestCase > def test_recorded > ie = IE.new > ie.goto(' https://www.seattlesymphony.org/'<https://www.seattlesymphony.org/%27> > ) > #ie.link(:url, ' > http://www.seattlesymphony.org/symphony/buy/subs/').click<http://www.seattlesymphony.org/symphony/buy/subs/%27%29.click> > #ie.goto('javascript:bakeCookie()') > #ie.button(:alt, 'New Subscription').click > ie.goto(' > http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx%27>) > > ie.image(:id, 'template_ib_GetStarted').click > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1' > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1%27> > ) > ie.goto(' > http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150%27> > ) > ie.button(:alt, 'Select This Series').click > ie.radio(:name, 'Section','73').set() > ie.button(:alt, 'Add This Series To My Cart').click > ie.button(:alt, 'Browse Series').click > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx' > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27> > ) > ie.goto(' > http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3%27> > ) > ie.link(:url, ' > http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx').click<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27%29.click> > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176' > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176%27> > ) > ie.button(:alt, 'Select This Series').click > ie.radio(:name, 'Section','62').set() > ie.button(:alt, 'Add This Series To My Cart').click > ie.button(:alt, 'Continue To Next Step').click > end > > end > > On 2/23/06, Michael Bolton <mb at michaelbolton.net> wrote: > > > > Did you cut and paste the code into your message, or did you retype it? > > > > ---Michael B. > > > > ------------------------------ > > *From:* wtr-general-bounces at rubyforge.org [mailto: > > wtr-general-bounces at rubyforge.org] *On Behalf Of *saud aziz > > *Sent:* February 23, 2006 12:10 PM > > *To:* wtr-general at rubyforge.org > > *Subject:* Re: [Wtr-general] Script hangs and does nothing > > > > Bret, I am using the one provided at: http://rubyforge.org/frs/download.php/5677/watir-1.4.1.exe > > > > > > Paul and Michael, i don't know where that space is coming from, it sure > > doesn't appear in the script that i have. > > > > On 2/23/06, Michael Bolton <mb at michaelbolton.net > wrote: > > > > > > Leave out the spaces after the open single quotes. > > > > > > ---Michael B. > > > > > > ------------------------------ > > > *From:* wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] > > > *On Behalf Of *saud aziz > > > *Sent:* February 22, 2006 12:14 PM > > > *To:* wtr-general at rubyforge.org > > > *Subject: * [Wtr-general] Script hangs and does nothing > > > > > > Hi guys, > > > > > > When i try to run the following script, it just hangs and never clicks > > > through the respective image buttons on site. Can someone run and tell me if > > > it works for them? Or how i could possibly modify it to make it run? Another > > > thing noticeable is that when you run this from command prompt, it sometimes > > > doesn't even display the buttons that you are supposed to click on at all. > > > So for instance on page ' http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx > > > ' you might not find button that says get started and you can make it > > > appear only if you press refresh/reload for browser. > > > > > > I am running latest version of Watir and Ruby available to General > > > Public. Any help is much appreciated. > > > > > > require 'watir' > > > include Watir > > > require 'test/unit' > > > class TC_recorded < Test::Unit::TestCase > > > def test_recorded > > > ie = IE.new > > > ie.goto('https://www.seattlesymphony.org/'<https://www.seattlesymphony.org/%27> > > > ) > > > #ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/').click<http://www.seattlesymphony.org/symphony/buy/subs/%27%29.click> > > > #ie.goto('javascript:bakeCookie()') > > > #ie.button(:alt, 'New Subscription').click > > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx%27> > > > ) > > > ie.image(:name, 'template:ib_GetStarted').click > > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1%27> > > > ) > > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150' > > > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150%27> > > > ) > > > ie.button(:alt, 'Select This Series').click > > > ie.radio(:name, 'Section','73').set() > > > ie.button(:alt, 'Add This Series To My Cart').click > > > ie.button(:alt, 'Browse Series').click > > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2' > > > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > > > ) > > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27> > > > ) > > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3' > > > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3%27> > > > ) > > > ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx').click > > > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27%29.click> > > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2' > > > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > > > ) > > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176%27> > > > ) > > > ie.button(:alt, 'Select This Series').click > > > ie.radio(:name, 'Section','62').set() > > > ie.button(:alt, 'Add This Series To My Cart').click > > > ie.button(:alt, 'Continue To Next Step').click > > > end > > > end > > > > > > Any help is much appreciated. obviously it is not even complete > > > script, but if you can get past 'ie.button(:alt, 'Select This > > > Series').click' this step, then it would be great to know. For me it just > > > hangs and does nothing, no errors, nada. > > > > > > > > > > > > > > > > > > -- > > > Saud Aziz > > > > > > "Whenever you find yourself on the side of the majority, it is time to > > > pause and reflect." - Mark Twain > > > > > > > > > > > > > > > _______________________________________________ > > > Wtr-general mailing list > > > Wtr-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > -- > > Saud Aziz > > > > "Whenever you find yourself on the side of the majority, it is time to > > pause and reflect." - Mark Twain > > > > > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > -- > Saud Aziz > > "Whenever you find yourself on the side of the majority, it is time to > pause and reflect." - Mark Twain > > > > -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060223/273eda68/attachment.html From saudaziz at gmail.com Thu Feb 23 15:58:04 2006 From: saudaziz at gmail.com (saud aziz) Date: Thu, 23 Feb 2006 12:58:04 -0800 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <24d0cb380602231257j40739351qd69bc5689f5d5526@mail.gmail.com> References: <24d0cb380602230910o5170176ch30f0428f3122d8a1@mail.gmail.com> <005b01c638b6$b4e22280$6801a8c0@Koko> <24d0cb380602231256h7020508cxa9aecf75dcb4aad9@mail.gmail.com> <24d0cb380602231257j40739351qd69bc5689f5d5526@mail.gmail.com> Message-ID: <24d0cb380602231258p3190d468ja7af8f0593d7f37b@mail.gmail.com> BTW, does it work for any of you? On 2/23/06, saud aziz <saudaziz at gmail.com> wrote: > > yeah, that space has something to do with gmail. They aren't in code. > > On 2/23/06, saud aziz <saudaziz at gmail.com > wrote: > > > > Cut/paste. Here is another try: > > > > require 'watir' > > include Watir > > require 'test/unit' > > class TC_recorded < Test::Unit::TestCase > > def test_recorded > > ie = IE.new > > ie.goto(' https://www.seattlesymphony.org/'<https://www.seattlesymphony.org/%27> > > ) > > #ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/').click > > <http://www.seattlesymphony.org/symphony/buy/subs/%27%29.click> > > #ie.goto('javascript:bakeCookie()') > > #ie.button(:alt, 'New Subscription').click > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx%27>) > > > > ie.image(:id, 'template_ib_GetStarted').click > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1' > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1%27> > > ) > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150' > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150%27> > > ) > > ie.button(:alt, 'Select This Series').click > > ie.radio(:name, 'Section','73').set() > > ie.button(:alt, 'Add This Series To My Cart').click > > ie.button(:alt, 'Browse Series').click > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > > ) > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx' > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27> > > ) > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3' > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3%27> > > ) > > ie.link(:url, ' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx').click > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27%29.click> > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > > ) > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176' > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176%27> > > ) > > ie.button(:alt, 'Select This Series').click > > ie.radio(:name, 'Section','62').set() > > ie.button(:alt, 'Add This Series To My Cart').click > > ie.button(:alt, 'Continue To Next Step').click > > end > > > > end > > > > On 2/23/06, Michael Bolton < mb at michaelbolton.net> wrote: > > > > > > Did you cut and paste the code into your message, or did you retype > > > it? > > > > > > ---Michael B. > > > > > > ------------------------------ > > > *From:* wtr-general-bounces at rubyforge.org [mailto: > > > wtr-general-bounces at rubyforge.org] *On Behalf Of *saud aziz > > > *Sent:* February 23, 2006 12:10 PM > > > *To:* wtr-general at rubyforge.org > > > *Subject:* Re: [Wtr-general] Script hangs and does nothing > > > > > > Bret, I am using the one provided at: http://rubyforge.org/frs/download.php/5677/watir-1.4.1.exe > > > > > > > > > Paul and Michael, i don't know where that space is coming from, it > > > sure doesn't appear in the script that i have. > > > > > > On 2/23/06, Michael Bolton <mb at michaelbolton.net > wrote: > > > > > > > > Leave out the spaces after the open single quotes. > > > > > > > > ---Michael B. > > > > > > > > ------------------------------ > > > > *From:* wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] > > > > *On Behalf Of *saud aziz > > > > *Sent:* February 22, 2006 12:14 PM > > > > *To:* wtr-general at rubyforge.org > > > > *Subject: * [Wtr-general] Script hangs and does nothing > > > > > > > > Hi guys, > > > > > > > > When i try to run the following script, it just hangs and never > > > > clicks through the respective image buttons on site. Can someone run and > > > > tell me if it works for them? Or how i could possibly modify it to make it > > > > run? Another thing noticeable is that when you run this from command prompt, > > > > it sometimes doesn't even display the buttons that you are supposed to click > > > > on at all. So for instance on page ' http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx > > > > ' you might not find button that says get started and you can make > > > > it appear only if you press refresh/reload for browser. > > > > > > > > I am running latest version of Watir and Ruby available to General > > > > Public. Any help is much appreciated. > > > > > > > > require 'watir' > > > > include Watir > > > > require 'test/unit' > > > > class TC_recorded < Test::Unit::TestCase > > > > def test_recorded > > > > ie = IE.new > > > > ie.goto('https://www.seattlesymphony.org/'<https://www.seattlesymphony.org/%27> > > > > ) > > > > #ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/').click<http://www.seattlesymphony.org/symphony/buy/subs/%27%29.click> > > > > #ie.goto('javascript:bakeCookie()') > > > > #ie.button(:alt, 'New Subscription').click > > > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx%27> > > > > ) > > > > ie.image(:name, 'template:ib_GetStarted').click > > > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1%27> > > > > ) > > > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150' > > > > > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150%27> > > > > ) > > > > ie.button(:alt, 'Select This Series').click > > > > ie.radio(:name, 'Section','73').set() > > > > ie.button(:alt, 'Add This Series To My Cart').click > > > > ie.button(:alt, 'Browse Series').click > > > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2' > > > > > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > > > > ) > > > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27> > > > > ) > > > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3' > > > > > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3%27> > > > > ) > > > > ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx').click > > > > > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27%29.click> > > > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2' > > > > > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > > > > ) > > > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176%27> > > > > ) > > > > ie.button(:alt, 'Select This Series').click > > > > ie.radio(:name, 'Section','62').set() > > > > ie.button(:alt, 'Add This Series To My Cart').click > > > > ie.button(:alt, 'Continue To Next Step').click > > > > end > > > > end > > > > > > > > Any help is much appreciated. obviously it is not even complete > > > > script, but if you can get past 'ie.button(:alt, 'Select This > > > > Series').click' this step, then it would be great to know. For me it just > > > > hangs and does nothing, no errors, nada. > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Saud Aziz > > > > > > > > "Whenever you find yourself on the side of the majority, it is time > > > > to pause and reflect." - Mark Twain > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > Wtr-general mailing list > > > > Wtr-general at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > > > > > > -- > > > Saud Aziz > > > > > > "Whenever you find yourself on the side of the majority, it is time to > > > pause and reflect." - Mark Twain > > > > > > > > > > > > > > > _______________________________________________ > > > Wtr-general mailing list > > > Wtr-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > -- > > Saud Aziz > > > > "Whenever you find yourself on the side of the majority, it is time to > > pause and reflect." - Mark Twain > > > > > > > > > > > -- > Saud Aziz > > "Whenever you find yourself on the side of the majority, it is time to > pause and reflect." - Mark Twain > > > > -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060223/142479c6/attachment.html From billagee at gmail.com Thu Feb 23 16:38:36 2006 From: billagee at gmail.com (Bill Agee) Date: Thu, 23 Feb 2006 13:38:36 -0800 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <24d0cb380602231258p3190d468ja7af8f0593d7f37b@mail.gmail.com> References: <24d0cb380602230910o5170176ch30f0428f3122d8a1@mail.gmail.com> <005b01c638b6$b4e22280$6801a8c0@Koko> <24d0cb380602231256h7020508cxa9aecf75dcb4aad9@mail.gmail.com> <24d0cb380602231257j40739351qd69bc5689f5d5526@mail.gmail.com> <24d0cb380602231258p3190d468ja7af8f0593d7f37b@mail.gmail.com> Message-ID: <73e7817e0602231338v196c5821xcb8c641cce47c71d@mail.gmail.com> On 2/23/06, saud aziz <saudaziz at gmail.com> wrote: > BTW, does it work for any of you? For me it errors out on the image call at line 12. I didn't check the page source to see if the image is missing/named something else/etc. Also, at first the script would hang for me; then I tried running it with test/unit's --verbose=verbose flag, and suddenly it started dying at line 12. Not sure if I changed something else to cause it to stop hanging, or it if's just something weird with test/unit. Here was the error I got: ----------------------------------- Started E Finished in 14.328 seconds. 1) Error: test_recorded(TC_recorded): Watir::Exception::UnknownObjectException: Unable to locate object, using id and template_ib_GetStarted c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2009:in `click' C:/temp/watirlist/sym.rb:12:in `test_recorded' 1 tests, 0 assertions, 0 failures, 1 errors From mb at michaelbolton.net Thu Feb 23 19:36:00 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Thu, 23 Feb 2006 19:36:00 -0500 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <24d0cb380602231258p3190d468ja7af8f0593d7f37b@mail.gmail.com> Message-ID: <00ef01c638da$494da890$6801a8c0@Koko> Nope. And I don't think it will; look at the source: <input type="image" name="template:ib_GetStarted" id="template_ib_GetStarted" src="../../../../_img/button/subs/getstarted.gif" alt="Get Started" border="0" /> What happens if you click on this field manually? Nothing; there's no javascript action and no link associated with it. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of saud aziz Sent: February 23, 2006 3:58 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Script hangs and does nothing BTW, does it work for any of you? On 2/23/06, saud aziz <saudaziz at gmail.com> wrote: yeah, that space has something to do with gmail. They aren't in code. On 2/23/06, saud aziz < saudaziz at gmail.com <mailto:saudaziz at gmail.com> > wrote: Cut/paste. Here is another try: require 'watir' include Watir require 'test/unit' class TC_recorded < Test::Unit::TestCase def test_recorded ie = IE.new ie.goto(' <https://www.seattlesymphony.org/%27> https://www.seattlesymphony.org/') #ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/').click <http://www.seattlesymphony.org/symphony/buy/subs/%27%29.click> #ie.goto('javascript:bakeCookie()') #ie.button(:alt, 'New Subscription').click ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx%27> http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx') ie.image(:id, 'template_ib_GetStarted').click ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1%2 7> http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1' ) ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx ?id=150' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150% 27> ) ie.button(:alt, 'Select This Series').click ie.radio(:name, 'Section','73').set() ie.button(:alt, 'Add This Series To My Cart').click ie.button(:alt, 'Browse Series').click ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id =2%27> http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id= 2') ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx %27> http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx' ) ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package .aspx?id=3' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id =3%27> ) ie.link(:url, ' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx' ).click <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx %27%29.click> ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id =2%27> http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id= 2') ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id= 176%27> http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=1 76' ) ie.button(:alt, 'Select This Series').click ie.radio(:name, 'Section','62').set() ie.button(:alt, 'Add This Series To My Cart').click ie.button(:alt, 'Continue To Next Step').click end end On 2/23/06, Michael Bolton < <mailto:mb at michaelbolton.net> mb at michaelbolton.net> wrote: Did you cut and paste the code into your message, or did you retype it? ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of saud aziz Sent: February 23, 2006 12:10 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Script hangs and does nothing Bret, I am using the one provided at: http://rubyforge.org/frs/download.php/5677/watir-1.4.1.exe <http://rubyforge.org/frs/download.php/5677/watir-1.4.1.exe> Paul and Michael, i don't know where that space is coming from, it sure doesn't appear in the script that i have. On 2/23/06, Michael Bolton <mb at michaelbolton.net <mailto:mb at michaelbolton.net> > wrote: Leave out the spaces after the open single quotes. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto: <mailto:wtr-general-bounces at rubyforge.org> wtr-general-bounces at rubyforge.org] On Behalf Of saud aziz Sent: February 22, 2006 12:14 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Script hangs and does nothing Hi guys, When i try to run the following script, it just hangs and never clicks through the respective image buttons on site. Can someone run and tell me if it works for them? Or how i could possibly modify it to make it run? Another thing noticeable is that when you run this from command prompt, it sometimes doesn't even display the buttons that you are supposed to click on at all. So for instance on page ' http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx <http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx> ' you might not find button that says get started and you can make it appear only if you press refresh/reload for browser. I am running latest version of Watir and Ruby available to General Public. Any help is much appreciated. require 'watir' include Watir require 'test/unit' class TC_recorded < Test::Unit::TestCase def test_recorded ie = IE.new ie.goto('https://www.seattlesymphony.org/' <https://www.seattlesymphony.org/%27> ) #ie.link(:url, ' <http://www.seattlesymphony.org/symphony/buy/subs/%27%29.click> http://www.seattlesymphony.org/symphony/buy/subs/').click #ie.goto('javascript:bakeCookie()') #ie.button(:alt, 'New Subscription').click ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx%27> http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx') ie.image(:name, 'template:ib_GetStarted').click ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1%2 7> http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1') ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx ?id=150' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150% 27> ) ie.button(:alt, 'Select This Series').click ie.radio(:name, 'Section','73').set() ie.button(:alt, 'Add This Series To My Cart').click ie.button(:alt, 'Browse Series').click ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package .aspx?id=2' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id =2%27> ) ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx %27> http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx' ) ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package .aspx?id=3' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id =3%27> ) ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx ').click <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx %27%29.click> ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package .aspx?id=2' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id =2%27> ) ie.goto(' <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id= 176%27> http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=1 76') ie.button(:alt, 'Select This Series').click ie.radio(:name, 'Section','62').set() ie.button(:alt, 'Add This Series To My Cart').click ie.button(:alt, 'Continue To Next Step').click end end Any help is much appreciated. obviously it is not even complete script, but if you can get past 'ie.button(:alt, 'Select This Series').click' this step, then it would be great to know. For me it just hangs and does nothing, no errors, nada. -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org <mailto:Wtr-general at rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org <mailto:Wtr-general at rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060223/934b5d0d/attachment.html From marco.neri at police.vic.gov.au Thu Feb 23 21:17:27 2006 From: marco.neri at police.vic.gov.au (Neri, Marco) Date: Fri, 24 Feb 2006 13:17:27 +1100 Subject: [Wtr-general] (nested?) table access - solution Message-ID: <AE918470A1BAB34B97D28AA43952D5E7010B456E@wt14px03.vicpolice.internal> FYI. Solution to my problem in case anyone else has a similar problem Using wet. Iterate over all the tables in the page. Find the index of the table that matches the desired text. Use the index to access the table. for i in 1..ie.tables.length # count of all tables in the page index = "index:=".concat(i.to_s) text = Browser("title:=MyPage").Table(index.to_s).text md = /^Names \([0-9]+\)$/.match(text) if (md != nil) break end end Browser("title:=MyPage").Table(index).fire_event("onClick") -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Neri, Marco Sent: Monday, 20 February 2006 12:29 To: wtr-general at rubyforge.org Subject: [Wtr-general] (nested?) table access - need help. Hi The developers on the application I'm testing have replaced a (menu) table of url links with rad panel control ( a 3rd party js control from telerik ). Using table = @ie.table(:index , i) in a loop, in the console I can see tabletype: id: PersonLinks_collapsableLinks name: value: disabled: false rows: 34 cols: 1 Using row = @ie.table(:id , 'PersonLinks_collapsableLinks')[3] puts(row[1].to_s) In the console I see ( ) Names (6) Addresses (15) Phone Numbers (6) Photos (21) Physical Descriptions (4) Scars, Marks, Tattoos (10) Miscellaneous IDs (1) Contacts (1) Dossier Known Associates (0) Criminal History Does this suggest that the one cell contains all of the items listed above ? What I was wanting to be able to do was access individual cell and then use .fire_Event("onClick") on it to trigger the menu items. I managed to get this to work for the 1st level of the menu ( details ). table = @ie.table(:id , 'PersonLinks_collapsableLinks') table[3][0].flash table[3][0].fire_event("onClick") The control then expands out the 2nd level of the menu with all of the items listed above. By counting the <tr> in the src for the table I can see why the 34 rows. This must also count up the nested tables? How can I access the nested table in order to access the row/cell within that? I can't use id as that tag hasn't been defined for the nested table ? thanks Src for the table is : </script><span id="PersonLinks_collapsableLinksStyleSheetHolder" style="display:none"></span><script type="text/javascript">RadPanelbarAppendStyleSheet('PersonLinks_collapsa bleLinks', '/LEAP/Web/UI/Style/panelbar.css');</script><table id="PersonLinks_collapsableLinks" cellspacing="0" cellpadding="0" class="Panelbar" style="width:100%;visibility: hidden"> <tr> <td id="SUMMARY" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="HeaderSelected" style="width:100%;"> <tr> <td id="SUMMARY_Text" style="width:100%;">Summary</td> </tr> </table></td> </tr><tr> <td id="DETAILS" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="HeaderCollapsed" style="width:100%;"> <tr> <td id="DETAILS_Text" style="width:100%;">Details</td> </tr> </table></td> </tr><tr style="display: none"><td valign="top" id="DETAILS_Panel" style="white-space: nowrap; width: 100%; display: none"><table cellspacing="0" cellpadding="0" width="100%"> <tr> <td id="NAMES" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="NAMES_Text" style="width:100%;">Names (6)</td> </tr> </table></td> </tr><tr> <td id="ADDRESSES" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="ADDRESSES_Text" style="width:100%;">Addresses (15)</td> </tr> </table></td> </tr><tr> <td id="PHONES" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="PHONES_Text" style="width:100%;">Phone Numbers (6)</td> </tr> </table></td> </tr><tr> <td id="IMAGES" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="IMAGES_Text" style="width:100%;">Photos (21)</td> </tr> </table></td> </tr><tr> <td id="DESCRIPTIONS" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="DESCRIPTIONS_Text" style="width:100%;">Physical Descriptions (4)</td> </tr> </table></td> </tr><tr> <td id="TATTOOS" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="TATTOOS_Text" style="width:100%;">Scars, Marks, Tattoos (10)</td> </tr> </table></td> </tr><tr> <td id="MISCELLANEOUSIDS" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="MISCELLANEOUSIDS_Text" style="width:100%;">Miscellaneous IDs (1)</td> </tr> </table></td> </tr><tr> <td id="CONTACTS" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="CONTACTS_Text" style="width:100%;">Contacts (1)</td> </tr> </table></td> </tr><tr> <td id="DOSSIER" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="DOSSIER_Text" style="width:100%;">Dossier</td> </tr> </table></td> </tr><tr> <td id="KNOWNASSOCIATES" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="KNOWNASSOCIATES_Text" style="width:100%;">Known Associates (0)</td> </tr> </table></td> </tr><tr> <td id="CRIMINALHISTORY" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="CRIMINALHISTORY_Text" style="width:100%;">Criminal History</td> </tr> </table></td> </tr> </table></td></tr><tr> <td id="INVOLVEMENTS" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="HeaderCollapsed" style="width:100%;"> <tr> <td id="INVOLVEMENTS_Text" style="width:100%;">Involvements</td> </tr> </table></td> </tr><tr style="display: none"><td valign="top" id="INVOLVEMENTS_Panel" style="white-space: nowrap; width: 100%; display: none"><table cellspacing="0" cellpadding="0" width="100%"> <tr> <td id="INTERESTFLAGS" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="INTERESTFLAGS_Text" style="width:100%;">Interest Flags (8)</td> </tr> </table></td> </tr><tr> <td id="NAMEWHEREABOUTS" style="white-space:nowrap;width:100%;"><table cellspacing="0" cellpadding="0" class="ItemCollapsed" style="width:100%;"> <tr> <td id="NAMEWHEREABOUTS_Text" style="width:100%;">Whereabouts (2)</td> </tr> </table></td> </tr> </table></td></tr> </table> ======================================================= The information contained in this email and any files attached may be confidential information to the intended recipient and may be the subject of legal professional privilege or public interest immunity. If you are not the intended recipient, any use, disclosure or copying is unauthorised. If you have received this document in error please telephone 1300 307 082 ******************************************************************* This footnote also confirms that this email message has been swept for the presence of computer viruses. ******************************************************************* _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ======================================================= The information contained in this email and any files attached may be confidential information to the intended recipient and may be the subject of legal professional privilege or public interest immunity. If you are not the intended recipient, any use, disclosure or copying is unauthorised. If you have received this document in error please telephone 1300 307 082 ******************************************************************* This footnote also confirms that this email message has been swept for the presence of computer viruses. ******************************************************************* From saudaziz at gmail.com Thu Feb 23 22:23:45 2006 From: saudaziz at gmail.com (saud aziz) Date: Thu, 23 Feb 2006 19:23:45 -0800 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <24d0cb380602231722g4ba548eft710e13dfffc3d8c8@mail.gmail.com> References: <24d0cb380602231258p3190d468ja7af8f0593d7f37b@mail.gmail.com> <00ef01c638da$494da890$6801a8c0@Koko> <24d0cb380602231722g4ba548eft710e13dfffc3d8c8@mail.gmail.com> Message-ID: <24d0cb380602231923h2d3ddeb3q8af6c8da930be48e@mail.gmail.com> Thats another thing. If you go to http://www.seattlesymphony.org/symphony/buy/subs/ and click on those buttons manually, they do work. But when i run the mentioned script on that site, it: 1) Sometimes doesn't render the button 2) if it does, it hangs 3) And sometimes it gives the same error that Bill Agee reported. Regards, Saud -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060223/7f562b6b/attachment.html From manishs at reconnex.net Thu Feb 23 22:50:30 2006 From: manishs at reconnex.net (Manish Sapariya) Date: Fri, 24 Feb 2006 09:20:30 +0530 Subject: [Wtr-general] multiple mails for a post Message-ID: <43FE8286.60601@reconnex.net> Is everybody getting multiple mails for one post like me? Thanks, Manish From mb at michaelbolton.net Fri Feb 24 01:06:00 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Fri, 24 Feb 2006 01:06:00 -0500 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <24d0cb380602231923h2d3ddeb3q8af6c8da930be48e@mail.gmail.com> Message-ID: <013801c63908$62d5faf0$6801a8c0@Koko> Here's what I'm observing: when I click on the URI in your message below, I get this: http://www.seattlesymphony.org/symphony/buy/subs/index.aspx This page has on it the heading "Series Tickets". When I click the link in your script, I get this: http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx This page has on it the heading "New Subscriptions" So they're different. I'd start by investigating that, and what my earlier message notes--on the latter page, <input type="image" name="template:ibNewSubscription" id="template_ibNewSubscription" src="../../../_img/button/subs/newsubscription.gif" alt="New Subscription" border="0" style="margin:7px auto;" /> is what you get, and this has no action associated with it. This is an important heuristic. It's not always true; it may not even be true in this case. But it behooves us to consider the possibility: when the test crashes, it could be that it's because the application under test may actually have a bug in it. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of saud aziz Sent: February 23, 2006 10:24 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Script hangs and does nothing Thats another thing. If you go to http://www.seattlesymphony.org/symphony/buy/subs/ and click on those buttons manually, they do work. But when i run the mentioned script on that site, it: 1) Sometimes doesn't render the button 2) if it does, it hangs 3) And sometimes it gives the same error that Bill Agee reported. Regards, Saud -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060224/ae6b693d/attachment.html From saudaziz at gmail.com Fri Feb 24 01:12:00 2006 From: saudaziz at gmail.com (saud aziz) Date: Thu, 23 Feb 2006 22:12:00 -0800 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <013801c63908$62d5faf0$6801a8c0@Koko> References: <24d0cb380602231923h2d3ddeb3q8af6c8da930be48e@mail.gmail.com> <013801c63908$62d5faf0$6801a8c0@Koko> Message-ID: <24d0cb380602232212y4f83f3f6g21528d930afbf1c5@mail.gmail.com> Those two are different links. If you go to first link that you mentioned and click on "New Subscriptions" button, that will take you to the second link you mentioned. On 2/23/06, Michael Bolton <mb at michaelbolton.net> wrote: > > Here's what I'm observing: when I click on the URI in your message below, > I get this: > > http://www.seattlesymphony.org/symphony/buy/subs/index.aspx > > This page has on it the heading "Series Tickets". > > When I click the link in your script, I get this: > > http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx > > This page has on it the heading "New Subscriptions" > > So they're different. I'd start by investigating that, and what my > earlier message notes--on the latter page, > > <input type="image" name="template:ibNewSubscription" id="template_ibNewSubscription" src="../../../_img/button/subs/newsubscription.gif" alt="New Subscription" border="0" style="margin:7px auto;" /> > > is what you get, and this has no action associated with it. > > This is an important heuristic. It's not always true; it may not even be true in this case. > But it behooves us to consider the possibility: when the test crashes, it could be > that it's because the application under test may actually have a bug in it. > > ---Michael B. > > > ------------------------------ > *From:* wtr-general-bounces at rubyforge.org [mailto: > wtr-general-bounces at rubyforge.org] *On Behalf Of *saud aziz > *Sent:* February 23, 2006 10:24 PM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] Script hangs and does nothing > > Thats another thing. If you go to > http://www.seattlesymphony.org/symphony/buy/subs/ and click on those > buttons manually, they do work. But when i run the mentioned script on that > site, it: > > 1) Sometimes doesn't render the button > 2) if it does, it hangs > 3) And sometimes it gives the same error that Bill Agee reported. > > Regards, > > Saud > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060223/0a034d45/attachment.html From gztest2005 at 126.com Fri Feb 24 01:31:34 2006 From: gztest2005 at 126.com (dennis) Date: Fri, 24 Feb 2006 14:31:34 +0800 Subject: [Wtr-general] No new window open In-Reply-To: <43FE8286.60601@reconnex.net> References: <43FE8286.60601@reconnex.net> Message-ID: <43FEA846.2020301@126.com> Hi guys, When I used Watir to test, I got something strange. Error occurs when I try to login on the system, when I visit the homepage manually and input the username and password, it seems good. But when I used watir, after I entered the username/password and click the login button, it wait for about 20 second and then close the current iexplore window. The script I used to test the application: require 'Watir' include Watir $IE0 = IE.new $IE0.goto("http://10.170.0.165:7001/") $IE0.wait $IE0.form( :name, "form").text_field( :name, "username").set("admin") $IE0.form( :name, "form").text_field( :name, "password").set("passwd") $IE0.form( :name, "form").button( :name, "btlogin").click $IE0.wait sleep(20) $IE1 = IE.attach( :title, "alert") $IE1.frame( :name, "leftFrame").link( :name, "nodeIcon5").click The homepage is very simple so I paste it here: <body class="login_body" onload="javascript: form.username.focus();"> <table class="common_table"> <form name="form" method="post" action="com.myapp.user.UserManage" target="indexwin"> <input type="hidden" name="act" value="login"> <tr> <td class="login_td_bg"> <table class="login_table" cellpadding="0"> <tr> <td><img src="images/login_top.jpg"></td> </tr> <tr> <td class="login_user_td"> <table class="login_table"> <tr> <td>UserName</td> <td>  <input type="text" class="login_input" tabIndex="1" name="username" onkeydown="javascript: return JumpToPassword();"></td> </tr> <tr> <td>Password</td> <td>  <input type="password" tabIndex="2" name="password" class="login_input" onkeydown="javascript: return SubmitForm();"></td> </tr> </table> </td> </tr> <tr> <td class="login_button_td"> <input type="button" id="btlogin" name="btlogin" tabIndex="3" value="Login" class="button" onclick="javascript: formsubmit(); return false;"> </td> </tr> </table> </td> </tr> </form> </table> </body> when user click "Login" button , function "formsubmit()" is called, the content of function "formsubit" is listed below: function formsubmit(){ //Check the user name if(form.username.value==""){ alert("Please enter username! "); return false; } //Check the password if(form.password.value==""){ alert("Please enter password! "); return false; } disabledbutton(); if(window.name != "indexwin"){ window.open("about:blank","indexwin","resizable=1,left=0,top=0,height=" +(screen.height-50)+", width="+(screen.width-10)); } form.submit(); if(window.name != "indexwin"){ closeWin(); } } Any help is appreciated, thanx. dennis From zeljko.filipin at gmail.com Fri Feb 24 02:53:47 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Fri, 24 Feb 2006 08:53:47 +0100 Subject: [Wtr-general] multiple mails for a post In-Reply-To: <43FE8286.60601@reconnex.net> References: <43FE8286.60601@reconnex.net> Message-ID: <f81b1250602232353s79365ca9x1d3f0d89fbe77a1c@mail.gmail.com> No. Are you using Outlook? On 2/24/06, Manish Sapariya <manishs at reconnex.net> wrote:> Is everybody getting multiple mails for one post like me?> Thanks,> Manish>> _______________________________________________> Wtr-general mailing list> Wtr-general at rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general> --http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/ From zeljko.filipin at gmail.com Fri Feb 24 03:00:21 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Fri, 24 Feb 2006 09:00:21 +0100 Subject: [Wtr-general] No new window open In-Reply-To: <43FEA846.2020301@126.com> References: <43FE8286.60601@reconnex.net> <43FEA846.2020301@126.com> Message-ID: <f81b1250602240000p6ed721fbsd470cbdc0dae2099@mail.gmail.com> > sleep(20) this is why your script waits 20 seconds > form.submit();> if(window.name != "indexwin"){> closeWin();> } I am not very god at javascript, but it looks to me that this closes the window. From gztest2005 at 126.com Fri Feb 24 03:08:54 2006 From: gztest2005 at 126.com (dennis) Date: Fri, 24 Feb 2006 16:08:54 +0800 Subject: [Wtr-general] No new window open In-Reply-To: <f81b1250602240000p6ed721fbsd470cbdc0dae2099@mail.gmail.com> References: <43FE8286.60601@reconnex.net> <43FEA846.2020301@126.com> <f81b1250602240000p6ed721fbsd470cbdc0dae2099@mail.gmail.com> Message-ID: <43FEBF16.7050006@126.com> Thanx for your reply. But in my javascript code, before the window closed, a new window should open first. Code: if(window.name != "indexwin"){ window.open("about:blank","indexwin","resizable=1,left=0,top=0,height=" +(screen.height-50)+", width="+(screen.width-10)); } form.submit(); if(window.name != "indexwin"){ closeWin(); } As I visit the homepage manully, it works(open a new window and close current window), but when I run using Watir, current window is closed and *no new window open*. Zeljko Filipin wrote: >>sleep(20) >> >> >this is why your script waits 20 seconds > > >>form.submit();> if(window.name != "indexwin"){> closeWin();> } >> >> >I am not very god at javascript, but it looks to me that this closes the window. >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > > From manishs at reconnex.net Fri Feb 24 04:58:44 2006 From: manishs at reconnex.net (Manish Sapariya) Date: Fri, 24 Feb 2006 15:28:44 +0530 Subject: [Wtr-general] multiple mails for a post In-Reply-To: <f81b1250602232353s79365ca9x1d3f0d89fbe77a1c@mail.gmail.com> References: <43FE8286.60601@reconnex.net> <f81b1250602232353s79365ca9x1d3f0d89fbe77a1c@mail.gmail.com> Message-ID: <43FED8D4.6000408@reconnex.net> No, I use thunderbird. Its just last two days I started recieving multiple mails. Regards, Manish On 02/24/2006 01:23 PM, Zeljko Filipin wrote: >No. Are you using Outlook? >On 2/24/06, Manish Sapariya <manishs at reconnex.net> wrote:> Is everybody getting multiple mails for one post like me?> Thanks,> Manish>> _______________________________________________> Wtr-general mailing list> Wtr-general at rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general> > >--http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/ >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > From zeljko.filipin at gmail.com Fri Feb 24 05:37:25 2006 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Fri, 24 Feb 2006 11:37:25 +0100 Subject: [Wtr-general] multiple mails for a post In-Reply-To: <43FED8D4.6000408@reconnex.net> References: <43FE8286.60601@reconnex.net> <f81b1250602232353s79365ca9x1d3f0d89fbe77a1c@mail.gmail.com> <43FED8D4.6000408@reconnex.net> Message-ID: <f81b1250602240237g555720d9k96e10110fddca8df@mail.gmail.com> I do not know for thunderbird, but I had similar problem with outlook.I made some rules for sorting e-mails in folders, and by mistakedoubled one, so I started receiving double mails. I fixed it - deletedall rules (and started using gmail). I do not know if this helps, orif thunderbird even has rules for sorting. On 2/24/06, Manish Sapariya <manishs at reconnex.net> wrote:> No, I use thunderbird.> Its just last two days I started recieving multiple mails.> Regards,> Manish From manishs at reconnex.net Fri Feb 24 06:00:49 2006 From: manishs at reconnex.net (Manish Sapariya) Date: Fri, 24 Feb 2006 16:30:49 +0530 Subject: [Wtr-general] multiple mails for a post In-Reply-To: <f81b1250602240237g555720d9k96e10110fddca8df@mail.gmail.com> References: <43FE8286.60601@reconnex.net> <f81b1250602232353s79365ca9x1d3f0d89fbe77a1c@mail.gmail.com> <43FED8D4.6000408@reconnex.net> <f81b1250602240237g555720d9k96e10110fddca8df@mail.gmail.com> Message-ID: <43FEE761.7080605@reconnex.net> I believe its not filter issue, may be my mail server posting me multiple copies. But for all other mails I am receving only single mails. Thats why I thought something wrong with the list server. Thanks anywas for the help. Regards, Manish On 02/24/2006 04:07 PM, Zeljko Filipin wrote: >I do not know for thunderbird, but I had similar problem with outlook.I made some rules for sorting e-mails in folders, and by mistakedoubled one, so I started receiving double mails. I fixed it - deletedall rules (and started using gmail). I do not know if this helps, orif thunderbird even has rules for sorting. >On 2/24/06, Manish Sapariya <manishs at reconnex.net> wrote:> No, I use thunderbird.> Its just last two days I started recieving multiple mails.> Regards,> Manish >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > From angrez at gmail.com Fri Feb 24 06:09:07 2006 From: angrez at gmail.com (Angrez Singh) Date: Fri, 24 Feb 2006 16:39:07 +0530 Subject: [Wtr-general] xpath support doesn't work for me In-Reply-To: <B0D561E4E514F447AA08B65C957C8CB40239026C@MI_EXCH1> References: <B0D561E4E514F447AA08B65C957C8CB40239026C@MI_EXCH1> Message-ID: <e26bda3e0602240309p1c6bf190l57f8e5ce22031bc4@mail.gmail.com> Hi Chris, I installed 'watir' from the tar ball. Steps I followed: 1. Manually copied 'watir.rb' & 'watir' folder to [ruby installation directory]/lib/ruby/site_ruby/1.8/ 2. Manually copied 'doc', 'examples', 'unittests' folders to [watir installation directory] I was able to run the core tests successfullly. $ruby core_tests.rb Loaded suite core_tests Started ............................................................................................................................................................................ Finished in 88.906 seconds. 172 tests, 991 assertions, 0 failures, 0 errors But when I tried to run xpath_tests.rb or all_tests.rb I got lots of exceptions & errors. One thing that was strange was two IE instances were getting opened when I tried to run any of these files. Then one got closed & there were lot of failures each was saying 'The object invoked has disconnected from its clients.'. So what I think is the IE instance that was closed (don't know how) was the correct IE that was being referenced in the tests. The IE instance that remained open (don't know how it got opened) is the one that is not used anywhere in the scripts. Anyways, successful run of core_tests.rb indicates that xpath is working fine because xpath unit tests are also included in the core tests. Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060224/97e154df/attachment.html From amithashettyb at yahoo.co.in Fri Feb 24 06:52:35 2006 From: amithashettyb at yahoo.co.in (Amitha Shetty) Date: Fri, 24 Feb 2006 11:52:35 +0000 (GMT) Subject: [Wtr-general] Is there a way to access External Style Sheet using watir? Message-ID: <20060224115235.66807.qmail@web8514.mail.in.yahoo.com> Hi, How to access External Style Sheet using watir? I have to write a test case to test UI for a screen.The screen has a table and desciption of html elements for this is called from a class displaytag. This class is in a .css file in a different location.The html has the href for the same. Is there a way to access this class in my test case to test the font, alignment and other UI of the table? HTML for the same is as given below: <html> <head> <link rel="stylesheet" type="text/css" href="css/displayTag.css" /> <SCRIPT LANGUAGE="JavaScript"> </SCRIPT> </head> <table class="displaytag" cellspacing="1" id="table1"> <thead> <tr> <th align="right">Heading 1</th> <th align="right">Heading 2</th> <th align="right">Heading 3</th> <tbody> <tr class="odd"> <td align="right"> 1/1  </td> --------------------------------- Jiyo cricket on Yahoo! India cricket Yahoo! Messenger Mobile Stay in touch with your buddies all the time. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060224/3e5ac688/attachment.html From angrez at gmail.com Thu Feb 23 23:50:11 2006 From: angrez at gmail.com (Angrez Singh) Date: Fri, 24 Feb 2006 10:20:11 +0530 Subject: [Wtr-general] (nested?) table access - solution In-Reply-To: <AE918470A1BAB34B97D28AA43952D5E7010B456E@wt14px03.vicpolice.internal> References: <AE918470A1BAB34B97D28AA43952D5E7010B456E@wt14px03.vicpolice.internal> Message-ID: <e26bda3e0602232050r2b70470cqe0f832fe12b9bcfc@mail.gmail.com> Hi, I think using XPath extension will be able to address this issue in a more simpler way than iterating over all the tables. Please refer to: http://rubyforge.org/pipermail/wtr-general/2005-August/003182.html You can download the latest tar ball from HEAD to use this extension. There is also a help document in the doc section. Regards, Angrez On 2/24/06, Neri, Marco <marco.neri at police.vic.gov.au> wrote: > > FYI. Solution to my problem in case anyone else has a similar problem > > Using wet. > > Iterate over all the tables in the page. Find the index of the table > that matches the desired text. Use the index to access the table. > > for i in 1..ie.tables.length # count of all tables in the page > index = "index:=".concat(i.to_s) > text = Browser("title:=MyPage").Table(index.to_s).text > md = /^Names \([0-9]+\)$/.match(text) > if (md != nil) > break > end > end > Browser("title:=MyPage").Table(index).fire_event("onClick") > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Neri, Marco > Sent: Monday, 20 February 2006 12:29 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] (nested?) table access - need help. > > Hi > > The developers on the application I'm testing have replaced a (menu) > table of url links with rad panel control ( a 3rd party js control from > telerik ). > > Using table = @ie.table(:index , i) in a loop, in the console I can see > > tabletype: > id: PersonLinks_collapsableLinks > name: > value: > disabled: false > rows: 34 > cols: 1 > > Using > row = @ie.table(:id , 'PersonLinks_collapsableLinks')[3] > puts(row[1].to_s) > > In the console I see ( ) > > Names (6) > Addresses (15) > Phone Numbers (6) > Photos (21) > Physical Descriptions (4) > Scars, Marks, Tattoos (10) > Miscellaneous IDs (1) > Contacts (1) > Dossier > Known Associates (0) > Criminal History > > Does this suggest that the one cell contains all of the items listed > above ? > > What I was wanting to be able to do was access individual cell and then > use .fire_Event("onClick") on it to trigger the menu items. I managed to > get this to work for the 1st level of the menu ( details ). > > table = @ie.table(:id , 'PersonLinks_collapsableLinks') > table[3][0].flash > table[3][0].fire_event("onClick") > > The control then expands out the 2nd level of the menu with all of the > items listed above. > > By counting the <tr> in the src for the table I can see why the 34 rows. > This must also count up the nested tables? > > How can I access the nested table in order to access the row/cell within > that? I can't use id as that tag hasn't been defined for the nested > table ? > > thanks > > Src for the table is : > > </script><span id="PersonLinks_collapsableLinksStyleSheetHolder" > style="display:none"></span><script > type="text/javascript">RadPanelbarAppendStyleSheet('PersonLinks_collapsa > bleLinks', '/LEAP/Web/UI/Style/panelbar.css');</script><table > id="PersonLinks_collapsableLinks" cellspacing="0" cellpadding="0" > class="Panelbar" style="width:100%;visibility: hidden"> > <tr> > <td id="SUMMARY" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="HeaderSelected" style="width:100%;"> > <tr> > <td id="SUMMARY_Text" > style="width:100%;">Summary</td> > </tr> > </table></td> > </tr><tr> > <td id="DETAILS" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="HeaderCollapsed" style="width:100%;"> > <tr> > <td id="DETAILS_Text" > style="width:100%;">Details</td> > </tr> > </table></td> > </tr><tr style="display: none"><td valign="top" > id="DETAILS_Panel" style="white-space: nowrap; width: 100%; display: > none"><table cellspacing="0" cellpadding="0" width="100%"> > <tr> > <td id="NAMES" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="NAMES_Text" > style="width:100%;">Names (6)</td> > </tr> > </table></td> > </tr><tr> > <td id="ADDRESSES" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="ADDRESSES_Text" > style="width:100%;">Addresses (15)</td> > </tr> > </table></td> > </tr><tr> > <td id="PHONES" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="PHONES_Text" > style="width:100%;">Phone Numbers (6)</td> > </tr> > </table></td> > </tr><tr> > <td id="IMAGES" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="IMAGES_Text" > style="width:100%;">Photos (21)</td> > </tr> > </table></td> > </tr><tr> > <td id="DESCRIPTIONS" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="DESCRIPTIONS_Text" > style="width:100%;">Physical Descriptions (4)</td> > </tr> > </table></td> > </tr><tr> > <td id="TATTOOS" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="TATTOOS_Text" > style="width:100%;">Scars, Marks, Tattoos (10)</td> > </tr> > </table></td> > </tr><tr> > <td id="MISCELLANEOUSIDS" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="MISCELLANEOUSIDS_Text" > style="width:100%;">Miscellaneous IDs (1)</td> > </tr> > </table></td> > </tr><tr> > <td id="CONTACTS" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="CONTACTS_Text" > style="width:100%;">Contacts (1)</td> > </tr> > </table></td> > </tr><tr> > <td id="DOSSIER" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="DOSSIER_Text" > style="width:100%;">Dossier</td> > </tr> > </table></td> > </tr><tr> > <td id="KNOWNASSOCIATES" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="KNOWNASSOCIATES_Text" > style="width:100%;">Known Associates (0)</td> > </tr> > </table></td> > </tr><tr> > <td id="CRIMINALHISTORY" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="CRIMINALHISTORY_Text" > style="width:100%;">Criminal History</td> > </tr> > </table></td> > </tr> > </table></td></tr><tr> > <td id="INVOLVEMENTS" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="HeaderCollapsed" style="width:100%;"> > <tr> > <td id="INVOLVEMENTS_Text" > style="width:100%;">Involvements</td> > </tr> > </table></td> > </tr><tr style="display: none"><td valign="top" > id="INVOLVEMENTS_Panel" style="white-space: nowrap; width: 100%; > display: none"><table cellspacing="0" cellpadding="0" width="100%"> > <tr> > <td id="INTERESTFLAGS" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="INTERESTFLAGS_Text" > style="width:100%;">Interest Flags (8)</td> > </tr> > </table></td> > </tr><tr> > <td id="NAMEWHEREABOUTS" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="NAMEWHEREABOUTS_Text" > style="width:100%;">Whereabouts (2)</td> > </tr> > </table></td> > </tr> > </table></td></tr> > </table> > > > ======================================================= > The information contained in this email and any files attached may be > confidential information to the intended recipient and may be the > subject of legal professional privilege or public interest immunity. > > If you are not the intended recipient, any use, disclosure or copying is > unauthorised. > > If you have received this document in error please telephone 1300 307 > 082 > > ******************************************************************* > This footnote also confirms that this email message has been swept for > the presence of computer viruses. > ******************************************************************* > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > ======================================================= > The information contained in this email and any files attached may > be confidential information to the intended recipient and may be > the subject of legal professional privilege or public interest immunity. > > If you are not the intended recipient, any use, disclosure or copying is > unauthorised. > > If you have received this document in error please telephone 1300 307 082 > > ******************************************************************* > This footnote also confirms that this email message has been swept > for the presence of computer viruses. > ******************************************************************* > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060224/27ad5afc/attachment.html From bret at pettichord.com Fri Feb 24 12:16:26 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 24 Feb 2006 11:16:26 -0600 Subject: [Wtr-general] Repository moving to OpenQA.org Message-ID: <ade75c5b0602240916v68c1a35ch6aaf0fd573e620c8@mail.gmail.com> The source repository is in the processing of moving from RubyForge.org to OpenQA.org. It is also moving from CVS to Subversion (SVN). I'll have more on how to access the source repository shortly. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060224/a86e6435/attachment.html From mb at michaelbolton.net Fri Feb 24 14:01:01 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Fri, 24 Feb 2006 14:01:01 -0500 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <24d0cb380602232212y4f83f3f6g21528d930afbf1c5@mail.gmail.com> Message-ID: <022801c63974$a777e580$6801a8c0@Koko> Yes: I know that those are two different links, pointing to two different. In fact, that was one of the key points of my message. Your script clicks on the second link ( <http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx> http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx) When I point the W3C consortium's validator (http://validator.w3.org) at that page, I get this report: [quote] I got the following unexpected response when trying to retrieve <http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx>: 301 Moved [/quote] I wonder if Watir is also finding that the page moved, but doesn't know how to cope. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of saud aziz Sent: February 24, 2006 1:12 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Script hangs and does nothing Those two are different links. If you go to first link that you mentioned and click on "New Subscriptions" button, that will take you to the second link you mentioned. On 2/23/06, Michael Bolton <mb at michaelbolton.net> wrote: Here's what I'm observing: when I click on the URI in your message below, I get this: http://www.seattlesymphony.org/symphony/buy/subs/index.aspx <http://www.seattlesymphony.org/symphony/buy/subs/index.aspx> This page has on it the heading "Series Tickets". When I click the link in your script, I get this: http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx This page has on it the heading "New Subscriptions" So they're different. I'd start by investigating that, and what my earlier message notes--on the latter page, <input type="image" name="template:ibNewSubscription" id="template_ibNewSubscription" src="../../../_img/button/subs/newsubscription.gif" alt="New Subscription" border="0" style= "margin:7px auto;" /> is what you get, and this has no action associated with it. This is an important heuristic. It's not always true; it may not even be true in this case. But it behooves us to consider the possibility: when the test crashes, it could be that it's because the application under test may actually have a bug in it. ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of saud aziz Sent: February 23, 2006 10:24 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Script hangs and does nothing Thats another thing. If you go to http://www.seattlesymphony.org/symphony/buy/subs/ and click on those buttons manually, they do work. But when i run the mentioned script on that site, it: 1) Sometimes doesn't render the button 2) if it does, it hangs 3) And sometimes it gives the same error that Bill Agee reported. Regards, Saud _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060224/979936d7/attachment.html From mb at michaelbolton.net Fri Feb 24 14:40:39 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Fri, 24 Feb 2006 14:40:39 -0500 Subject: [Wtr-general] No new window open In-Reply-To: <43FEBF16.7050006@126.com> Message-ID: <024e01c6397a$31aa8550$6801a8c0@Koko> So your script will have to attach to that window. ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of dennis Sent: February 24, 2006 3:09 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] No new window open Thanx for your reply. But in my javascript code, before the window closed, a new window should open first. Code: if(window.name != "indexwin"){ window.open("about:blank","indexwin","resizable=1,left=0,top=0,height=" +(screen.height-50)+", width="+(screen.width-10)); } form.submit(); if(window.name != "indexwin"){ closeWin(); } As I visit the homepage manully, it works(open a new window and close current window), but when I run using Watir, current window is closed and *no new window open*. Zeljko Filipin wrote: >>sleep(20) >> >> >this is why your script waits 20 seconds > > >>form.submit();> if(window.name != "indexwin"){> closeWin();> } >> >> >I am not very god at javascript, but it looks to me that this closes the window. >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > > From tester.paul at gmail.com Fri Feb 24 16:23:50 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Fri, 24 Feb 2006 16:23:50 -0500 Subject: [Wtr-general] Need help with Javascript Popup window Message-ID: <37c405480602241323y1f414d24o@mail.gmail.com> Problem Description: - I'm trying to dismiss an AutoComplete Javascript popup window on a Login page, but I can't get the script to press the Yes/No button. Background: Checked FAQ and searched Message Archives - haven't found anything that helps. ENV'T & SETUP: - Running Ruby 184-16p3, Watir 1.4.1 on Windows XP - IE 6.0, go to: Tools > Internet Options > Content > [AutoComplete...] and put checkmarks next to (i) "User names and passwords on forms", and (ii) "Prompt me to save passwords", press [OK] buttons to save the changes - Go to a Login screen of some sort, enter the User ID and password => When the "AutoComplete" dialog appears, press [Yes]. The SCRIPT: ---- require 'watir' include Watir require 'test/unit' class TC_Sign_In < Test::Unit::TestCase def startClicker( button , waitTime = 0.5) w = WinClicker.new longName = $ie.dir.gsub("/" , "\\" ) shortName = w.getShortFileName(longName) c = "start rubyw #{shortName }\\watir\\clickJSDialog.rb #{button } #{ waitTime} " puts "Starting #{c}" w.winsystem(c) w=nil end def test_Sign_In # open the web browser and go to the Login page ... # enter correct Username and *incorrect* Password $ie.text_field(:name, /UserNameField/).set($userID) $ie.text_field(:name, /PasswordField/).set($pass + "1") # expect the AutoComplete dialog to pop up because the password is different startClicker("No") $ie.button(:name, /LoginButton/).click ... end ---- So, what happens? => The Login page appears, the username and password are entered as expected, the [Login] button is pressed, the AutoComplete dialog appears as expected. => Then .. nothing... => It looks like there is a pause and then the (modal) AutoComplete dialog loses focus somehow. The Watir script just hangs at this point. - If I manually click the [No] button, the script continues to completion without error. Please help! How can I click this popup to make it go away? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060224/f4b83c37/attachment.html From bret at pettichord.com Fri Feb 24 19:06:56 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 24 Feb 2006 18:06:56 -0600 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <24d0cb380602220913r3d926578uaa0049f0c3d02456@mail.gmail.com> References: <24d0cb380602220913r3d926578uaa0049f0c3d02456@mail.gmail.com> Message-ID: <ade75c5b0602241606h6606545eh140462c650e4c8b2@mail.gmail.com> The "image" on the page is actually a button. The recorder that you used to create the script has a bug, which you should report back to the creator of the recorder. Also there is a ton of crap in this script, also presumably generated by the recorder. For example, i can see no reason to have successive calls to ie.goto in a script. The extra crud in the script appears to have confused the discussion of this problem. The following script works for me (note that i trimmed your script and changed the final call from ie.image to ie.button): require 'watir' include Watir require 'test/unit' class TC_recorded < Test::Unit::TestCase def test_recorded ie = IE.new ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx') ie.button(:name, 'template:ib_GetStarted').click end end If you still are having problems please send us a short bit of code that you think should work (i.e. not something that you don't understand that was generated by a recorder). This is not the correct forum to look for help in debugging other peoples recorders. You will need to contact them directly for help. Bret On 2/22/06, saud aziz <saudaziz at gmail.com> wrote: > > Hi guys, > > When i try to run the following script, it just hangs and never clicks > through the respective image buttons on site. Can someone run and tell me if > it works for them? Or how i could possibly modify it to make it run? Another > thing noticeable is that when you run this from command prompt, it sometimes > doesn't even display the buttons that you are supposed to click on at all. > So for instance on page ' > http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx' you > might not find button that says get started and you can make it appear only > if you press refresh/reload for browser. > > I am running latest version of Watir and Ruby available to General Public. > Any help is much appreciated. > > require 'watir' > include Watir > require 'test/unit' > class TC_recorded < Test::Unit::TestCase > def test_recorded > ie = IE.new > ie.goto('https://www.seattlesymphony.org/'<https://www.seattlesymphony.org/%27> > ) > #ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/').click<http://www.seattlesymphony.org/symphony/buy/subs/%27%29.click> > #ie.goto('javascript:bakeCookie()') > #ie.button(:alt, 'New Subscription').click > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx%27> > ) > ie.image(:name, 'template:ib_GetStarted').click > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150' > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150%27> > ) > ie.button(:alt, 'Select This Series').click > ie.radio(:name, 'Section','73').set() > ie.button(:alt, 'Add This Series To My Cart').click > ie.button(:alt, 'Browse Series').click > ie.goto(' > http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3' > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3%27> > ) > ie.link(:url, ' > http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx').click<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27%29.click> > ie.goto(' > http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > ) > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176%27> > ) > ie.button(:alt, 'Select This Series').click > ie.radio(:name, 'Section','62').set() > ie.button(:alt, 'Add This Series To My Cart').click > ie.button(:alt, 'Continue To Next Step').click > end > end > > Any help is much appreciated. obviously it is not even complete script, > but if you can get past 'ie.button(:alt, 'Select This Series').click' > this step, then it would be great to know. For me it just hangs and does > nothing, no errors, nada. > > > > > > -- > Saud Aziz > > "Whenever you find yourself on the side of the majority, it is time to > pause and reflect." - Mark Twain > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060224/967499a8/attachment.html From bret at pettichord.com Fri Feb 24 20:59:58 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 24 Feb 2006 19:59:58 -0600 Subject: [Wtr-general] Is there a way to access External Style Sheet using watir? In-Reply-To: <20060224115235.66807.qmail@web8514.mail.in.yahoo.com> References: <20060224115235.66807.qmail@web8514.mail.in.yahoo.com> Message-ID: <ade75c5b0602241759y36e6cae7r12aed5b4b30c3fac@mail.gmail.com> Yes, you can access the attributes of objects. It doesn't matter where their attributes come from, whether they are coded in the html or come from a class in an external style sheet. Try something like this: ie.table(:class, 'displaytag').attribute_value('font') Bret On 2/24/06, Amitha Shetty <amithashettyb at yahoo.co.in> wrote: > > Hi, > How to access External Style Sheet using watir? > I have to write a test case to test UI for a screen.The screen has a table > and desciption of html elements for this is called from a class displaytag. > This class is in a .css file in a different location.The html has the href > for the same. > Is there a way to access this class in my test case to test the font, > alignment and other UI of the table? > > HTML for the same is as given below: > > <html> > <head> > <link rel="stylesheet" type="text/css" href="css/displayTag.css" /> > <SCRIPT LANGUAGE="JavaScript"> > </SCRIPT> > </head> > <table class="displaytag" cellspacing="1" id="table1"> > <thead> > <tr> > <th align="right">Heading 1</th> > <th align="right">Heading 2</th> > <th align="right">Heading 3</th> > > <tbody> > <tr class="odd"> > <td align="right"> > 1/1  > </td> > > ------------------------------ > Jiyo cricket on Yahoo! India cricket<http://us.rd.yahoo.com/mail/in/mailcricket/*http://in.sports.yahoo.com/cricket/> > Yahoo! Messenger Mobile<http://us.rd.yahoo.com/mail/in/mailmobilemessenger/*http://in.mobile.yahoo.com/new/messenger/>Stay in touch with your buddies all the time. > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060224/ef45ad53/attachment.html From bret at pettichord.com Sat Feb 25 02:45:41 2006 From: bret at pettichord.com (Bret Pettichord) Date: Sat, 25 Feb 2006 01:45:41 -0600 Subject: [Wtr-general] Changing testing environments In-Reply-To: <OF227E7212.E8B4B78A-ON8625711B.00634D67-8625711B.00648E0D@nd.convergys.com> References: <OF227E7212.E8B4B78A-ON8625711B.00634D67-8625711B.00648E0D@nd.convergys.com> Message-ID: <ade75c5b0602242345q1a99c839n5a0790d4111eb3d9@mail.gmail.com> Carl, Thanks for sharing your experiences with Watir. Any time you have to use sleep to keep a script synchronized you are likely to eventually run into the kinds of reliability problems you are seeing. I consider any situation where you need to use sleeps to reveal a bug in Watir. The popup code has always been iffy. One of the problems we have had has been there has not been a clear way of distinguishing the stuff that is tested and reliable from other stuff that is more experimental. At one time, it was suggested that the popup code shouldn't be released because people might expect too much of it, but it was also pointed out that it useful and better than nothing. In the future, we will be moving untested libraries of unknown reliability into a contrib directory. You will use "require 'watir/contrib/libname" to use these libraries. In any case, i am working on creating a robust popup support library. Some of this code necessary is already checked in. Watir 1.5 will support modal web dialogs as well as have more robust and convenient support for modal windows dialogs as well. I am always eager to get help. The biggest area of help that i can use is if people are to create more unit tests. For example, if someone created unit tests for popups with hard-coded sleeps, then i could remove the sleeps and use them to test my new popup code support. That would be a massive help. What kinds of popups are you having trouble with? Do we have tests for them? Bret On 2/20/06, carl.l.shaulis at convergys.com <carl.l.shaulis at convergys.com> wrote: > > > Good afternoon: > > We created a testing suite using test environment A. Various strategic > sleeps were put in place to optimize the execution of WATIR scripts > against > this test environment. For the most part these test suites execute with > some reliability. > > On Friday I attempted to run the same set of scripts on my development > environment. Of course the scripts would break (primarily failed > assertions) because my laptop is not as powerful as the testing machines. > > How do y'all handle the issue of pointing your tests to different > environments and not having the scripts execute with reliability? > > Should we create scripts in the worst case environment and assume they > will > function on the production ready hardware? > > I believe the primary problem is the latency associated with Pop > ups. Does > anyone use any tricks to make their scripts more reliable? > > Despite everyone's hard work on WATIR, I am finding this to be an extreme > limitation and I am once again questioning my choice of WATIR as our > preferred testing solutions. > > Will any of the new activities for the next release address this concern? > > Am I isolated in having this concern? > > Any thoughts or suggestions would be appreciated. > > Thanks, > > Carl > > > > > > -- > "NOTICE: The information contained in this electronic mail transmission > is > intended by Convergys Corporation for the use of the named individual or > entity to which it is directed and may contain information that is > privileged or otherwise confidential. If you have received this > electronic > mail transmission in error, please delete it from your system without > copying or forwarding it, and notify the sender of the error by reply > email > or by telephone (collect), so that the sender's address records can be > corrected." > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060225/489d4ee2/attachment.html From bret at pettichord.com Sat Feb 25 02:52:40 2006 From: bret at pettichord.com (Bret Pettichord) Date: Sat, 25 Feb 2006 01:52:40 -0600 Subject: [Wtr-general] Error Accessing Frames In-Reply-To: <37c405480602201147j69661d18v@mail.gmail.com> References: <37c405480602201147j69661d18v@mail.gmail.com> Message-ID: <ade75c5b0602242352md8429d4uf74c48731cfe123f@mail.gmail.com> Paul, Thank you for the detailed report. I think we may have suppressed these warnings post 1.4.1. These warnings indicate that the different frames are being hosted from different machines, different ports or different protocols. I have provided background on this problem several times on this list. I really had been hoping that someone would step to trying to organize this kind of information for new users. This is definitely a frequently asked question. Bret On 2/20/06, Paul Carvalho <tester.paul at gmail.com> wrote: > > Hi there, I just noticed something with our latest software build that has > unexpectedly weirded out my Watir scripts. > > I noticed that when I run my scripts, I get an error similar to the > following now: > ---- > ## End of test: Login > . > Finished in 9.706 seconds. > > 1 tests, 1 assertions, 0 failures, 0 errors > W, [20-Feb-2006 14:29:03#3276] WARN -- : frame error in waitdocument > OLE error code:80070005 in <Unknown> > Access is denied. > > > HRESULT error code:0x80020009 > Exception occurred. > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1405:in `method_missing' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1405:in `wait' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1404:in `upto' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1404:in `wait' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2014:in `click' > LD_1_Sign_In(wip).rb:71:in `test_Sign_In' > c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:70:in `__send__' > c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:70:in `run' > c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:in `run' > c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `each' > c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `run' > c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:in `run' > c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `each' > c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `run' > c:/ruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:44:in `run_suite' > c:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:65:in > `start_mediator' > c:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:39:in `start' > c:/ruby/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:27:in `run' > c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:194:in `run' > c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:14:in `run' > c:/ruby/lib/ruby/1.8/test/unit.rb:285 > c:/ruby/lib/ruby/1.8/test/unit.rb:283 > >Exit code: 0 > ---- > > (FYI: Line 71 in my script = $ie.button(:name, /LoginButton/).click ) > > I haven't changed anything in the scripts, so I figure it must be the app > that has changed. I went to an IRB prompt and executed the following: > ---- > irb(main):006:0> ie.show_frames() > there are 4 frames > frame index: 1 --Access Denied-- > frame index: 2 name: ContextTree > frame index: 3 name: MainWindow > frame index: 4 --Access Denied-- > => 0..3 > ---- > > That's interesting. I don't remember the "Access Denied" frames before. > I pointed the browser to an older build and reran the same command: > ---- > irb(main):007:0> ie.show_frames () > there are 4 frames > frame index: 1 name: LeftStatic > frame index: 2 name: ContextTree > frame index: 3 name: MainWindow > frame index: 4 name: RightStatic > => 0..3 > ---- > > Okay, so I tried re-running the same script on this older build and it > runs without error (as expected). > > I asked one of the developers if there was a CSS change to the current > build and he said that we're now loading the Left and Right frames > dynamically instead of statically. I'm not really sure what that means, but > I know something is breaking Ruby/Watir. (I'm running Watir 1.4.1 on Ruby > 182-15.) > > Technically, these 'warnings' don't interfere with the test scripts > because they still work as expected. I just don't like the noise. Does > anyone have any suggestions as to what would cause Ruby or Watir to fail to > recognise the frame names like this? > > Is there some way that I can suppress these warnings? Since I'm not > trying to access these frames anyways, I'd rather not be bothered by them. > > Paul. > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060225/d33ab31d/attachment.html From bret at pettichord.com Sat Feb 25 03:12:11 2006 From: bret at pettichord.com (Bret Pettichord) Date: Sat, 25 Feb 2006 02:12:11 -0600 Subject: [Wtr-general] (nested?) table access - need help. In-Reply-To: <AE918470A1BAB34B97D28AA43952D5E7010B4563@wt14px03.vicpolice.internal> References: <AE918470A1BAB34B97D28AA43952D5E7010B4563@wt14px03.vicpolice.internal> Message-ID: <ade75c5b0602250012p844aebnb2a570e5688d6342@mail.gmail.com> Comments inline below. On 2/19/06, Neri, Marco <marco.neri at police.vic.gov.au> wrote: > > Hi > > The developers on the application I'm testing have replaced a (menu) > table of url links with rad panel control ( a 3rd party js control from > telerik ). > > Using table = @ie.table(:index , i) in a loop, in the console I can see > > tabletype: > id: PersonLinks_collapsableLinks > name: > value: > disabled: false > rows: 34 > cols: 1 > > Using > row = @ie.table(:id , 'PersonLinks_collapsableLinks')[3] > puts(row[1].to_s) > > In the console I see ( ) > > Names (6) > Addresses (15) > Phone Numbers (6) > Photos (21) > Physical Descriptions (4) > Scars, Marks, Tattoos (10) > Miscellaneous IDs (1) > Contacts (1) > Dossier > Known Associates (0) > Criminal History > > Does this suggest that the one cell contains all of the items listed > above ? yes, although there may be a table in that cell... > What I was wanting to be able to do was access individual cell and then > use .fire_Event("onClick") on it to trigger the menu items. I managed to > get this to work for the 1st level of the menu ( details ). > > table = @ie.table(:id , 'PersonLinks_collapsableLinks') > table[3][0].flash > table[3][0].fire_event("onClick") > > The control then expands out the 2nd level of the menu with all of the > items listed above. > > By counting the <tr> in the src for the table I can see why the 34 rows. > This must also count up the nested tables? Yes. How can I access the nested table in order to access the row/cell within > that? I can't use id as that tag hasn't been defined for the nested > table ? If you use a recent tarball, you can do stuff like ie.table(:id, "foo")[0][1].table(:index, 1) to access a table inside a table. > thanks > > Src for the table is : > > </script><span id="PersonLinks_collapsableLinksStyleSheetHolder" > style="display:none"></span><script > type="text/javascript">RadPanelbarAppendStyleSheet('PersonLinks_collapsa > bleLinks', '/LEAP/Web/UI/Style/panelbar.css');</script><table > id="PersonLinks_collapsableLinks" cellspacing="0" cellpadding="0" > class="Panelbar" style="width:100%;visibility: hidden"> > <tr> > <td id="SUMMARY" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="HeaderSelected" style="width:100%;"> > <tr> > <td id="SUMMARY_Text" > style="width:100%;">Summary</td> > </tr> > </table></td> > </tr><tr> > <td id="DETAILS" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="HeaderCollapsed" style="width:100%;"> > <tr> > <td id="DETAILS_Text" > style="width:100%;">Details</td> > </tr> > </table></td> > </tr><tr style="display: none"><td valign="top" > id="DETAILS_Panel" style="white-space: nowrap; width: 100%; display: > none"><table cellspacing="0" cellpadding="0" width="100%"> > <tr> > <td id="NAMES" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="NAMES_Text" > style="width:100%;">Names (6)</td> > </tr> > </table></td> > </tr><tr> > <td id="ADDRESSES" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="ADDRESSES_Text" > style="width:100%;">Addresses (15)</td> > </tr> > </table></td> > </tr><tr> > <td id="PHONES" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="PHONES_Text" > style="width:100%;">Phone Numbers (6)</td> > </tr> > </table></td> > </tr><tr> > <td id="IMAGES" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="IMAGES_Text" > style="width:100%;">Photos (21)</td> > </tr> > </table></td> > </tr><tr> > <td id="DESCRIPTIONS" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="DESCRIPTIONS_Text" > style="width:100%;">Physical Descriptions (4)</td> > </tr> > </table></td> > </tr><tr> > <td id="TATTOOS" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="TATTOOS_Text" > style="width:100%;">Scars, Marks, Tattoos (10)</td> > </tr> > </table></td> > </tr><tr> > <td id="MISCELLANEOUSIDS" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="MISCELLANEOUSIDS_Text" > style="width:100%;">Miscellaneous IDs (1)</td> > </tr> > </table></td> > </tr><tr> > <td id="CONTACTS" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="CONTACTS_Text" > style="width:100%;">Contacts (1)</td> > </tr> > </table></td> > </tr><tr> > <td id="DOSSIER" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="DOSSIER_Text" > style="width:100%;">Dossier</td> > </tr> > </table></td> > </tr><tr> > <td id="KNOWNASSOCIATES" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="KNOWNASSOCIATES_Text" > style="width:100%;">Known Associates (0)</td> > </tr> > </table></td> > </tr><tr> > <td id="CRIMINALHISTORY" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="CRIMINALHISTORY_Text" > style="width:100%;">Criminal History</td> > </tr> > </table></td> > </tr> > </table></td></tr><tr> > <td id="INVOLVEMENTS" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="HeaderCollapsed" style="width:100%;"> > <tr> > <td id="INVOLVEMENTS_Text" > style="width:100%;">Involvements</td> > </tr> > </table></td> > </tr><tr style="display: none"><td valign="top" > id="INVOLVEMENTS_Panel" style="white-space: nowrap; width: 100%; > display: none"><table cellspacing="0" cellpadding="0" width="100%"> > <tr> > <td id="INTERESTFLAGS" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="INTERESTFLAGS_Text" > style="width:100%;">Interest Flags (8)</td> > </tr> > </table></td> > </tr><tr> > <td id="NAMEWHEREABOUTS" > style="white-space:nowrap;width:100%;"><table cellspacing="0" > cellpadding="0" class="ItemCollapsed" style="width:100%;"> > <tr> > <td id="NAMEWHEREABOUTS_Text" > style="width:100%;">Whereabouts (2)</td> > </tr> > </table></td> > </tr> > </table></td></tr> > </table> > > > ======================================================= > The information contained in this email and any files attached may > be confidential information to the intended recipient and may be > the subject of legal professional privilege or public interest immunity. > > If you are not the intended recipient, any use, disclosure or copying is > unauthorised. > > If you have received this document in error please telephone 1300 307 082 > > ******************************************************************* > This footnote also confirms that this email message has been swept > for the presence of computer viruses. > ******************************************************************* > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060225/eec87f52/attachment.html From saudaziz at gmail.com Sat Feb 25 13:29:12 2006 From: saudaziz at gmail.com (saud aziz) Date: Sat, 25 Feb 2006 10:29:12 -0800 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <ade75c5b0602241606h6606545eh140462c650e4c8b2@mail.gmail.com> References: <24d0cb380602220913r3d926578uaa0049f0c3d02456@mail.gmail.com> <ade75c5b0602241606h6606545eh140462c650e4c8b2@mail.gmail.com> Message-ID: <24d0cb380602251029w6b139250n898b52a350ee40df@mail.gmail.com> Thanks Bret. That did work and just by changing image to button i was able to go all the way.. One thing i don't understand is that if you view source, it renders it as <input type="image"> but using it as button works? Why would that be the case? Following is how it renders in Firefox 1.5 <h4>Step 3: Check out</h4> <p style="width: 350px;"> Review your order and submit payment information. </p> <br> <input name="template:ib_GetStarted" id="template_ib_GetStarted" src="../../../../_img/button/subs/getstarted.gif" alt="Get Started" border="0" type="image"> and in IE 7 beta as well: <h4>Step 3: Check out</h4> <p style="width:350px;"> Review your order and submit payment information. </p> <br /> <input type="image" name="template:ib_GetStarted" id="template_ib_GetStarted" src="../../../../_img/button/subs/getstarted.gif" alt="Get Started" border="0" /> And you are right on the money that recorder is not perfect, actually far from it. But it does help in recording the path and after doing that i can easily add more code for asserts, logging and what not manually. On 2/24/06, Bret Pettichord <bret at pettichord.com> wrote: > > The "image" on the page is actually a button. The recorder that you used > to create the script has a bug, which you should report back to the creator > of the recorder. > > Also there is a ton of crap in this script, also presumably generated by > the recorder. For example, i can see no reason to have successive calls to > ie.goto in a script. The extra crud in the script appears to have confused > the discussion of this problem. > > The following script works for me (note that i trimmed your script and > changed the final call from ie.image to ie.button): > > require 'watir' > include Watir > require 'test/unit' > class TC_recorded < Test::Unit::TestCase > def test_recorded > ie = IE.new > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx%27> > ) > ie.button(:name, 'template:ib_GetStarted').click > end > end > > If you still are having problems please send us a short bit of code that > you think should work ( i.e. not something that you don't understand that > was generated by a recorder). > > This is not the correct forum to look for help in debugging other peoples > recorders. You will need to contact them directly for help. > > Bret > > On 2/22/06, saud aziz <saudaziz at gmail.com> wrote: > > > Hi guys, > > > > When i try to run the following script, it just hangs and never clicks > > through the respective image buttons on site. Can someone run and tell me if > > it works for them? Or how i could possibly modify it to make it run? Another > > thing noticeable is that when you run this from command prompt, it sometimes > > doesn't even display the buttons that you are supposed to click on at all. > > So for instance on page ' > > http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx' you > > might not find button that says get started and you can make it appear only > > if you press refresh/reload for browser. > > > > I am running latest version of Watir and Ruby available to General > > Public. Any help is much appreciated. > > > > require 'watir' > > include Watir > > require 'test/unit' > > class TC_recorded < Test::Unit::TestCase > > def test_recorded > > ie = IE.new > > ie.goto('https://www.seattlesymphony.org/' > > <https://www.seattlesymphony.org/%27>) > > #ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/').click<http://www.seattlesymphony.org/symphony/buy/subs/%27%29.click> > > #ie.goto('javascript:bakeCookie()') > > #ie.button(:alt, 'New Subscription').click > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx%27> > > ) > > ie.image(:name, 'template:ib_GetStarted').click > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1%27> > > ) > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150' > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150%27> > > ) > > ie.button(:alt, 'Select This Series').click > > ie.radio(:name, 'Section','73').set() > > ie.button(:alt, 'Add This Series To My Cart').click > > ie.button(:alt, 'Browse Series').click > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2' > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > > ) > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27> > > ) > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3' > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3%27> > > ) > > ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx').click > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx%27%29.click> > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2' > > > > <http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2%27> > > ) > > ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176'<http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176%27> > > ) > > ie.button(:alt, 'Select This Series').click > > ie.radio(:name, 'Section','62').set() > > ie.button(:alt, 'Add This Series To My Cart').click > > ie.button(:alt, 'Continue To Next Step').click > > end > > end > > > > Any help is much appreciated. obviously it is not even complete script, > > but if you can get past 'ie.button(:alt, 'Select This Series').click' > > this step, then it would be great to know. For me it just hangs and does > > nothing, no errors, nada. > > > > > > > > > > > > -- > > Saud Aziz > > > > "Whenever you find yourself on the side of the majority, it is time to > > pause and reflect." - Mark Twain > > > > > > > > > > _______________________________________________ > > 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 > > -- Saud Aziz "Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060225/cc1ea1b3/attachment.html From bret at pettichord.com Sat Feb 25 15:35:03 2006 From: bret at pettichord.com (Bret Pettichord) Date: Sat, 25 Feb 2006 14:35:03 -0600 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <24d0cb380602251029w6b139250n898b52a350ee40df@mail.gmail.com> References: <24d0cb380602220913r3d926578uaa0049f0c3d02456@mail.gmail.com> <ade75c5b0602241606h6606545eh140462c650e4c8b2@mail.gmail.com> <24d0cb380602251029w6b139250n898b52a350ee40df@mail.gmail.com> Message-ID: <ade75c5b0602251235r324066a4l4745d430b17ab931@mail.gmail.com> On 2/25/06, saud aziz <saudaziz at gmail.com> wrote: > > Thanks Bret. That did work and just by changing image to button i was able > to go all the way.. > > One thing i don't understand is that if you view source, it renders it as > <input type="image"> but using it as button works? Why would that be the > case? There are two different things in HTML. One is an image tag. It is represented as <img blah blah blah> The other is an image input. It is represented as <input type="image" blah blah>. Text fields, file files, buttons, check boxes, etc are all examples of different kinds of input types. It would be easy to extend Watir to support these input images with, say, ie.image_button(blah) or ie.image_input(blah) in addition to the existing support in ie.button(blah). I'm thinking making this a separate type would key users that there were two types of images and that they had to use the right type with Water. Even better would be to make Watir's ie.image(blah) work with either kind, but that would more work and may lead to other complications. I also see that we don't have any unit tests for this kind of image. We should. Bret <input name="template:ib_GetStarted" id= > "template_ib_GetStarted" src="../../../../_img/button/subs/getstarted.gif" alt= > "Get Started" border="0" type="image"> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060225/0bd636d7/attachment.html From philipreedtech at gmail.com Sat Feb 25 20:06:15 2006 From: philipreedtech at gmail.com (philip reed) Date: Sat, 25 Feb 2006 20:06:15 -0500 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <ade75c5b0602251235r324066a4l4745d430b17ab931@mail.gmail.com> References: <24d0cb380602220913r3d926578uaa0049f0c3d02456@mail.gmail.com> <ade75c5b0602241606h6606545eh140462c650e4c8b2@mail.gmail.com> <24d0cb380602251029w6b139250n898b52a350ee40df@mail.gmail.com> <ade75c5b0602251235r324066a4l4745d430b17ab931@mail.gmail.com> Message-ID: <f462129b0602251706y1f161782v9d8e3677dd6cef4@mail.gmail.com> On 2/25/06, Bret Pettichord <bret at pettichord.com> wrote: > It would be easy to extend Watir to support these input images with, say, > ie.image_button(blah) or ie.image_input(blah) in addition to the existing > support in ie.button(blah). I'm thinking making this a separate type would > key users that there were two types of images and that they had to use the > right type with Wat[i]r. FWIW, I had exactly this misunderstanding and spent an hour or so trying to figure out why Watir wouldn't click the image. Then I realized precisely what Bret said about the term "image" being overloaded in HTML, tried button, and all was well. One advantage of having an alias image_button is that a search on the doc for /image/ (e.g., bringing the RDoc up in the browser and searching on my best guess at the appropriate method name) would match image_button. So I'd cast my vote for that simple solution. If making image.click work for input images wouldn't cause complications then so much the better, but just having a documented method image_button would probably prevent a "gotcha" for a few of us poor souls. JMO. Thanks, Philip From mb at michaelbolton.net Sat Feb 25 23:11:57 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Sat, 25 Feb 2006 23:11:57 -0500 Subject: [Wtr-general] Script hangs and does nothing In-Reply-To: <ade75c5b0602251235r324066a4l4745d430b17ab931@mail.gmail.com> Message-ID: <00c201c63a8a$c94073a0$6601a8c0@Koko> HTML doesn't have buttons; it has inputs with types of "image" or "button" or "submit". I've never understood why WATIR doesn't track (at least via aliases) HTML's conventions: input(:img, "blah").click input(:button, "foo").click input(:submit, "bar").click ---Michael B. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: February 25, 2006 3:35 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Script hangs and does nothing On 2/25/06, saud aziz <saudaziz at gmail.com> wrote: Thanks Bret. That did work and just by changing image to button i was able to go all the way.. One thing i don't understand is that if you view source, it renders it as <input type="image"> but using it as button works? Why would that be the case? There are two different things in HTML. One is an image tag. It is represented as <img blah blah blah> The other is an image input. It is represented as <input type="image" blah blah>. Text fields, file files, buttons, check boxes, etc are all examples of different kinds of input types. It would be easy to extend Watir to support these input images with, say, ie.image_button(blah) or ie.image_input(blah) in addition to the existing support in ie.button(blah). I'm thinking making this a separate type would key users that there were two types of images and that they had to use the right type with Water. Even better would be to make Watir's ie.image(blah) work with either kind, but that would more work and may lead to other complications. I also see that we don't have any unit tests for this kind of image. We should. Bret <input name="template:ib_GetStarted" id= "template_ib_GetStarted" src="../../../../_img/button/subs/getstarted.gif" alt= "Get Started" border="0" type="image"> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060225/5e799362/attachment.html From bret at pettichord.com Sun Feb 26 02:44:41 2006 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 26 Feb 2006 01:44:41 -0600 Subject: [Wtr-general] Input element names in Watir, was Re: Script hangs and does nothing Message-ID: <ade75c5b0602252344r2df35062ib39ae514b8f356ca@mail.gmail.com> As a general rule, Watir tries to follow HTML as regards terminology. But i don't understand your suggestion. On 2/25/06, Michael Bolton <mb at michaelbolton.net> wrote: > > HTML doesn't have buttons; it has inputs with types of "image" or "button" > or "submit". I've never understood why WATIR doesn't track (at least via > aliases) HTML's conventions: > > input(:img, "blah").click > > input(:button, "foo").click > > input(:submit, "bar").click > I can't tell whether you intend "blah", "foo" and "bar" to represent names or id's or text or something else. So this syntax can't work. The parallel thing to do would be... ie.input(:type, "image").click Except that here we get no place to say which image button we want. One solution would be if watir allowed mulitple attributes, but so far it doesn't. And even still it runs into the problem that you want to have different methods for a file input than an image input than a checkbox. The most convenient and understandable way to do this is by representing these different kinds of things as separate classes (and factory methods) in Watir. I think a more rational way to support these in Watir and follow the HTML structure would be to support factory methods (and classes) for every one of these different types. Thus: Tag Watir 1.4 New <input type=image> button image_input <input type=text> text_field text_input <input type=file> field_field file_input <input type=submit> button submit_input <input type=button> button button_input <input type=checkbox> check_box checkbox_input <input type=hidden> hidden hidden_input <input type=password> text_field password_input <input type=radio> radio radio_input <input type=reset> button reset_input <input type=textarea> text_field textarea_input But even here i start to get confused, because looking at Watir's tests, as well as the HTML specs, the correct tag for textarea (a multiline input field) is <textarea> and yet the Watir code that supports as part of the TextField object actually looks for <input type=textarea>. And a similar confusing is also in play for <select> vs <input type=select-one> or <input type=select-multiple> and now i am wondering whether IE is transmogrifying the HTML from the one form to the other.... In any case, i would be happy to support a more logical system if i could actually get a logical explanation of what the HTML is that we need to support actually is (and why Watir's support for one thing actually works with another). Of course we would continue to support the Watir 1.4 factory methods going forward regardless. Bret -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060226/5dc705d5/attachment.html From bcarlso at gmail.com Sun Feb 26 10:03:55 2006 From: bcarlso at gmail.com (Brandon Carlson) Date: Sun, 26 Feb 2006 09:03:55 -0600 Subject: [Wtr-general] Can I run arbitrary JavaScript functions from Watir? Message-ID: <19cb0cc70602260703v10dc87d5oadbc4240b222ee9a@mail.gmail.com> For example: <html> <head> <script> function foo() { alert("foo()"); } </script> </head> <body/> </html> I would like to write a Watir script that can call this function directly. From bret at pettichord.com Sun Feb 26 11:43:11 2006 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 26 Feb 2006 10:43:11 -0600 Subject: [Wtr-general] Can I run arbitrary JavaScript functions from Watir? In-Reply-To: <19cb0cc70602260703v10dc87d5oadbc4240b222ee9a@mail.gmail.com> References: <19cb0cc70602260703v10dc87d5oadbc4240b222ee9a@mail.gmail.com> Message-ID: <ade75c5b0602260843j299248c0r29fa1db3a99299d7@mail.gmail.com> You can use fire_event to trigger events on elements. And you can bind events to javascript functions. So create an invisible element (say, a div), bind your function to some event and then use Watir to trigger the event. Bret On 2/26/06, Brandon Carlson <bcarlso at gmail.com> wrote: > > For example: > > <html> > <head> > <script> > function foo() { > alert("foo()"); > } > </script> > </head> > <body/> > </html> > > I would like to write a Watir script that can call this function directly. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060226/2083f04b/attachment.html From christopher_brown at engin.com.au Sun Feb 26 16:32:34 2006 From: christopher_brown at engin.com.au (Brown, Christopher) Date: Mon, 27 Feb 2006 08:32:34 +1100 Subject: [Wtr-general] xpath support doesn't work for me Message-ID: <B0D561E4E514F447AA08B65C957C8CB402390277@MI_EXCH1> Hi Angrez, I've follwoed your steps and get a similar result (1 failure) when I run core_tests.rb. A couple of strange things. 1. I seem to have an extra test 2. the IE window is opened then immediately closed. Is this normal? This is what I get: Finished in 171.406 seconds. 1) Failure: test_http_errors(TC_Navigate) [./unittests/navigate_test.rb:51]: <Watir::Exception::NavigationException> exception expected but none was thrown. 172 tests, 991 assertions, 1 failures, 0 errors Anyway, I'm trying to run the following code just to get things started require 'watir' ie = Watir::IE.start(" http://localhost/index.asp <http://localhost/index.asp> ") ie.element_by_xpath("//map[@id='top_menu_map']/area[contains(@href , 'signup.htm')]/").click The browser opens to the correct page but I get the following error web_pages>ruby trial.rb C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1922:in `elements_by_xpath': undefined method `elements' for nil:NilClass (NoMethodError) from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1912:in `element_by_xpath' from trial.rb:5 I suspect there is something wrong with my xpath value. My xpath skills are more than a little rusty so I've used XPath Explorer ( http://www.purpletech.com/xpe/ <http://www.purpletech.com/xpe/> ). I also tried ie.element_by_xpath("//area[contains(@href , 'signup.htm')]/").click and get the same result. Any ideas what I could be doing wrong? Regards Chris -----Original Message----- From: Angrez Singh [mailto:angrez at gmail.com] Sent: Friday, February 24, 2006 10:09 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] xpath support doesn't work for me Hi Chris, I installed 'watir' from the tar ball. Steps I followed: 1. Manually copied 'watir.rb' & 'watir' folder to [ruby installation directory]/lib/ruby/site_ruby/1.8/ 2. Manually copied 'doc', 'examples', 'unittests' folders to [watir installation directory] I was able to run the core tests successfullly. $ruby core_tests.rb Loaded suite core_tests Started ............................................................................ ............................................................................ .................... Finished in 88.906 seconds. 172 tests, 991 assertions, 0 failures, 0 errors But when I tried to run xpath_tests.rb or all_tests.rb I got lots of exceptions & errors. One thing that was strange was two IE instances were getting opened when I tried to run any of these files. Then one got closed & there were lot of failures each was saying 'The object invoked has disconnected from its clients.'. So what I think is the IE instance that was closed (don't know how) was the correct IE that was being referenced in the tests. The IE instance that remained open (don't know how it got opened) is the one that is not used anywhere in the scripts. Anyways, successful run of core_tests.rb indicates that xpath is working fine because xpath unit tests are also included in the core tests. Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060227/9eca7da2/attachment.html From angrez at gmail.com Sun Feb 26 23:27:17 2006 From: angrez at gmail.com (Angrez Singh) Date: Mon, 27 Feb 2006 09:57:17 +0530 Subject: [Wtr-general] xpath support doesn't work for me In-Reply-To: <B0D561E4E514F447AA08B65C957C8CB402390277@MI_EXCH1> References: <B0D561E4E514F447AA08B65C957C8CB402390277@MI_EXCH1> Message-ID: <e26bda3e0602262027u58395fcas4cb8ec498642f727@mail.gmail.com> Hi Chris, > web_pages>ruby trial.rb > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1922:in `elements_by_xpath': > undefined method `elements' for nil:NilClass (NoMethodError) > from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1912:in > `element_by_xpath' > from trial.rb:5 > Did you get an 'error.xml' file in the folder from where you are executing the trial.rb? There is nothing wrong with the XPath query. Could you please send me the HTML & code that you are trying to execute? Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060227/4a42e881/attachment.html From christopher_brown at engin.com.au Mon Feb 27 14:46:13 2006 From: christopher_brown at engin.com.au (Brown, Christopher) Date: Tue, 28 Feb 2006 06:46:13 +1100 Subject: [Wtr-general] xpath support doesn't work for me Message-ID: <B0D561E4E514F447AA08B65C957C8CB40239027C@MI_EXCH1> Hi Angrez, This is is the code I'm trying to run require 'watir' ie = Watir::IE.start("http://dev/index.asp") ie.element_by_xpath("//map[@id='top_menu_map']/area[6]/").click() I've tried various modifications to the XPath but what you see above is what I get from the XPath browser and even though I haven't done much with XPAth recently it looks okay to me. I've attached the error.xml file. I can't see anything to suggest there is a problem Let me know what you reckon. Regards Chris -----Original Message----- From: Angrez Singh [mailto:angrez at gmail.com] Sent: Monday, February 27, 2006 3:27 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] xpath support doesn't work for me Hi Chris, web_pages>ruby trial.rb C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1922:in `elements_by_xpath': undefined method `elements' for nil:NilClass (NoMethodError) from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1912:in `element_by_xpath' from trial.rb:5 Did you get an 'error.xml' file in the folder from where you are executing the trial.rb? There is nothing wrong with the XPath query. Could you please send me the HTML & code that you are trying to execute? Regards, Angrez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060228/0c59c7f2/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: error.xml Type: application/octet-stream Size: 4177 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20060228/0c59c7f2/attachment.obj From tester.paul at gmail.com Mon Feb 27 16:23:53 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Mon, 27 Feb 2006 16:23:53 -0500 Subject: [Wtr-general] HTML Page Size and Load times Message-ID: <37c405480602271323h3888e715k@mail.gmail.com> Hi there, I'm currently writing a script that will walk through our site map and spit out a list of page sizes and load times to a text file. Using the Watir examples I found a function that gets the html page and I guessed that you could get the length using: > puts ie.html.length This spits out a number that is not quite what I expected - it's a bit low. So, I output what the function gets (e.g. using "puts ie.html") and I copied it to a text file. I then went to the web browser and used View > Page Source and saved the output to a different file. Comparing the page outputs I got the following numbers: > ie.html.length = 12653 > File size of original Page source = 14260 bytes Visually comparing these files, I found that when you use View > Page Source from the browser, you get the whole Page HTML, but when you use the Watir " ie.html" method, you get a stripped down version of the page html. For example, the Header info is absent as well as any pretty indenting. That might be good for when I need to parse the file and get specific info out of it, but not when I need to know the exact page size. Is there a way that I can use Watir or Ruby to collect the *whole* page html? Incidentally, someone once mentioned to me that there is a down_load_time attribute, but I can't find any info on it anywhere. Is there a reference in the Watir API or elsewhere that can tell me what methods and attributes are available for working with the HTML pages? Thanks. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060227/0cbd2408/attachment.html From mb at michaelbolton.net Mon Feb 27 17:10:07 2006 From: mb at michaelbolton.net (Michael Bolton) Date: Mon, 27 Feb 2006 17:10:07 -0500 Subject: [Wtr-general] HTML Page Size and Load times In-Reply-To: <37c405480602271323h3888e715k@mail.gmail.com> Message-ID: <02b201c63bea$91d52990$6601a8c0@Koko> Incidentally, someone once mentioned to me that there is a down_load_time attribute, but I can't find any info on it anywhere. Is there a reference in the Watir API or elsewhere that can tell me what methods and attributes are available for working with the HTML pages? For load time try load_time = ie.goto('http://www.SomePageForWhichYouWantTheLoadTime.com') ---Michael B. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060227/908e8ab9/attachment.html From marco.neri at police.vic.gov.au Mon Feb 27 18:13:19 2006 From: marco.neri at police.vic.gov.au (Neri, Marco) Date: Tue, 28 Feb 2006 10:13:19 +1100 Subject: [Wtr-general] interesting behavior of require in my TestSuitetorun test cases in a sequential order... Message-ID: <AE918470A1BAB34B97D28AA43952D5E7010B4573@wt14px03.vicpolice.internal> I've been trying to get cruise control to work as per Yury's blog http://blogs.byte-force.com/buggins/archive/2005/11/29/704.aspx Based on the example in the blog I have a testsuite.rb with a straight copy / paste of Yury's code. # This part is all of old code to run tests. # (It just picks all test cases from a directory - they start with "tc_") require 'test/unit' Dir['ts_*.rb'].each { |testCase| puts(testCase) } # this is to see the order of ts files Dir['tc_*.rb'].each { |testCase| require testCase } # This is the new part to replace autorunner.rb which would start otherwise. # It should save the resulting XML to a directory named "TestResults". require 'XMLRunner' XMLRunner::report_to 'TestResults' I then have 2 files in the same dir. TS_1.rb and TS_2.rb TS_1.rb: require 'test/unit' require 'TC_LoadHome3.rb' TS_2.rb require 'test/unit' require 'TC_LoadHome2.rb' LoadHome3 is exact same test as LoadHome2 only that it is setup so an assertion fails. I run the testsuite ( either from cmd or CC force build ) and I see that the line Dir['tc_*.rb'].each { |testCase| require testCase } Prints out TS_1.rb and TS_2.rb in order but the tests execute in order of TC_LoadHome2.rb 1st and then TC_LoadHome3.rb. The same also applies if I was to config TS_1.rb to be require 'test/unit' require 'TC_LoadHome3.rb' require 'TC_LoadHome2.rb' Using the example on http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.h tml I can setup a class and specify the order eg. class TS_MyTests def self.suite suite = Test::Unit::TestSuite.new suite << TC_test000.suite suite << TC_test001.suite suite << TC_test004.suite return suite end end Test::Unit::UI::Console::TestRunner.run(TS_MyTests) This works. ( for me ). Has anyone else come up with another any other method to have the tests execute in the desired order ? -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Michael Bolton Sent: Sunday, 8 January 2006 07:13 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] interesting behavior of require in my TestSuitetorun test cases in a sequential order... Looks to me like they're running in alphabetical order. But why are you using /require/ instead of calling them? ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Roy Sin Sent: January 5, 2006 8:45 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] interesting behavior of require in my TestSuite torun test cases in a sequential order... Hi Wtr, I have a few classes, each class is a test case for a Report and I'm trying to run them all together in a TestSuite. Here is my reports_testsuite.rb : require 'login' # run Test Cases in the order listed below require 'stopRpt_test' require 'landmarkSumRpt_test' require 'mileageSumRpt_test' ... But when i ran it, landmarkSumRpt runs first follow by mileageSumRpt , then the last one is StopRpt. I even tried to prefix with 'test1_stopRpt_test' 'test2_landmarkSumRpt_test' 'test3_mileageSumRpt_test' but still test1_stopRpt_test will run last. I also puts a text at the beginning of each of my test cases to know when each one starts but instead I get: Stop Report Test Case running... Landmark Summary Test Case running... Mileage Summary Test Case running... Loaded suite C:/TestAutomation/workspace/QA_TestAutomation/gmmsunittests_Staging/repo rts/ reports_testsuite1 Started Has anyone experience this type of situation? thanks __________________________________________ Yahoo! DSL - Something to write home about. Just $16.99/mo. or less. dsl.yahoo.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 _____________________________________________________________________ This e-mail has been scanned for viruses by MCI's Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com ======================================================= The information contained in this email and any files attached may be confidential information to the intended recipient and may be the subject of legal professional privilege or public interest immunity. If you are not the intended recipient, any use, disclosure or copying is unauthorised. If you have received this document in error please telephone 1300 307 082 ******************************************************************* This footnote also confirms that this email message has been swept for the presence of computer viruses. ******************************************************************* From marco.neri at police.vic.gov.au Mon Feb 27 18:48:14 2006 From: marco.neri at police.vic.gov.au (Neri, Marco) Date: Tue, 28 Feb 2006 10:48:14 +1100 Subject: [Wtr-general] thoughts on how to setup custom command line parameters? Message-ID: <AE918470A1BAB34B97D28AA43952D5E7010B4575@wt14px03.vicpolice.internal> Hi I'd like to be able to specify additional command line parameters. Eg url ( dev or sys test envs ), a directory to dump results to, a flag to close (or not) the browser at the finish of a test. What I'm using at the moment is ARGV[] Eg @test_site = ARGV[0] Problem with this is that the order is fixed and it also seems to break the -b flag to run the browser minimised. If I was to read in the ARGV and then parse the tokens using a regex that would solve my fixed order problem but what about the -b flag? I'd appreciate any suggestions. Thanks Marco ======================================================= The information contained in this email and any files attached may be confidential information to the intended recipient and may be the subject of legal professional privilege or public interest immunity. If you are not the intended recipient, any use, disclosure or copying is unauthorised. If you have received this document in error please telephone 1300 307 082 ******************************************************************* This footnote also confirms that this email message has been swept for the presence of computer viruses. ******************************************************************* From jared at kilmore.info Mon Feb 27 19:25:49 2006 From: jared at kilmore.info (Jared Quinert) Date: Tue, 28 Feb 2006 11:25:49 +1100 Subject: [Wtr-general] thoughts on how to setup custom command line parameters? In-Reply-To: <AE918470A1BAB34B97D28AA43952D5E7010B4575@wt14px03.vicpolice.internal> References: <AE918470A1BAB34B97D28AA43952D5E7010B4575@wt14px03.vicpolice.internal> Message-ID: <4403988D.7030104@kilmore.info> I think you can edit watir.rb to make the default state invisible. Would that help? You can then explicitly make it visible within your script if you need it to be. I know I've done this in the past. Jared Neri, Marco wrote: >Hi > >I'd like to be able to specify additional command line parameters. Eg >url ( dev or sys test envs ), a directory to dump results to, a flag to >close (or not) the browser at the finish of a test. > >What I'm using at the moment is ARGV[] > >Eg @test_site = ARGV[0] > >Problem with this is that the order is fixed and it also seems to break >the -b flag to run the browser minimised. > >If I was to read in the ARGV and then parse the tokens using a regex >that would solve my fixed order problem but what about the -b flag? > >I'd appreciate any suggestions. > >Thanks > >Marco > > > > >======================================================= >The information contained in this email and any files attached may >be confidential information to the intended recipient and may be >the subject of legal professional privilege or public interest immunity. > >If you are not the intended recipient, any use, disclosure or copying is >unauthorised. > >If you have received this document in error please telephone 1300 307 082 > >******************************************************************* >This footnote also confirms that this email message has been swept >for the presence of computer viruses. >******************************************************************* > > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > From philipreedtech at gmail.com Mon Feb 27 20:49:13 2006 From: philipreedtech at gmail.com (philip reed) Date: Mon, 27 Feb 2006 20:49:13 -0500 Subject: [Wtr-general] thoughts on how to setup custom command line parameters? In-Reply-To: <AE918470A1BAB34B97D28AA43952D5E7010B4575@wt14px03.vicpolice.internal> References: <AE918470A1BAB34B97D28AA43952D5E7010B4575@wt14px03.vicpolice.internal> Message-ID: <f462129b0602271749m755d956eu8108fb00fd2f4837@mail.gmail.com> Marco, Perhaps I'm not understanding your question, but I believe the standard Ruby library optparse is intended to solve the problems you cite with passing command-line parameters: http://www.ruby-doc.org/stdlib/libdoc/optparse/rdoc/index.html I've used it a bit on a non-Watir Ruby project I'm hacking around with, and it's pretty nice once you get the hang of it. Sorry if I'm answering the wrong question. Philip On 2/27/06, Neri, Marco <marco.neri at police.vic.gov.au> wrote: > Hi > > I'd like to be able to specify additional command line parameters. Eg > url ( dev or sys test envs ), a directory to dump results to, a flag to > close (or not) the browser at the finish of a test. > > What I'm using at the moment is ARGV[] > > Eg @test_site = ARGV[0] > > Problem with this is that the order is fixed and it also seems to break > the -b flag to run the browser minimised. > > If I was to read in the ARGV and then parse the tokens using a regex > that would solve my fixed order problem but what about the -b flag? > > I'd appreciate any suggestions. > > Thanks > > Marco > > > > > ======================================================= > The information contained in this email and any files attached may > be confidential information to the intended recipient and may be > the subject of legal professional privilege or public interest immunity. > > If you are not the intended recipient, any use, disclosure or copying is > unauthorised. > > If you have received this document in error please telephone 1300 307 082 > > ******************************************************************* > This footnote also confirms that this email message has been swept > for the presence of computer viruses. > ******************************************************************* > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- Philip Reed, Developer Positronic Design http://www.positronicdesign.com 617/319.5929 From bret at pettichord.com Mon Feb 27 21:09:16 2006 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 27 Feb 2006 20:09:16 -0600 Subject: [Wtr-general] HTML Page Size and Load times In-Reply-To: <37c405480602271323h3888e715k@mail.gmail.com> References: <37c405480602271323h3888e715k@mail.gmail.com> Message-ID: <ade75c5b0602271809r4b94a0eaxe8e7fdf7a28cccb5@mail.gmail.com> > > Visually comparing these files, I found that when you use View > Page > Source from the browser, you get the whole Page HTML, but when you use the > Watir " ie.html" method, you get a stripped down version of the page > html. For example, the Header info is absent as well as any pretty > indenting. The fact that the header info is absent is a bug in 1.4.1. It is fixed in HEAD. But the html you see in Watir has been parsed and then reconstituted, so it won't be exactly what you started with. You will, for example, lose your indenting. Incidentally, someone once mentioned to me that there is a down_load_time > attribute, but I can't find any info on it anywhere. Is there a reference > in the Watir API or elsewhere that can tell me what methods and attributes > are available for working with the HTML pages? Look under the "attributes" section of the doc for the Watir::IE class in the API documentation. http://wtr.rubyforge.org/rdoc/classes/Watir/IE.html Don't worry about missing this. Marick wrote a blog post describing how to add this functionality to Watir without realizing that it was already there. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060227/8f8af799/attachment.html From dara.lillis at kiodex.com Tue Feb 28 13:58:21 2006 From: dara.lillis at kiodex.com (Dara Lillis) Date: Tue, 28 Feb 2006 10:58:21 -0800 Subject: [Wtr-general] any way to make IE.text_field.set optional? Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E3A06CF@ehost011-27.exch011.intermedia.net> I'm passing a bunch of text arguments to a method, which will enter them in various fields in a web page. Problem is, I don't always want to enter all the fields, sometimes I only want to enter some of them. Is there an argument I can pass that will tell text_field.set to ignore that particular one? simplified example: def enter_text(arg1, arg2, arg3) @ie.text_field(:name, 'field1').set(arg1) @ie.text_field(:name, 'field2').set(arg2) @ie.text_field(:name, 'field3').set(arg3) end Sometimes I will want to enter all 3, but I want to be able to call this method and, say, enter only arg2 and arg3. I've tried passing nil or '' but neither works. I know I can write some code to make this work but I feel I must be missing something obvious, am I? Thanks, -Dara -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060228/801b4c09/attachment.html From ctrainor at interac.org Tue Feb 28 16:29:01 2006 From: ctrainor at interac.org (Charlie Trainor) Date: Tue, 28 Feb 2006 16:29:01 -0500 Subject: [Wtr-general] any way to make IE.text_field.set optional? Message-ID: <49EE4085F2E38D47AC70EF04AA5582A7085FE4@ITOREX3.interac.local> You could add a few simple "unless" clauses, e.g. def enter_text(arg1, arg2, arg3) @ie.text_field(:name, 'field1').set(arg1) unless arg1.nil? @ie.text_field(:name, 'field2').set(arg2) unless arg2.nil? @ie.text_field(:name, 'field3').set(arg3) unless arg3.nil? end - Charlie -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]On Behalf Of Dara Lillis Sent: Tuesday, February 28, 2006 1:58 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] any way to make IE.text_field.set optional? I'm passing a bunch of text arguments to a method, which will enter them in various fields in a web page. Problem is, I don't always want to enter all the fields, sometimes I only want to enter some of them. Is there an argument I can pass that will tell text_field.set to ignore that particular one? simplified example: def enter_text(arg1, arg2, arg3) @ie.text_field(:name, 'field1').set(arg1) @ie.text_field(:name, 'field2').set(arg2) @ie.text_field(:name, 'field3').set(arg3) end Sometimes I will want to enter all 3, but I want to be able to call this method and, say, enter only arg2 and arg3. I've tried passing nil or '' but neither works. I know I can write some code to make this work but I feel I must be missing something obvious, am I? Thanks, -Dara -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060228/85b3366e/attachment.html From marco.neri at police.vic.gov.au Tue Feb 28 17:31:45 2006 From: marco.neri at police.vic.gov.au (Neri, Marco) Date: Wed, 1 Mar 2006 09:31:45 +1100 Subject: [Wtr-general] thoughts on how to setup custom command lineparameters? Message-ID: <AE918470A1BAB34B97D28AA43952D5E7010B4577@wt14px03.vicpolice.internal> Hey Philip Thanks for the link to optparse. There's 1 example in the API that I should be able to copy/hack as a start. thanks M -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of philip reed Sent: Tuesday, 28 February 2006 12:49 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] thoughts on how to setup custom command lineparameters? Marco, Perhaps I'm not understanding your question, but I believe the standard Ruby library optparse is intended to solve the problems you cite with passing command-line parameters: http://www.ruby-doc.org/stdlib/libdoc/optparse/rdoc/index.html I've used it a bit on a non-Watir Ruby project I'm hacking around with, and it's pretty nice once you get the hang of it. Sorry if I'm answering the wrong question. Philip On 2/27/06, Neri, Marco <marco.neri at police.vic.gov.au> wrote: > Hi > > I'd like to be able to specify additional command line parameters. Eg > url ( dev or sys test envs ), a directory to dump results to, a flag > to close (or not) the browser at the finish of a test. > > What I'm using at the moment is ARGV[] > > Eg @test_site = ARGV[0] > > Problem with this is that the order is fixed and it also seems to > break the -b flag to run the browser minimised. > > If I was to read in the ARGV and then parse the tokens using a regex > that would solve my fixed order problem but what about the -b flag? > > I'd appreciate any suggestions. > > Thanks > > Marco > > > > > ======================================================= > The information contained in this email and any files attached may be > confidential information to the intended recipient and may be the > subject of legal professional privilege or public interest immunity. > > If you are not the intended recipient, any use, disclosure or copying > is unauthorised. > > If you have received this document in error please telephone 1300 307 > 082 > > ******************************************************************* > This footnote also confirms that this email message has been swept for > the presence of computer viruses. > ******************************************************************* > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- Philip Reed, Developer Positronic Design http://www.positronicdesign.com 617/319.5929 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ======================================================= The information contained in this email and any files attached may be confidential information to the intended recipient and may be the subject of legal professional privilege or public interest immunity. If you are not the intended recipient, any use, disclosure or copying is unauthorised. If you have received this document in error please telephone 1300 307 082 ******************************************************************* This footnote also confirms that this email message has been swept for the presence of computer viruses. *******************************************************************