[Wtr-general] I have a couple of questions...
I haven't gotten a computer setup with WATiR yet, but I wanted to see if I could get an answer before I got to it... #1 - If I do something like ie.link( :id, "blah" ) will it find the link regardless of frame on the page? or do I have to add stuff to specify the frame & then the link within it... #2 - If an auth dialog pops up, can I fill in the fields @ run time ... I know if the browser shows the login as part of a web page, I can set the text and submit, but I want to know, if it's truly AUTH based HTTP, will it let me fill in THOSE? I know I can do that with information in the URL, but I want to know about the dialog option. j. -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I have a couple of questions...
Wow, thanks for the quick response ... So, with the .link or .frame or .blah calls, what do they return if it can't find the item ? or if it finds multiple? j. On 8/2/05, Paul Rogers <[EMAIL PROTECTED]> wrote: > 1. no - you must specify the frame, like > ie.frame(:index,2).link(:id,'blah').click > 2. yes, but you have to use the Autoit tool to help you, its not too > hard though. > > Paul > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Wood > Sent: 02 August 2005 20:37 > To: wtr-general@rubyforge.org > Subject: [Wtr-general] I have a couple of questions... > > > I haven't gotten a computer setup with WATiR yet, but I wanted to see if > I could get an answer before I got to it... > > #1 - If I do something like ie.link( :id, "blah" ) will it find the link > regardless of frame on the page? or do I have to add stuff to specify > the frame & then the link within it... > > #2 - If an auth dialog pops up, can I fill in the fields @ run time ... > > I know if the browser shows the login as part of a web page, I can set > the text and submit, but I want to know, if it's truly AUTH based HTTP, > will it let me fill in THOSE? > > I know I can do that with information in the URL, but I want to know > about the dialog option. > > j. > > -- > "So long, and thanks for all the fish" > > Jeff Wood > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I have a couple of questions...
I don't mind the return the first one ... But, it really would be beneficial to be able to say, I don't know which frame this is in ... ( I've got situations where the dev team I support is moving things around a LOT ) ... so, If I can just say, I know it's called "BLAH" then find it whereever, but I'm sure I can code that up myself ( I just see it as useful ). Thanks for the blazing results... As soon as I get my testing dialed in, I'm going to show this to the company I work for ... I think I can get a pretty major following for this. ( we're a mid-large sized eComm company located in Seattle ). >From what I've seen so far, WATiR looks like it's going to solve a LOT of problems for me. Thank you for developing it. j. On 8/2/05, Paul Rogers <[EMAIL PROTECTED]> wrote: > If it cant find it, it raises an ObjectNotFoundException. > If there are multiple, it returns the first one. There have been > suggestions we should raise an exception if there are multiple. Im not > sure, as there is nothing preventing you from having the same name or id > on html tags in the page. > > Paul > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Wood > Sent: 02 August 2005 20:58 > To: wtr-general@rubyforge.org > Subject: Re: [Wtr-general] I have a couple of questions... > > > Wow, thanks for the quick response ... > > So, with the .link or .frame or .blah calls, what do they return if it > can't find the item ? or if it finds multiple? > > j. > > On 8/2/05, Paul Rogers <[EMAIL PROTECTED]> wrote: > > 1. no - you must specify the frame, like > > ie.frame(:index,2).link(:id,'blah').click > > 2. yes, but you have to use the Autoit tool to help you, its not too > > hard though. > > > > Paul > > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Wood > > Sent: 02 August 2005 20:37 > > To: wtr-general@rubyforge.org > > Subject: [Wtr-general] I have a couple of questions... > > > > > > I haven't gotten a computer setup with WATiR yet, but I wanted to see > > if I could get an answer before I got to it... > > > > #1 - If I do something like ie.link( :id, "blah" ) will it find the > > link regardless of frame on the page? or do I have to add stuff to > > specify the frame & then the link within it... > > > > #2 - If an auth dialog pops up, can I fill in the fields @ run time > > ... > > > > I know if the browser shows the login as part of a web page, I can set > > > the text and submit, but I want to know, if it's truly AUTH based > > HTTP, will it let me fill in THOSE? > > > > I know I can do that with information in the URL, but I want to know > > about the dialog option. > > > > j. > > > > -- > > "So long, and thanks for all the fish" > > > > Jeff Wood > > > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > -- > "So long, and thanks for all the fish" > > Jeff Wood > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I have a couple of questions...
That would be cool. Iterators on ALL of the browser objects would be good. (frames, buttons, text_input, images, etc. ). j. On 8/2/05, Paul Rogers <[EMAIL PROTECTED]> wrote: > I want to add a frame iterator object as soon as I get the chance: > > Ie.frames.each {|f| } > > When that's, there, it would be simple for you to add your 'click a link > in any frame' method. It wont be this release though. > > Paul > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Wood > Sent: 02 August 2005 21:19 > To: wtr-general@rubyforge.org > Subject: Re: [Wtr-general] I have a couple of questions... > > > I don't mind the return the first one ... > > But, it really would be beneficial to be able to say, I don't know which > frame this is in ... ( I've got situations where the dev team I support > is moving things around a LOT ) ... so, If I can just say, I know it's > called "BLAH" then find it whereever, but I'm sure I can code that up > myself ( I just see it as useful ). > > Thanks for the blazing results... > > As soon as I get my testing dialed in, I'm going to show this to the > company I work for ... I think I can get a pretty major following for > this. ( we're a mid-large sized eComm company located in Seattle ). > > >From what I've seen so far, WATiR looks like it's going to solve a LOT > of problems for me. > > Thank you for developing it. > > j. > > > On 8/2/05, Paul Rogers <[EMAIL PROTECTED]> wrote: > > If it cant find it, it raises an ObjectNotFoundException. > > If there are multiple, it returns the first one. There have been > > suggestions we should raise an exception if there are multiple. Im not > > > sure, as there is nothing preventing you from having the same name or > > id on html tags in the page. > > > > Paul > > > > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Wood > > Sent: 02 August 2005 20:58 > > To: wtr-general@rubyforge.org > > Subject: Re: [Wtr-general] I have a couple of questions... > > > > > > Wow, thanks for the quick response ... > > > > So, with the .link or .frame or .blah calls, what do they return if it > > > can't find the item ? or if it finds multiple? > > > > j. > > > > On 8/2/05, Paul Rogers <[EMAIL PROTECTED]> wrote: > > > 1. no - you must specify the frame, like > > > ie.frame(:index,2).link(:id,'blah').click > > > 2. yes, but you have to use the Autoit tool to help you, its not too > > > > hard though. > > > > > > Paul > > > > > > -Original Message- > > > From: [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Wood > > > Sent: 02 August 2005 20:37 > > > To: wtr-general@rubyforge.org > > > Subject: [Wtr-general] I have a couple of questions... > > > > > > > > > I haven't gotten a computer setup with WATiR yet, but I wanted to > > > see if I could get an answer before I got to it... > > > > > > #1 - If I do something like ie.link( :id, "blah" ) will it find the > > > link regardless of frame on the page? or do I have to add stuff to > > > specify the frame & then the link within it... > > > > > > #2 - If an auth dialog pops up, can I fill in the fields @ run time > > > ... > > > > > > I know if the browser shows the login as part of a web page, I can > > > set > > > > > the text and submit, but I want to know, if it's truly AUTH based > > > HTTP, will it let me fill in THOSE? > > > > > > I know I can do that with information in the URL, but I want to know > > > > about the dialog option. > > > > > > j. > > > > > > -- > > > "So long, and thanks for all the fish" > > > > > > Jeff Wood > > > > > > ___ > > > Wtr-general mailing list > > > Wtr-general@rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > ___ > > > Wtr-general mailing list > > > Wtr-general@rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > -- > > "So long, and thanks for all the fish" > > >
Re: [Wtr-general] I have a couple of questions...
I'm not saying it's bad to be able to specify a frame ( I want x in y ) ... I'm saying, if you have more of a moving target, the ability to say I want x in whatever frame I can find it in ... I wouldn't want things that way, but I know of some dev teams that just can't leave anything alone, so you've go a large problem with supporting a moving target. j. On 8/2/05, Chris McMahon <[EMAIL PROTECTED]> wrote: > > But, it really would be beneficial to be able to say, I don't know > > which frame this is in ... ( I've got situations where the dev team I > > support is moving things around a LOT ) ... so, If I can just say, I > > know it's called "BLAH" then find it whereever, but I'm sure I can > > code that up myself ( I just see it as useful ). > > I've actually found that having to specify the frame in question turns > out to be a blessing, not a curse. It's easy enough to do, and it is > one of the features that really sets Watir apart from similar tools. > -Chris > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] I have a couple of questions...
Excellent. I look forward to getting my test system up and running. AutoIT was mentioned, is that a free thing or a pay thing ... Not that I have a problem with paying for things, but it is a sizable investment for a company the size of which I work for. j. On 8/2/05, Paul Rogers <[EMAIL PROTECTED]> wrote: > Most of those are already there ;-) > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Wood > Sent: 02 August 2005 21:43 > To: wtr-general@rubyforge.org > Subject: Re: [Wtr-general] I have a couple of questions... > > > That would be cool. > > Iterators on ALL of the browser objects would be good. (frames, buttons, > text_input, images, etc. ). > > j. > > On 8/2/05, Paul Rogers <[EMAIL PROTECTED]> wrote: > > I want to add a frame iterator object as soon as I get the chance: > > > > Ie.frames.each {|f| } > > > > When that's, there, it would be simple for you to add your 'click a > > link in any frame' method. It wont be this release though. > > > > Paul > > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Wood > > Sent: 02 August 2005 21:19 > > To: wtr-general@rubyforge.org > > Subject: Re: [Wtr-general] I have a couple of questions... > > > > > > I don't mind the return the first one ... > > > > But, it really would be beneficial to be able to say, I don't know > > which frame this is in ... ( I've got situations where the dev team I > > support is moving things around a LOT ) ... so, If I can just say, I > > know it's called "BLAH" then find it whereever, but I'm sure I can > > code that up myself ( I just see it as useful ). > > > > Thanks for the blazing results... > > > > As soon as I get my testing dialed in, I'm going to show this to the > > company I work for ... I think I can get a pretty major following for > > this. ( we're a mid-large sized eComm company located in Seattle ). > > > > >From what I've seen so far, WATiR looks like it's going to solve a > > >LOT > > of problems for me. > > > > Thank you for developing it. > > > > j. > > > > > > On 8/2/05, Paul Rogers <[EMAIL PROTECTED]> wrote: > > > If it cant find it, it raises an ObjectNotFoundException. If there > > > are multiple, it returns the first one. There have been suggestions > > > we should raise an exception if there are multiple. Im not > > > > > sure, as there is nothing preventing you from having the same name > > > or id on html tags in the page. > > > > > > Paul > > > > > > > > > -Original Message- > > > From: [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Wood > > > Sent: 02 August 2005 20:58 > > > To: wtr-general@rubyforge.org > > > Subject: Re: [Wtr-general] I have a couple of questions... > > > > > > > > > Wow, thanks for the quick response ... > > > > > > So, with the .link or .frame or .blah calls, what do they return if > > > it > > > > > can't find the item ? or if it finds multiple? > > > > > > j. > > > > > > On 8/2/05, Paul Rogers <[EMAIL PROTECTED]> wrote: > > > > 1. no - you must specify the frame, like > > > > ie.frame(:index,2).link(:id,'blah').click > > > > 2. yes, but you have to use the Autoit tool to help you, its not > > > > too > > > > > > hard though. > > > > > > > > Paul > > > > > > > > -Original Message- > > > > From: [EMAIL PROTECTED] > > > > [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Wood > > > > Sent: 02 August 2005 20:37 > > > > To: wtr-general@rubyforge.org > > > > Subject: [Wtr-general] I have a couple of questions... > > > > > > > > > > > > I haven't gotten a computer setup with WATiR yet, but I wanted to > > > > see if I could get an answer before I got to it... > > > > > > > > #1 - If I do something like ie.link( :id, "blah" ) will it find > > > > the link regardless of frame on the page? or do I have to add > > > > stuff to specify the frame & then the link within it... > > > > > > > > #2 - If an auth dialog pops up, can I fill
Re: RE: [Wtr-general] I have a couple of questions...
I think there should be 2 ... one for top level frames and one that is exhaustive. Not that both features are necessary out of the gate ... top level frames would be a good start . j. On 8/3/05, Paul Rogers <[EMAIL PROTECTED]> wrote: > ah, good point. Should it perhaps only iterate the top level frames? > > and if you wanted lower level frames, you would apply an iterator to that > frame. Seems like this way would save me work;-) But probably be less > intuiitive. > > - Original Message - > From: Bret Pettichord <[EMAIL PROTECTED]> > Date: Wednesday, August 3, 2005 2:35 am > Subject: RE: [Wtr-general] I have a couple of questions... > > > At 10:33 PM 8/2/2005, Paul Rogers wrote: > > >I want to add a frame iterator object as soon as I get the chance: > > > > > >Ie.frames.each {|f| } > > > > > >When that's, there, it would be simple for you to add your 'click > > a link > > >in any frame' method. It wont be this release though. > > > > > >Paul > > > > This will be harder than the other iterators because frame > > collections can > > be nested. If you only search document.frames[], you won't > > actually > > traverse all of the frames. > > > > > > > > _ > > Bret Pettichord > > www.pettichord.com > > > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Question: Javascript/CSS onClick?
ximum > > of 10 character."); > > frmLogin.pass.focus(); > >} else { > > frmLogin.submit(); > >} > > } > > > > > > function checkKey(){ > >if (window.event.keyCode == 13){ > > verifyUser(); > >} > > } > > > > > > > > > > > > -=-=- CSS -=-=- > > > > td.loginOnOver{ > > background-image: url(../graphics/logindown.jpg); > > height: 22px; > > width: 60px; > > cursor: hand; > > } > > > > td.loginOnOut{ > > background-image: url(../graphics/loginup.jpg); > > height: 22px; > > width: 60px; > > } > > > > > > > > -=-=- Test code to login (minus clicking the 'Log In' button) -=-=- > > > > require 'test/unit' > > #variables > > testSite = "http://192.168.5.5/login/"; > > #open the IE browser > > ie = IE.new > > > > ie.goto(testSite) > > > > puts "Entering user ID" > > ie.frame("main").frame("frmLogin").text_field(:name,"user").set("testeracct") > > puts "Entering user password" > > ie.frame("main").frame("frmLogin").text_field(:name,"pass").set("123456") > > puts "Clicking Log In button" > > > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] identify image links by their url?
I agree, assign unique ids for each image ... should make things quite a bit easier. j. On 8/3/05, Paul Rogers <[EMAIL PROTECTED]> wrote: > yep, but its best to use a reg exp, otherwise you need the full path: > > ie.image(:src , /some_pic.gif/).click > Content-class: urn:content-classes:message > Content-Type: multipart/alternative; > boundary="_=_NextPart_001_01C5980C.CA4F3156" > > > --_=_NextPart_001_01C5980C.CA4F3156 > Content-Type: text/plain; > charset="us-ascii" > Content-Transfer-Encoding: quoted-printable > > > > How can I click on an image-link using watir, if two images have the > same "alt"-text? Can I use their url? > > --_=_NextPart_001_01C5980C.CA4F3156 > Content-Type: text/html; > charset="us-ascii" > Content-Transfer-Encoding: quoted-printable > > > > > charset=3Dus-ascii"> > 6.5.7226.0"> > identify image links by their url? > > > > > > > How = > can I click on an image-link LANG=3D"de"> = > using watir LANG=3D"de">, = > if two images have the same LANG=3D"de"> FACE=3D"Arial">„ LANG=3D"de"> FACE=3D"Arial">al LANG=3D"de"> FACE=3D"Arial">t LANG=3D"de"> FACE=3D"Arial">” LANG=3D"de"> FACE=3D"Arial">-text? Can I use their url? LANG=3D"de"> > > > > --_=_NextPart_001_01C5980C.CA4F3156-- > > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Iterators
I agree, but what I would suggest for the handling of dynamic content is that, in the event that the block for an iterator causes a page (re)load, that an exception should be thrown kicking things OUT of the block ... PageContextChangedError or something like that... that way you can iterate happily as long as you don't cause a load, and if you do, you get kicked out of your iterator. ... makes sense to me. j. On 8/3/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > OK, well that means reworking the iterators -- i suggest we do this before > creating more. > > The problem with the current iterators is that they iterate over COM > objects, rather than over, say Watir::TextField objects (which is > implicitly what my example would require). This would require Wrapper > objects, like those we already have for Form. > > Personally, i think we should not be exposing COM objects, except as a > 'back door' to let people muck with the iternals -- we should not be > inviting people to mess with them. > > (Another issue with Iterators is that they can only iterate over a static > page. Thus the following code will fail > > > ie.buttons.each {| b | b.click if b.name == "foo" and b.title == "bar"} > > because a new page will load after clicking the button, making the buttons > iteration lose context. > > Bet > > At 08:09 AM 8/3/2005, Shao Kang Tat wrote: > >+1 :) > > > >I'd also put in a request for table cells...sometimes I work with > >tables that have more rows/columns than the row_count and column_count > >say they do. When I try a table[x][y].exists? I get an error > > > > > >On 8/3/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > > > At 10:42 PM 8/2/2005, Jeff Wood wrote: > > > >Iterators on ALL of the browser objects would be good. (frames, > > > >buttons, text_input, images, etc. ). > > > > > > Most of these are already in place. > > > > > > I have a question of my own. Would you like to see kind of thing work? > > > > > > target = nil > > > ie.text_fields.each {| tf | target = tf if tf.name == "foo" and tf.title > > > == "bar"} > > > target.set("hooray") if target > > > > > > Bret > > > > > > > > > _ > > > Bret Pettichord > > > www.pettichord.com > > > > > > ___ > > > Wtr-general mailing list > > > Wtr-general@rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > >___ > >Wtr-general mailing list > >Wtr-general@rubyforge.org > >http://rubyforge.org/mailman/listinfo/wtr-general > > _ > Bret Pettichord > www.pettichord.com > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Iterators
Also, I agree, the underlying COM shouldn't be exposed. j. On 8/3/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > OK, well that means reworking the iterators -- i suggest we do this before > creating more. > > The problem with the current iterators is that they iterate over COM > objects, rather than over, say Watir::TextField objects (which is > implicitly what my example would require). This would require Wrapper > objects, like those we already have for Form. > > Personally, i think we should not be exposing COM objects, except as a > 'back door' to let people muck with the iternals -- we should not be > inviting people to mess with them. > > (Another issue with Iterators is that they can only iterate over a static > page. Thus the following code will fail > > > ie.buttons.each {| b | b.click if b.name == "foo" and b.title == "bar"} > > because a new page will load after clicking the button, making the buttons > iteration lose context. > > Bet > > At 08:09 AM 8/3/2005, Shao Kang Tat wrote: > >+1 :) > > > >I'd also put in a request for table cells...sometimes I work with > >tables that have more rows/columns than the row_count and column_count > >say they do. When I try a table[x][y].exists? I get an error > > > > > >On 8/3/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > > > At 10:42 PM 8/2/2005, Jeff Wood wrote: > > > >Iterators on ALL of the browser objects would be good. (frames, > > > >buttons, text_input, images, etc. ). > > > > > > Most of these are already in place. > > > > > > I have a question of my own. Would you like to see kind of thing work? > > > > > > target = nil > > > ie.text_fields.each {| tf | target = tf if tf.name == "foo" and tf.title > > > == "bar"} > > > target.set("hooray") if target > > > > > > Bret > > > > > > > > > _ > > > Bret Pettichord > > > www.pettichord.com > > > > > > ___ > > > Wtr-general mailing list > > > Wtr-general@rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > >___ > >Wtr-general mailing list > >Wtr-general@rubyforge.org > >http://rubyforge.org/mailman/listinfo/wtr-general > > _ > Bret Pettichord > www.pettichord.com > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: RE: [Wtr-general] I have a couple of questions...
... will the new dialog functionality replace the AutoIT stuff as well ? On 8/3/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > Another complication of this is that some frame properties are not > accessible from the frame itself, but rather from its container. This is > because, internally, there is a Frame element and a Window element referred > to by the frame and contained in the Frames array. To see what i mean, look > at what i recently had to do to allow Frames to be accessed by id instead > of name -- kinda hairy. > > The design principle with Watir is that we try to make Watir be intuitive, > even if that means our code isn't a simple mapping to the OLE objects. > I fully agree with that, if all I wanted was access to the COM stuff, I could do that without WATiR. > Ultimately, i think we need to start taking a more experimental approach. > We need to be able to release an implementation and discuss it and modify > it, *before* we commit to supporting it. So, where/how is the repository ( SCM ) run now? I mean, if this is an experimentation thing, we need to get setup to go and pull source to try the experimental version, and leave the "release" version for the people that don't want to play with new features that will most likely change before release. > Right now i am working on new dialog support code. I think everyone will > like both the new API and the new functionality that will come with it. If > so, we then face what to do with the old WinClicker and WindowHandler code, > which i would like to deprecate. So, does this new functionality replace the AutoIT stuff or does it wrap it ... or what ??? > Bret > > At 10:27 AM 8/3/2005, Paul Rogers wrote: > >ah, good point. Should it perhaps only iterate the top level frames? > > > >and if you wanted lower level frames, you would apply an iterator to that > >frame. Seems like this way would save me work;-) But probably be less > >intuiitive. > > > >- Original Message - > >From: Bret Pettichord <[EMAIL PROTECTED]> > >Date: Wednesday, August 3, 2005 2:35 am > >Subject: RE: [Wtr-general] I have a couple of questions... > > > > > At 10:33 PM 8/2/2005, Paul Rogers wrote: > > > >I want to add a frame iterator object as soon as I get the chance: > > > > > > > >Ie.frames.each {|f| } > > > > > > > >When that's, there, it would be simple for you to add your 'click > > > a link > > > >in any frame' method. It wont be this release though. > > > > > > > >Paul > > > > > > This will be harder than the other iterators because frame > > > collections can > > > be nested. If you only search document.frames[], you won't > > > actually > > > traverse all of the frames. > > > > > > > > > > > > _ > > > Bret Pettichord > > > www.pettichord.com > > > > > > ___ > > > Wtr-general mailing list > > > Wtr-general@rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > >___ > >Wtr-general mailing list > >Wtr-general@rubyforge.org > >http://rubyforge.org/mailman/listinfo/wtr-general > > _ > Bret Pettichord > www.pettichord.com > > _______ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > I'm MORE than happy to help with coding as well. I'm not familiar with how things normally work with RubyForge projects ( or at the general open source level either ) ... I've mostly worked in closed source environments... But, I'd be GLAD to help make the current Best-In-Class solution the Best Solution Possible. j. -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: RE: [Wtr-general] I have a couple of questions...
No, I'm just trying to get ANY version installed on my box. I wasn't worried about the new stuff yet. I've just got a freshly imaged laptop and I'm trying to get things running. So, I am/was looking for ideas to help figure out why watir won't install. j. On 8/3/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > I haven't committed the new dialog code yet. You'll have to be a bit more > patient. > > Bret > > At 11:38 AM 8/3/2005, Jeff Wood wrote: > >... will the new dialog functionality replace the AutoIT stuff as well ? > > > >On 8/3/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > > > Another complication of this is that some frame properties are not > > > accessible from the frame itself, but rather from its container. This is > > > because, internally, there is a Frame element and a Window element > > > referred > > > to by the frame and contained in the Frames array. To see what i mean, > > > look > > > at what i recently had to do to allow Frames to be accessed by id instead > > > of name -- kinda hairy. > > > > > > The design principle with Watir is that we try to make Watir be intuitive, > > > even if that means our code isn't a simple mapping to the OLE objects. > > > > > > >I fully agree with that, if all I wanted was access to the COM stuff, > >I could do that without WATiR. > > > > > Ultimately, i think we need to start taking a more experimental approach. > > > We need to be able to release an implementation and discuss it and modify > > > it, *before* we commit to supporting it. > > > >So, where/how is the repository ( SCM ) run now? > > > >I mean, if this is an experimentation thing, we need to get setup to > >go and pull source to try the experimental version, and leave the > >"release" version for the people that don't want to play with new > >features that will most likely change before release. > > > > > Right now i am working on new dialog support code. I think everyone will > > > like both the new API and the new functionality that will come with it. If > > > so, we then face what to do with the old WinClicker and WindowHandler > > > code, > > > which i would like to deprecate. > > > >So, does this new functionality replace the AutoIT stuff or does it > >wrap it ... or what ??? > > > > > Bret > > > > > > At 10:27 AM 8/3/2005, Paul Rogers wrote: > > > >ah, good point. Should it perhaps only iterate the top level frames? > > > > > > > >and if you wanted lower level frames, you would apply an iterator to that > > > >frame. Seems like this way would save me work;-) But probably be less > > > >intuiitive. > > > > > > > >- Original Message - > > > >From: Bret Pettichord <[EMAIL PROTECTED]> > > > >Date: Wednesday, August 3, 2005 2:35 am > > > >Subject: RE: [Wtr-general] I have a couple of questions... > > > > > > > > > At 10:33 PM 8/2/2005, Paul Rogers wrote: > > > > > >I want to add a frame iterator object as soon as I get the chance: > > > > > > > > > > > >Ie.frames.each {|f| } > > > > > > > > > > > >When that's, there, it would be simple for you to add your 'click > > > > > a link > > > > > >in any frame' method. It wont be this release though. > > > > > > > > > > > >Paul > > > > > > > > > > This will be harder than the other iterators because frame > > > > > collections can > > > > > be nested. If you only search document.frames[], you won't > > > > > actually > > > > > traverse all of the frames. > > > > > > > > > > > > > > > > > > > > _ > > > > > Bret Pettichord > > > > > www.pettichord.com > > > > > > > > > > ___ > > > > > Wtr-general mailing list > > > > > Wtr-general@rubyforge.org > > > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > >___ > > > >Wtr-general mailing list > > > >Wtr-general@rubyforge.org > > > >http://rubyforge.org/mailman/listinfo/wtr-general > > > &g
Re: RE: [Wtr-general] I have a couple of questions...
Ok, I just ran the installer ( versions .15 & .14 ) and after I've gotten Ruby installed, when I run the watir installer ( install.rb ) it says it can't find Fox Any ideas? I'm running XP. j. On 8/3/05, Jeff Wood <[EMAIL PROTECTED]> wrote: > ... will the new dialog functionality replace the AutoIT stuff as well ? > > On 8/3/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > > Another complication of this is that some frame properties are not > > accessible from the frame itself, but rather from its container. This is > > because, internally, there is a Frame element and a Window element referred > > to by the frame and contained in the Frames array. To see what i mean, look > > at what i recently had to do to allow Frames to be accessed by id instead > > of name -- kinda hairy. > > > > The design principle with Watir is that we try to make Watir be intuitive, > > even if that means our code isn't a simple mapping to the OLE objects. > > > > I fully agree with that, if all I wanted was access to the COM stuff, > I could do that without WATiR. > > > Ultimately, i think we need to start taking a more experimental approach. > > We need to be able to release an implementation and discuss it and modify > > it, *before* we commit to supporting it. > > So, where/how is the repository ( SCM ) run now? > > I mean, if this is an experimentation thing, we need to get setup to > go and pull source to try the experimental version, and leave the > "release" version for the people that don't want to play with new > features that will most likely change before release. > > > Right now i am working on new dialog support code. I think everyone will > > like both the new API and the new functionality that will come with it. If > > so, we then face what to do with the old WinClicker and WindowHandler code, > > which i would like to deprecate. > > So, does this new functionality replace the AutoIT stuff or does it > wrap it ... or what ??? > > > Bret > > > > At 10:27 AM 8/3/2005, Paul Rogers wrote: > > >ah, good point. Should it perhaps only iterate the top level frames? > > > > > >and if you wanted lower level frames, you would apply an iterator to that > > >frame. Seems like this way would save me work;-) But probably be less > > >intuiitive. > > > > > >- Original Message - > > >From: Bret Pettichord <[EMAIL PROTECTED]> > > >Date: Wednesday, August 3, 2005 2:35 am > > >Subject: RE: [Wtr-general] I have a couple of questions... > > > > > > > At 10:33 PM 8/2/2005, Paul Rogers wrote: > > > > >I want to add a frame iterator object as soon as I get the chance: > > > > > > > > > >Ie.frames.each {|f| } > > > > > > > > > >When that's, there, it would be simple for you to add your 'click > > > > a link > > > > >in any frame' method. It wont be this release though. > > > > > > > > > >Paul > > > > > > > > This will be harder than the other iterators because frame > > > > collections can > > > > be nested. If you only search document.frames[], you won't > > > > actually > > > > traverse all of the frames. > > > > > > > > > > > > > > > > _ > > > > Bret Pettichord > > > > www.pettichord.com > > > > > > > > ___ > > > > Wtr-general mailing list > > > > Wtr-general@rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > >___ > > >Wtr-general mailing list > > >Wtr-general@rubyforge.org > > >http://rubyforge.org/mailman/listinfo/wtr-general > > > > _ > > Bret Pettichord > > www.pettichord.com > > > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > I'm MORE than happy to help with coding as well. I'm not familiar with > how things normally work with RubyForge projects ( or at the general > open source level either ) ... I've mostly worked in closed source > environments... > > But, I'd be GLAD to help make the current Best-In-Class solution the > Best Solution Possible. > > j. > > -- > "So long, and thanks for all the fish" > > Jeff Wood > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: RE: [Wtr-general] I have a couple of questions...
Actually the installer looks for both. j. On 8/3/05, Paul Rogers <[EMAIL PROTECTED]> wrote: > the latest version of ruby installs 'fox12' > I think the installer was written for 'fox' > > I cnat be certain as I dont have any code available right now. We would need > to fix this for the next release though > > Paul > > - Original Message - > From: Jeff Wood <[EMAIL PROTECTED]> > Date: Wednesday, August 3, 2005 12:38 pm > Subject: Re: RE: [Wtr-general] I have a couple of questions... > > > Ok, I just ran the installer ( versions .15 & .14 ) and after I've > > gotten Ruby installed, when I run the watir installer ( install.rb ) > > it says it can't find Fox > > > > Any ideas? I'm running XP. > > > > j. > > > > > > On 8/3/05, Jeff Wood <[EMAIL PROTECTED]> wrote: > > > ... will the new dialog functionality replace the AutoIT stuff > > as well ? > > > > > > On 8/3/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > > > > Another complication of this is that some frame properties are not > > > > accessible from the frame itself, but rather from its > > container. This is > > > > because, internally, there is a Frame element and a Window > > element referred > > > > to by the frame and contained in the Frames array. To see what > > i mean, look > > > > at what i recently had to do to allow Frames to be accessed by > > id instead > > > > of name -- kinda hairy. > > > > > > > > The design principle with Watir is that we try to make Watir > > be intuitive, > > > > even if that means our code isn't a simple mapping to the OLE > > objects.> > > > > > > > I fully agree with that, if all I wanted was access to the COM > > stuff,> I could do that without WATiR. > > > > > > > Ultimately, i think we need to start taking a more > > experimental approach. > > > > We need to be able to release an implementation and discuss it > > and modify > > > > it, *before* we commit to supporting it. > > > > > > So, where/how is the repository ( SCM ) run now? > > > > > > I mean, if this is an experimentation thing, we need to get > > setup to > > > go and pull source to try the experimental version, and leave the > > > "release" version for the people that don't want to play with new > > > features that will most likely change before release. > > > > > > > Right now i am working on new dialog support code. I think > > everyone will > > > > like both the new API and the new functionality that will come > > with it. If > > > > so, we then face what to do with the old WinClicker and > > WindowHandler code, > > > > which i would like to deprecate. > > > > > > So, does this new functionality replace the AutoIT stuff or does it > > > wrap it ... or what ??? > > > > > > > Bret > > > > > > > > At 10:27 AM 8/3/2005, Paul Rogers wrote: > > > > >ah, good point. Should it perhaps only iterate the top level > > frames?> > > > > > > >and if you wanted lower level frames, you would apply an > > iterator to that > > > > >frame. Seems like this way would save me work;-) But probably > > be less > > > > >intuiitive. > > > > > > > > > >- Original Message - > > > > >From: Bret Pettichord <[EMAIL PROTECTED]> > > > > >Date: Wednesday, August 3, 2005 2:35 am > > > > >Subject: RE: [Wtr-general] I have a couple of questions... > > > > > > > > > > > At 10:33 PM 8/2/2005, Paul Rogers wrote: > > > > > > >I want to add a frame iterator object as soon as I get > > the chance: > > > > > > > > > > > > > >Ie.frames.each {|f| } > > > > > > > > > > > > > >When that's, there, it would be simple for you to add > > your 'click > > > > > > a link > > > > > > >in any frame' method. It wont be this release though. > > > > > > > > > > > > > >Paul > > > > > > > > > > > > This will be harder than the other iterators because frame > > > > > > collections can > > > > > > be nested. If you only search document.f
Re: RE: [Wtr-general] I have a couple of questions...
Found the problem ... it installed fxruby under gems. So, it won't find it until require 'rubygems' is included at the top. j. On 8/3/05, Jeff Wood <[EMAIL PROTECTED]> wrote: > Actually the installer looks for both. > > j. > > On 8/3/05, Paul Rogers <[EMAIL PROTECTED]> wrote: > > the latest version of ruby installs 'fox12' > > I think the installer was written for 'fox' > > > > I cnat be certain as I dont have any code available right now. We would > > need to fix this for the next release though > > > > Paul > > > > - Original Message - > > From: Jeff Wood <[EMAIL PROTECTED]> > > Date: Wednesday, August 3, 2005 12:38 pm > > Subject: Re: RE: [Wtr-general] I have a couple of questions... > > > > > Ok, I just ran the installer ( versions .15 & .14 ) and after I've > > > gotten Ruby installed, when I run the watir installer ( install.rb ) > > > it says it can't find Fox > > > > > > Any ideas? I'm running XP. > > > > > > j. > > > > > > > > > On 8/3/05, Jeff Wood <[EMAIL PROTECTED]> wrote: > > > > ... will the new dialog functionality replace the AutoIT stuff > > > as well ? > > > > > > > > On 8/3/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > > > > > Another complication of this is that some frame properties are not > > > > > accessible from the frame itself, but rather from its > > > container. This is > > > > > because, internally, there is a Frame element and a Window > > > element referred > > > > > to by the frame and contained in the Frames array. To see what > > > i mean, look > > > > > at what i recently had to do to allow Frames to be accessed by > > > id instead > > > > > of name -- kinda hairy. > > > > > > > > > > The design principle with Watir is that we try to make Watir > > > be intuitive, > > > > > even if that means our code isn't a simple mapping to the OLE > > > objects.> > > > > > > > > > I fully agree with that, if all I wanted was access to the COM > > > stuff,> I could do that without WATiR. > > > > > > > > > Ultimately, i think we need to start taking a more > > > experimental approach. > > > > > We need to be able to release an implementation and discuss it > > > and modify > > > > > it, *before* we commit to supporting it. > > > > > > > > So, where/how is the repository ( SCM ) run now? > > > > > > > > I mean, if this is an experimentation thing, we need to get > > > setup to > > > > go and pull source to try the experimental version, and leave the > > > > "release" version for the people that don't want to play with new > > > > features that will most likely change before release. > > > > > > > > > Right now i am working on new dialog support code. I think > > > everyone will > > > > > like both the new API and the new functionality that will come > > > with it. If > > > > > so, we then face what to do with the old WinClicker and > > > WindowHandler code, > > > > > which i would like to deprecate. > > > > > > > > So, does this new functionality replace the AutoIT stuff or does it > > > > wrap it ... or what ??? > > > > > > > > > Bret > > > > > > > > > > At 10:27 AM 8/3/2005, Paul Rogers wrote: > > > > > >ah, good point. Should it perhaps only iterate the top level > > > frames?> > > > > > > > >and if you wanted lower level frames, you would apply an > > > iterator to that > > > > > >frame. Seems like this way would save me work;-) But probably > > > be less > > > > > >intuiitive. > > > > > > > > > > > >- Original Message - > > > > > >From: Bret Pettichord <[EMAIL PROTECTED]> > > > > > >Date: Wednesday, August 3, 2005 2:35 am > > > > > >Subject: RE: [Wtr-general] I have a couple of questions... > > > > > > > > > > > > > At 10:33 PM 8/2/2005, Paul Rogers wrote: > > > > > > > >I want to add a frame iterator object as soon as I get > > > the chance: > > > > > &
Re: RE: [Wtr-general] I have a couple of questions...
It's working wonderfully now. So, is there a good online tutorial for the AutoIT stuff? j. On 8/3/05, Jeff Wood <[EMAIL PROTECTED]> wrote: > Found the problem ... it installed fxruby under gems. > > So, it won't find it until require 'rubygems' is included at the top. > > j. > > On 8/3/05, Jeff Wood <[EMAIL PROTECTED]> wrote: > > Actually the installer looks for both. > > > > j. > > > > On 8/3/05, Paul Rogers <[EMAIL PROTECTED]> wrote: > > > the latest version of ruby installs 'fox12' > > > I think the installer was written for 'fox' > > > > > > I cnat be certain as I dont have any code available right now. We would > > > need to fix this for the next release though > > > > > > Paul > > > > > > - Original Message - > > > From: Jeff Wood <[EMAIL PROTECTED]> > > > Date: Wednesday, August 3, 2005 12:38 pm > > > Subject: Re: RE: [Wtr-general] I have a couple of questions... > > > > > > > Ok, I just ran the installer ( versions .15 & .14 ) and after I've > > > > gotten Ruby installed, when I run the watir installer ( install.rb ) > > > > it says it can't find Fox > > > > > > > > Any ideas? I'm running XP. > > > > > > > > j. > > > > > > > > > > > > On 8/3/05, Jeff Wood <[EMAIL PROTECTED]> wrote: > > > > > ... will the new dialog functionality replace the AutoIT stuff > > > > as well ? > > > > > > > > > > On 8/3/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > > > > > > Another complication of this is that some frame properties are not > > > > > > accessible from the frame itself, but rather from its > > > > container. This is > > > > > > because, internally, there is a Frame element and a Window > > > > element referred > > > > > > to by the frame and contained in the Frames array. To see what > > > > i mean, look > > > > > > at what i recently had to do to allow Frames to be accessed by > > > > id instead > > > > > > of name -- kinda hairy. > > > > > > > > > > > > The design principle with Watir is that we try to make Watir > > > > be intuitive, > > > > > > even if that means our code isn't a simple mapping to the OLE > > > > objects.> > > > > > > > > > > > I fully agree with that, if all I wanted was access to the COM > > > > stuff,> I could do that without WATiR. > > > > > > > > > > > Ultimately, i think we need to start taking a more > > > > experimental approach. > > > > > > We need to be able to release an implementation and discuss it > > > > and modify > > > > > > it, *before* we commit to supporting it. > > > > > > > > > > So, where/how is the repository ( SCM ) run now? > > > > > > > > > > I mean, if this is an experimentation thing, we need to get > > > > setup to > > > > > go and pull source to try the experimental version, and leave the > > > > > "release" version for the people that don't want to play with new > > > > > features that will most likely change before release. > > > > > > > > > > > Right now i am working on new dialog support code. I think > > > > everyone will > > > > > > like both the new API and the new functionality that will come > > > > with it. If > > > > > > so, we then face what to do with the old WinClicker and > > > > WindowHandler code, > > > > > > which i would like to deprecate. > > > > > > > > > > So, does this new functionality replace the AutoIT stuff or does it > > > > > wrap it ... or what ??? > > > > > > > > > > > Bret > > > > > > > > > > > > At 10:27 AM 8/3/2005, Paul Rogers wrote: > > > > > > >ah, good point. Should it perhaps only iterate the top level > > > > frames?> > > > > > > > > >and if you wanted lower level frames, you would apply an > > > > iterator to that > > > > > > >frame. Seems like this way would save me work;-) But probably > > > > be less > > >
Re: [Wtr-general] Watir 1.4 is released
What is the normal process for upgrading from one version to the next ... just install the new one? or, what? j. On 8/3/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > The Web Testing in Ruby group is pleased to announce the release of Watir > 1.4. Watir is a Ruby Library for automating web applications using the > Internet Explorer browser. > > http://rubyforge.org/frs/?group_id=104&release_id=2579 > > This release contains many bug fixes and new features. > > - fix method name for accessing class name of P/Span/Div (change from style > to class_name) > - fix for bug 2152 (frame index in show_frames off by 1) > - added alt as a property to image > - added file_fields > - fixed TextArea#to_s > - moved reset button to buttons class > - add IE#send_keys > - frames can now be referenced using regexps and ids > - added IE#minimize, IE#maximize, IE#restore > - onChange and onBlur events now triggered by TextField#set > - added default option to set for checkbox > - added colspan method to tablecell > - fix for bug reported by Scott P, wrong objects are sometimes found > - fixed bug with radio/checkboxes doing multiple fireevents > - fix for table, id and reg exp > - wait for page load before returning from IE.attach > - update to select_list -- new interface still in progress > - added .show method to iterators > - fix for flashing objects in table cells > - added flash for forms > - flash returns nil instead of the curious '10' > - removed ScreenCapture module from IE class > > _ > Bret Pettichord > www.pettichord.com > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] IE Security Dialog box (HTTP basic Authentification/Watir)
Within the WATiR distribution there are a number of examples as well as an extensive unit test directory. If you look in the unit tests for WinHelper ... it will show you what you are after. Basically, you need to create a Thread that runs WinHelper and use it's logon method ( which provides it with the title of the window to watch and the username & password to use in the dialog )... Then in a separate thread actuall cause your IE object to go to the URL . It's pretty simple and as I said there is an example of this within the WATiR unit tests. The code isn't hard to follow. j. On 8/8/05, Juan Pablo Mattenet <[EMAIL PROTECTED]> wrote: > > > Hi, > > I'm new to watir and ruby, and I'm having the following issue: > > The application under test uses HTTP basic authetification for the login. > > This causes IE to put up a dialog box requesting the user and password. > > And I don't know how to manipulate this particular window from Watir > > > a search in the maillist has returned this post: > > http://rubyforge.org/pipermail/wtr-general/2005-March/001081.html > > Is this the current way (using WinClicker)? > > Where I can download the WinClicker? > > Regards, > > JP > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] problems with 1.3.1
I've got a situation where I'm doing the whole dual-thread thing for WinHelper ... but, sometimes it doesn't like it if there is already a window open ... If I close all of my IE windows then run the script it seems to be happier. Also, sometimes, in the login fields from the auth dialog, sometimes the text is garbled... Is this stuff that's fixed in 1.4 ? and, I haven't seen any documentation on how to upgrade between versions... Should I simple blow out my lib/ruby/1.8/watir directory and do another install? Let me know... Thanks. -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] problems with 1.3.1
So, Is there a clean way to deal with some of the things I'm running into ? Is there anything I can do to help with any of these kinds of things? j. On 8/10/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > At 12:59 PM 8/10/2005, Jeff Wood wrote: > >Is this stuff that's fixed in 1.4 ? > > No. > > >and, I haven't seen any documentation on how to upgrade between versions... > > > >Should I simple blow out my lib/ruby/1.8/watir directory and do another > >install? > > Yes. > > > _ > Bret Pettichord > www.pettichord.com > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] choose file window
using alt codes ... like hold alt and type 0254 ( and release alt )... that's how you type extended characters. j. On 8/11/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > At 03:41 AM 8/11/2005, Neumann, Carsten - ENCOWAY wrote: > >May be he doesn t find it because in my German Windows version this window > >is called: Datei auswählen > > > >Can that be the reason? > > I think this is it. We have another report from a french speaker: > > > http://rubyforge.org/tracker/index.php?func=detail&aid=1713&group_id=104&atid=487 > > Can you tell me how to create a string that contains an a-umlaut if i don't > have a german keyboard? > > > > _ > Bret Pettichord > www.pettichord.com > > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] What WATIR can do?
Tuyet Cong-Ton-Nu wrote: Some questions came up during a demo of WATIR. Our automation team would like to know whether WATIR can do the following functions: 1. Launch external applications from a test script such as Excel, Word, etc. 2. Include variables, functions, web/window declarations and/or additional test cases from other test scripts (E.g. – “uses”, “script:”) 3. File I/O (E.g. – Logging, test input/output data, expected results, etc.) 4. Exception handling (WATIR errors distinguished from system or OS errors) 5. Customizable result states (E.g. – warnings) 6. Command line support (launch, quit, run one, run multiple, output) 7. Access & scope declarations (private, public, protected, friend, etc.) 8. Integrates & interacts directly w/ desktop applications & Operating System on some level (command line? Process id? Can it tell the OS of the machine running WATIR is Win2K or XP, etc.) 9. Change script to trap System Error when table is not accessible 10. Investigate launching 2 scripts at the same time (use two different instances of IE) I believe most of the answers are YES, but I am not sure about 4, 8 & 9. Your answers are appreciated. Thanks. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Ok, #1 - Understand that WATiR is simply a library for Ruby ... since your scripts are all ruby programs you have access to everything Ruby can get to ... Ruby under Windows has the Win32Ole library which means it can talk with any COM enabled application. #2 - Again, scripts are Ruby based, you can pull functionality from multiple files together as well as database connectivity, command-line arguments, environment variables, etc. #3 - ... same answer, Ruby has File I/O. #4 - Yes, WATiR has it's own exception mechanisms that wrap application exceptions from Internet Explorer. #5 - ... I guess I need more specifics about what you are looking for. Programs have exit values just like a C application. Ruby also has a built in logging class that allows for differing levels of information to all be output to the same file... Warnings vs Errors vs Informational messages. Ruby also has built in support in the standard object library for xUnit style test case and test suite objects. #6 - ... I guess I need more specifics on this one too... You can kick off ruby scripts or, if you installed from the one-click installer, you can simply double click a script to run it. As far as run-one, run-all, etc ... well, that's up to whatever command-line options you program into your applications. But, again, fully-featured programming language, you should find everything you are looking for. #7 - Ruby has access specifiers and an Object inheritance model that should be more than sufficient for you, it even implements some things ( like mix-ins ) that you probably aren't used to. #8 - Ruby has access to the running environment which provides information about the running version of windows. You can run separate programs as separate processes ( child or otherwise ). #9 - Ruby has exception handling and you can simply wrap the call attempting to access a specific table/whatever with that error-handler and watch for the error that is raised when that situation occurs. #10 - Yes, WATiR supports multiple distinct IE processes... Each invocation of IE.new creates a new/distinct window. Let me know if I didn't answer any of your points to your satisfaction. j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] next steps
Bret Pettichord wrote: I wanna hear from the WET guys on this. Satti? Raghu? There are two parts of the problem. 1. Just click the buttons and working the controls. WET has this licked. 2. Avoiding the thread-locking. WET uses a method similar to our IE#remote_eval. But i have ideas on how to make this better. Bret At 05:36 PM 8/17/2005, Jonathan Kohl wrote: > 4. rip out winclicker and autoit and use wet/winobjects > instead +100 We need a good solution for modal dialog boxes, alerts, popups, etc. This is the feature I get asked about most frequently (even just a couple of hours ago). -Jonathan > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] On Behalf Of Bret > Pettichord > Sent: August 17, 2005 4:32 PM > To: wtr-general@rubyforge.org > Subject: [Wtr-general] next steps > > 1. finish purging all camelCase names in methods and local > and instance variables. > 2. finish renaming stuff that has the wrong name (like all > the references to containers called 'ieController') 3. > separate logic for locating objects (get_object) so it can be > configured separately without having to what the WET people > did (change overriding syntax). > 4. rip out winclicker and autoit and use wet/winobjects > instead 5. make it so that anything that be a container; > refactor different methods currently used for this (frames & forms) > > and then > > 6. defer invokation of COM calls until necessary > > I've been pushing us this way for a while and believe that it > is more important than ever. The simplest example of what > this means is that code like this will work: > > table = ie.frame(:name, 'foo').table(:index, 4) > # do stuff > table[3][4].button(:index, 1).click > > This is convenient and often what casual users expect. > Currently watir supports this to one level only. > > Once we have this, this gives us a platform that we can do > several other > things: > a. invoke method in a separate process, so we never run into > thread blocking problems again. > b. invoke selenium or xcom/mozilla or another browser-driving > technology instead of IE/COM c. attach a logger so we get > cheap, decent, accurate logging > > > > _ > Bret Pettichord > www.pettichord.com > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _ Bret Pettichord www.pettichord.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general So, when are the two projects simply going to merge? I mean, it sounds like all of the involved parties wouldn't mind... j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] installer issues
Jonathan Kohl wrote: I am getting some emails reporting a couple of issues. The first is from folks trying to install Watir with Ruby 182-15. They get an error message about the installer not being able to find Fox. Looks like Fox is now installed as a Gem, so one must also require rubygems in the installer. We should figure out a way to clean this up; I'm wondering how many new users are running into this, not telling us and moving on in frustration. Here are two issues that were last emailed to me: I installed the 182-15 one-click Ruby build to start. When I tried to install watir using install.rb, the install failed because the Fox gui libraries couldn't be found. This seems likely to be a problem with the ruby installation not working correctly. The installer mentioned something about running a "command line" version of the installer, but it wasn't obvious where that might be and your documentation didn't mention anything about it either. So, I figured that 182-15 was shot just like 182-13 is. :) - After downloading and installing 182-14, I was able to get the watir installer to start up and run. However, during the installation, I got a dialog saying that a LoadLibrary("c:\Programs") failed (or something to that effect). This is because I installed Ruby in "C:\Program Files\Ruby" and watir in "C:\Program Files\Ruby\watir" initially (since I don't like to clutter up C:\ and D:\). I'm guessing that the load library call can't handle the space in the directory name. This could be a watir install problem (improper string quoting/escaping) or a ruby load library problem I guess. These have been popping up on the email list as well lately. Any thoughts or ideas on fixes? Thanks; -Jonathan ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general The problem is quite easy to fix, simply add require 'rubygems' right before the require 'fox' line Everything works from there. j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] installer issues
Bret Pettichord wrote: I just installed Ruby 182-15 and then Watir 1.4 and did not have any problems. All the unit tests (but the three frame tests -- a known issue) ran without problem. I did not need to add require 'rubygems'. I'm pretty sure that Fox was a gem in 182-14 as well. The second problem cited below, regarding LoadLibrary not working when there are spaces, would not be a Watir problem. But a Ruby problem. If someone wants to track this down, they should report it to the Ruby Installer team. If we confirm this doesn't work, i suppose we could update our install docs. For a while now, installing Ruby sets environment variable RUBYOPT to rubygems. If someone did not have administrator privileges then they would not get this setting and i could imagine that they would run into problems like those detailed below. * You must install as administrator on Windows NT, 2000, and XP in order for path and environment variable settings to take effect. So far, i haven't taken the time to understand how Ruby and Watir work in a non-administrator environment and haven't taken the time to support it. I see that this is not documented in the readme, so i can update that. If someone wants to investigate running watir and ruby in a non-admin environment and give a detailed report as to whether it can be made to work, that would be appreciated. Do we want to support this kind of environment? Wouldn't this mean that ruby would not be in your path? Sounds like a headache to me. Several people have suggested that we replace our current Watir installer with a nullsoft installer (in addition to creating a Gem). I think that's the general direction i'd like to move, rather than try to bulletproof our current installer (which is admitedly shaky). If there are more reports of problems, i would like to see them. Actual error messages and details as to exactly when they occur would be extremely helpful. Bret P.S. Since i teach classes on effective bug reporting, i thought i might cite the second report below as a particular good example of a common mistake than many people make in their bug reports. It is vague on specifics around the actual error message ("or something to that effect") and long on guesses as to what the source of the problem might be. At 10:32 PM 8/18/2005, Jeff Wood wrote: Jonathan Kohl wrote: I am getting some emails reporting a couple of issues. The first is from folks trying to install Watir with Ruby 182-15. They get an error message about the installer not being able to find Fox. Looks like Fox is now installed as a Gem, so one must also require rubygems in the installer. We should figure out a way to clean this up; I'm wondering how many new users are running into this, not telling us and moving on in frustration. Here are two issues that were last emailed to me: I installed the 182-15 one-click Ruby build to start. When I tried to install watir using install.rb, the install failed because the Fox gui libraries couldn't be found. This seems likely to be a problem with the ruby installation not working correctly. The installer mentioned something about running a "command line" version of the installer, but it wasn't obvious where that might be and your documentation didn't mention anything about it either. So, I figured that 182-15 was shot just like 182-13 is. :) - After downloading and installing 182-14, I was able to get the watir installer to start up and run. However, during the installation, I got a dialog saying that a LoadLibrary("c:\Programs") failed (or something to that effect). This is because I installed Ruby in "C:\Program Files\Ruby" and watir in "C:\Program Files\Ruby\watir" initially (since I don't like to clutter up C:\ and D:\). I'm guessing that the load library call can't handle the space in the directory name. This could be a watir install problem (improper string quoting/escaping) or a ruby load library problem I guess. These have been popping up on the email list as well lately. Any thoughts or ideas on fixes? Thanks; -Jonathan ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general The problem is quite easy to fix, simply add require 'rubygems' right before the require 'fox' line Everything works from there. j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _ Bret Pettichord www.pettichord.com
Re: [Wtr-general] installer issues
Bret Pettichord wrote: I just installed Ruby 182-15 and then Watir 1.4 and did not have any problems. All the unit tests (but the three frame tests -- a known issue) ran without problem. I did not need to add require 'rubygems'. I'm pretty sure that Fox was a gem in 182-14 as well. The second problem cited below, regarding LoadLibrary not working when there are spaces, would not be a Watir problem. But a Ruby problem. If someone wants to track this down, they should report it to the Ruby Installer team. If we confirm this doesn't work, i suppose we could update our install docs. For a while now, installing Ruby sets environment variable RUBYOPT to rubygems. If someone did not have administrator privileges then they would not get this setting and i could imagine that they would run into problems like those detailed below. * You must install as administrator on Windows NT, 2000, and XP in order for path and environment variable settings to take effect. So far, i haven't taken the time to understand how Ruby and Watir work in a non-administrator environment and haven't taken the time to support it. I see that this is not documented in the readme, so i can update that. If someone wants to investigate running watir and ruby in a non-admin environment and give a detailed report as to whether it can be made to work, that would be appreciated. Do we want to support this kind of environment? Wouldn't this mean that ruby would not be in your path? Sounds like a headache to me. Several people have suggested that we replace our current Watir installer with a nullsoft installer (in addition to creating a Gem). I think that's the general direction i'd like to move, rather than try to bulletproof our current installer (which is admitedly shaky). If there are more reports of problems, i would like to see them. Actual error messages and details as to exactly when they occur would be extremely helpful. Bret P.S. Since i teach classes on effective bug reporting, i thought i might cite the second report below as a particular good example of a common mistake than many people make in their bug reports. It is vague on specifics around the actual error message ("or something to that effect") and long on guesses as to what the source of the problem might be. At 10:32 PM 8/18/2005, Jeff Wood wrote: Jonathan Kohl wrote: I am getting some emails reporting a couple of issues. The first is from folks trying to install Watir with Ruby 182-15. They get an error message about the installer not being able to find Fox. Looks like Fox is now installed as a Gem, so one must also require rubygems in the installer. We should figure out a way to clean this up; I'm wondering how many new users are running into this, not telling us and moving on in frustration. Here are two issues that were last emailed to me: I installed the 182-15 one-click Ruby build to start. When I tried to install watir using install.rb, the install failed because the Fox gui libraries couldn't be found. This seems likely to be a problem with the ruby installation not working correctly. The installer mentioned something about running a "command line" version of the installer, but it wasn't obvious where that might be and your documentation didn't mention anything about it either. So, I figured that 182-15 was shot just like 182-13 is. :) - After downloading and installing 182-14, I was able to get the watir installer to start up and run. However, during the installation, I got a dialog saying that a LoadLibrary("c:\Programs") failed (or something to that effect). This is because I installed Ruby in "C:\Program Files\Ruby" and watir in "C:\Program Files\Ruby\watir" initially (since I don't like to clutter up C:\ and D:\). I'm guessing that the load library call can't handle the space in the directory name. This could be a watir install problem (improper string quoting/escaping) or a ruby load library problem I guess. These have been popping up on the email list as well lately. Any thoughts or ideas on fixes? Thanks; -Jonathan ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general The problem is quite easy to fix, simply add require 'rubygems' right before the require 'fox' line Everything works from there. j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _ Bret Pettichord www.pettichord.com __
Re: [Wtr-general] installer issues
Zeljko Filipin wrote: Go to http://rubyforge.org/projects/wtr/ > Latest File Releases > scripting101 > Download or just click http://rubyforge.org/frs/?group_id=104&release_id=2516 . As far as I remember, there are materials that could help you. Zeljko From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Jeff Wood Sent: Friday, August 19, 2005 7:17 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] installer issues Bret, If you have any, I would really appreciate any materials you could send my way to help me teach a class on WATiR ... I'm sure I can some up with some, but if you have some already, it would save me time. I'm going to give a learning session on it, and I expect attendance to be between 100 & 200 people ( could be more )... So, as you can see, it gives me a great chance to evangelize & help get more folks in the ruby way ... Thanks in advance for your time. j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Thanks for the link ... I feel a bit dumb for not recogniting that package to be exactly that... So, the 101 stuff is based on WATiR 1.3.1 ... Is an update to 1.4 due ? or would that be a good thing to contribute back? j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] installer issues
Jeff Wood wrote: Zeljko Filipin wrote: Go to http://rubyforge.org/projects/wtr/ > Latest File Releases > scripting101 > Download or just click http://rubyforge.org/frs/?group_id=104&release_id=2516 . As far as I remember, there are materials that could help you. Zeljko From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Jeff Wood Sent: Friday, August 19, 2005 7:17 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] installer issues Bret, If you have any, I would really appreciate any materials you could send my way to help me teach a class on WATiR ... I'm sure I can some up with some, but if you have some already, it would save me time. I'm going to give a learning session on it, and I expect attendance to be between 100 & 200 people ( could be more )... So, as you can see, it gives me a great chance to evangelize & help get more folks in the ruby way ... Thanks in advance for your time. j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Thanks for the link ... I feel a bit dumb for not recogniting that package to be exactly that... So, the 101 stuff is based on WATiR 1.3.1 ... Is an update to 1.4 due ? or would that be a good thing to contribute back? j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Ok, I looked at that stuff ... and unfortunately ... It looks like this tutorial is meant as a day-long kinda class ... I only have 1-2 hours ... So, I'm going to include documentation on getting Ruby & WATiR installed under Windows ... And I'm going to show them irb and doing live testing with it. as well as using the Test::Unit framework. I'll do some simple tests of some of the web-based interfaces around the company. Thanks for the reference though. j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] finding text in a cell that contains a specified image?
I know it's a user preference game, but it's much more "the ruby way" to stay away from "for ... in ... " ... also, your range starts @ 1 ... what about row 0 ? Oh, and exists? is deprecated (1.4), you should get used to exist? how about, t.row_count.times do |i| theCell = t[i].find { |c| c.image( :src, xxx ).exist? } return theCell.text.strip if theCell end anyways, comments are welcome. j. On 8/19/05, Shao Kang Tat <[EMAIL PROTECTED]> wrote: > I'm doing something similar. But I'm not dealing with images, rather > links and texts, so I'd imagine the code would be similar to the one > I"m using and would work: > > > ie.tables.each do|t| # since you don't have ID's, look at every table > for i in 1..t.row_count # for every row in this table > > # for every column in this row, look at its contents > t[i].each{|c| if c.image(:src, xxx).exists? # if true, this > is your cell > return c.text.strip > } > end > end > > > > > > > > On 8/19/05, Warren Pollans <[EMAIL PROTECTED]> wrote: > > Hello again, > > > > Could some please point me to a way of finding text in a cell that > > contains a specified image? There are no ids available for the table, > > row or cell :-( - and there are several tables on the page. There is > > only one cell (at a time) that contains this particular image - the > > text in the cell is displaying status that I'm trying to capture. This > > status msg can occur in one of four different tables - depending on > > which form on the page is submitted - the same image is used in all > > cases. > > > > I think I want to walk through the DOM looking for a td element that has > > "img src=xxx" - I imagine there's a simpler watir way :-) > > > > Thanks, > > > > Warren > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] finding text in a cell that contains a specified image?
well, that's a good reason for not trying row 0 then ;) j. On 8/19/05, Shao Kang Tat <[EMAIL PROTECTED]> wrote: > well the loop starts at 1 because there is no row 0 for a table :) > > > Shao > > > > On 8/19/05, Jeff Wood <[EMAIL PROTECTED]> wrote: > > I know it's a user preference game, but it's much more "the ruby way" > > to stay away from "for ... in ... " ... also, your range starts @ 1 > > ... what about row 0 ? Oh, and exists? is deprecated (1.4), you should > > get used to exist? > > > > how about, > > > > t.row_count.times do |i| > > theCell = t[i].find { |c| c.image( :src, xxx ).exist? } > > return theCell.text.strip if theCell > > end > > > > anyways, comments are welcome. > > > > j. > > > > On 8/19/05, Shao Kang Tat <[EMAIL PROTECTED]> wrote: > > > I'm doing something similar. But I'm not dealing with images, rather > > > links and texts, so I'd imagine the code would be similar to the one > > > I"m using and would work: > > > > > > > > > ie.tables.each do|t| # since you don't have ID's, look at every table > > > for i in 1..t.row_count # for every row in this table > > > > > > # for every column in this row, look at its contents > > > t[i].each{|c| if c.image(:src, xxx).exists? # if true, this > > > is your cell > > > return c.text.strip > > > } > > > end > > > end > > > > > > > > > > > > > > > > > > > > > > > > On 8/19/05, Warren Pollans <[EMAIL PROTECTED]> wrote: > > > > Hello again, > > > > > > > > Could some please point me to a way of finding text in a cell that > > > > contains a specified image? There are no ids available for the table, > > > > row or cell :-( - and there are several tables on the page. There is > > > > only one cell (at a time) that contains this particular image - the > > > > text in the cell is displaying status that I'm trying to capture. This > > > > status msg can occur in one of four different tables - depending on > > > > which form on the page is submitted - the same image is used in all > > > > cases. > > > > > > > > I think I want to walk through the DOM looking for a td element that has > > > > "img src=xxx" - I imagine there's a simpler watir way :-) > > > > > > > > Thanks, > > > > > > > > Warren > > > > ___ > > > > Wtr-general mailing list > > > > Wtr-general@rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > ___ > > > Wtr-general mailing list > > > Wtr-general@rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > -- > > "So long, and thanks for all the fish" > > > > Jeff Wood > > > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] finding text in a cell that contains a specified image?
.times is part of Fixnum from Ruby, not a specific piece of WATiR. It's functioning properly, your range solution vs my times solution isbetter in this circumstance. j. On 8/19/05, Shao Kang Tat <[EMAIL PROTECTED]> wrote:> actually I tested out tables using t.row_count.times do|i|. Theproblem with using this method on tables is that it attempts to do row0 (or so I think). I used IRB to go to google.ca and did a> ie.tables.each do |t| m = tend> which set m to be the last table on the page. (it has 2 rows)Then I did a comparison between .times do and for i in methods. Here are the results:> > Using: .times do|i|> irb(main):183:0> m.row_count.times do|i|irb(main):184:1* m[i].each {|c| puts c.text}irb(main):185:1> end> WIN32OLERuntimeError: Unknown property or method `-1'HRESULT error code:0x80020006 Unknown name.from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2472:in `[]'from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2472:in `row'from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2422:in `[]'from (irb):184 fromirb(main):183:0> m.row_count.times do|i|irb(main):184:1* m[i].each {|c| puts c.text}i! rb(main):185:1> endWIN32OLERuntimeError: Unknown property or method `-1' HRESULT error code:0x80020006 Unknown name.from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2472:in `[]'from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2472:in `row'from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2422:in `[]'from (irb):184 from (irb):183:in `times'from (irb):183from ♥:0 (irb):183:in `times'from (irb):183from ♥:0> using for i in 1..rowcount> irb(main):189:0> for i in 1..m.row_countirb(main):190:1> m[i].each{|c| puts c.text}irb(main):191:1> end> > Advanced Search Preferences Language ToolsSearch: the webpages from Canada> > So I'm assuming Watir will always start at index 0 when using .times do|x|is that right? Would it be possible to make watir Know what iscalling .times so that it can start at a different index - in thiscase, tables? I actually do use .times do|x| in some cases but Inever tried with tables until! now because I assumed it would start atindex 0.> Shao> ___> Wtr-general mailing list> Wtr-general@rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general> -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] finding text in a cell that contains a specified image?
Bret, My bad ... it's part of Ruby not you ... File.exist? and File.exists? I knew I'd seen it recently ... just wasn't clear on WHERE. Check the Std Lib docs ... under File#exist? and File#exists? ... exists? is marked obsolete. j. On 8/19/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > At 11:28 AM 8/19/2005, Jeff Wood wrote: > >Oh, and exists? is deprecated (1.4), you should > >get used to exist? > > huh? we've always used 'exists?' in watir. > > > _ > Bret Pettichord > www.pettichord.com > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] installer issues
Bret, Thank you for the link to Paul's site ... He's got some good stuff in his watir-5 pdf copy of his presentation... So, I'll use that as a basis, but I'm still going to do the actual demo against one of the in-house web apps ... that way people get more buy-in ... Thanks so much ... Also, I do have a question about the docs for WATiR ... I haven't found a good place that lists all of the "how" criteria for the different objects... If there's anything good for this somewhere, please let me know ... Paul's pdf had a good start on this ... j. On 8/19/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > At 08:20 AM 8/19/2005, Jeff Wood wrote: > >Ok, I looked at that stuff ... and unfortunately ... It looks like this > >tutorial is meant as a day-long kinda class ... I only have 1-2 hours ... > > > >So, I'm going to include documentation on getting Ruby & WATiR installed > >under Windows ... And I'm going to show them irb and doing live testing > >with it. as well as using the Test::Unit framework. > > > >I'll do some simple tests of some of the web-based interfaces around the > >company. > > > There are also some slide decks in there you may want to use. > > And more here: http://members.shaw.ca/paul_rogers/index.html > > > _ > Bret Pettichord > www.pettichord.com > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] finding text in a cell that containsaspecified image?
t; > > > > > > > We've discussed changing Watir to use zero-based > > > indexing, but are > > > > > concerned about compatability. Paul discussed this in a recent > > > > > email. > > > > > Comments? Anyone opposed to a switch? > > > > > > > > > > Bret > > > > > > > > > > > > > > > > > > > > _ > > > > > Bret Pettichord > > > > > www.pettichord.com > > > > > > > > > > ___ > > > > > Wtr-general mailing list > > > > > Wtr-general@rubyforge.org > > > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > >___ > > > >Wtr-general mailing list > > > >Wtr-general@rubyforge.org > > > >http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > _ > > > Bret Pettichord > > > www.pettichord.com > > > > > > ___ > > > Wtr-general mailing list > > > Wtr-general@rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Use Index in a Table given by SpySmith
Tuyet Cong-Ton-Nu wrote: I used SpySmith (great tool, thanks Bret for letting us know) to find a value (USAL6l1) in a table and it gave me this info: Innermost Element: [TD], Frame: [main/body/tabContent], Index: [137] USAL6I1 I want to extract “USAL6l1” from this table, and I can do it in irb with this command: irb(main):032:0> puts frame1.table(:index, 3)[6][3] USAL6I1 But how can I do it using the Index [137] that SpySmith gave me? I looked at the table_test.rb and tried various combinations, but nothing worked. Your help is appreciated. Thanks. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general That index is based on the sourceIndex property of the element... Maybe we should add support for finding items by sourceIndex or by index from the all collection... What'dya think bret? j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Running IE minimized or invisible?
saud aziz wrote: Is it possible to run your tests scripting in Ruby with Watir (of course) either with IE minimized or invisible? I would like to be able to work on other stuff while it does its thing without interrupted. Is that possible? -- "..man is a human being, not because of his physical powers for physically the camel is his superior; not because of his size for the elephant is larger; not because of his courage for the lion is more courageous; not because of his appetite for the ox has the greater; not because of coitus for the least of the birds is more virile than he, but rather by virtue of his noble aims and ideals. [As a matter of fact] he was only created to know." (Al- Ghazali; The book of Knowledge, Section 1) ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general As long as your tests don't involve interacting with PopUps, this should work ... I believe much of the PopUp functionality requires the popup to be the top-most window. People will correct me if I'm wrong. j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Test suites
Lisa Crispin wrote: Eventually we want to run our tests from CruiseControl, but I think the first baby step would be actually to run a suite of tests from the command line. (Or maybe I'm wrong about that, maybe I should run each test from ant, I am not sure, I am seeking advice on this). The test::unit doc (http://www.ruby-doc.org/core/classes/Test/Unit.html) shows that you can simply require each test and it will magically be run. This works. However, I want a summary of the results at the end, how many tests ran, how many assertions, failures, errors, summed for all the tests that ran. I've googled and looked at the Scripting for Testers class materials (Boy, I wish I could have attended that at Agile 2005, but I was presenting at the same time), and I can't find out how to do this. I see there is something called 'Watir::logging' (very clever) but I can't find any doc on how to use it (at least, not any doc that I can make heads or tails out of). Is there a way to run a suite of tests and get a summary of the results at the end? Am I better off doing this in ant from the get-go or am I correct to look for intermediate steps? thanks, Lisa ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Simply review http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html The Test::Unit framework supports TestCase objects ( multiple tests within a single class ) .. and TestSuite objects which lets you aggregate multiple TestCase objects into a single suite. The documentation has numerous examples. I think it will cover all of the situations you are trying to cover. j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] WATIR Queries
Sathish, RE: #1 Remember that you have full access to all of Ruby and its core libraries ( as well as a large wealth of 3rd party libraries ) for your WATiR scripts. You can read from files yourself, or connect to a database or any of those options. RE: #2 You'd have to tell us what specifically you are looking for in the way of reporting... Are you looking for database-related information? or, web-server generated information? or testing-side information? It makes a pretty large difference in suggesting a tool for you. j. On 8/24/05, Sathish Chandrasekaran <[EMAIL PROTECTED]> wrote: > > Hi all, > > We are using WATIR for automating a java application. > > We have the following queries: > > 1. I have a select (combo) box in a form. > > But i want to access data from a file and use the data for selecting the > option in a combo box. > > How to write a ruby script for the above ( combo box or radio button or List > or Option menu and other similar types of selection . ) > > Can the above be automated using Watir or should it be done manually ?? > > 2. How to generate a brief report using WATIR, after having populated the > database through the form for hundred records ? > > Please let me know asap > > Regards > > Sathish C > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Question...
I've been looking through the function lists ... There are a number of things like showAllObjects and show_all_objects textField and text_field and on and on ... Was there a decision to change apis at some point ... that's what I seem to be seeing... and if so, which is the current preferred API ? I mean, I prefer to use as few _ chars as possible ... but, let me know. j. -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Question...
darn, but, ok. thanks. j. On 8/24/05, Paul Rogers <[EMAIL PROTECTED]> wrote: > I originally wrote the methods using camelCase. the prefferred ruby way is > train_case. > The camelCase ones will get deprecated, so use train_case > > Paul > > - Original Message - > From: Jeff Wood <[EMAIL PROTECTED]> > Date: Wednesday, August 24, 2005 9:31 am > Subject: [Wtr-general] Question... > > > I've been looking through the function lists ... There are a > > number of > > things like > > > > showAllObjects and show_all_objects > > textField and text_field > > and on and on ... > > > > Was there a decision to change apis at some point ... that's what I > > seem to be seeing... and if so, which is the current preferred API ? > > > > I mean, I prefer to use as few _ chars as possible ... but, let me > > know. > > j. > > > > > > -- > > "So long, and thanks for all the fish" > > > > Jeff Wood > > > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Problem with running tests in a suite
add a setup function to your test case to create a new instance for each test then, add a teardown function and force the browser to go away. ( ie.quit ) that should take care of things... On 8/24/05, Lisa Crispin <[EMAIL PROTECTED]> wrote: > If we have really small scripts/test cases, they run fine in a suite. > But as we add code to them, we start having a problem where the first > IE browser window does not shut down, and the second script errors out > because there was a window already open. As the scripts get larger, > this happens more consistently. > > We're working around this by putting in sleeps, but that seems like a > hack and potentially unreliable. What am I missing here? One of my > Java programmer coworkers who knows some Ruby looked at it with me, > but couldn't come up with any other solution. > > Here is what my suite looks like. Maybe there's a better way to do the suite? > > $:.push("../lib") > $:.push("../scripts/simple") > > require 'test/unit' > require 'Payroll/tc_manage_groups' > require 'Payroll/tc_create_payroll' > > thanks, > Lisa > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] watir/dialog
Bret Pettichord wrote: It has not yet been released. Unlike previous releases, 1.4.1 did not include everything in HEAD. Bret At 09:46 AM 8/23/2005, Zeljko Filipin wrote: Is watir/dialog removed from new version? I just installed watir gem, and both remote_eval and watir/dialog seem to be missing (or am I missing something)? I recently moved to remote_eval for dealing with _javascript_ pop up windows. Zeljko ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _ Bret Pettichord www.pettichord.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Bret, Do you have any examples using the new remote_eval stuff? j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] [ wtr-Support Requests-2303 ] get the inner text from a tag
Bret Pettichord wrote: Anyone want to help this guy out? All you have to do is look at the code for P and Span and do the same thing to create a Pre. It is a couple lines of Ruby. Any takers? Bret At 06:50 PM 8/24/2005, [EMAIL PROTECTED] wrote: Support Requests item #2303, was opened at 2005-08-24 19:50 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=488&aid=2303&group_id=104 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Nobody (None) Assigned to: Nobody (None) Summary: get the inner text from a tag Initial Comment: Im trying to get the text from inside a tag that is in a frame. this frame doesn't contain any other HTML but the tag and the text in between. like so... some text here... some text here... some text here... some text here... _ Bret Pettichord www.pettichord.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Bret, I've already got the code written, you just gotta add me to the project... my login is programr Haven't added any unit tests yet. j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] [ wtr-Support Requests-2303 ] get the inner text from a tag
Bret Pettichord wrote: Anyone want to help this guy out? All you have to do is look at the code for P and Span and do the same thing to create a Pre. It is a couple lines of Ruby. Any takers? Bret At 06:50 PM 8/24/2005, [EMAIL PROTECTED] wrote: Support Requests item #2303, was opened at 2005-08-24 19:50 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=488&aid=2303&group_id=104 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Nobody (None) Assigned to: Nobody (None) Summary: get the inner text from a tag Initial Comment: Im trying to get the text from inside a tag that is in a frame. this frame doesn't contain any other HTML but the tag and the text in between. like so... some text here... some text here... some text here... some text here... _ Bret Pettichord www.pettichord.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Even got a sample page and a few test cases ... innerText tests, exists tests ... find by :id & :index ... didn't try any for :name ... Just gotta give me the word ... j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Help : new to Watir
It sounds like you are doing load testing which is not what I think WATiR is intended for. WATiR is meant for functional/procedural testing. If you are simply wanting to load/perf-test large quantities of simultaneous sessions on the system ... That would possibly be better suited for simple HTTP calls directly... ( like using uri-open or wget and/or curl ) That's my $0.02 ... YMMV j. On 8/26/05, Murtaza Lokhandwala <[EMAIL PROTECTED]> wrote: > Hi Everybody, > > I started using WATIR to write my first web > application test script two ago. > > -- The web page I am testing has approximately 6 input > boxes and 7 drop down boxes for each record. And I am > displaying 10 records per page. To view more user have > to use 'Next >>' or '<< Previous' buttons. > > I started with hard coded values to have a feel of > WATIR. The script is working but I was planning to use > it to load the web server / database by creating 200 > sessions. And each session creating 1 form having > approx 50 transactions. > > Using the script I created couple of forms but each > form is taking approximately 12-14 min for 20 > transactions. > > I am attaching the script for the review. Please help > me me in making the script more efficient. Because the > test case I am handling needs 200 such sessions. > > Thank you very much. > > Murtaza > > > > __ > Yahoo! Mail for Mobile > Take Yahoo! Mail with you! Check email on your mobile phone. > http://mobile.yahoo.com/learn/mail > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Passing data between scirpts?
There is usually a clean way to build something into an object instead of simply blasting things to a global variable. If all of your tests are within a single TestCase object, then you can easily use instance variables for that class ( @blah ) and then all of the methods within that instance object will have access. Beyond that, if you have multiple separate TestCase objects then you either need to use something like a global ( even if that global is simply an object to hold your real globals ... still not the recommended solution ... globals are almost always sloppy ) or maybe serialize your values out to environment variables or a properties file and have each class load it... ( Think YAML! ) Those are the options I would use... Hope that helps. j. On 8/26/05, Jonathan Kohl <[EMAIL PROTECTED]> wrote: > +1 > > Use extreme caution with global variables. :) > > -Jonathan > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Kingsley > > Sent: August 26, 2005 1:08 PM > > To: wtr-general@rubyforge.org > > Subject: RE: [Wtr-general] Passing data between scirpts? > > > > Or a class variable @@var > > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Zeljko Filipin > > Sent: 26 August 2005 10:45 > > To: wtr-general@rubyforge.org > > Subject: Re: [Wtr-general] Passing data between scirpts? > > > > Global variable is any variable that starts with $ (like > > $my_global_variable). > > > > Zeljko > > > > 2005/8/26, Ian Phillips <[EMAIL PROTECTED]>: > > > Hi. > > > > > > Just started using WATIR and have hit this problem. I need > > to pass a > > > variable or have a global variable so that all my scripts > > have access > > > to it. Is this possible? > > > > > > I have a port number that can change each time I start my app so I > > > want to be able to change this value in one place. > > > > > > Any helps or links would be useful. > > > > > > Thanks > > > > > > Ian Phillips > > > > > > ___ > > > Wtr-general mailing list > > > Wtr-general@rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Consolidate scripts into a master test plan
There are a number of ways you can do it. You should use the Ruby Test::Unit framework. >From there, you can either wrap each of your existing test scripts with a function and have one test case object that contains all of them Or you can build a separate class to wrap each of your scripts and then build a TestSuite object to call all of those ... Either one works, it really depends on the size of your scripts and how much of the functionality of those tests is duplicated, because wrapping multiple of those in the same TestCase object would then allow you to break out that functionality and therefore not repeat yourself. Hope that made sense... Ask if you need more detail. j. On 8/29/05, Torres, Ben (HQP) <[EMAIL PROTECTED]> wrote: > Hi, > > I've been writing a test script for each individual test case. How do I > consolidate all my test scripts into a master test script so all I would > need to execute is the master test script? Will I need to make each > testcase a function? > > Thanks, > Ben > > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "So long, and thanks for all the fish" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Key / value pairs.
That's one way to do it ... Another is to use YAML which has a pretty heavy following with the Ruby community in general... So, the following would do the same ... You can simply use a hash to store things... Here's a quick script to load up a sample --SCRIPT-- require 'yaml' config = Hash.new config["username"] = "joe" config["password"] = "pass" config["foo"] = "bar" config["baz"] = 5 config["zoo"] = [ 1, 2, 3, 4, 5 ] File.open( "config.yaml", "w" ) { |file| file << config.to_yaml } --SCRIPT-- Then in your normal script you can get to this as simply as: --SCRIPT-- require 'yaml' config = YAML.load( File.new( 'config.yaml' ) ) config.each_pair { |key,value| puts "#{ key } -- #{ value }" } --SCRIPT-- It's that easy ... YAML is pretty cool. Hope that helps. j. On 8/29/05, Kingsley <[EMAIL PROTECTED]> wrote: > > > > Hi > > > > You might find this useful: > > > > class MissingConfigurationFile < ArgumentError ; end > > > > class MyConfig > > > > MyConfig = Struct.new("MyConfig", :property, :value) > > > > def initialize(config_file) > > begin > > @config = File.readlines(config_file) > > rescue > > raise MissingConfigurationFile, "Can't find config file" > > end > > end > > > > def parse_config_file > > rem_array = [] > > prop_array = [] > > @config.each do |line| > > if line.match(/^#/) > > rem_array << line > > else > > unless line.match(/^\n$/) then prop_array << line.chomp end > > end > > end > > return prop_array - rem_array > > end > > > > def properties > > config_hash = {} > > parse_config_file.each do |data| > > split = data.split("=") > > property = split[0].gsub(/\s*/, "") > > value = split[1].gsub(/$\s*/, "").gsub(/^\s*/, "") > > config_hash.store(property,MyConfig.new(property, value)) > > end > > return config_hash > > end > > > > end > > > > myConfig = MyConfig.new("config.txt").properties > > config_option_name = myConfig['OPTION_NAME].property > > config_option_value = myConfig['OPTION_NAME'].value > > > > config.txt > > > > # Lines with a # are ignored > > OPTION_NAME = put some value here > > OPTION_2 = more options > > > > Hope it's useful > > > > Thanks > > > > Kingsley > > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > [EMAIL PROTECTED] > Sent: 29 August 2005 06:40 > To: wtr-general@rubyforge.org > Subject: [Wtr-general] Key / value pairs. > > > > This email is to be read subject to the disclaimer below. > > > Hello all, > > I'm new to Watirr (and Ruby), so forgive me if the question is rather > simplistic... > > What I'd like to do, is to have a configuration file (eg. config.txt), > which would have a number of key/value pairs, such as "UserName=user", which > would be read by a test script to, for example, log into a page. Hence, what > I need, is a method to read each line in a given file; strip off the > comments (if exist; denoted by #); find the pair based on the key (ie. > UserName) and get the value (ie. user) and store it in a variable. > > Any help would be greatly appreciated. > > Regards > > Leon > > > NOTICE - This communication contains information which is confidential and > the copyright of Ernst & Young or a third party. > > If you are not the intended recipient of this communication please delete > and destroy all copies and telephone Ernst & Young on 1800 655 717 > immediately. If you are the intended recipient of this communication you > should not copy, disclose or distribute this communication without the > authority of Ernst & Young. > > Any views expressed in this Communication are those of the individual > sender, except where the sender specifically states them to be the views of > Ernst &
Re: [Wtr-general] Watir attracts Ruby Newbies
Bret Pettichord wrote: Watir is rapidly attracting users. (We pronounce it 'water'.) Many of our users are new to Ruby and even new to object-oriented languages. In fact, they can't tell where Watir ends and Ruby begins. Thus, they end up asking lots of questions to the Watir mailing list (wtr-general@rubyforge.org) that are really just Ruby questions. I gave a presentation of Watir's precursor at the Ruby Conference 2003 in Austin. At that time, i said that we were using Ruby as our scripting language because it was intuitive and easy to learn for non-programmers. But now they are wanting to read data from spreadsheets or csv files or initialization files. Or they want to create libraries. Or they want help with Test::Unit. I consider myself middling in my Ruby skills. I've heard meta-classes explained at least three times and still don't understand them. But i'm one of the more knowledgable people on the list. We could use your help. If you are interested in helping new users learn how to use Ruby, please consider joining our mailing list. (Or you could just help Brian with his book.) Oh, and BTW, we now have a gem for Watir ('gem install watir'). It has unit tests and rdoc. And yes, Watir only works on Windows and only with Internet Explorer. I offer apologies to the OSS gods. http://wtr.rubyforge.org/ Bret _ Bret Pettichord www.pettichord.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general That's why I'm here... I'm here for whatever I'm needed for. j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Unicode and Watir
I believe the normal method is to use iconv Which, was recently sent to the ruby-talk mailing list where a user had packaged them up nice and easy for windows users. Original Message was from Dave Burt [EMAIL PROTECTED] : I posted this while the gateway was down a couple of days ago: > Hi, > > I'd like to offer Windows One-Click Installer users two handy add-on > packages: Iconv and Curses. > > The packages include: > * all the required binaries > * the ruby extension (.so) > * the library proper (.dll) > * automatic installation script (setup.rb) > * information on installation (README) > * a list of where to get the binaries if you don't trust me (README) > > http://www.dave.burt.id.au/ruby/iconv.zip > http://www.dave.burt.id.au/ruby/curses.zip > > Cheers, > Dave Hope that helps. I haven't played with it yet, but I thought I'd pass the info along. j. On 8/31/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: I have a client who would like to use Watir to test a Unicode enabledapplication, supporting double-byte languages such as Chinese and Japanese. It looks to me like it doesn't work, but i haven't done Unicode with Rubybefore and thought i would check to see if any one else had looked into this.Bret_Bret Pettichord www.pettichord.com___Wtr-general mailing listWtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general-- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] new installers
Bret Pettichord wrote: Our new installers have been out for a bit. And we need to update our docs to reflect this. Should we tell people about the one-click installer, the gem or both? We have scattered reports of problems with the new one-click installer. We'd appreciate hearing more about it? Is it working for you. Do you like it? Is it better than the old one. I want to update our documentation on how to install Watir and would like some feedback first. I am also planning to convert the old installer to be a simply command line installer -- that way we have something very reliable for people who want more than a gem and are having problems with the one-clicker or want to install directly from HEAD. Bret _ Bret Pettichord www.pettichord.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general My vote is for the gem... I wish more of the community would just stand behind it and get it "standardized" so that we don't have to deal with language detractors that complain we don't have a CPAN or a PEAR j. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Watir and Ajax
What specifically are you looking for? I was able to use WATiR to load the page ... enter a criteria... validate the result ... follow the link ... and on from there ... ie = IE.new ie.goto "instant.search.yahoo.com" ie.text_field( :name, "p" ).set "boston weather" ie.link( :text, /Extended/ ).click if ie.contains_text "Currently" ... hope that's enough. Realize that all you are doing with WATiR is directing IE and looking at the page it has loaded and the current content of that page... So, if the underlying system is changing the content ... it doesn't care. That's what is so nice about WATiR vs other tools like HTTPUnit that would have to emulate all of the functionality that IE takes care of for us... ... I hope that helps answer your question. j. On 9/26/05, Sean Gallagher <[EMAIL PROTECTED]> wrote: > Has anyone tried using Watir to test a website that uses Ajax? > > As a test, I am looking at the new Yahoo Instant Search. > > http://instant.search.yahoo.com/ > > Here is the form HTML: > > action="http://rds.yahoo.com/;_ylt=AsI0.1halgK5ggoEYqqRJtOSA8oF;_ylu=X3oDMTB > hNjRqazhxBHNlYwNzZWFyY2g-/SIG=11ia1q7e9/EXP=1127856681/*-http%3A//search.yah > oo.com/search"> name=fr value="sfp-inst"> > Instant Search > > onkeydown="instant_key(event);return true;"> > > > > > > I don't know how to handle the input that includes the onkeydown event using > Watir. > > Does anyone have any suggestions and/or advice? > > Thanks. > > -sean > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to click on image
... easy. ie = IE.newie.goto site_urlie.link( :url, /menu_id=1/ ).click j. On 9/26/05, Max Kononovich <[EMAIL PROTECTED]> wrote:> Hello, I am a new in Watir. I have a html page with> the number of images. Each of them belong to one of> the tree elements. So I have the following in the View> Source for each of two buttons.>> > href="http://test.test.net/admin/menus/edit/?menu_id=1";;> > height="19" align="top" title="menus_edit_item"> alt="menus_edit_item" />> href="http://conf.myamphi.net/admin/menus/add_item/?menu_id=1";;> > height="19" align="top" title="menus_add_item"> alt="menus_add_item" />> >> And I need to click on the image with defined in the> href menu_id and action type(add_item or edit ).> If anybody know how I can do it?>> Thanks in advance,>> Max>>>>>>> > Вы уже с Yahoo!?> Испытайте обновленную и улучшенную. Yahoo! Почту! http://ru.mail.yahoo.com> ___> Wtr-general mailing list> Wtr-general@rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general> --"http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Watir and Ajax
Sean, I don't think you were really looking at the code ... notice that the "click" action only happens after simply testing the existance of text within the page... So, extending the example to a small test suite ... It can see things fine. Anything that IE can do, WATiR can. --SCRIPT-- require 'test/unit'require 'watir' class MyTest < Test::Unit::TestCase include Watir def setup @ie = IE.new @ie.goto( "instant.search.yahoo.com" ) end def teardown @ie.close sleep( 5 ) end def test_one assert( @ie.contains_text( "Ruby Home Page" ) == nil ) @ie.text_field( :name, "p" ).set "ruby" assert( @ie.link( :text, "Ruby Home Page" ) ) end def test_two assert( @ie.contains_text( "Forecast" ) == nil ) @ie.text_field( :name, "p" ).set "boston weather" assert( @ie.link( :text, /Forecast/ ) ) endend --SCRIPT-- ... I hope that helps... j. On 9/27/05, Sean Gallagher <[EMAIL PROTECTED]> wrote: No, that does not answer my question.I am looking to test updates to the page from the Ajax engine. In the case of instant search, I need to be able to test that when I type "ruby" intothe form field, the browser is updated and shows the link for "Ruby HomePage" without clicking the button and submitting the form. (try typing that manually in the browser and you will see what I mean)I do not think that Watir can "see" this type of change...(?)-sean ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Regarding Frames and SSL
Provide us with a bit more information ( like the actual error that you're getting ) and it'll help us provide you with an answer... j. On 9/27/05, Sankar <[EMAIL PROTECTED]> wrote: > Hi There, > I am trying to automate a web site which uses "Frames" using WATIR. > For the login of user account, the web page is hosted on https:// > For that particular page alone, > $ie.frame("frame2").button(:name,"login").click doesnt work > . > > Any idea why is that ?? > is there a way of work around ? > > Thanks, > - Sankar > > -- > If you enjoy programming computers, you are in a very fortunate minority of > people who can make a great living doing work they enjoy. - Joel > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] clicking this image
I ran into the same problem recently ... wrote: > I just used the form submit method instead. it works fine now. THanks. > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Montano, Jan > (Corp,IB&IM) > Sent: Wednesday, September 28, 2005 3:04 PM > To: wtr-general@rubyforge.org > Subject: [Wtr-general] clicking this image > > > hi I've had a hard time clicking this image > > src="images/RBJ_LoginButtonOff.gif" border="0" tabindex="3"> > > $ie.image(:src,/RBJ_LoginButtonOff/).click > # results with unable to locate object error > > attached is the html source. > > -> > <> > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Regarding Frames and SSL
In my current installation of IE, there are options to allow cross-domain scripting ... you might want to see what's available ... j. On 9/27/05, Sankar <[EMAIL PROTECTED]> wrote: > > I am testing an application whose main page is like this > > rows="130,*,0" marginheight="0" > marginwidth="0"> > > > > > > All my testing controls are in frame b. > when the frame b contains http pages, WATIR is able to access it, > When the frame b contains a login page which is https, WATIR is throwing an > error. > > I understand it is due to the cross domain scripting. Is there a way to over > home this error > > there are 3 frames > frame index: 0 name: header > frame index: 1 --Access Denied-- > frame index: 2 name: download > > > > > > W, [27-Sep-2005 21:49:45#3704] WARN -- : frame error in waitdocument > OLE error code:80070005 in > Access is denied. > > HRESULT error code:0x80020009 > Exception occurred. > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in > `method_missing' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `wait' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `upto' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `wait' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1849:in `waitForIE' > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2099:in `click' > E:/home-ST.rb:97:in `test_print_assertion' > 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_mediato > 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 > W, [27-Sep-2005 21:49:45#3704] WARN -- : runtime error in wait > > > > > > These are the errors i get > > > > Thanks, > > Sankar > > > On 9/27/05, Jeff Wood <[EMAIL PROTECTED]> wrote: > > > > Provide us with a bit more information ( like the actual error that > > you're getting ) and it'll help us provide you with an answer... > > > > j. > > > > On 9/27/05, Sankar <[EMAIL PROTECTED]> wrote: > > > Hi There, > > > I am trying to automate a web site which uses "Frames" using WATIR. > > > For the login of user account, the web page is hosted on https:// > > > For that particular page alone, > > > $ie.frame("frame2").button(:name,"login").click doesnt > work > > > . > > > > > > Any idea why is that ?? > > > is there a way of work around ? > > > > > > Thanks, > > > - Sankar > > > > > > -- > > > If you enjoy programming computers, you are in a very fortunate minority > of > > > people who can make a great living doing work they enjoy. - Joel > > > ___ > > > Wtr-general mailing list > > > Wtr-general@rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > > > > -- > > "http://ruby-lang.org -- do you ruby?" > > > > Jeff Wood > > > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > -- > > If you enjoy programming computers, you are in a very fortunate minority of > people who can make a great living doing work they enjoy. - Joel > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Regarding Frames and SSL
Hmm, I'll have to look into it a bit further. I don't have any sites with an SSL sitting around to play with... I'll see what I can do ... maybe somebody else has an idea ... ?? j. On 9/28/05, Sankar <[EMAIL PROTECTED]> wrote: > I have enabled that option as well. > i am still getting the error.. > > is there a way to overcome this ?? > > - Sankar > > > On 9/28/05, Jeff Wood <[EMAIL PROTECTED]> wrote: > > > > In my current installation of IE, there are options to allow > > cross-domain scripting ... you might want to see what's available ... > > > > j. > > > > On 9/27/05, Sankar <[EMAIL PROTECTED] > wrote: > > > > > > I am testing an application whose main page is like this > > > > > > > > rows="130,*,0" marginheight="0" > > > marginwidth="0"> > > > > > > > > > > > > > > > > > > All my testing controls are in frame b. > > > when the frame b contains http pages, WATIR is able to access it, > > > When the frame b contains a login page which is https, WATIR is throwing > an > > > error. > > > > > > I understand it is due to the cross domain scripting. Is there a way to > over > > > home this error > > > > > > there are 3 frames > > > frame index: 0 name: header > > > frame index: 1 --Access Denied-- > > > frame index: 2 name: download > > > > > > > > > > > > > > > > > > W, [27-Sep-2005 21:49:45#3704] WARN -- : frame error in waitdocument > > > OLE error code:80070005 in > > > Access is denied. > > > > > > HRESULT error code:0x80020009 > > > Exception occurred. > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in > > > `method_missing' > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `wait' > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `upto' > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `wait' > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1849:in > `waitForIE' > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2099:in `click' > > > E:/home-ST.rb:97:in `test_print_assertion' > > > 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_mediato > > > > 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 > > > W, [27-Sep-2005 21:49:45#3704] WARN -- : runtime error in wait > > > > > > > > > > > > > > > > > > These are the errors i get > > > > > > > > > > > > Thanks, > > > > > > Sankar > > > > > > > > > On 9/27/05, Jeff Wood <[EMAIL PROTECTED]> wrote: > > > > > > > > Provide us with a bit more information ( like the actual error that > > > > you're getting ) and it'll help us provide you with an answer... > > > > > > > > j. > > > > > > > > On 9/27/05, Sankar <[EMAIL PROTECTED]> wrote: > > > > > Hi There, > > > > > I am trying to automate a web site which uses "Frames" using WATIR. > > > > > For the login of user account, the web page is hosted on https:// > > > > > For that particular page alone, > > > > > $ie.frame("frame2").button(:name,"login").click > d
Re: [Wtr-general] How to get digital id and problem with confirmation message
If I remember correctly, you should put the $helper.push_confirm_button_ok() BEFORE the $ie.link( :url, /menu_delete_item/ ).click ... the explanation is that the helper then spawns the seperatethread/process that watches for the box to pop up. Then when youcilck it sees it ... Otherwise, it's already popped, so the helperdoesn't have anything to help with. ... hope that helps. j. On 9/28/05, Max Kononovich <[EMAIL PROTECTED]> wrote:>> Thanks for your help,>> And can you tell me how I can get digital Id having string> "http://xxx.xxx.net/admin/menus/edit_item/?menu_item_id=122";>> And another question can you propose any way how I can click "ok" button on> the confirmation message. I try to use the following>> require 'watir/WindowHelper'> $helper = WindowHelper.new> $ie.link(:url, /menu_delete_item/).click> $helper.push_confirm_button_ok()>> When confirmation message appeares it wait for somthing. I click "Cancel"> manually and click link again after then it works. What heppens?>> Thanks,>> Max>> > Вы уже с Yahoo!?> Испытайте обновленную и улучшенную Yahoo! Почту!> ___> Wtr-general mailing list> Wtr-general@rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general>>> --"http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How do I save a web page from a test run (attempt using Win32API)?
There is also the AutoIT active x control that is currently installed with WATiR that should give you similar ability to grab a window by title, and then send keystrokes to it ... and I know it to work. Of course, I do believe that Bret is working to remove the AutoIT stuff from the distribution, but it is available to you now. I hope that helps. Documentation & such are all available online ... j.On 9/30/05, Joe Yakich <[EMAIL PROTECTED]> wrote: Everyone,Canoo WebTest has a nice feature whereby the HTML pages of the applicationunder test are saved for viewing later, which is very handy when a test casefails.So, I went looking for something similar in Rubyland, and ran across this posting.http://rubyforge.org/pipermail/win32utils-devel/2005-April/000358.htmlWith some modification (since I want to save the HTML, not get a screen print), I came up with the following code that doesn't quite work. As abonus, it somehow hoses Windows (DOS command windows become gigantic andnon-functional, keyboard input no longer functions, etc.)Any Win32 experts see what I've left out? Thanks in advance!Joeclass SaveWebPage require 'Win32API' def initialize@KEYEVENTF_KEYUP = 0x2@SW_HIDE = 0@SW_SHOW = 5@SW_SHOWNORMAL = 1 @VK_CONTROL = 0x11@VK_F4 = 0x73@VK_MENU = 0x12@VK_RETURN = 0x0D@VK_SHIFT= 0x10@VK_SNAPSHOT = 0x2C@VK_TAB = 0x09 end # Use IE's "save page as" menu selection (Alt, F, A, S) def save_pagekeybd_event = Win32API.new("user32", "keybd_event", ['I','I','L','L'],'V')vkKeyScan = Win32API.new("user32", "VkKeyScan", ['I'], 'I')keybd_event.Call(@VK_MENU, 1, 0, 0)keybd_event.Call(vkKeyScan.Call(?F), 1, 0, 0)keybd_event.Call(vkKeyScan.Call(?A), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?S), 1, 0, 0) endend___Wtr-general mailing listWtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general-- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Please help to get the item id
I hope I'm speaking for others on this list, but jumping on somebody with an RTFM answer is extremely inappropriate. You can simply suggest they pick up either a copy of Ruby in a Nutshell ( by Matz ) ... or Programming Ruby 2nd Ed ( by Dave Thomas ). It is completely agreed that there are many ways the OPer could have found the information, but they came here for help, not to get cussed at. It'd be a real turn off to me if I were still green @ this if people responded to my questions like that. Anyways, like I said, I *hope* I was responding appropriately in this. If not, somebody will bite me for overstepping. j. On 10/1/05, Alexey Verkhovsky <[EMAIL PROTECTED]> wrote: Max Kononovich wrote:> Is anybody know how to get digital id having the string> " http://soft-bogomazov:88/admin/menus/add_item/?menu_id=14"> I mean that I need for "14". It is very important for me. Please help.RTFM about regular expressions - they are your best friend for tasks like this.irb:001:0> s = "http://soft-bogomazov:88/admin/menus/add_item/?menu_id=14"=> " http://soft-bogomazov:88/admin/menus/add_item/?menu_id=14"irb:002:0> i = s.gsub(/^http:.*\?menu_id=(\d+)$/, '\1')=> "14"---Alexey Verkhovsky___ Wtr-general mailing listWtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general -- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Please help to get the item id
The 'F' in RTFM has ALWAYS had derogatory meaning since the inception of the acronym. http://www.pmms.cam.ac.uk/~gjm11/jargon/jargR.html#rtfm And, yes, I saw that you had included irb lines within your post, but, people come here for help... They want solutions spelled out, because ( hopefully ) they've already done all of the research they could, and just didn't understand, or couldn't find the right docs in the first place... If you had simply changed your town from RTFM to "there are a number of good online references for regular expressions like : ( enumerate urls ) ... as well as the wonderful O'Reilly book "Mastering Regular Expressions" ... Here's a solution, and it does look a bit like line-noise, so if you'd like to understand it better, any of these resources should help." Much calmer, much nicer, and an easier way to grow the community. Anyways, ciao for now. j. On 10/1/05, Alexey Verkhovsky <[EMAIL PROTECTED]> wrote: > Sorry, the RTFM abbreviation wasn't meant to be anything like you > imagine. Just a suggestion where to look for a generic solution to this > class of problems. > The quote from IRB session quote was a specific solution to the question > posed. > > Alex > > > I hope I'm speaking for others on this list, but jumping on somebody > > with an RTFM answer is extremely inappropriate. > > On 10/1/05, *Alexey Verkhovsky* <[EMAIL PROTECTED] > > <mailto:[EMAIL PROTECTED]>> wrote: > > > > RTFM about regular expressions - they are your best friend for tasks > > like this. > > > > irb:001:0> s = > > "http://soft-bogomazov:88/admin/menus/add_item/?menu_id=14"; > > => " http://soft-bogomazov:88/admin/menus/add_item/?menu_id=14"; > > irb:002:0> i = s.gsub(/^http:.*\?menu_id=(\d+)$/, '\1') > > => "14" > > > > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Please help to get the item id
Erg last_message.gsub( "your town", "your tone" ).repost j. On 10/1/05, Jeff Wood <[EMAIL PROTECTED]> wrote: > The 'F' in RTFM has ALWAYS had derogatory meaning since the inception > of the acronym. > > http://www.pmms.cam.ac.uk/~gjm11/jargon/jargR.html#rtfm > > And, yes, I saw that you had included irb lines within your post, but, > people come here for help... They want solutions spelled out, because > ( hopefully ) they've already done all of the research they could, and > just didn't understand, or couldn't find the right docs in the first > place... > > If you had simply changed your town from RTFM to "there are a > number of good online references for regular expressions like : ( > enumerate urls ) ... as well as the wonderful O'Reilly book "Mastering > Regular Expressions" ... Here's a solution, and it does look a bit > like line-noise, so if you'd like to understand it better, any of > these resources should help." > > Much calmer, much nicer, and an easier way to grow the community. > > Anyways, ciao for now. > > j. > > On 10/1/05, Alexey Verkhovsky <[EMAIL PROTECTED]> wrote: > > Sorry, the RTFM abbreviation wasn't meant to be anything like you > > imagine. Just a suggestion where to look for a generic solution to this > > class of problems. > > The quote from IRB session quote was a specific solution to the question > > posed. > > > > Alex > > > > > I hope I'm speaking for others on this list, but jumping on somebody > > > with an RTFM answer is extremely inappropriate. > > > On 10/1/05, *Alexey Verkhovsky* <[EMAIL PROTECTED] > > > <mailto:[EMAIL PROTECTED]>> wrote: > > > > > > RTFM about regular expressions - they are your best friend for > tasks > > > like this. > > > > > > irb:001:0> s = > > > "http://soft-bogomazov:88/admin/menus/add_item/?menu_id=14"; > > > => " http://soft-bogomazov:88/admin/menus/add_item/?menu_id=14"; > > > irb:002:0> i = s.gsub(/^http:.*\?menu_id=(\d+)$/, '\1') > > > => "14" > > > > > > > > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > -- > "http://ruby-lang.org -- do you ruby?" > > Jeff Wood > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] OT: generate random text?
Use a function like: def random_text( length ) output = "" length.times do output << ('A'..'Z').to_a[ rand(26) ] end output end then, where ever you need it : just call it random_text( 42 ) # for 42 chars of random text ... j. On 10/3/05, Chris McMahon <[EMAIL PROTECTED]> wrote: Hi...I want to generate some random text for test purposes. "rand" doesn'tseem to DWIM. Say, to pick an arbitrary letter from the uppercaserange A to Z.[A-Z].rand[A..Z].rand seems right, but isn't.-Chris___Wtr-general mailing listWtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general-- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Problems with XPath extension
Ok ... I'm trying to figure out what specifically you NEED/WANT this for ??? What is the point of going after the DIV tag if you already know the text inside it ? ... Just my question ... I'm trying to see practical use. I can see use for finding a tag based on id's &| attributes, sorry, guess I'm a little dense. j. On 10/4/05, Padraig O'Leary <[EMAIL PROTECTED]> wrote: Hi, I extended Watir Ver. 1.4.1 with the Xpath extension. However I'm having problems with the Xpath extension. It has problems identifying nodes using the text they contain. For example a node with: some text Xpath will have trouble finding the DIV tag using the text it contains. If I put the following code in (:xpath, "//div['some totally different text']") It would find the above node. See the example below: bbb yyy If I use this Xpath (:xpath, "//[EMAIL PROTECTED]'div2']/*/.='blah blah'") it'll fine the node bbb. It finds the first element without looking at the end of the XPath statement. You cant search for an node based on the text it contains! Will Watir Ver. 1.5 contain the same Xpath version that's now available in Head in CVS or is to plan to modify. Should I wait to see if the new version will fix this problem or go the awkward route of trying to change the way the tag elements are generated? Has anybody else come across the same problems? Thanks a millionPádraig___Wtr-general mailing list Wtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general -- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] OT: generate random text?
I recently posted this, but I'll pop another copy here. def allowed_chars output = [] output += ('A'..'Z').to_a output += ('0'..'9').to_a end def random_text( length ) output = "" allowed = allowed_chars() length.times do output << allowed[ rand( allowed.length ) ] end output end all done with functionality to easily add/remove chars from your set of allowed. hope that helps. j. On 10/4/05, Winston, Phyllis H <[EMAIL PROTECTED]> wrote: Alan Richardson has an excel spreadsheet using visual basic macros fordata generation:http://www.compendiumdev.co.uk/testdata/index.php-Original Message- From: Chris McMahon [mailto:[EMAIL PROTECTED]]Sent: Monday, October 03, 2005 6:33 PMTo: wtr-general@rubyforge.org Subject: [Wtr-general] OT: generate random text?Hi...I want to generate some random text for test purposes. "rand" doesn'tseem to DWIM. Say, to pick an arbitrary letter from the uppercase range A to Z.[A-Z].rand[A..Z].randseems right, but isn't.-Chris___Wtr-general mailing list Wtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general-- " http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] OT: generate random text?
Wow, do it the hard way... don't worry about permutations. How about: def allowed_chars( char_classes = "ul" ) output = [] char_classes.split( // ).each do |curr| case curr when "u" output += ( 'A'..'Z' ).to_a when "l" output += ( 'a'..'z' ).to_a when "d" output += ( '0'..'9' ).to_a else raise ArgumentError, "Invalid value passed to allowed_chars: #{ curr }" end end output end ... the rest should be fine ;) j.On 10/4/05, Cain, Mark <[EMAIL PROTECTED]> wrote: Added a few tweaks, hope that is ok 8-) def allowed_chars( val ) output = [] case val when 'u' then output += ('A'..'Z').to_a when 'l' then output += ('a'..'z').to_a when 'd' then output += ('0'..'9').to_a when 'uld' output += ('A'..'Z').to_a output += ('a'..'z').to_a output += ('0'..'9').to_a else output += ('A'..'Z').to_a output += ('a'..'z').to_a end end # 'u' - upper, 'l' - lower, 'd' - digit, 'uld' - alpha numeric # default upper and lower case string def random_text( length, val='ul' ) v = val output = "" allowed = allowed_chars( val ) length.times do output << allowed[ rand( allowed.length ) ] end output end --Mark From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Jeff Wood Sent: Tuesday, October 04, 2005 1:29 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] OT: generate random text? I recently posted this, but I'll pop another copy here. def allowed_chars output = [] output += ('A'..'Z').to_a output += ('0'..'9').to_a end def random_text( length ) output = "" allowed = allowed_chars() length.times do output << allowed[ rand( allowed.length ) ] end output end all done with functionality to easily add/remove chars from your set of allowed. hope that helps. j. On 10/4/05, Winston, Phyllis H <[EMAIL PROTECTED]> wrote: Alan Richardson has an excel spreadsheet using visual basic macros for data generation: http://www.compendiumdev.co.uk/testdata/index.php -Original Message- From: Chris McMahon [mailto:[EMAIL PROTECTED]] Sent: Monday, October 03, 2005 6:33 PM To: wtr-general@rubyforge.org Subject: [Wtr-general] OT: generate random text? Hi... I want to generate some random text for test purposes. "rand" doesn't seem to DWIM. Say, to pick an arbitrary letter from the uppercase range A to Z. [A-Z].rand [A..Z].rand seems right, but isn't. -Chris ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -- " http://ruby-lang.org -- do you ruby?" Jeff Wood ___Wtr-general mailing listWtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general-- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] [ wtr-Support Requests-2574 ] Need file access by URL instead of actual path
You should use the file:// handler ... should work. ie.goto( "file://c:/myApp/config/config.xml" ) ... anything you can do with IE can be done... If you are looking for the URL to the local file: Click "File" -> "Open" Navigate to the file and click Open Copy the URL in the IE address bar. Use that in your GoTo ... should be all you need. j. On 10/4/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Support Requests item #2574, was opened at 2005-10-04 13:21You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=488&aid=2574&group_id=104Category: NoneGroup: None Status: OpenResolution: NonePriority: 3Submitted By: Nobody (None)Assigned to: Nobody (None)Summary: Need file access by URL instead of actual pathInitial Comment:Is there a way to access files using the URL, instead of the actual OS path? I want to muck with my web app's config settings in my watir scripts, in order to manipulate the app for testing. The actual file path for the config files will vary depending on the location from which the scripts are run. But the URL path is always constant. If I could access files using //localhost/myApp/config/config.xml, I would be in business. But this fails in ruby/watir. They don't seem to understand a path like that.--You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=488&aid=2574&group_id=104___Wtr-general mailing listWtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general-- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to click on the confirmation button
This isn't meant as an RTM email, but most people will find pretty much every thinkable scenario for using WATiR has test cases in the Unit tests. If you simply navigate to where you have WATiR installed, there is a unittests directory that contains examples of calling _javascript_ that pops input dialogs and automatically closing them with an Ok or Cancel response... I find that whenever I am stuck, those testcases show me the way... Hope that helps... Specifically look at the _javascript__*.rb unit tests... They cover exactly this question. j.On 10/4/05, Max Kononovich <[EMAIL PROTECTED]> wrote: Hello, Please, tell how I can start the separete process? Thanks, Max Message: 8Date: Mon, 03 Oct 2005 14:31:51 -0400From: Alfred Whitehead Subject: Re: [Wtr-general] Buttons on the confirmation messageTo: wtr-general@rubyforge.orgMessage-ID: <[EMAIL PROTECTED]>Content-Type: text/plain; charset=KOI8-R; format=flowed Hi Max,I have played with something similar to this in the past. I found that, when linked up to IE, the whole process that your script is running in will become blocked when a _javascript_ pop-up appears. This seems to affect all threads that are part of that process.One possible solution would be to spawn a separate process to run myclicker.rb. There may well be a better solution (and I would enjoy seeing it too!). AlfMax Kononovich wrote:>Hello>>I'll try the algorithm below. But it seems ! that nohig>happens. I mean the comfirmation message appeares>however $helper doesn't click on the button. Please,>tell if you know the solution. >>Thanks,>>Max> > >>>Hi Max,>>>>Try this out like this:>>>># This you should write in the script>>Thread.new { system("rubyw myclicker.rb") }>>$ie.link(:url, /menu_delete/).click >>>>Now create a new file called myclicker.rb>>require 'watir/WindowHelper'>>$helper = WindowHelper.new>>$helper.push_confirm_button_ok()>>>>Hope this helps, >>>>P.S.: You can change the name of the file from>>myclicker.rb but make sure>>both the names are same (the names shown in bold>>text).>>>>Regards, >>Angrez>> >>>>>> >> > >>?? ??? ? Yahoo!? >? ??? ? ??. Yahoo! ?! http://ru.mail.yahoo.com>___>Wtr-general mailing list> Wtr-general@rubyforge.org>http://rubyforge.org/mailman/listinfo/wtr-general > >-- Alf Whitehead [[EMAIL PROTECTED]] 416-214-4977 x260Quality Assurance Specialist Klick Communications, http://klick.com/--Message: 9Date: Mon, 3 Oct 2005 17:32:57 -0500 From: Chris McMahon Subject: [Wtr-general] OT: generate random text?To: wtr-general@rubyforge.org Message-ID:<[EMAIL PROTECTED] >Content-Type: text/plain; charset=ISO-8859-1Hi...I want to generate some random text for test purposes. "rand" doesn'tsee! m to DWIM. Say, to pick an arbitrary letter from the uppercaserange A to Z.[A-Z].rand[A..Z].randseems right, but isn't.-Chris--___ Wtr-general mailing listWtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-generalEnd of Wtr-general Digest, Vol 23, Issue 2******Вы уже с Yahoo!? Испытайте обновленную и улучшенную Yahoo! Почту! http://ru.mail.yahoo.com ___Wtr-general mailing listWtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general-- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Regarding Frames and SSL
Sankar, Why not put all of the pages on ONE site? Either a private site that only you use for testing, or putting the testing pages on the server with the SSL. If there are no links to them outside of your testing, I don't see much of an issue. Anyways, that would be the only work around I can think of. j. On 10/4/05, Sankar <[EMAIL PROTECTED]> wrote: Can anyone suggest some possible workarounds to overcome this frame issue.I am stuck at this point. Please help Thanks in Advance,Sankar On 9/28/05, Bret Pettichord <[EMAIL PROTECTED] > wrote: I'm pretty sure this is the standard cross-site scripting problem.AKA the same-origin policy: "a script can read only the properties of windows and documents that have the same origin (i.e., that were loaded from the (1) same host, (2) through the same port, and (3) by the sameprotocol) as the script itself."In this case, the protocol is different, but i'm pretty sure a workaround that worked for different hosts would also work for different protocols. BretAt 03:02 PM 9/28/2005, Jeff Wood wrote:>Hmm, I'll have to look into it a bit further.>>I don't have any sites with an SSL sitting around to play with... I'll >see what I can do ... maybe somebody else has an idea ... ?? >>j.>>On 9/28/05, Sankar < [EMAIL PROTECTED]> wrote:> > I have enabled that option as well. > > i am still getting the error.. > >> > is there a way to overcome this ??> >> > - Sankar > >> >> > On 9/28/05, Jeff Wood < [EMAIL PROTECTED] > wrote: > > >> > > In my current installation of IE, there are options to allow> > > cross-domain scripting ... you might want to see what's available ...> > >> > > j. > > >> > > On 9/27/05, Sankar <[EMAIL PROTECTED] > wrote: > > > > > > > > I am testing an application whose main page is like this > > > >> > > > > > > > rows="130,*,0" marginheight="0" > > > > marginwidth="0">> > > > > > > > > > > > > > > > > > > >> > > > All my testing controls are in frame b. > > > > when the frame b contains http pages, WATIR is able to access it,> > > > When the frame b contains a login page which is https, WATIR is > throwing> > an> > > > error. > > > >> > > > I understand it is due to the cross domain scripting. Is there a way to> > over> > > > home this error > > > >> > > > there are 3 frames > > > > frame index: 0 name: header> > > > frame index: 1 --Access Denied--> > > > frame index: 2 name: download > > > >> > > >> > > > > > > >> > > >> > > > W, [27-Sep-2005 21:49:45#3704] WARN -- : frame error in waitdocument> > > > OLE error code:80070005 in > > > > Access is denied. > > > >> > > > HRESULT error code:0x80020009> > > > Exception occurred.> > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in > > > > `method_missing' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `wait'> > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `upto'> > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `wait' > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1849:in> > `waitForIE'> > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2099:in `click'> > > > E:/home-ST.rb:97:in `test_print_assertion' > > > > 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_mediato> > > >> > c:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:39:in > > > > `start'
Re: [Wtr-general] handling file dialog
Not even using AutoIt ??? I was under the impression that we could do just about ANYTHING with AutoIt. j. On 10/5/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: At 02:46 AM 10/5/2005, Zeljko Filipin wrote:>I also need that, as far as I know, it is not supported. >They say all modal dialogs will be supported in 1.5>(http://wtr.rubyforge.org/wiki/wiki.pl?RoadMap)There is some support for some modal dialogs in 1.4.It is often awkward, and will be improved in 1.5. There are also some typesof dialogs (not those mentioned by the OP) that can't be accessed using 1.4.Bret_Bret Pettichord www.pettichord.com___Wtr-general mailing listWtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general-- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to get background color source for a table cell?
Although I don't have the time to work the example tonight, the new xpath & integration with REXML should make that easy to get. j. On 10/6/05, Amita Shetty <[EMAIL PROTECTED]> wrote: Hi,How to get background color source for a table cell?I want to write a test case that verifies the color of the table cell as the color of the cell varies with cell data.HTML for the tablecell is as below:Critical8 Thanks,Amitha___Wtr-general mailing listWtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general-- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] string split after ie.contains_text
contains_text does NOT return the text It returns the index into the text on the page where the text occurs. You should use something like: # get the complete text of the current page page_text = $ie.text # run it through a regular expression and capture the match and it's subgroups match = /Event\# (\d+)/.match( page_text ) # if we got a result if match != nil # parse those two pieces ... the match complete_match = match[0] # and the subgroup digits = match[1] else # no match found end On 10/11/05, Cain, Mark <[EMAIL PROTECTED]> wrote: > Try to_str and if that doesn't work try to_s (supported by almost all > classes) > > --Mark > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of beth ferguson > Sent: Tuesday, October 11, 2005 10:23 AM > To: Watir Mailing List > Subject: [Wtr-general] string split after ie.contains_text > > theText= $~ = $ie.contains_text(/Event\# > ([0-9]+)([0-9]+)([0-9]+)([0-9])/) > > puts (theText); > > b = theText.split(/\d/) > > b.push(theText.sub(b[0],"")) > > puts b > > The above snippet does not work if theText is gotten via the > contains_text method. (I get the following error: > > ./createEvent.rb:40:in `userCreateEvent': private method `split' called > for # (NoMethodError) from someTest.rb:88) > > However the snippet does work if I hand it the string ("Event# 1234"). > Is there a ToString() method or something like that , that I can use to > make theText into a flat string rather than a method referent. > > Thanks- > > Beth > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to get background color source for a tablecell?
I'll get back to you as soon as I write up some example code based on what's currently in the CVS version of WATiR. j. On 10/10/05, Amita Shetty <[EMAIL PROTECTED]> wrote: > I tried getHTML for table cell(Table cell is dynamic) > ie.frame(:index,1).table(:index,table_index)[2][2].getHTML > But I am getting the following error message: > "undefined method `getHTML' for # > (NoMethodError)" > > How else can I do it? > > Thanks, > Amitha > > > > > > -Original Message- > From: [EMAIL PROTECTED] on behalf of Jeff Wood > Sent: Fri 10/7/2005 12:56 PM > To: wtr-general@rubyforge.org > Cc: > Subject: Re: [Wtr-general] How to get background color source for a > tablecell? > > > Although I don't have the time to work the example tonight, the new > xpath & integration with REXML should make that easy to get. > > j. > > > On 10/6/05, Amita Shetty <[EMAIL PROTECTED]> wrote: > > Hi, > How to get background color source for a table cell? > I want to write a test case that verifies the color of the > table cell as the color of the cell > varies with cell data. > > > HTML for the tablecell is as below: > > color="#FF">Critical8 > > Thanks, > Amitha > > > > > > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > -- > "http://ruby-lang.org -- do you ruby?" > > Jeff Wood > > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] string split after ie.contains_text
Yeah, but if you are going to learn ruby & regexps, do it the ruby way ... don't use those UGLY perl $1 $2 match items... go OOP on it ... return /Event\#([0-9]+)/.match( host.text )[1] j. On 10/11/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > At 04:23 PM 10/11/2005, beth ferguson wrote: > > Actually-- what i did was: > > > >theText= $~ = host.contains_text(/Event\# > >([0-9]+)([0-9]+)([0-9]+)([0-9])/) > > a = theText.to_s > > b = a.split(/\d/) > > b.push(a.sub(b[0],"")) > > host.link(:text, "[Logout]").click > > return b[1] > > > >Returning the 2 item of the split as i know that's what I'll always want > >in this instance > > I think this does what you want somewhat more simply: > >host.contains_text /Event\#([0-9]+)/ >return $1 > > Note that host.contains_text is just a fancy wrapper around a match. This > might be easier to understand: > >host.text =~ /Event\#([0-9]+)/ >return $1 > > In fact, i'm thinking of deprecating contains_text in favor of this, > because this just pushes you that much faster into learning Ruby regexps, > which is a good thing. > > Bret > > > > > _ > Bret Pettichord > www.pettichord.com > > _______ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] how to delete an item by clicking a trashcan icon...
One of the easiest ways to do this would be to have an ID inserted into those image tags ... something like id='delete_84' ... ... That makes it much easier to find the specific delete button you are looking for. WATiR treats clickable images as buttons ... so doing ie.button( :id, "delete_84" ).click will cause the _javascript_ to be fired. Hope that helps ... otherwise you've got a bit more work, but it's still doable. Let us know if you need more help. j. On 10/13/05, Roy Sin <[EMAIL PROTECTED]> wrote: I have a list of assets on a list page, basically one assetper row. And if the asset can be deleted, a trash can willbe visible at the beginning of that row. It's not like abutton where I can look for the attribute name. I can search for the asset name but how do I instruct the scriptto click the trash can next to that asset name?below is the property of that image.src="" border=0> thanksRoy__Yahoo! Mail - PC Magazine Editors' Choice 2005http://mail.yahoo.com___ Wtr-general mailing listWtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general -- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Iterating over a Unit Test With Hash Values
I would put the code to iterate the hash inside your test_* function. Simply make the first statement load your data ... then iterate over a child method. class MultiAddressTest < Test::Unit::Testcase def setup @testSite = "http://www.mapquest.com"; @ie = IE.new @testSite # default behavior, not necessary =>@ie.set_fast_speed # wrap in one call to IE.new => @ie.goto(@testSite) end def teardown @ie.close sleep 5 end def validate_direct( street, zip ) @ie.text_field( :name, "address" ).set street @ie.text_field( :name, "zipcode" ).set zip @ie.button( :value, "Get Directions" ).click # Do Assertions to validate assumptions about web page displayed after click end def test_directions load "input.rb" $plan.each { |curr| validate_direct curr[ "street" ], curr[ "zip" ] end end end ... should work. I took out your heavy use of global variables ... not necessary and generally considered "error prone". j. On 10/17/05, Terry Peppers <[EMAIL PROTECTED]> wrote: > I tried posting this to the mailing list last night to no avail, so if this > does show up as a double post I apologize in advance. > > I've been using Watir for the past couple of weeks with great success. My > company has been able to stay a bit more agile when it comes to releases > because of the unit tests for the code and because of the Watir tests for > the interfaces we've been building. It's made for some less stressful > releases - so I'm very thankful to the Watir community for this. > > I've been chewing on a problem for the past couple of weeks and getting no > success. I don't think it's a problem with Watir as much as it's my > inexperience with Ruby. > > My problem is this: What if I want to run a unit test multiple times but > with different data each time through the test? > > For example, let's say I have the following unit test - I'm using MapQuest > here as an example. My real world example does deal with addresses - and > MapQuest is a good example, I think. > > Here's some sample code: > > *** begin code *** > > require 'watir' > require 'test/unit' > include Watir > > class MultipleAddressTest < Test::Unit::TestCase > >def setup > $testSite = "http://www.mapquest.com"; > $street = "123 Foo" > $zip = "90210" > $ie = IE.new > $ie.set_fast_speed > $ie.goto($testSite) > $ie.wait >end > >def test_directions > $ie.text_field(:name, "address").set($street) > $ie.text_field(:name, "zipcode").set($zip) > $ie.button(:value, "Get Directions").click > sleep 7 > $ie.close >end > > end > > *** end code *** > > My problem is this - how can I run this same unit test multiple times for > different addresses. My object orientation isn't so good, and I'm not really > familiar with Unit Tests outside of what's in Watir's limited documentation. > Anyway, I digress. > > Let's say I have a hash that I can iterate through: > > *** begin pseduo code *** > > $plans = { >"1181" => { > "street" => "36 Dearborn Street", > "zip" => "01979" >}, >"1183" => { > "street" => "940 10th Street", > "zip" => "80302" >}, >"1184" => { > "street" => "14030 Biscayne Blvd", > "zip" => "33181" >}, >"1185" => { > "street" => "807 Reilly Ct", > "zip" => "95747" >}, >"1187" => { > "street" => "21388 West Lane", > "zip" => "19958" >}, >"1188" => { > "street" => "7877 Forest Blvd", > "zip" => "55125" >}, >"1189" => { > "street" => "10 River Walk Plaza", > "zip" => "55107" >} > } > > $plans.each_value do |plan| >street = plan['street'] >zip = plan['zip'] >puts street, zip > end > > *** end pseudo code *** > > How do I link up the ability to iterate through this hash for each pair of > addresses and zip codes with the Unit Test that takes address and zip as > inputs? I'd rather not write multiple tests that do the same thing - seems > repetitive work for a task that should be easy to accomplish with an > iterator. > > I hope I'm being clear - can anyone help me? I'm sure it's a very easy fix. > > Thanks. > > t. > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to check visibility of a control?
I know that somewhere deep down through all of the OLE crud ... the visibility of a control SHOULD be discernable. Just haven't found it. j. On 10/17/05, Vishal Chavan <[EMAIL PROTECTED]> wrote: Hi Amol, I am a newbie as far as Watir is concerned, but while struggling with a problem discovered that you can definately get the attributes for a control. Here is the code..Hope that what ur looking for... require 'watir' require 'test/unit' ie = Watir::IE.start(" http://wtr.rubyforge.org/watir_user_guide.html") var = ie.checkbox(:name, "checkme") puts var var = ie.radio(:name, "clickme") puts var #You get following output.. #type: checkboxid:name: checkmevalue: 1disabled: false type: radioid: 1name: clickmevalue: ondisabled: false Though this does not prove if the control is visible or not...Also there need to be a parser to parse the data in this case... If u learn some better way to do this, please let me know. Thanks, Vishal --- amol deshpande <[EMAIL PROTECTED]> wrote:From: amol deshpande < [EMAIL PROTECTED]>Date: Mon, 17 Oct 2005 10:29:05 -0700 (PDT)To: wtr-general@rubyforge.org Subject: [Wtr-general] How to check visibility of a control? Hi All,I wanted to check the visibility of a control on apage.I was wondering if there is any methd such asgetAttribute()When i tried this .. ie.show_attributes orcontrol_name = ie.control(:id,"abc")ie.getAttribute(control_name,"style.display")i get a error message No Such Method.Does anybody have any Idea of getting around this. ThanksADNo Body Has ever Collided With The Sky...So Sky Is The Limit!__ Yahoo! Music Unlimited Access over 1 million songs. Try it free. http://music.yahoo.com/unlimited/___Wtr-general mailing list Wtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general Join SQAtester.com Community ---> http://www.sqatester.com/testersarea/joinus.htm ___Wtr-general mailing listWtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general-- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] how to get the id from a href tag...
Actually, the more object oriented ruby way to do it would be --SCRIPT-- # define a method so you don't repeat yourself when you want to do this later. def getLinkID( *args ) # we used *args so we can pass whatever we want to the #link call. regex = /id=(\d+)/ id = nil begin # setup your tools & values href = ie.link( *args ).href # find the value matches = regex.match( href ) if matches # found it id = matches[1] end rescue # this failure would "normally" happen if ie.link can't find the link in the page. end # return whatever we have ... value or nil id end # how this is callable as my_id = getLinkID( :text, "New Vehicle" ) # or ( whatever you want ) my_id = getLinkID( :name, /Blah/ ) --SCRIPT-- I try to stay away from the less-readable perl-like ways of doing it. I don't like implicit variables. j. On 10/19/05, Zeljko Filipin <[EMAIL PROTECTED]> wrote: > I am not shure what do you need. My guess is that you need to isolate > 'id=89' from 'sub_viewvehicle.php?id=89&t=vehicle'. If you need > something else, let me know. > > # try to find 'id=' followed with two digits (\d) in > 'sub_viewvehicle.php?id=89&t=vehicle' > # 'sub_viewvehicle.php?id=89&t=vehicle' =~ /id=\d\d/ > ie.link(:text, 'New Vehicle').href =~ /id=\d\d/ > > # string that matches is stored in variable $& (and yes, this is ugly > looking variable, and it has a nicer Ruby name, but I can not find it > now) > puts $& > > Zeljko > > 2005/10/18, Roy Sin <[EMAIL PROTECTED]>: > > Hi All, > > > > Below is a sample of a href on a hyperlink > > > > New > > Vehicle > > > > How can I get the dynamic id? > > > > thanks > > > > > > > > > > __ > > Yahoo! Mail - PC Magazine Editors' Choice 2005 > > http://mail.yahoo.com > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to get background color source for atablecell?
Since you have the code for the table and/or table cell, the method is simply ".html" $ie.frame( :index, 1 ).table( :index, 2 ).html all done. you can then use a regular expression on the returned string. j. On 10/18/05, chaya shetty <[EMAIL PROTECTED]> wrote: > Can getHTML be used for a table or tablecell? > When I tried > tab=$ie.frame(:index,1).table(:index,2).getHTML > puts tab it gave the following exception: > undefined method `getHTML' for # (NoMethodError). > > > Amita Shetty <[EMAIL PROTECTED]> wrote: > > > -Original Message- > From: [EMAIL PROTECTED] on behalf of amol > deshpande > Sent: Wed 10/12/2005 1:49 AM > To: wtr-general@rubyforge.org > Cc: > Subject: Re: [Wtr-general] How to get background color source for > atablecell? > > > > Hi, > in the watir_bonus\unitTest\table_test.rb they have > highlighted the colors of the cells/rows. > If you have not seen that example ..check to see if it > helps > AD > > --- Amita Shetty wrote: > > > I tried getHTML for table cell(Table cell is > > dynamic) > > > ie.frame(:index,1).table(:index,table_index)[2][2].getHTML > > But I am getting the following error message: > > "undefined method `getHTML' for > > # (NoMethodError)" > > > > How else can I do it? > > > > Thanks, > > Amitha > &! gt; > > > > > > > > > > -Original Message- > > From: [EMAIL PROTECTED] on behalf > > of Jeff Wood > > Sent: Fri 10/7/2005 12:56 PM > > To: wtr-general@rubyforge.org > > Cc: > > Subject: Re: [Wtr-general] How to get background > > color source for a tablecell? > > > > > > Although I don't have the time to work the example > > tonight, the new xpath & integration with REXML > > should make that easy to get. > > > > j. > > > > > > On 10/6/05, Amita Shetty > > wrote: > > > > Hi, > > How to get background color source for a table > > cell? > > I want to write a test case that verifies the > > color of the table cell as the color of the cell > > varies with cell data. > > > > > > HTML for the tablecell is as below: > > > > > > style="width:! 60px; border:#00 1pt solid" title= > > "TITLE"> > color="#FF">Critical > 8 > > > > Thanks, > > Amitha > > > > > > > > > > > > > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > -- > > "http://ruby-lang.org -- do you ruby?" > > > > Jeff Wood > > > > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > No Body Has ever Collided With The Sky...So Sky Is The Limit! > > > > __ > Start your day with Yahoo! - Make it your home page! > http://www.yahoo.com/r/hs > ___ > Wtr-gen! eral mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > Yahoo! India Matrimony: Find your partner now. > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] how to get the id from a href tag...
Your easiest solution is to get your developer to add an id tag to the image. It won't hurt anything and it makes testing infinitely easier. You have With the addition, you would have Which would make finding the right image to click: id = getLinkID( :name, "New Vehicle" ) ie.button( :id, /del_#{ id }/ ).click Nice and clean, yeah? Always try to get development to put IDs on things it will save your sanity. j. On 10/19/05, Roy Sin <[EMAIL PROTECTED]> wrote: > Thanks Jeff and Zeljko for both the more OO method and the > quick method. > To explain further what I need to do is to get the id. From > that id then I want to click a gif image in an IMG tag > example as shown below: > src="/brand/client/images/del.gif" border=0> > > Let's say the id is 80 and I pass it in a variable $myid > > How do I proceed to click that image? because onclick is > not > part of the IMG attribute it's a javascript that the > developer is passing the id to. > > $ie.frame("main").image(:??, ??).click > > thanks for the help > > --- Jeff Wood <[EMAIL PROTECTED]> wrote: > > > Actually, the more object oriented ruby way to do it > > would be > > > > --SCRIPT-- > > > > # define a method so you don't repeat yourself when you > > want to do this later. > > def getLinkID( *args ) > > > > # we used *args so we can pass whatever we want to the > > #link call. > > > > regex = /id=(\d+)/ > > id = nil > > > > begin > > > > # setup your tools & values > > href = ie.link( *args ).href > > > > # find the value > > matches = regex.match( href ) > > if matches > > # found it > > id = matches[1] > > end > > > > rescue > > > > # this failure would "normally" happen if ie.link > > can't find the > > link in the page. > > > > end > > > > # return whatever we have ... value or nil > > id > > > > end > > > > # how this is callable as > > my_id = getLinkID( :text, "New Vehicle" ) > > > > # or ( whatever you want ) > > my_id = getLinkID( :name, /Blah/ ) > > > > --SCRIPT-- > > > > I try to stay away from the less-readable perl-like ways > > of doing it. > > I don't like implicit variables. > > > > j. > > > > On 10/19/05, Zeljko Filipin <[EMAIL PROTECTED]> > > wrote: > > > I am not shure what do you need. My guess is that you > > need to isolate > > > 'id=89' from 'sub_viewvehicle.php?id=89&t=vehicle'. If > > you need > > > something else, let me know. > > > > > > # try to find 'id=' followed with two digits (\d) in > > > 'sub_viewvehicle.php?id=89&t=vehicle' > > > # 'sub_viewvehicle.php?id=89&t=vehicle' =~ /id=\d\d/ > > > ie.link(:text, 'New Vehicle').href =~ /id=\d\d/ > > > > > > # string that matches is stored in variable $& (and > > yes, this is ugly > > > looking variable, and it has a nicer Ruby name, but I > > can not find it > > > now) > > > puts $& > > > > > > Zeljko > > > > > > 2005/10/18, Roy Sin <[EMAIL PROTECTED]>: > > > > Hi All, > > > > > > > > Below is a sample of a href on a hyperlink > > > > > > > > New > > > > Vehicle > > > > > > > > How can I get the dynamic id? > > > > > > > > thanks > > > > > > > > > > > > > > > > > > > > __ > > > > Yahoo! Mail - PC Magazine Editors' Choice 2005 > > > > http://mail.yahoo.com > > > > ___ > > > > Wtr-general mailing list > > > > Wtr-general@rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > ___ > > > Wtr-general mailing list > > > Wtr-general@rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > -- > > "http://ruby-lang.org -- do you ruby?" > > > > Jeff Wood > > > > ___ > > Wtr-general mailing list > > Wtr-general@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > __ > Yahoo! Mail - PC Magazine Editors' Choice 2005 > http://mail.yahoo.com > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Loading input variables from a text file into 2Darray (long)
Additionally, You should start to look at WET , the extension to the watir project ... It actually has a syntax for you being able to define your test data in an excel spreadsheet ( for easy modification ) ... and then call it directly from your script. There is a merger in the works between the projects ... No information yet on when, but ... You could take a look at that ... it might be an easier way to maintain the information you need for testing. j. On 10/19/05, Mike Tierney <[EMAIL PROTECTED]> wrote: > Thanks to all. I used this one below (works great) but I'll check out the > other solutions when I have time. In about 2002 I was sick of using Rational > Robot datapools, had a lot of boring, repititious stuff to add over & over > via Robot in a few screens, and found something similar to this whole concept > in a Rational group contributed by Carl Nagle. I think it was the first yahoo > group, not the one where you have two-tiered input files ok I'm off > topic. The point is a little test automation can turn a horribly boring > testing task into something reasonably good & productive. > Now watir is really slick- can't wait for the next cool thing I can do with > it. Also belated thanks Carl if you are out there. > Mike Tierney > > > Try this: > > dataArray= Array.new > n = 0 > File.new("data.csv").each_line do |line| > line.chomp! > dataArray[n] = line.split(',') > n += 1 > end > > i=0 > while(i < dataArray.length) > # go to address query start > > puts "First: #{dataArray[i][0]}" > puts "Second: #{dataArray[i][1]}" > puts "Third: #{dataArray[i][2]}" > > sleep 2 > > i = i + 1 > sleep 2 > > end > > > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] screw it, I'm using Perl Fwd: painfully stupid AutoIT question
Actually, the problem is that you didn't tell AutoIT WHICH window to send the RETURN to ... If you look at the documentation and the unit tests that are included with Watir, you will see proper usage for AutoIT. j. On 10/20/05, Chris McMahon <[EMAIL PROTECTED]> wrote: > Hi... > I definitely have some sort of WIN32OLE vs AutoIt problem. I > broke out the Perl controller to capture that particular error > message. > I gave up on AutoIt, I'm using Perl Win32::GuiTest and perl > system(1,ruby.exe) for a controller. It's easy, it's bulletproof, and > it works. > > -Chris > > -- Forwarded message -- > From: Chris McMahon <[EMAIL PROTECTED]> > Date: Oct 20, 2005 11:58 AM > Subject: painfully stupid AutoIT question > To: wtr-general@rubyforge.org > > > This should work, right? > > # > popup_thread = Thread.new { > puts "entering popup thread" > sleep 1 > @autoit = WIN32OLE.new('AutoItX3.Control') > @autoit.WinWait "", "" > @autoit.Send "{ENTER}" >puts Time.now > } > > puts "clicking link" > puts Time.now > @ie.link(:id,"peskyPopupLink").click > > popup_thread.join #JUST IN CASE > ### > > popup_thread starts, returning control to the calling script > Watir clicks peskyPopupLink > popup_thread sleeps 1 second, cranks up AutoIt, attaches to top > window, and hits the default button. > > But I don't think popup_thread ever completes. Output from this script is > > Started > entering popup thread > clicking link > Thu Oct 20 11:53:51 Central Daylight Time 2005 > > leading me to believe that the "puts Time.now" in popup_thread is > never executed. Any suggestions as to what I've done wrong are > welcome... > -Chris > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] screw it, I'm using Perl Fwd: painfully stupid AutoIT question
+1 on the comment ... But, you can cheat and use dRuby or my new Roxy classes to talk between scripts physically running in seperate processes if necessary ... That may help with the threading issues ... yes/no? j. On 10/21/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > At 10:48 AM 10/21/2005, Chris McMahon wrote: > >I was only able to capture the msg. when running the AutoIt script in > >the Perl controller. > > The threading in the Win32 Ruby implementation is distinctly inferior to > Perl's. There, i said it. > > Bret > > > _ > Bret Pettichord > www.pettichord.com > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] screw it, I'm using Perl Fwd: painfully stupid AutoIT question
Ruby manages it's own threads so in some ways it's better ... But, in other ways, worse. j. On 10/21/05, Chris McMahon <[EMAIL PROTECTED]> wrote: > > The threading in the Win32 Ruby implementation is distinctly inferior to > > Perl's. There, i said it. > > Yikes! > Perl's threads are no great shakes, and neither are Windows'. I was > under the impression that Ruby's threads were about the best out > there. > -C > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] screw it, I'm using Perl Fwd: painfully stupid AutoIT question
All I can say is ... well, there should be nothing perl can do that ruby can't do better ( except make really line-noise looking scripts ;) ) j. On 10/21/05, Chris McMahon <[EMAIL PROTECTED]> wrote: > > yes/no? > > I really, really like the architecture of a process that loops, > handling normal Windows client windows with a GuiTest implementation, > and another process that uses Watir to muck around in IE. > > Once it's running, maintenance is trivial, adding handling for new > popup windows is easy, and there are none of the tightly-coupled > issues when trying to manipulate multiple threads from within the same > script. > > That said, I wonder how Wayne is doing on a Ruby GuiTest? Anyone > know? (I've been following the Perl GuiTest mail list, and version > 1.5x looks really, really powerful.) > -Chris > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] file_field
#1 The window pops because the watir library uses a second script to encapsulate the functionality of doing a file upload. The second program is cycling through all of the window titles it can find looking for the file dialog that was created when your script said to upload a file. When it finds it, it sets the entry field to the name you provided and clicks the "select" button on the dialog, making it go away. #2 The only way to prevent it would be to rename the script it is running to a .rbw file extension and change the watir library to use the renamed script. .rb files open in a console .rbw files open without one. But, you lose the debugging information it provides... Hope that helps j. On 10/24/05, Dale Herrig <[EMAIL PROTECTED]> wrote: When ever I use the ie.fileField it pops up a dos window and seems to be cycling through a number of directories. Question #1. Does anybody know why the window is popped up and what it is doing. Question #2. Is there a way to prevent the dos window from popping up. Thanks ___Wtr-general mailing list Wtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general -- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] documentation function
Since your scripts are written in Ruby, you can use the provided tools for RDoc to generate documentation on your class files. Review the online documentation for the RDoc project for more information: http://rdoc.sourceforge.net/doc/index.html Hope that helps. It has a variety of different output formats. j. On 10/24/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: is there a documentation function for watir? wherein comments will be like constructed in xml format and serve as a documentation of the test script? ___Wtr-general mailing listWtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general-- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] help on clicking an image...
Try $ie.frame( :name, "main" ).image( :alt, "Delete Asset" ).click If that doesn't work, please provide a bit more information. Debugging with a blindfold is pretty hard stuff. j. On 10/24/05, amol deshpande <[EMAIL PROTECTED]> wrote: Hi,try and use the alt attribute.$ie.frame("main").image(:alt,"DeleteAsset").fire_event("onclick") AD--- Roy Sin <[EMAIL PROTECTED]> wrote:> Hi All>> I have an image tag like:> > src="" border=0>>> I tried the following where the variable $theid is> 1334> from> above but>> $ie.frame("main").image(:text, > />>> but i get the error> Watir::Exception::UnknownObjectException: Unable to> locate> object, using text and (?-mix:>> > thanks in advance for any help on that.>>>>>>> __> Yahoo! Mail - PC Magazine Editors' Choice 2005> http://mail.yahoo.com> ___> Wtr-general mailing list> Wtr-general@rubyforge.org> http://rubyforge.org/mailman/listinfo/wtr-general>No Body Has ever Collided With The Sky...So Sky Is The Limit!__Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com___Wtr-general mailing listWtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general-- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] getting the exception value
There's been on going threads both here & in the general [EMAIL PROTECTED] mailing list. IEs COM interface does not expose any of the HTTP information for the request. Suggestions have included using a small proxy server in between you and the actual site and then finding some way of querying it for the HTTP information. Nothing seems to have been done on that front. j. On 10/24/05, Jonathan Kohl <[EMAIL PROTECTED]> wrote: Or in the body - not sure if getHTML will get the title tags or not.> -Original Message- > From: [EMAIL PROTECTED]> [mailto:[EMAIL PROTECTED]] On Behalf Of Jonathan Kohl > Sent: October 24, 2005 9:55 PM> To: wtr-general@rubyforge.org> Subject: Re: [Wtr-general] getting the exception value>> You could probably use getHTML, and then use a regular > _expression_ to parse out the error from the HTML. You can> often find that in the title tags:> 404 Not Found>> Hope that helps.>> -Jonathan> > > -Original Message-> > From: [EMAIL PROTECTED]> > [mailto: [EMAIL PROTECTED]] On Behalf Of> Pierre Garigue> > Sent: October 24, 2005 9:38 AM> > To: wtr-general@rubyforge.org> > Subject: [Wtr-general] getting the exception value > >> >> > Looking around the API I found this:> >> > Watir::Exception::NavigationException> > "This exception is thrown if an http error, such as a 404, > 500 etc is> > encountered while navigating"> >> >> > Does anyone have an example where this is used? I would> also very much> > like to be able to know if it was a 404 or a 500 for my logs > >> > Cheers> >> > Pierre Garigue> > Quality Assurance> > EXTEND>>MEDIA> > 190 Liberty Street> > Toronto, Ontario> > Canada > > M6K 3L5> > ___> > e:[EMAIL PROTECTED]> > http://www.extend.com> >> > > >> > ___> > Wtr-general mailing list> > Wtr-general@rubyforge.org> > http://rubyforge.org/mailman/listinfo/wtr-general> >>> _______> Wtr-general mailing list> Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general>___Wtr-general mailing list Wtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general -- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Error while running unit test for File Field
Usually, If you enclose an argument like : D:\Program Files\watir in quotes, things are happier "D:\Program Files\watir" Works that way from the command line too. Hope that helps. j. On 10/24/05, Angrez Singh <[EMAIL PROTECTED]> wrote: Hi,I got following error while running the unit test case for File Field. The system cannot find the file d:/program. I have installed watir 1.4.1 in directory d:/program files/watir.I think its the space between 'program' and 'files' that is causing the problem.If I install it in the directory d:/watir/ everything works fine or any directory which is not having space in its name.Is this a bug?Regards,Angrez___Wtr-general mailing list Wtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general -- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] help on clicking an image...
Unfortunately you can't pass parameters to the fireEvent ... all you are doing is telling IE that the event needs to be fired ... IE looks at the event you requested to see if that element has a handler for that event. You can do the multiple criteria, without WET (yes it's more limited, but it does work). $ie.buttons( :alt, "Delete Asset" )[1].click However this still doesn't help with the OP as much as he would like. Truly, I would suggest getting the developers to add an id attribute to these and name it something like delete_#{ item_id } so if the id is 84 then the tag would ge It would make your life MUCH easier, then you simply code for $ie.button( :id, "delete_#{ desired_item_id }" ).click done. With out that, using index is your only real choice. Currently. When the new version of WATiR hits that has XPath support, you'll be able to find it with: $ie.button( :xpath, "//[EMAIL PROTECTED]'rusure(#{ desired_item_id })\'" ).click # ( or something like that... ) My XPath is rusty ... use www.zvon.org ... great online XPath tutorial. Anyways, the new xpath support is going to open up our world ... just gotta wait a bit longer...j. On 10/25/05, Sathya Shankar <[EMAIL PROTECTED]> wrote: Hi Roy.I think for this case you require multiple parameter to recognzie oneobject. This option is supported in WET. In WET the syntax would by like this.Browser("title:=.").Button("alt:=Delete Asset", "id:=","index:=1").clickI think this should solve your issue. RegardsSathyaRoy Sin wrote:>thanks for the suggestion this will work if there was only>one image with alt text "Delete Asset". But I have more>than one images with the same alt text, the only thing that >differentiate them is the dynamically generated id, that is>why I'm trying to pass the id. Could I pass the id in the>onclick in the fire_event method?>>>--- amol deshpande < [EMAIL PROTECTED]> wrote:>>>>>Hi,>>try and use the alt attribute.>>$ie.frame("main").image(:alt,"Delete>>Asset").fire_event("onclick") >>AD>>>>--- Roy Sin <[EMAIL PROTECTED]> wrote:>>>>>>>>>Hi All>>>>>>I have an image tag like: >>>>>>src="" border=0>>>>>>>I tried the following where the variable $theid is >>>1334>>>from>>>above but>>>>>>$ie.frame("main").image(:text,>>>/>>>>>>>but i get the error >>>Watir::Exception::UnknownObjectException: Unable to>>>locate>>>object, using text and (?-mix:>>>>>>>thanks in advance for any help on that. >>>>>>>>>>>>>>>>>>>>>__>>>Yahoo! Mail - PC Magazine Editors' Choice 2005>>> http://mail.yahoo.com>>>___>>>Wtr-general mailing list>>>Wtr-general@rubyforge.org >>>http://rubyforge.org/mailman/listinfo/wtr-general>>>>>>>>>>>No Body Has ever Collided With The Sky...So Sky Is The >>Limit!>>>>>>>>__>>Yahoo! FareChase: Search multiple travel sites in one>>click.>> http://farechase.yahoo.com>>___>>Wtr-general mailing list>>Wtr-general@rubyforge.org>> http://rubyforge.org/mailman/listinfo/wtr-general>>>>>>>>>>>>__ >Yahoo! Mail - PC Magazine Editors' Choice 2005>http://mail.yahoo.com>___>Wtr-general mailing list> Wtr-general@rubyforge.org>http://rubyforge.org/mailman/listinfo/wtr-general>>--Sathya Shankar M GSoftware Testing Engineer Qantom Softwarehttp://www.qantom.comPh : 26799269 Xtn. 123sip : [EMAIL PROTECTED]___ Wtr-general mailing listWtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general -- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] password clear text
Or, simply request the information during testing... puts "Username: " username = gets puts "Password: " password = gets # this should be a call to readline so you can hide it, but I haven't figured out how to do that yet. anyways, ... done. j. On 10/25/05, Bret Pettichord <[EMAIL PROTECTED]> wrote: > At 10:37 AM 10/25/2005, Dale Herrig wrote: > >I developed a test script to login using the following: > > > > ie.text_field(:name,"id").set("username") > > ie.text_field(:name,"passwd").set("password") > > > >This works just fine but I had to hardcode the password. We have some > >concerns about clear text passwords in scripts. > > > >So the question is, is there a way to create an encrypted password and > >store in a binary file and then have the test script read the binary file > >and encode the password, perhaps something like: > > > >ie.text_field(:name,"passwd").setEncrypted(password.encrypted.file) > > > >I did not find anything in the archive about this, but perhaps I missed. > > Where would you store the encryption key? How would you store it? As clear > text? > > The common solution to this problem is to put the passwords in a separate > file that is not stored with the scripts. This avoids hard-coding. > >require 'passwords' >ie.text_field(:name, "passwd").set($user_password) > > Your suggested use of encryption sounds like waving a magic wand without > really protecting anything. I am sure that there is a way to do what you > ask, but i just don't see the point. > > Bret > > > _____ > Bret Pettichord > www.pettichord.com > > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] clicking on link with same name
# set focus to the mainFrame ie.frame( :name, "mainFrame" ).click # get the count of links that match the criteria ie.links( :href, /.*manish.*delete.*/ ).size.times do |iter| # iterate over them without relying on the collection since it will change after each click. ie.links( :href, /.*manish.*delete.*/ )[i+1].click end something like that should work ... j. On 10/25/05, Manish Sapariya <[EMAIL PROTECTED]> wrote: > Hi list, > > I have a app which has multiple links on same page with same > name. However each of this link is associated with one more > link which identifies them uniquely. To be very specific its > the page has list of records which I can edit or delete. The > links for edit/delete have same name, but they are assciated > with record name. > > Currently I have hacked way as following. > So I delete the record its name is/or like manish. > > > --- > i = 0 > ie.frame("mainFrame").links.each { |l| > i = i +1 > if l.to_s =~ /manish/ then > if l.to_s =~ /delete/ then > print l.to_s > puts "\n#{i}i\n" > ie.frame("mainFrame").link(:index, i).click > break; > end > > > end > } > --- > > Is there a cleaner solution? > > Thanks and Regards, > Manish > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to hide the explorer window in Watir
Not that I'm aware of. j. On 10/25/05, chaya shetty <[EMAIL PROTECTED]> wrote: > > > Hi, > > I want the internet explorer window to be hidden while my script is running. > > One option for this is: > > $ie.getIE.visible = false > > But this will just hide the main window, the popups are not hidden. > > Is there any other way to do this?? > > > > > Thanks > > Chaya > > > Yahoo! India Matrimony: Find your partner now. > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Is there a method to do ie.contains_html() ?
IT's a LOT easier than that ... just add class Watir::IE def contains_html( input ) html.scan( input ) != [] end end after you do your require... now it *does* have a contains_html function. assert $ie.contains_html "blah" or assert $ie.contains_html /blah/ hope that helps. j. On 10/26/05, Sy Ali <[EMAIL PROTECTED]> wrote: Ok, interpreting Pierre's example, I can come up with the code below.However, this always fails. I assume I'm doing something somewhat wrong here, but I don't quite understand what.#-- BEGINrequire 'Watir' # the watir controllerinclude Watir# Search for text in the HTML of a pagedef search_html(string) puts " searching the source for " + string begin assert_match(string,$ie.html()) puts " ok -- found " + string rescue => e puts ">>>FAIL -- could not find " + string endend$ie = Watir::IE.start("http://example.com")search_html(".")# END___ Wtr-general mailing listWtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general -- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Is there a method to do ie.contains_html() ?
There are two problems ... #1 you can't use the assert functions unless you are building a TestCase object... #2 you don't need the search_html function. just require 'watir' include Watir class Watir::IE def contains_html( input ) html.scan( input ) != [] end end $ie = IE.new $ie.goto http://example.com $ie.contains_html( "." ) should return a true or false. so you could do if $ie.contains_html "." puts "Has html" else puts "Doesn't have html" end ... that's all there is to it... My code was meant as an alternative ... but any function that people send to you that contains assert won't work without additional libraries being required. Let me know if my example doesn't work for you. j. On 10/26/05, Sy Ali <[EMAIL PROTECTED]> wrote: Jeff, does that mean that I do this? :require 'Watir' # the watir controllerinclude Watir class Watir::IEdef search_html( input ) html.scan( input ) != []endenddef search_html(string) puts " searching the source for " + string begin assert_match($ie.contains_html,string) puts " ok -- found " + string rescue => e puts ">>>FAIL -- could not find " + string endend$ie = Watir::IE.start(" http://example.com")search_html(".")Because this also fails..___Wtr-general mailing list Wtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general-- " http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] getting the HTTP status
Just remember that the assert* functions are ONLY available two ways ... either do a require 'test/unit/assertions' include Test::Unit::Assertions # now you have access to the assert* functions. or put your code inside of an object derived from Test::Unit::TestCase ... Hope that helps. j. On 10/26/05, Pierre Garigue <[EMAIL PROTECTED]> wrote: you may want to look at the log4r http://log4r.sourceforge.net/ to have an oject that take care of loging your reports. It may be overkill.Most of my test use the 'rescue => e' wayexample expected = "hello" #some text on the homepage @@log.info "Expected: Home page Page" begin @@ie.goto(homepageurl) assert(@@ie.contains_text(expected)) @@log.info "PASS" rescue => e @@log.info "FAIL" end I'm not sure the way below is better, here is a fragment begin assert_nothing_raised(){ (@@ ie.link(:text, link_name).click) } @@log.info "PASS: got down to #{link_name}" rescue => e @@log.info "FAIL: did not get to #{link_name}" endcheersPierre garigue-Original Message- From: Sy Ali [mailto:[EMAIL PROTECTED]]Sent: Wednesday, October 26, 2005 1:30 PMTo: wtr-general@rubyforge.orgSubject: Re: [Wtr-general] getting the HTTP status On 10/21/05, Pierre Garigue <[EMAIL PROTECTED]> wrote:> I because I 'rescue' everything, getting a 500 or 404 would just give me a fail. I would like to add info to the log that is failed and got this http status. I too am using the basic "rescue" technique, which doesn't really giveme a whole lot to work with. I read through the technical docs[1] andcouldn't find anything more specific. Perhaps this feature does not exist?I wonder what would happen if I turned on friendly error messages ..then if rescue catches the error, could I scan the page or title todetermine the nature of the error?Here is my "go to" method, used with goto("http://example.org/foo/bar.html") or goto(variable). It'sdifferent than yours because it notices succesfully-loaded, butredirected pages:def goto(url) begin puts "* going to " + url $ie.goto(url) rescue puts ">>>ERROR" else puts " ok, destination loads" end if $ie.url() == url puts " ok, I stayed at the destination url" else puts " warning: rewriting or redirection took effect" endend[1] http://wtr.rubyforge.org/rdoc/index.html___Wtr-general mailing list Wtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general___Wtr-general mailing list Wtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general -- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Is there a method to do ie.contains_html() ?
Well, when you get back let me know ... always glad to help. j. On 10/26/05, Sy Ali <[EMAIL PROTECTED]> wrote: On 10/26/05, Sy Ali <[EMAIL PROTECTED]> wrote:> Jeff, does that mean that I do this? : >> require 'Watir' # the watir controller> include Watir>> class Watir::IE> def search_html( input )> html.scan( input ) != []> end> end> def search_html(string) > puts " searching the source for " + string> begin> assert_match($ie.contains_html,string)> puts " ok -- found " + string > rescue => e> puts ">>>FAIL -- could not find " + string> end> end>> $ie = Watir::IE.start(" http://example.com")> search_html(".")>>> Because this also fails..>Blah, now I know that's wrong.. I think I'm going to take a break...___ Wtr-general mailing listWtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general -- "http://ruby-lang.org -- do you ruby?"Jeff Wood ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general