From andy__s at hotmail.com Sun May 1 11:22:21 2005 From: andy__s at hotmail.com (Andy Sipe) Date: Sun, 01 May 2005 11:22:21 -0400 Subject: [Wtr-general] counting regular expressions on a page In-Reply-To: <593b9ae8050430173242e64228@mail.gmail.com> Message-ID: No direct way that I know of, but it'd be easy enough to add. Until its added, another way to get it would be to use the scan method of string against the text. Something like: require 'Watir' include Watir def count_occurances(ie, pattern) count = 0 ie.text.scan(pattern){|txt|count += 1} count end ie = IE::start("http://www.google.com") puts count_occurances(ie, /oo/) # 4 puts count_occurances(ie, /Goog/) # 2 this will count all occurances of 'oo' and 'Goog' on the google home page. -andy ----Original Message Follows---- From: Shao Kang Tat <shaorobics at gmail.com> hi, say I'm doing this: assert($ie.contains_text(*some regular expression*)) is there a way to get a hold of the # of occurences this regular expression appears on the page? Thanks Shao _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Sun May 1 12:16:18 2005 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 01 May 2005 11:16:18 -0500 Subject: [Wtr-general] counting regular expressions on a page In-Reply-To: References: <593b9ae8050430173242e64228@mail.gmail.com> Message-ID: <5.1.0.14.2.20050501111530.039b87a8@127.0.0.1> At 10:22 AM 5/1/2005, Andy Sipe wrote: > count = 0 > ie.text.scan(pattern){|txt|count += 1} > count or: ie.text.scan(pattern).length _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Sun May 1 12:10:20 2005 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 01 May 2005 11:10:20 -0500 Subject: [Wtr-general] Clicking Popup Windows In-Reply-To: <20050430084111.YQPH10290.priv-edtnes56.telusplanet.net@tin tin> References: <5.1.0.14.2.20050430021205.03adcc28@127.0.0.1> Message-ID: <5.1.0.14.2.20050501110546.039b88e8@127.0.0.1> At 03:41 AM 4/30/2005, Jonathan Kohl wrote: >This is definitely more intuitive than what we have been doing, and closer >to what I think would be the most intuitive: >ie.button("Go").click >window_helper.push_confirm_button_ok > >I don't know how we could do the latter without using threads, but the >example you gave is better than what we've been doing. I think that we could eventually do this without having to make the users use threads. But that means that we'd have to hide the use of threads ourselves. The way to do this would be that we'd have to start up a seperate server that would actually be used to drive IE itself and all calls such as ie.foo would be passed to the server (a separate ruby process) using DRB. The server would then be blocked whenever a popup appeared. But the popup calls, on the other hand, would be handled directly by the client process (the one the user is using). So they wouldn't be blocked. But it will be a lot of work before we get there. In the mean time, i suggest that we rename WindowHelper to Popup, since that is what we are talking to. (Just as we call our IE Helper IE.) And it should be in the Watir module. Bret _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Sun May 1 12:57:03 2005 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 01 May 2005 11:57:03 -0500 Subject: [Wtr-general] testing show_links In-Reply-To: References: <5.1.0.14.2.20050430001302.03ae2eb0@127.0.0.1> Message-ID: <5.1.0.14.2.20050501115612.03a30ba8@127.0.0.1> At 10:34 AM 4/30/2005, Andy Sipe wrote: >The test is passing on my local build, if someone can send in the failing >message I can fix it, I'm sure it has something to do with the building of >the file URLs and the $myDir variables. looks like some missing whitespace in the regexp: 4) Failure: test_showLinks(TC_showlinks) [d:/workspace/watir/unittests/../unittests/links_test.rb:149:in `test_showLinks' d:/workspace/watir/unittests/../unittests/links_test.rb:149:in `each_with_index' d:/workspace/watir/unittests/../unittests/links_test.rb:149:in `each' d:/workspace/watir/unittests/../unittests/links_test.rb:149:in `each_with_index' d:/workspace/watir/unittests/../unittests/links_test.rb:149:in `test_showLinks']: <"1 file:///d:/workspace/watir/unittests/html/links2.html test1"> expected to be =~ . _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Sun May 1 13:03:55 2005 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 01 May 2005 12:03:55 -0500 Subject: [Wtr-general] unit test failures In-Reply-To: <20050430093229.VSJR1968.priv-edtnes28.telusplanet.net@tint in> Message-ID: <5.1.0.14.2.20050501120318.03a922d0@127.0.0.1> At 04:32 AM 4/30/2005, you wrote: >I ran with the -f switch for fast, and it ran very quickly. Very cool >feature! Sadly, my Ruby runtime crashed (looked like a General Protection >fault) about half way through the test run using 1.8.0-10 on Win2K. We've seen crash bugs in the OLE library in older versions. I suggest upgrading to Ruby 1.8.2. This upgrade may fix your assert_raise problem as well. _____________________ Bret Pettichord www.pettichord.com From andy__s at hotmail.com Sun May 1 15:18:38 2005 From: andy__s at hotmail.com (Andy Sipe) Date: Sun, 01 May 2005 15:18:38 -0400 Subject: [Wtr-general] testing show_links In-Reply-To: <5.1.0.14.2.20050501115612.03a30ba8@127.0.0.1> Message-ID: Thanks - The white space between the url and the inner text wasn't showing up for me locally because the path was much longer. When I moved it to a shorter location it failed. I updated the test to account for the space if it exists. Thanks -andy ----Original Message Follows---- From: Bret Pettichord <bret at pettichord.com> At 10:34 AM 4/30/2005, Andy Sipe wrote: >The test is passing on my local build, if someone can send in the >failing message I can fix it, I'm sure it has something to do with >the building of the file URLs and the $myDir variables. looks like some missing whitespace in the regexp: 4) Failure: test_showLinks(TC_showlinks) [d:/workspace/watir/unittests/../unittests/links_test.rb:149:in `test_showLinks' d:/workspace/watir/unittests/../unittests/links_test.rb:149:in `each_with_index' d:/workspace/watir/unittests/../unittests/links_test.rb:149:in `each' d:/workspace/watir/unittests/../unittests/links_test.rb:149:in `each_with_index' d:/workspace/watir/unittests/../unittests/links_test.rb:149:in `test_showLinks']: <"1 file:///d:/workspace/watir/unittests/html/links2.html test1"> expected to be =~ </^1 + +file:\/\/\/d:\/workspace\/watir\/unittests\/html\/links2.htmltest1$/>. _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From shaorobics at gmail.com Sun May 1 19:29:02 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Sun, 1 May 2005 19:29:02 -0400 Subject: [Wtr-general] assertions Message-ID: <593b9ae805050116291168c9ee@mail.gmail.com> hi when I do an assert w/o a begin/rescue block I get this printed to the screen: 1) Failure: test_a(HTMLLogTester) [C:/Documents and Settings/Shao/Desktop/Log Test/Test.rb:59:in `case3' C:/Documents and Settings/Shao/Desktop/Log Test/Test.rb:19:in `test_a']: is not true. but when I use a begin/rescue block and do: puts e.message the only message I get is " is not true. is there a way to get the other part of the failure/errors? I want to put them in a variable.. Shao From alex at verk.info Sun May 1 19:56:59 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Sun, 01 May 2005 19:56:59 -0400 Subject: [Wtr-general] assertions In-Reply-To: <593b9ae805050116291168c9ee@mail.gmail.com> References: <593b9ae805050116291168c9ee@mail.gmail.com> Message-ID: Shao Kang Tat wrote: >puts e.message > >the only message I get is " is not true. > > Try this: puts e.message puts e.backtrace -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) From shaorobics at gmail.com Sun May 1 20:03:22 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Sun, 1 May 2005 20:03:22 -0400 Subject: [Wtr-general] assertions In-Reply-To: References: <593b9ae805050116291168c9ee@mail.gmail.com> Message-ID: <593b9ae805050117033634932e@mail.gmail.com> Hi Alexey I actually tried that: e.backtrace. it gives a rather large list, including lines from the assertion.rb files as well. I'm more interested in just the calls made by my test only. For example I want this: 1) Failure: test_a(HTMLLogTester) [C:/Documents and Settings/Shao/Desktop/Log Test/Test.rb:59:in `case3' C:/Documents and Settings/Shao/Desktop/Log Test/Test.rb:19:in `test_a']: is not true. and not this, as it includes much more detail c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:41:in `assert_blocko' c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:39:in `_wrap_assertion' c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:39:in `assert_blocko' c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:50:in `asserto' c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:48:in `_wrap_assertion' c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:48:in `asserto' C:/Documents and Settings/Shao/Desktop/Log Test/Test.rb:61:in `case3' C:/Documents and Settings/Shao/Desktop/Log Test/Test.rb:21:in `test_a' 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' Thanks On 5/1/05, Alexey Verkhovsky wrote: > Shao Kang Tat wrote: > > >puts e.message > > > >the only message I get is " is not true. > > > > > Try this: > puts e.message > puts e.backtrace > -- > > Best regards, > > Alexey Verkhovsky > > Ruby Forum: http://ruby-forum.org (moderator) > RForum: http://rforum.andreas-s.net (co-author) > Instiki: http://instiki.org (maintainer) > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From alex at verk.info Sun May 1 20:10:59 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Sun, 01 May 2005 20:10:59 -0400 Subject: [Wtr-general] assertions In-Reply-To: <593b9ae805050117033634932e@mail.gmail.com> References: <593b9ae805050116291168c9ee@mail.gmail.com> <593b9ae805050117033634932e@mail.gmail.com> Message-ID: Shao Kang Tat wrote: >Hi Alexey > >it gives a rather large list, including lines from the assertion.rb >files as well. > > It's Ruby, so everything is easy. Try: puts e.backtrace.delete_if { |path| path =~ /test\/unit/ } Good enough? -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) From shaorobics at gmail.com Sun May 1 20:14:32 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Sun, 1 May 2005 20:14:32 -0400 Subject: [Wtr-general] assertions In-Reply-To: References: <593b9ae805050116291168c9ee@mail.gmail.com> <593b9ae805050117033634932e@mail.gmail.com> Message-ID: <593b9ae80505011714e33ed56@mail.gmail.com> Hi Alexey, That is GENIUS! :D I'm new to ruby but I love it! Thanks! Shao On 5/1/05, Alexey Verkhovsky wrote: > Shao Kang Tat wrote: > > >Hi Alexey > > > >it gives a rather large list, including lines from the assertion.rb > >files as well. > > > > > It's Ruby, so everything is easy. Try: > > puts e.backtrace.delete_if { |path| path =~ /test\/unit/ } > > Good enough? > > -- > Best regards, > > Alexey Verkhovsky > > Ruby Forum: http://ruby-forum.org (moderator) > RForum: http://rforum.andreas-s.net (co-author) > Instiki: http://instiki.org (maintainer) > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From shaorobics at gmail.com Sun May 1 20:27:30 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Sun, 1 May 2005 20:27:30 -0400 Subject: [Wtr-general] jumping back to the middle of a begin block Message-ID: <593b9ae80505011727221f72c9@mail.gmail.com> if I have: begin line1 line2 line3 line4 rescue => e puts e.backtrace retry end say line1 produces an error..is there anyway to jump back up to line2 and continue execution from there? Shao From paul.rogers at shaw.ca Sun May 1 22:26:36 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 01 May 2005 20:26:36 -0600 Subject: [Wtr-general] Another ruby web testing tool Message-ID: <001001c54ebe$5d0ccd40$afd29044@NewDell> http://www.iunknown.com/commentswithentry.aspx?entryid=f8053753-435a-47a d-a755-62386fd4a569 From bret at pettichord.com Mon May 2 00:54:45 2005 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 01 May 2005 23:54:45 -0500 Subject: [Wtr-general] jumping back to the middle of a begin block In-Reply-To: <593b9ae80505011727221f72c9@mail.gmail.com> Message-ID: <5.1.0.14.2.20050501235254.03ad3168@127.0.0.1> No, not really. But, it sounds like what you want are "assertions" that log error messages without throwing exceptions. That can be done. Bret At 07:27 PM 5/1/2005, Shao Kang Tat wrote: >if I have: > >begin > line1 > line2 > line3 > line4 >rescue => e > puts e.backtrace > retry >end > > >say line1 produces an error..is there anyway to jump back up to line2 >and continue execution from there? > >Shao > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From ati.ozgur at gmail.com Mon May 2 07:14:49 2005 From: ati.ozgur at gmail.com (Atilla Ozgur) Date: Mon, 2 May 2005 14:14:49 +0300 Subject: [Wtr-general] Clicking Popup Windows In-Reply-To: <5.1.0.14.2.20050501110546.039b88e8@127.0.0.1> References: <5.1.0.14.2.20050430021205.03adcc28@127.0.0.1> <5.1.0.14.2.20050501110546.039b88e8@127.0.0.1> Message-ID: I would like to change interface of windowHelper (PopUp) to something like this. instead of push_alert_button() push_confirm_button_ok() push_confirm_button_cancel() push_button(:alert) push_button(:confirm, :Ok) push_button(:confirm, :Cancel) other types of button would be added to this interface. I think this is more close to syntax of watir. What do you think about this? From Mark_Cain at rl.gov Mon May 2 10:22:30 2005 From: Mark_Cain at rl.gov (Cain, Mark) Date: Mon, 2 May 2005 07:22:30 -0700 Subject: [Wtr-general] testing show_links Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04E154F1B@EX5V.rl.gov> Paul, for whatever it is worth... I use the unit test examples ALOT--it is the first place I go to see how to handle a particular web object. As my knowledge of Ruby grows that will probably change but in the short term I have been able to automate an entire complex data-driven application using only the examples provided (and this forum for additional detail ;-)). The example are very helpful!! Thanks, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Friday, April 29, 2005 6:46 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] testing show_links I think that 1. the show methods don't really need tests 2. now that we have iterators for almost everything, the show methods should use these, and make unit tests for the show methods ( if we really want them) much simpler I really only added them to the unit tests so that there were examples available. But I don't think people are really using the unit tests as examples. When we get some better docs on how to use watir with irb ( im going to do it next week I hope) we can use those instead of the examples. But by all means do this in the mean time. It actually sounds like a good thing. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andy Sipe Sent: 29 April 2005 19:36 To: wtr-general at rubyforge.org Subject: [Wtr-general] testing show_links In trying to remove some of the noise from the unit tests, I'd to add this to the show_links type methods. def show_links(strm=$stdout) ... ... strm.puts .. This way we can substitue another stream and do the test and it shouldn't change any end user behavior. Any thoughts on this? -andy _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050502/0a0c486a/attachment.html From tomfeo at presslogic.com Mon May 2 10:31:55 2005 From: tomfeo at presslogic.com (Tom) Date: Mon, 2 May 2005 08:31:55 -0600 Subject: [Wtr-general] testing show_links In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04E154F1B@EX5V.rl.gov> Message-ID: DITTO! It was from these examples that I was able to create a script in less than 5 minutes to log into our application. Now that I've been able to reference Frames using the index, I've been able to drill down deeper in our app. With over 4600 tests in our test suite, I'm really hoping to have at least 25% automated by the end of this month, of course depending on 'spare' time :}. Tom _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Monday, May 02, 2005 8:23 AM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] testing show_links Paul, for whatever it is worth... I use the unit test examples ALOT--it is the first place I go to see how to handle a particular web object. As my knowledge of Ruby grows that will probably change but in the short term I have been able to automate an entire complex data-driven application using only the examples provided (and this forum for additional detail ;-)). The example are very helpful!! Thanks, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Friday, April 29, 2005 6:46 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] testing show_links I think that 1. the show methods don't really need tests 2. now that we have iterators for almost everything, the show methods should use these, and make unit tests for the show methods ( if we really want them) much simpler I really only added them to the unit tests so that there were examples available. But I don't think people are really using the unit tests as examples. When we get some better docs on how to use watir with irb ( im going to do it next week I hope) we can use those instead of the examples. But by all means do this in the mean time. It actually sounds like a good thing. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andy Sipe Sent: 29 April 2005 19:36 To: wtr-general at rubyforge.org Subject: [Wtr-general] testing show_links In trying to remove some of the noise from the unit tests, I'd to add this to the show_links type methods. def show_links(strm=$stdout) ... ... strm.puts .. This way we can substitue another stream and do the test and it shouldn't change any end user behavior. Any thoughts on this? -andy _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050502/7de136d9/attachment.html From paul.rogers at shaw.ca Mon May 2 11:40:25 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 02 May 2005 09:40:25 -0600 Subject: 4600 tests - was RE: [Wtr-general] testing show_links In-Reply-To: Message-ID: <001701c54f2d$425163c0$afd29044@NewDell> kind of off topic... Words like Test and TestCases get thrown around alot in QA. What do you consider a test? Whats a typical test in these 4600 tests? How do you keep track off them? How do you record the results of them? Im also working on some rails software that is a database for tests and results. Its a rewrite of the tracker we used in my last job. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Tom Sent: 02 May 2005 08:32 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] testing show_links DITTO! It was from these examples that I was able to create a script in less than 5 minutes to log into our application. Now that I've been able to reference Frames using the index, I've been able to drill down deeper in our app. With over 4600 tests in our test suite, I'm really hoping to have at least 25% automated by the end of this month, of course depending on 'spare' time :}. Tom _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Monday, May 02, 2005 8:23 AM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] testing show_links Paul, for whatever it is worth... I use the unit test examples ALOT--it is the first place I go to see how to handle a particular web object. As my knowledge of Ruby grows that will probably change but in the short term I have been able to automate an entire complex data-driven application using only the examples provided (and this forum for additional detail ;-)). The example are very helpful!! Thanks, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Friday, April 29, 2005 6:46 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] testing show_links I think that 1. the show methods don't really need tests 2. now that we have iterators for almost everything, the show methods should use these, and make unit tests for the show methods ( if we really want them) much simpler I really only added them to the unit tests so that there were examples available. But I don't think people are really using the unit tests as examples. When we get some better docs on how to use watir with irb ( im going to do it next week I hope) we can use those instead of the examples. But by all means do this in the mean time. It actually sounds like a good thing. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andy Sipe Sent: 29 April 2005 19:36 To: wtr-general at rubyforge.org Subject: [Wtr-general] testing show_links In trying to remove some of the noise from the unit tests, I'd to add this to the show_links type methods. def show_links(strm=$stdout) ... ... strm.puts .. This way we can substitue another stream and do the test and it shouldn't change any end user behavior. Any thoughts on this? -andy _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050502/bf6c0806/attachment.html From tomfeo at presslogic.com Mon May 2 12:34:48 2005 From: tomfeo at presslogic.com (Tom) Date: Mon, 2 May 2005 10:34:48 -0600 Subject: 4600 tests - was RE: [Wtr-general] testing show_links In-Reply-To: <001701c54f2d$425163c0$afd29044@NewDell> Message-ID: We consider a singe test to be: Action: click on Save button Expected: item will save Actual: hopefully matches expected, if not, a bug is logged. These are organized in Test Director based on the sections/pages of the application. We've customized the Test Plan section in TD to track when it was last tested and for which iteration it was tested on. If a bug was logged against the test, then the Bugzilla bug number is recorded. Ya, I know, we're using Test Director and we still log bugs into Bugzilla. Why you ask? Simple, Bugzilla has a far superior web based interface then TD. This allows our client to access our bug tracking system without having to access a VPN. So why don't we use a simple excel spreadsheet to track our tests? In the future we are hoping to track our requirements and link them to the tests so that potentially we can start to create our tests before the code is written. Then hopefully the developers will be able to use our tests to ensure they have met the requirements. Am I living in a fantasy world? Maybe, but if you don't dream you don't discover new ways of doing things. Maybe something you want to look into while you're working on your rails software is how you can integrate requirements with the tests? With our clients so engrained in Bugzilla and the reluctance to track bugs in TD internally (partly due to licensing costs), it seems to me to be a waste of money to use TD for what we use it for. Tom _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Monday, May 02, 2005 9:40 AM To: wtr-general at rubyforge.org Subject: 4600 tests - was RE: [Wtr-general] testing show_links kind of off topic... Words like Test and TestCases get thrown around alot in QA. What do you consider a test? Whats a typical test in these 4600 tests? How do you keep track off them? How do you record the results of them? Im also working on some rails software that is a database for tests and results. Its a rewrite of the tracker we used in my last job. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Tom Sent: 02 May 2005 08:32 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] testing show_links DITTO! It was from these examples that I was able to create a script in less than 5 minutes to log into our application. Now that I've been able to reference Frames using the index, I've been able to drill down deeper in our app. With over 4600 tests in our test suite, I'm really hoping to have at least 25% automated by the end of this month, of course depending on 'spare' time :}. Tom _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Monday, May 02, 2005 8:23 AM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] testing show_links Paul, for whatever it is worth... I use the unit test examples ALOT--it is the first place I go to see how to handle a particular web object. As my knowledge of Ruby grows that will probably change but in the short term I have been able to automate an entire complex data-driven application using only the examples provided (and this forum for additional detail ;-)). The example are very helpful!! Thanks, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Friday, April 29, 2005 6:46 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] testing show_links I think that 1. the show methods don't really need tests 2. now that we have iterators for almost everything, the show methods should use these, and make unit tests for the show methods ( if we really want them) much simpler I really only added them to the unit tests so that there were examples available. But I don't think people are really using the unit tests as examples. When we get some better docs on how to use watir with irb ( im going to do it next week I hope) we can use those instead of the examples. But by all means do this in the mean time. It actually sounds like a good thing. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andy Sipe Sent: 29 April 2005 19:36 To: wtr-general at rubyforge.org Subject: [Wtr-general] testing show_links In trying to remove some of the noise from the unit tests, I'd to add this to the show_links type methods. def show_links(strm=$stdout) ... ... strm.puts .. This way we can substitue another stream and do the test and it shouldn't change any end user behavior. Any thoughts on this? -andy _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050502/36f325e8/attachment.html From bret at pettichord.com Mon May 2 13:03:43 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 02 May 2005 12:03:43 -0500 Subject: [Wtr-general] do/end vs. {} Message-ID: <5.1.0.14.2.20050502115824.03c6c9d8@127.0.0.1> This is a coding convention i'd like contributors to follow. If you have a block that is a single line, use braces. Thus: array.each {|x| puts x} If the block goes to more than one line, use do/end. Thus: array. each do |x| x.something x.something_else end This is non-conformant: array.each { |x| puts x } It works, but it should be written as a do/end (or put on one line). This is pretty much the standard ruby convention. I've cleaned up a lot of code like this lately. Thanks for your help with this. (Pickaxe II has a good explanation of the slight semantic differences between the two Bret _____________________ Bret Pettichord www.pettichord.com From lorenzo_jorquera at yahoo.com Mon May 2 13:59:00 2005 From: lorenzo_jorquera at yahoo.com (Lorenzo Jorquera) Date: Mon, 2 May 2005 12:59:00 -0500 (CDT) Subject: [Wtr-general] drop down menues Message-ID: <20050502175900.98037.qmail@web32212.mail.mud.yahoo.com> Hi, I am trying to access an horizontal drop-down menu. I 've managed to access the top level items, that are divs. When I fire an onmouseover event on these divs, a drop down menue with several options appears. I want to click on one of those options but I can?t find them. I think this kind of drop down menues are very common, so I want to ask: Has anyone dealt with this menues? What kind of objects are the drop down options usually? Thanks in advance. --------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050502/5af2f183/attachment.html From jkohl at telusplanet.net Mon May 2 14:39:56 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Mon, 2 May 2005 11:39:56 -0700 Subject: [Wtr-general] drop down menues In-Reply-To: <20050502175900.98037.qmail@web32212.mail.mud.yahoo.com> References: <20050502175900.98037.qmail@web32212.mail.mud.yahoo.com> Message-ID: <1115059196.427673fcb93f4@webmail.telusplanet.net> Lorenzo; If you go to this page: http://www.cbc.ca and place your mouse over "RADIO" (top-left item, next to CBC.CA image) , is this the kind of drop down you are talking about? On this page, we haven't figured out how to select the menu items. You can get them to work as the example Chris Hedges contributed to the examples folder shows _if_ the links wired to each element are declared somewhere in the current page that is loaded. In the case of the cbc site we can't click them, these are declared in other pages that aren't currently loaded in the DOM. Paul and I have been working on how to click those menu items, but don't have it figured out yet. If anyone has some insight, please let the list know. Thanks; -Jonathan Quoting Lorenzo Jorquera : > Hi, > I am trying to access an horizontal drop-down menu. I 've managed to access > the top level items, that are divs. When I fire an onmouseover event on these > divs, a drop down menue with several options appears. I want to click on one > of those options but I can?t find them. I think this kind of drop down menues > are very common, so I want to ask: Has anyone dealt with this menues? What > kind of objects are the drop down options usually? > > Thanks in advance. > > > > --------------------------------- > Do You Yahoo!? > Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del > Mundo. > Vis?ta Yahoo! Noticias. > From chrishedges at gmail.com Mon May 2 14:42:50 2005 From: chrishedges at gmail.com (Chris Hedges) Date: Mon, 2 May 2005 12:42:50 -0600 Subject: [Wtr-general] drop down menues In-Reply-To: <1115059196.427673fcb93f4@webmail.telusplanet.net> References: <20050502175900.98037.qmail@web32212.mail.mud.yahoo.com> <1115059196.427673fcb93f4@webmail.telusplanet.net> Message-ID: <5820aff6050502114236adc083@mail.gmail.com> Here is a good way to utilize the mouse-over drop-down menus for IE. I add some sleeps and flashes for visual. Just make sure that your pop-up blockers are off. require 'thread' require 'watir' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'watir/testUnitAddons' include Watir testSite = 'http://www.fortlewis.edu' $ie = IE.new ie2 = nil puts "## Beginning of Example: FortLewis.edu" puts " " sleep 1 puts "Step 1: go to the test site: " + testSite $ie.goto(testSite) $ie.link(:text," Prospective Students ").fireEvent("onMouseOver") sleep 1 $ie.link(:text," Prospective Students ").fireEvent("onMouseOut") $ie.link(:text," Current Students ").fireEvent("onMouseOver") $ie.link(:url,"http://faculty.fortlewis.edu/").flash sleep 1 On 5/2/05, jkohl at telusplanet.net wrote: > Lorenzo; > > If you go to this page: > http://www.cbc.ca and place your mouse over "RADIO" (top-left item, next to > CBC.CA image) , is this the kind of drop down you are talking about? On this > page, we haven't figured out how to select the menu items. > > You can get them to work as the example Chris Hedges contributed to the > examples folder shows _if_ the links wired to each element are declared > somewhere in the current page that is loaded. In the case of the cbc site we > can't click them, these are declared in other pages that aren't currently > loaded in the DOM. Paul and I have been working on how to click those menu > items, but don't have it figured out yet. If anyone has some insight, please > let the list know. > > Thanks; > > -Jonathan > > > Quoting Lorenzo Jorquera : > > > Hi, > > I am trying to access an horizontal drop-down menu. I 've managed to access > > the top level items, that are divs. When I fire an onmouseover event on these > > divs, a drop down menue with several options appears. I want to click on one > > of those options but I can?t find them. I think this kind of drop down menues > > are very common, so I want to ask: Has anyone dealt with this menues? What > > kind of objects are the drop down options usually? > > > > Thanks in advance. > > > > > > > > --------------------------------- > > Do You Yahoo!? > > Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del > > Mundo. > > Vis?ta Yahoo! Noticias. > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From lorenzo_jorquera at yahoo.com Mon May 2 15:00:13 2005 From: lorenzo_jorquera at yahoo.com (Lorenzo Jorquera) Date: Mon, 2 May 2005 14:00:13 -0500 (CDT) Subject: [Wtr-general] drop down menues In-Reply-To: 6667 Message-ID: <20050502190013.19093.qmail@web32213.mail.mud.yahoo.com> Yes, it is the same kind of menues... I will try Chris Hedges examples and see how it goes... Thanks a lot. jkohl at telusplanet.net wrote: Lorenzo; If you go to this page: http://www.cbc.ca and place your mouse over "RADIO" (top-left item, next to CBC.CA image) , is this the kind of drop down you are talking about? On this page, we haven't figured out how to select the menu items. You can get them to work as the example Chris Hedges contributed to the examples folder shows _if_ the links wired to each element are declared somewhere in the current page that is loaded. In the case of the cbc site we can't click them, these are declared in other pages that aren't currently loaded in the DOM. Paul and I have been working on how to click those menu items, but don't have it figured out yet. If anyone has some insight, please let the list know. Thanks; -Jonathan Quoting Lorenzo Jorquera : > Hi, > I am trying to access an horizontal drop-down menu. I 've managed to access > the top level items, that are divs. When I fire an onmouseover event on these > divs, a drop down menue with several options appears. I want to click on one > of those options but I can?t find them. I think this kind of drop down menues > are very common, so I want to ask: Has anyone dealt with this menues? What > kind of objects are the drop down options usually? > > Thanks in advance. > > > > --------------------------------- > Do You Yahoo!? > Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del > Mundo. > Vis?ta Yahoo! Noticias. > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general --------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050502/19c2798a/attachment.html From jkohl at telusplanet.net Mon May 2 15:02:30 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Mon, 2 May 2005 12:02:30 -0700 Subject: [Wtr-general] drop down menues In-Reply-To: <20050502190013.19093.qmail@web32213.mail.mud.yahoo.com> References: <20050502190013.19093.qmail@web32213.mail.mud.yahoo.com> Message-ID: <1115060550.42767946a2e8b@webmail.telusplanet.net> Cool. Just note that his will example will work in cases where the URL mapped to a drop-down menu item is declared somewhere in the page. In the case of sites like CBC.ca, it doesn't work. -Jonathan Quoting Lorenzo Jorquera : > Yes, it is the same kind of menues... I will try Chris Hedges examples and > see how it goes... > > Thanks a lot. > > > > jkohl at telusplanet.net wrote: > Lorenzo; > > If you go to this page: > http://www.cbc.ca and place your mouse over "RADIO" (top-left item, next to > CBC.CA image) , is this the kind of drop down you are talking about? On this > > page, we haven't figured out how to select the menu items. > > You can get them to work as the example Chris Hedges contributed to the > examples folder shows _if_ the links wired to each element are declared > somewhere in the current page that is loaded. In the case of the cbc site we > > can't click them, these are declared in other pages that aren't currently > loaded in the DOM. Paul and I have been working on how to click those menu > items, but don't have it figured out yet. If anyone has some insight, please > > let the list know. > > Thanks; > > -Jonathan > > > > > Quoting Lorenzo Jorquera : > > > Hi, > > I am trying to access an horizontal drop-down menu. I 've managed to > access > > the top level items, that are divs. When I fire an onmouseover event on > these > > divs, a drop down menue with several options appears. I want to click on > one > > of those options but I can?t find them. I think this kind of drop down > menues > > are very common, so I want to ask: Has anyone dealt with this menues? What > > kind of objects are the drop down options usually? > > > > Thanks in advance. > > > > > > > > --------------------------------- > > Do You Yahoo!? > > Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del > > Mundo. > > Vis?ta Yahoo! Noticias. > > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > --------------------------------- > Do You Yahoo!? > Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del > Mundo. > Vis?ta Yahoo! Noticias. > From lorenzo_jorquera at yahoo.com Mon May 2 15:17:42 2005 From: lorenzo_jorquera at yahoo.com (Lorenzo Jorquera) Date: Mon, 2 May 2005 14:17:42 -0500 (CDT) Subject: [Wtr-general] drop down menues In-Reply-To: 6667 Message-ID: <20050502191742.25232.qmail@web32208.mail.mud.yahoo.com> Well, I could not find the url mapped to the menu item anywhere in the page (The page has lot of frames so it is diffucult to tell if it is there). But I solved my problem by doing a ie.goto to the url. Thanks a lot!. jkohl at telusplanet.net wrote: Cool. Just note that his will example will work in cases where the URL mapped to a drop-down menu item is declared somewhere in the page. In the case of sites like CBC.ca, it doesn't work. -Jonathan Quoting Lorenzo Jorquera : > Yes, it is the same kind of menues... I will try Chris Hedges examples and > see how it goes... > > Thanks a lot. > > > > jkohl at telusplanet.net wrote: > Lorenzo; > > If you go to this page: > http://www.cbc.ca and place your mouse over "RADIO" (top-left item, next to > CBC.CA image) , is this the kind of drop down you are talking about? On this > > page, we haven't figured out how to select the menu items. > > You can get them to work as the example Chris Hedges contributed to the > examples folder shows _if_ the links wired to each element are declared > somewhere in the current page that is loaded. In the case of the cbc site we > > can't click them, these are declared in other pages that aren't currently > loaded in the DOM. Paul and I have been working on how to click those menu > items, but don't have it figured out yet. If anyone has some insight, please > > let the list know. > > Thanks; > > -Jonathan > > > > > Quoting Lorenzo Jorquera : > > > Hi, > > I am trying to access an horizontal drop-down menu. I 've managed to > access > > the top level items, that are divs. When I fire an onmouseover event on > these > > divs, a drop down menue with several options appears. I want to click on > one > > of those options but I can?t find them. I think this kind of drop down > menues > > are very common, so I want to ask: Has anyone dealt with this menues? What > > kind of objects are the drop down options usually? > > > > Thanks in advance. > > > > > > > > --------------------------------- > > Do You Yahoo!? > > Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del > > Mundo. > > Vis?ta Yahoo! Noticias. > > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > --------------------------------- > Do You Yahoo!? > Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del > Mundo. > Vis?ta Yahoo! Noticias. > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general --------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050502/d15c7858/attachment.html From bret at pettichord.com Mon May 2 13:28:57 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 02 May 2005 12:28:57 -0500 Subject: [Wtr-general] Clicking Popup Windows In-Reply-To: References: <5.1.0.14.2.20050501110546.039b88e8@127.0.0.1> <5.1.0.14.2.20050430021205.03adcc28@127.0.0.1> <5.1.0.14.2.20050501110546.039b88e8@127.0.0.1> Message-ID: <5.1.0.14.2.20050502122658.03c73ea8@127.0.0.1> How about this: popup = Watir::Popup.new() popup.button(:alert).click This would rename the class as well as the methods. At 06:14 AM 5/2/2005, Atilla Ozgur wrote: >I would like to change interface of windowHelper (PopUp) to something like >this. >instead of >push_alert_button() >push_confirm_button_ok() >push_confirm_button_cancel() > >push_button(:alert) >push_button(:confirm, :Ok) >push_button(:confirm, :Cancel) > >other types of button would be added to this interface. I think this >is more close to syntax of watir. > > What do you think about this? > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From jkohl at telusplanet.net Mon May 2 19:59:10 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Mon, 2 May 2005 17:59:10 -0600 Subject: [Wtr-general] drop down menues In-Reply-To: <20050502191742.25232.qmail@web32208.mail.mud.yahoo.com> Message-ID: <20050502235913.SSCY23797.priv-edtnes57.telusplanet.net@tintin> > Well, I could not find the url mapped to the menu item anywhere in the > page (The page has lot of frames so it is diffucult to tell if it is there). > > But I solved my problem by doing a ie.goto to the url. > > Thanks a lot!. Yep, that's a workaround. I'd love to be able to highlight the images somehow, but can't use fireEvent for "hover". Ideally, we would send a mouseOver to the first object that spawns the drop-down. Then we would send a "hover" to the item, and then a "click" to it. What we're doing is creating an illusion of using the menu - I want to eventually be able to physically interact with the menus and click the items to validate they are wired correctly if possible. -Jonathan > jkohl at telusplanet.net wrote: > Cool. > > Just note that his will example will work in cases where the URL > mapped to a > > drop-down menu item is declared somewhere in the page. In the case of > sites like CBC.ca, it doesn't work. > > -Jonathan > > Quoting Lorenzo Jorquera : > > > Yes, it is the same kind of menues... I will try Chris Hedges > > examples and see how it goes... > > > > Thanks a lot. > > > > > > > > jkohl at telusplanet.net wrote: > > Lorenzo; > > > > If you go to this page: > > http://www.cbc.ca and place your mouse over "RADIO" (top-left item, > > next to > > > CBC.CA image) , is this the kind of drop down you are talking about? > > On > this > > > > page, we haven't figured out how to select the menu items. > > > > You can get them to work as the example Chris Hedges contributed to > > the examples folder shows _if_ the links wired to each element are > > declared somewhere in the current page that is loaded. In the case > > of the cbc site > we > > > > can't click them, these are declared in other pages that aren't > > currently loaded in the DOM. Paul and I have been working on how to > > click those menu > > > items, but don't have it figured out yet. If anyone has some > > insight, > please > > > > let the list know. > > > > Thanks; > > > > -Jonathan > > > > > > > > > > Quoting Lorenzo Jorquera : > > > > > Hi, > > > I am trying to access an horizontal drop-down menu. I 've managed > > > to > > access > > > the top level items, that are divs. When I fire an onmouseover > > > event on > > these > > > divs, a drop down menue with several options appears. I want to > > > click on > > one > > > of those options but I can?t find them. I think this kind of drop > > > down > > menues > > > are very common, so I want to ask: Has anyone dealt with this menues? > What > > > kind of objects are the drop down options usually? > > > > > > Thanks in advance. > > > > > > > > > > > > --------------------------------- > > > Do You Yahoo!? > > > Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el > > > resto > del > > > Mundo. > > > Vis?ta Yahoo! Noticias. > > > > > > > > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > --------------------------------- > > Do You Yahoo!? > > Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el > > resto del Mundo. > > Vis?ta Yahoo! Noticias. > > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > --------------------------------- > Do You Yahoo!? > Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto > del Mundo. > Vis?ta Yahoo! Noticias. > From paul.rogers at shaw.ca Mon May 2 20:15:41 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 02 May 2005 18:15:41 -0600 Subject: [Wtr-general] Clicking Popup Windows In-Reply-To: <5.1.0.14.2.20050502122658.03c73ea8@127.0.0.1> Message-ID: <007f01c54f75$3df37320$afd29044@NewDell> Its also good, as we would be also doing file requesters and network dalog boxes too Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 02 May 2005 11:29 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Clicking Popup Windows How about this: popup = Watir::Popup.new() popup.button(:alert).click This would rename the class as well as the methods. At 06:14 AM 5/2/2005, Atilla Ozgur wrote: >I would like to change interface of windowHelper (PopUp) to something >like >this. >instead of >push_alert_button() >push_confirm_button_ok() >push_confirm_button_cancel() > >push_button(:alert) >push_button(:confirm, :Ok) >push_button(:confirm, :Cancel) > >other types of button would be added to this interface. I think this is >more close to syntax of watir. > > What do you think about this? > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From jfry at lyris.com Mon May 2 20:37:08 2005 From: jfry at lyris.com (Jeff Fry) Date: Mon, 02 May 2005 17:37:08 -0700 Subject: [Wtr-general] testing show_links In-Reply-To: <00c101c54d26$6d7f6a50$afd29044@NewDell> References: <00c101c54d26$6d7f6a50$afd29044@NewDell> Message-ID: <4276C7B4.2040601@lyris.com> Paul Rogers wrote: >I really only added them to the unit tests so that there were examples >available. But I don't think people are really using the unit tests as >examples. > For what it's worth, I have definitely used (and appreciate using) the unit tests as examples. That's not to disagree with taking the show methods out of the tests - just to let anyone who is writing unit tests know that for at least some of us they are also a useful learning reference. Jeff Fry From jkohl at telusplanet.net Mon May 2 20:59:40 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Mon, 2 May 2005 18:59:40 -0600 Subject: [Wtr-general] testing show_links In-Reply-To: <4276C7B4.2040601@lyris.com> Message-ID: <20050503005941.VVPM23797.priv-edtnes57.telusplanet.net@tintin> I use the unit tests as well for examples. I started writing the examples and the user guide by munging through the unit tests. :) -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of Jeff Fry > Sent: May 2, 2005 6:37 PM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] testing show_links > > Paul Rogers wrote: > > >I really only added them to the unit tests so that there were examples > >available. But I don't think people are really using the unit tests as > >examples. > > > For what it's worth, I have definitely used (and appreciate using) the > unit tests as examples. That's not to disagree with taking the show > methods out of the tests - just to let anyone who is writing unit tests > know that for at least some of us they are also a useful learning > reference. > > Jeff Fry > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From jkohl at telusplanet.net Mon May 2 21:00:32 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Mon, 2 May 2005 19:00:32 -0600 Subject: [Wtr-general] Clicking Popup Windows In-Reply-To: <5.1.0.14.2.20050502122658.03c73ea8@127.0.0.1> Message-ID: <20050503010035.FZBW1683.priv-edtnes27.telusplanet.net@tintin> That looks good. I'm curious about getting text out of a JavaScript popup. A lot of web apps use JavaScript for validation and have custom messages. Can we scrape these messages out for test validation? -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of Bret Pettichord > Sent: May 2, 2005 11:29 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Clicking Popup Windows > > How about this: > > popup = Watir::Popup.new() > popup.button(:alert).click > > This would rename the class as well as the methods. > > > At 06:14 AM 5/2/2005, Atilla Ozgur wrote: > >I would like to change interface of windowHelper (PopUp) to something > like > >this. > >instead of > >push_alert_button() > >push_confirm_button_ok() > >push_confirm_button_cancel() > > > >push_button(:alert) > >push_button(:confirm, :Ok) > >push_button(:confirm, :Cancel) > > > >other types of button would be added to this interface. I think this > >is more close to syntax of watir. > > > > What do you think about this? > > > >_______________________________________________ > >Wtr-general mailing list > >Wtr-general at rubyforge.org > >http://rubyforge.org/mailman/listinfo/wtr-general > > _____________________ > Bret Pettichord > www.pettichord.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Mon May 2 21:24:03 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 02 May 2005 19:24:03 -0600 Subject: [Wtr-general] Clicking Popup Windows In-Reply-To: <20050503010035.FZBW1683.priv-edtnes27.telusplanet.net@tintin> Message-ID: <008001c54f7e$cab5c1b0$afd29044@NewDell> The current winclickers has a getStaticText method which does this. AutoIt mentions static text in the help, but I couldn't see how to use it. I didn't try very hard though Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jonathan Kohl Sent: 02 May 2005 19:01 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Clicking Popup Windows That looks good. I'm curious about getting text out of a JavaScript popup. A lot of web apps use JavaScript for validation and have custom messages. Can we scrape these messages out for test validation? -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of Bret Pettichord > Sent: May 2, 2005 11:29 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Clicking Popup Windows > > How about this: > > popup = Watir::Popup.new() > popup.button(:alert).click > > This would rename the class as well as the methods. > > > At 06:14 AM 5/2/2005, Atilla Ozgur wrote: > >I would like to change interface of windowHelper (PopUp) to something > like > >this. > >instead of > >push_alert_button() > >push_confirm_button_ok() > >push_confirm_button_cancel() > > > >push_button(:alert) > >push_button(:confirm, :Ok) > >push_button(:confirm, :Cancel) > > > >other types of button would be added to this interface. I think this > >is more close to syntax of watir. > > > > What do you think about this? > > > >_______________________________________________ > >Wtr-general mailing list > >Wtr-general at rubyforge.org > >http://rubyforge.org/mailman/listinfo/wtr-general > > _____________________ > Bret Pettichord > www.pettichord.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Sun May 1 22:54:53 2005 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 01 May 2005 21:54:53 -0500 Subject: [Wtr-general] images_tests.rb failures Message-ID: <5.1.0.14.2.20050501215356.03ab65a8@127.0.0.1> I spent some time looking at this. I used a tool called FileMon from www.winternals.com to log the interactions between iexplore and the file system. And i improved the error message to give more information when this saves. Oddly enough, both of the failing tests pass when run alone (using the -n flag). But they still fail when run as part of the test case. Obviously you are making some assumptions about how IE is interacting with the filesystem. How do we know that they are correct? Mostly we access IE using its COM interface, which is pretty much guarenteed to be stable. It's filesystem API, however, is undocumented and could vary for all kinds of reasons. We saw similar code for some cookie manager code that someone wrote. I think the Image#save code is going to have to be moved there as well. Making assumptions about IE is going to make it less reliable. That's not a good thing in a test tool. I think a more reliable approach to doing save_as would stick to the COM and AutoIt interfaces. Bret 1) Error: test_save_remote_image(TC_Images): Watir::Exception::CacheItemNotFound: Match not found in C:\Documents and Settings\bpettich.PETTICHORDB\Local Settings\Temporary Internet Files using (?-mix:triangle\[\d+\].jpg) d:/workspace/watir/unittests/../watir.rb:3052:in `save' d:/workspace/watir/unittests/images_test.rb:181:in `safe_file_block' d:/workspace/watir/unittests/images_test.rb:181:in `each' d:/workspace/watir/unittests/images_test.rb:181:in `safe_file_block' d:/workspace/watir/unittests/images_test.rb:134:in `test_save_remote_image' d:/workspace/watir/unittests/images_test.rb:132:in `run_webrick' d:/workspace/watir/unittests/images_test.rb:132:in `test_save_remote_image' 2) Error: test_save_remote_image_overwrites(TC_Images): Watir::Exception::CacheItemNotFound: Match not found in C:\Documents and Settings\bpettich.PETTICHORDB\Local Settings\Temporary Internet Files using (?-mix:triangle\[\d+\].jpg) d:/workspace/watir/unittests/../watir.rb:3052:in `save' d:/workspace/watir/unittests/images_test.rb:181:in `safe_file_block' d:/workspace/watir/unittests/images_test.rb:181:in `each' d:/workspace/watir/unittests/images_test.rb:181:in `safe_file_block' d:/workspace/watir/unittests/images_test.rb:143:in `test_save_remote_image_overwrites' d:/workspace/watir/unittests/images_test.rb:141:in `run_webrick' d:/workspace/watir/unittests/images_test.rb:141:in `test_save_remote_image_overwrites' 11 tests, 84 assertions, 0 failures, 2 errors At 10:53 AM 4/30/2005, Andy Sipe wrote: >Name is a regex that is trying to match something like imagename[1].jpg >or imagename[15].bmp. The code is walking the users cache and is >looking to find the most recent image in the cache that matches the file >name of the src attribute of the image in question. The regex is used >becaue the cache isn't filled with imagename.jpg but imagename[x].jpg. >Basically every image that is a possible match is stuck in the matches >array. If no matches are found then the CacheItemNotFound exception is >thrown meaning we couldn't find the cache. If matches are found then the >most recent (by timestamp) is the image that is saved. > >It seems the failures you are seeing are because the items isn't being >found when it is expected -- the CacheItemNotFound exception is being thrown. > >Are others seeing this same test failure? If not maybe it is a local IE >cache setting or a full cache? > >It could also be a problem with the assumptions the search is using (OS or >browser version or...). > >-andy _____________________ Bret Pettichord www.pettichord.com From andy__s at hotmail.com Tue May 3 09:11:55 2005 From: andy__s at hotmail.com (Andy Sipe) Date: Tue, 03 May 2005 09:11:55 -0400 Subject: [Wtr-general] images_tests.rb failures In-Reply-To: <5.1.0.14.2.20050501215356.03ab65a8@127.0.0.1> Message-ID: Yes, I agree the file system code isn't working. I've been looking at alternate ways of doing the same thing but through the document interface. The closest I've come is using document.execCommand("SaveAs"....) and try and have IE save it directly. This has two caveats: 1) For IE to save the image (vs the HTML source) the image has to be the only thing on the page, so the image save code in Image would look something roughly like: def save(path) tmpie = ie.start(src) begin tmpie.document.execCommand("SaveAs", false, path) ensure tmpie.close end end This would require another IE instance to start up and bring the image down. Would this be an acceptable requirement? 2) The second problem is that I cannot get document.execCommand("SaveAs", false, path) to just save it directly without showing the dialog. According to the docs on MSDN the false means show no UI and save to path, but no matter what I do it seems to show the dialog. Maybe I'm just missing something on how it should work. If something like this would work it would remove the file system stuff and also remove the need to run webrick during the unittests, which would speed things up a bit. Thanks -andy ----Original Message Follows---- From: Bret Pettichord <bret at pettichord.com> ... I think a more reliable approach to doing save_as would stick to the COM and AutoIt interfaces. Bret From jared at kilmore.info Tue May 3 22:34:25 2005 From: jared at kilmore.info (Jared Quinert) Date: Wed, 04 May 2005 12:34:25 +1000 Subject: [Wtr-general] Agile tester wanted - Melbourne Australia In-Reply-To: <20050429005338.ZBCD11833.priv-edtnes40.telusplanet.net@tintin> References: <20050429005338.ZBCD11833.priv-edtnes40.telusplanet.net@tintin> Message-ID: <427834B1.90704@kilmore.info> I apologise if this is not appropriate, but I couldn't find any negative responses to Jonathon's previous job posting :) We are a developer of lending solutions looking for an agile/context-driven tester to join an XP team in Melbourne, Australia. Not mentioned in the job advertisement below is that we are beginning to use Watir. You can find the full advertisement at: http://www.seek.com.au/showjob.asp?jobid=4907526 The key aspects are agile/context-driven values and relevant lending industry or mass-market consumer product experience. Please apply through the Seek advertisement. I can answer questions if sent to me directly (not sent to the list). A permit to work in Australia is required. Jared Quinert From andy__s at hotmail.com Wed May 4 07:55:52 2005 From: andy__s at hotmail.com (Andy Sipe) Date: Wed, 04 May 2005 07:55:52 -0400 Subject: [Wtr-general] images_tests.rb failures In-Reply-To: Message-ID: Actually I think it would have to be something more like def save(path) @ieController.goto(src) begin @ieController.document.execCommand("SaveAs", false, path) ensure @ieController.back end end This allow any cookie/sessions etc.... to be kept in place. -andy ----Original Message Follows---- From: "Andy Sipe" <andy__s at hotmail.com> Yes, I agree the file system code isn't working. I've been looking at alternate ways of doing the same thing but through the document interface. The closest I've come is using document.execCommand("SaveAs"....) and try and have IE save it directly. This has two caveats: 1) For IE to save the image (vs the HTML source) the image has to be the only thing on the page, so the image save code in Image would look something roughly like: def save(path) tmpie = ie.start(src) begin tmpie.document.execCommand("SaveAs", false, path) ensure tmpie.close end end This would require another IE instance to start up and bring the image down. Would this be an acceptable requirement? 2) The second problem is that I cannot get document.execCommand("SaveAs", false, path) to just save it directly without showing the dialog. According to the docs on MSDN the false means show no UI and save to path, but no matter what I do it seems to show the dialog. Maybe I'm just missing something on how it should work. If something like this would work it would remove the file system stuff and also remove the need to run webrick during the unittests, which would speed things up a bit. Thanks -andy ----Original Message Follows---- From: Bret Pettichord &lt;bret at pettichord.com&gt; ... I think a more reliable approach to doing save_as would stick to the COM and AutoIt interfaces. Bret _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Wed May 4 01:44:46 2005 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 04 May 2005 00:44:46 -0500 Subject: [Wtr-general] images_tests.rb failures In-Reply-To: References: <5.1.0.14.2.20050501215356.03ab65a8@127.0.0.1> Message-ID: <5.1.0.14.2.20050504004248.03793da8@127.0.0.1> Appreciate your efforts on this. A few comments... At 08:11 AM 5/3/2005, Andy Sipe wrote: >Yes, I agree the file system code isn't working. I've been looking at >alternate ways of doing the same thing but through the document interface. > >The closest I've come is using document.execCommand("SaveAs"....) and try >and have IE save it directly. This has two caveats: > >1) For IE to save the image (vs the HTML source) the image has to be the >only thing on the page, so the image save code in Image would look >something roughly like: > >def save(path) > tmpie = ie.start(src) > begin > tmpie.document.execCommand("SaveAs", false, path) > ensure > tmpie.close > end >end > >This would require another IE instance to start up and bring the image >down. Would this be an acceptable requirement? not sure i understand, but the second IE instance could be invisible thus obviating any concerns. >2) The second problem is that I cannot get document.execCommand("SaveAs", >false, path) to just save it directly without showing the dialog. >According to the docs on MSDN the false means show no UI and save to path, >but no matter what I do it seems to show the dialog. Maybe I'm just >missing something on how it should work. > >If something like this would work it would remove the file system stuff >and also remove the need to run webrick during the unittests, which would >speed things up a bit. i liked the way you used webrick and suspect the technique will be useful for other unittests. >Thanks -andy > > > > > > > >----Original Message Follows---- >From: Bret Pettichord <bret at pettichord.com> > >... >I think a more reliable approach to doing save_as would stick to the COM >and AutoIt interfaces. > >Bret > > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Wed May 4 11:30:27 2005 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 04 May 2005 10:30:27 -0500 Subject: [Wtr-general] Job Posting Policy Message-ID: <5.1.0.14.2.20050504102715.0395d008@127.0.0.1> Postings for jobs using Watir are welcome on this list. _____________________ Bret Pettichord www.pettichord.com From shaorobics at gmail.com Thu May 5 10:03:14 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Thu, 5 May 2005 10:03:14 -0400 Subject: [Wtr-general] attaching a new window Message-ID: <593b9ae805050507035d70729@mail.gmail.com> Hi, this is the situation. I have Watir click a button and a pop up appears as a new window with an "OK" button. $ie.button(:id, "Save").click $popup = IE.attach(:title, "Budget already exists") $popup.button(:name, 'button').click it stalls there until I close the window on my own and then I get the following error: Error!! Aborting ALL TESTS --> c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:295:in `attach_browser_window': Unable to locate a window with title of Budget already exists c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:241:in `attach_init' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:234:in `attach' C:/Documents and Settings/stat/Desktop/Watir QA/Eatmr/Tests/GlobalBudget.rb:52:in `case1' (eval):1:in `try' C:/Documents and Settings/stat/Desktop/Watir QA/Eatmr/Tests/GlobalBudget.rb:37:in `eval' C:/Documents and Settings/stat/Desktop/Watir QA/Eatmr/Tests/GlobalBudget.rb:37:in `test_main' any ideas? From Mark_Cain at rl.gov Thu May 5 10:25:58 2005 From: Mark_Cain at rl.gov (Cain, Mark) Date: Thu, 5 May 2005 07:25:58 -0700 Subject: [Wtr-general] attaching a new window Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D1E7@EX5V.rl.gov> You might try looking at this tread. http://rubyforge.org/pipermail/wtr-general/2005-April/001461.html There is also the AutoIT application (included now in the latest version from of WATIR) for accessing object. --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: Thursday, May 05, 2005 7:03 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] attaching a new window Hi, this is the situation. I have Watir click a button and a pop up appears as a new window with an "OK" button. $ie.button(:id, "Save").click $popup = IE.attach(:title, "Budget already exists") $popup.button(:name, 'button').click it stalls there until I close the window on my own and then I get the following error: Error!! Aborting ALL TESTS --> c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:295:in `attach_browser_window': Unable to locate a window with title of Budget already exists c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:241:in `attach_init' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:234:in `attach' C:/Documents and Settings/stat/Desktop/Watir QA/Eatmr/Tests/GlobalBudget.rb:52:in `case1' (eval):1:in `try' C:/Documents and Settings/stat/Desktop/Watir QA/Eatmr/Tests/GlobalBudget.rb:37:in `eval' C:/Documents and Settings/stat/Desktop/Watir QA/Eatmr/Tests/GlobalBudget.rb:37:in `test_main' any ideas? _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From shaorobics at gmail.com Thu May 5 11:05:26 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Thu, 5 May 2005 11:05:26 -0400 Subject: [Wtr-general] showModalDialog Message-ID: <593b9ae805050508054fc93b94@mail.gmail.com> does anyone know how to get WATIR to click on ModalDialog? IE.attach(:title, "blahblah") doesn't work I found an earlier post on this but it didn't help much (or maybe I"m blind) http://rubyforge.org/pipermail/wtr-general/2005-February/000822.html either way, can someone lead me in the right direction? Or...some direction at least :D Shao From DBoyt at anteon.com Thu May 5 11:30:21 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Thu, 5 May 2005 11:30:21 -0400 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC85DBC5D@HQ-EXVS02.anteon.com> Paul, in the response you gave below, is the index of the checkbox related to the table or table cell in any way? Or is this the same as saying "ie.checkbox(:index,1).set"? The problem I'm having is clicking an image inside a table cell without having to know what the image's index is. The code I'm testing is structured like this: ...
...
...
How do I click an image in the table without looping through based on the images' indexes? I want to be able to be able to do something like "ie.table(:index, 1).image.click" instead of "ie.image(:index, 2).click". Is there a way I can do this? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Mon, 25 Apr 2005 10:42:24 -0600 From: Paul Rogers Subject: RE: [Wtr-general] How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <005e01c549b5$c27edf50$afd29044 at NewDell> Content-Type: text/plain; charset="us-ascii" ie.table(:id, 'my_table)[1[2].checkbox(:index,1).set for the second question, the answer is no! You can do it yourself easily though Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Ramya Ramalinga, Moorthy (IE10) Sent: 25 April 2005 06:56 To: wtr-general at rubyforge.org Subject: [Wtr-general] How to access a CheckBox inside a Table Hi All, I would like to know how to set/clear the Check Box Control placed inside a Table. Also, is there any method available in Watir::Table , which returns the Row/Column information if we provide the Cell Element Value. Regards, Ramya Honeywell DES - SAIF Extn : 8674 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050425/17c4cff2 /attachment-0001.htm From paul.rogers at shaw.ca Thu May 5 11:54:09 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 05 May 2005 09:54:09 -0600 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC85DBC5D@HQ-EXVS02.anteon.com> Message-ID: <002b01c5518a$ad0db2e0$afd29044@NewDell> ie.table(:id, 'my_table)[1[2].checkbox(:index,1).set This refers to the first checkbox in the 2nd cell of the first row Im not sure understand what you're trying to do? ie.table(:index, 1)[1][1].image(:index,1).click Would click the first image in the first cell of the first row of the first table You can of course just use the src of the image Ie.image(:src, /image1/).click Does that solve the problem? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 09:30 To: wtr-general at rubyforge.org Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Paul, in the response you gave below, is the index of the checkbox related to the table or table cell in any way? Or is this the same as saying "ie.checkbox(:index,1).set"? The problem I'm having is clicking an image inside a table cell without having to know what the image's index is. The code I'm testing is structured like this: ...
...
...
How do I click an image in the table without looping through based on the images' indexes? I want to be able to be able to do something like "ie.table(:index, 1).image.click" instead of "ie.image(:index, 2).click". Is there a way I can do this? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Mon, 25 Apr 2005 10:42:24 -0600 From: Paul Rogers Subject: RE: [Wtr-general] How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <005e01c549b5$c27edf50$afd29044 at NewDell> Content-Type: text/plain; charset="us-ascii" ie.table(:id, 'my_table)[1[2].checkbox(:index,1).set for the second question, the answer is no! You can do it yourself easily though Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Ramya Ramalinga, Moorthy (IE10) Sent: 25 April 2005 06:56 To: wtr-general at rubyforge.org Subject: [Wtr-general] How to access a CheckBox inside a Table Hi All, I would like to know how to set/clear the Check Box Control placed inside a Table. Also, is there any method available in Watir::Table , which returns the Row/Column information if we provide the Cell Element Value. Regards, Ramya Honeywell DES - SAIF Extn : 8674 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050425/17c4cff2 /attachment-0001.htm _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Thu May 5 11:54:54 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 05 May 2005 09:54:54 -0600 Subject: [Wtr-general] showModalDialog In-Reply-To: <593b9ae805050508054fc93b94@mail.gmail.com> Message-ID: <002c01c5518a$c7ae1ae0$afd29044@NewDell> We havent found a way to do these dialogs. I suppose there may be able to do something using AutoIt Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 05 May 2005 09:05 To: wtr-general at rubyforge.org Subject: [Wtr-general] showModalDialog does anyone know how to get WATIR to click on ModalDialog? IE.attach(:title, "blahblah") doesn't work I found an earlier post on this but it didn't help much (or maybe I"m blind) http://rubyforge.org/pipermail/wtr-general/2005-February/000822.html either way, can someone lead me in the right direction? Or...some direction at least :D Shao _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Thu May 5 11:55:54 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 05 May 2005 09:55:54 -0600 Subject: [Wtr-general] attaching a new window In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D1E7@EX5V.rl.gov> Message-ID: <002d01c5518a$eb54b120$afd29044@NewDell> We have decided to move to Auto-it for popup like this. There are some unit tests, but I forget which file they are in Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: 05 May 2005 08:26 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] attaching a new window You might try looking at this tread. http://rubyforge.org/pipermail/wtr-general/2005-April/001461.html There is also the AutoIT application (included now in the latest version from of WATIR) for accessing object. --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: Thursday, May 05, 2005 7:03 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] attaching a new window Hi, this is the situation. I have Watir click a button and a pop up appears as a new window with an "OK" button. $ie.button(:id, "Save").click $popup = IE.attach(:title, "Budget already exists") $popup.button(:name, 'button').click it stalls there until I close the window on my own and then I get the following error: Error!! Aborting ALL TESTS --> c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:295:in `attach_browser_window': Unable to locate a window with title of Budget already exists c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:241:in `attach_init' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:234:in `attach' C:/Documents and Settings/stat/Desktop/Watir QA/Eatmr/Tests/GlobalBudget.rb:52:in `case1' (eval):1:in `try' C:/Documents and Settings/stat/Desktop/Watir QA/Eatmr/Tests/GlobalBudget.rb:37:in `eval' C:/Documents and Settings/stat/Desktop/Watir QA/Eatmr/Tests/GlobalBudget.rb:37:in `test_main' any ideas? _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From shaorobics at gmail.com Thu May 5 12:17:38 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Thu, 5 May 2005 12:17:38 -0400 Subject: [Wtr-general] I've found a way to get rid of the showModalDialog Message-ID: <593b9ae805050509174d44bd92@mail.gmail.com> in my case, the webpages were coded to popup a showModalDialog..which hitting enter does NOTHING, and the user MUST hit the "OK" button which is embedded in HTML, HTML source you cannot view...but if you do this: wshShell = WIN32OLE.new("WScript.Shell") wshShell.AppActivate("Dialog Title"); #AppActivate search the applications by title wshShell.SendKeys("%{F4}") that will close it up Shao From DBoyt at anteon.com Thu May 5 12:34:56 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Thu, 5 May 2005 12:34:56 -0400 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC85DBC9D@HQ-EXVS02.anteon.com> You got it right about what I'm trying to do -- I want to click the first image in any row in the table. My example wasn't right though because the image sources are actually the same until one's clicked. This is a tree type structure so there's a "plus" image and a "minus" image. If the first level's expanded and the second's collapsed, it'll look like ...
...
...
When I do ie.table(:index, 1)[1][1].image(:index, 1).src I get "minus.png", but when I do ie.table(:index, 1)[2][1].image(:index, 1).src I also get "minus.png" instead of "plus.png". The only way to click the second image is ie.table(:index, 1)[2][1].image(:index, 2).click or ie.image(:index, 2).click Am I missing something? If it matters, the version of watir I'm using is 1.161 (from "puts IE::REVISION"). Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Thu, 05 May 2005 09:54:09 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <002b01c5518a$ad0db2e0$afd29044 at NewDell> Content-Type: text/plain; charset=us-ascii ie.table(:id, 'my_table)[1[2].checkbox(:index,1).set This refers to the first checkbox in the 2nd cell of the first row Im not sure understand what you're trying to do? ie.table(:index, 1)[1][1].image(:index,1).click Would click the first image in the first cell of the first row of the first table You can of course just use the src of the image Ie.image(:src, /image1/).click Does that solve the problem? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 09:30 To: wtr-general at rubyforge.org Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Paul, in the response you gave below, is the index of the checkbox related to the table or table cell in any way? Or is this the same as saying "ie.checkbox(:index,1).set"? The problem I'm having is clicking an image inside a table cell without having to know what the image's index is. The code I'm testing is structured like this: ...
...
...
How do I click an image in the table without looping through based on the images' indexes? I want to be able to be able to do something like "ie.table(:index, 1).image.click" instead of "ie.image(:index, 2).click". Is there a way I can do this? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama From DBoyt at anteon.com Thu May 5 12:41:49 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Thu, 5 May 2005 12:41:49 -0400 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC85DBCA6@HQ-EXVS02.anteon.com> For what it's worth, here's how I figured out to expand the entire tree require 'watir' include Watir ie = IE.attach(:title, "Test Page") while ie.html.include? "plus.gif" ie.images.length.downto(1) do |x| if ie.image(:index, x).src.include? "plus.gif" ie.image(:index, x).click end end end Is there a better solution? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama From jkohl at telusplanet.net Thu May 5 14:56:28 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Thu, 5 May 2005 11:56:28 -0700 Subject: [Wtr-general] Watir Works article is available online In-Reply-To: <593b9ae805050509174d44bd92@mail.gmail.com> References: <593b9ae805050509174d44bd92@mail.gmail.com> Message-ID: <1115319388.427a6c5cbdf95@webmail.telusplanet.net> There is a pdf of the watir works article from last month's Better Software magazine here: http://www.kohl.ca/articles/watir_works.pdf There is a reference page for the article for those folks new to Ruby and Watir here: http://wtr.rubyforge.org/article.html It talks about some of the syntax changes since the article came out in versions beyond 1.0.3. -Jonathan From paul.rogers at shaw.ca Thu May 5 15:17:54 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 05 May 2005 13:17:54 -0600 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC85DBCA6@HQ-EXVS02.anteon.com> Message-ID: <003d01c551a7$23c24650$afd29044@NewDell> If you get a more recent versoin from cvs ( release coming soon, I promise) the iterators mixin in enumerable. There is probably something there you can use, although Im not sure what exactly. Grep seems like its should work, but Im not sure how to make it work on the image.src You can use the iterator in a simple way too: ie.images.each do |image| image.click if /plus/.match(image.src) end -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 10:42 To: wtr-general at rubyforge.org Subject: RE: RE: [Wtr-general] Re: How to access a CheckBox inside a Table For what it's worth, here's how I figured out to expand the entire tree require 'watir' include Watir ie = IE.attach(:title, "Test Page") while ie.html.include? "plus.gif" ie.images.length.downto(1) do |x| if ie.image(:index, x).src.include? "plus.gif" ie.image(:index, x).click end end end Is there a better solution? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Thu May 5 15:22:24 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 05 May 2005 13:22:24 -0600 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC85DBC9D@HQ-EXVS02.anteon.com> Message-ID: <003e01c551a7$c41ab4c0$afd29044@NewDell> So, my first question is, when you click the plus, is there a page reload? If you are doing somethig like My_table = ie.table(index,1) My_table[1][1].image(:index,1).click Then you will need torecreate the my_table, as it refers to the old page If your app use javascript to add a row to the table that's now visible, you may need to do this Ie.table(:index,1).update_rows This causes the watir representaion of the table to get refreshed. Is the minus.png in a hidden div? that may account for watir getting the wrong image. If I get some time I'll try something like this out Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 10:35 To: wtr-general at rubyforge.org Subject: RE: RE: [Wtr-general] Re: How to access a CheckBox inside a Table You got it right about what I'm trying to do -- I want to click the first image in any row in the table. My example wasn't right though because the image sources are actually the same until one's clicked. This is a tree type structure so there's a "plus" image and a "minus" image. If the first level's expanded and the second's collapsed, it'll look like ...
...
...
When I do ie.table(:index, 1)[1][1].image(:index, 1).src I get "minus.png", but when I do ie.table(:index, 1)[2][1].image(:index, 1).src I also get "minus.png" instead of "plus.png". The only way to click the second image is ie.table(:index, 1)[2][1].image(:index, 2).click or ie.image(:index, 2).click Am I missing something? If it matters, the version of watir I'm using is 1.161 (from "puts IE::REVISION"). Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Thu, 05 May 2005 09:54:09 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <002b01c5518a$ad0db2e0$afd29044 at NewDell> Content-Type: text/plain; charset=us-ascii ie.table(:id, 'my_table)[1[2].checkbox(:index,1).set This refers to the first checkbox in the 2nd cell of the first row Im not sure understand what you're trying to do? ie.table(:index, 1)[1][1].image(:index,1).click Would click the first image in the first cell of the first row of the first table You can of course just use the src of the image Ie.image(:src, /image1/).click Does that solve the problem? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 09:30 To: wtr-general at rubyforge.org Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Paul, in the response you gave below, is the index of the checkbox related to the table or table cell in any way? Or is this the same as saying "ie.checkbox(:index,1).set"? The problem I'm having is clicking an image inside a table cell without having to know what the image's index is. The code I'm testing is structured like this: ...
...
...
How do I click an image in the table without looping through based on the images' indexes? I want to be able to be able to do something like "ie.table(:index, 1).image.click" instead of "ie.image(:index, 2).click". Is there a way I can do this? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Thu May 5 16:03:10 2005 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 05 May 2005 15:03:10 -0500 Subject: [Wtr-general] Watir Works article is available online In-Reply-To: <1115319388.427a6c5cbdf95@webmail.telusplanet.net> References: <593b9ae805050509174d44bd92@mail.gmail.com> <593b9ae805050509174d44bd92@mail.gmail.com> Message-ID: <5.1.0.14.2.20050505145146.036595d0@127.0.0.1> I think it's confusing to show two ways of doing this: >In Watir versions after 1.0.3, to execute ie = IE.new, you must include >the Watir module after the require watir statement in your script like this: >require 'watir' >include Watir >ie = IE.new I find that the second method is much easier for people to understand: >Alternatively, you can include the Watir module inline like this: >require 'watir' >ie = Watir::IE.new I like to avoid having to explain the Include statement. It is easy for people to confuse it with require (even Paul), especially because other languages use include to mean what Ruby means by require. (Until recently the RDOC said to do both the include *and* use the Watir::IE syntax. That was doubly confusing.) At 01:56 PM 5/5/2005, jkohl at telusplanet.net wrote: >There is a pdf of the watir works article from last month's Better Software >magazine here: http://www.kohl.ca/articles/watir_works.pdf I added this to this page: http://wtr.rubyforge.org/wiki/wiki.pl?WatirArticles >There is a reference page for the article for those folks new to Ruby and >Watir >here: >http://wtr.rubyforge.org/article.html >It talks about some of the syntax changes since the article came out in >versions beyond 1.0.3. I would think that this would be good information to also include in the stickynotes section for the article in stickyminds.com: http://stickyminds.com/bettersoftware/magazine.asp?fn=cisnd&tsnid=385 _____________________ Bret Pettichord www.pettichord.com From christopher.mcmahon at gmail.com Thu May 5 18:42:29 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 5 May 2005 16:42:29 -0600 Subject: [Wtr-general] what is Fox? Message-ID: <72799cd7050505154220456a43@mail.gmail.com> Hi... Am getting Gui installer can not be executed on your system. Please run the command line installer install.rb:16: uninitialized constant Fox (NameError) ...and I can't find any Fox on the system for this code: begin require 'fox' require 'fox/colors' rescue Exception begin require 'fox12' require 'fox12/colors' rescue Exception puts "Gui installer can not be executed on your system." puts "Please run the command line installer" end What's up? C:\watir\watir> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050505/f77690fa/attachment.html From jkohl at telusplanet.net Thu May 5 18:46:00 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Thu, 5 May 2005 16:46:00 -0600 Subject: [Wtr-general] what is Fox? In-Reply-To: <72799cd7050505154220456a43@mail.gmail.com> Message-ID: <20050505224521.IYOE26020.priv-edtnes46.telusplanet.net@tintin> It?s a Ruby GUI library that the installer uses. It lives here: :ruby/lib/ruby/site_ruby/1.8/fox I?m not sure what the error is about though. -Jonathan ________________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon Sent: May 5, 2005 4:42 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] what is Fox? Hi... Am getting Gui installer can not be executed on your system. Please run the command line installer install.rb:16: uninitialized constant Fox (NameError) ...and I can't find any Fox on the system for this code:? begin ??? require 'fox' ??? require 'fox/colors' rescue Exception ??? begin ??????? require 'fox12' ??????? require 'fox12/colors' ??? rescue Exception ??????? puts "Gui installer can not be executed on your system." ??????? puts "Please run the command line installer" ??? end What's up?? C:\watir\watir> From alex at verk.info Thu May 5 18:49:01 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Thu, 05 May 2005 18:49:01 -0400 Subject: [Wtr-general] what is Fox? In-Reply-To: <72799cd7050505154220456a43@mail.gmail.com> References: <72799cd7050505154220456a43@mail.gmail.com> Message-ID: Chris McMahon wrote: > What's up? Hi Chris, Looks like you need to update the Ruby version on your PC to One-Click Installer 1.8.2-15. Your Ruby installation doesn't have rubyfox, at least not version 1.2. -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) From paul.rogers at shaw.ca Thu May 5 19:24:22 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 05 May 2005 17:24:22 -0600 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC85DBC9D@HQ-EXVS02.anteon.com> Message-ID: <004b01c551c9$918d9aa0$afd29044@NewDell> I added some unit tests for this sort of condition, and it looks like watir does the Right Thing. I'll see if I can either find some code like this to really try it, or maybe write some Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 10:35 To: wtr-general at rubyforge.org Subject: RE: RE: [Wtr-general] Re: How to access a CheckBox inside a Table You got it right about what I'm trying to do -- I want to click the first image in any row in the table. My example wasn't right though because the image sources are actually the same until one's clicked. This is a tree type structure so there's a "plus" image and a "minus" image. If the first level's expanded and the second's collapsed, it'll look like ...
...
...
When I do ie.table(:index, 1)[1][1].image(:index, 1).src I get "minus.png", but when I do ie.table(:index, 1)[2][1].image(:index, 1).src I also get "minus.png" instead of "plus.png". The only way to click the second image is ie.table(:index, 1)[2][1].image(:index, 2).click or ie.image(:index, 2).click Am I missing something? If it matters, the version of watir I'm using is 1.161 (from "puts IE::REVISION"). Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Thu, 05 May 2005 09:54:09 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <002b01c5518a$ad0db2e0$afd29044 at NewDell> Content-Type: text/plain; charset=us-ascii ie.table(:id, 'my_table)[1[2].checkbox(:index,1).set This refers to the first checkbox in the 2nd cell of the first row Im not sure understand what you're trying to do? ie.table(:index, 1)[1][1].image(:index,1).click Would click the first image in the first cell of the first row of the first table You can of course just use the src of the image Ie.image(:src, /image1/).click Does that solve the problem? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 09:30 To: wtr-general at rubyforge.org Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Paul, in the response you gave below, is the index of the checkbox related to the table or table cell in any way? Or is this the same as saying "ie.checkbox(:index,1).set"? The problem I'm having is clicking an image inside a table cell without having to know what the image's index is. The code I'm testing is structured like this: ...
...
...
How do I click an image in the table without looping through based on the images' indexes? I want to be able to be able to do something like "ie.table(:index, 1).image.click" instead of "ie.image(:index, 2).click". Is there a way I can do this? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Thu May 5 20:07:44 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 05 May 2005 18:07:44 -0600 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table In-Reply-To: <004b01c551c9$918d9aa0$afd29044@NewDell> Message-ID: <004c01c551cf$a12a20e0$afd29044@NewDell> Well, I added some more tests, and its NOT doing the right thing... Watch this space Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: 05 May 2005 17:24 To: wtr-general at rubyforge.org Subject: RE: RE: [Wtr-general] Re: How to access a CheckBox inside a Table I added some unit tests for this sort of condition, and it looks like watir does the Right Thing. I'll see if I can either find some code like this to really try it, or maybe write some Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 10:35 To: wtr-general at rubyforge.org Subject: RE: RE: [Wtr-general] Re: How to access a CheckBox inside a Table You got it right about what I'm trying to do -- I want to click the first image in any row in the table. My example wasn't right though because the image sources are actually the same until one's clicked. This is a tree type structure so there's a "plus" image and a "minus" image. If the first level's expanded and the second's collapsed, it'll look like ...
...
...
When I do ie.table(:index, 1)[1][1].image(:index, 1).src I get "minus.png", but when I do ie.table(:index, 1)[2][1].image(:index, 1).src I also get "minus.png" instead of "plus.png". The only way to click the second image is ie.table(:index, 1)[2][1].image(:index, 2).click or ie.image(:index, 2).click Am I missing something? If it matters, the version of watir I'm using is 1.161 (from "puts IE::REVISION"). Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Thu, 05 May 2005 09:54:09 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <002b01c5518a$ad0db2e0$afd29044 at NewDell> Content-Type: text/plain; charset=us-ascii ie.table(:id, 'my_table)[1[2].checkbox(:index,1).set This refers to the first checkbox in the 2nd cell of the first row Im not sure understand what you're trying to do? ie.table(:index, 1)[1][1].image(:index,1).click Would click the first image in the first cell of the first row of the first table You can of course just use the src of the image Ie.image(:src, /image1/).click Does that solve the problem? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 09:30 To: wtr-general at rubyforge.org Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Paul, in the response you gave below, is the index of the checkbox related to the table or table cell in any way? Or is this the same as saying "ie.checkbox(:index,1).set"? The problem I'm having is clicking an image inside a table cell without having to know what the image's index is. The code I'm testing is structured like this: ...
...
...
How do I click an image in the table without looping through based on the images' indexes? I want to be able to be able to do something like "ie.table(:index, 1).image.click" instead of "ie.image(:index, 2).click". Is there a way I can do this? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Thu May 5 21:40:55 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 05 May 2005 19:40:55 -0600 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table In-Reply-To: <004c01c551cf$a12a20e0$afd29044@NewDell> Message-ID: <004e01c551dc$a525f3b0$afd29044@NewDell> This is actually going to cause a lot of problems If you had 2 links in a table cell, I think you would see the same behaviour. Im not sure Im going to be able to fix this soon. I need to do a release today for the Star East class next week, then I can try and fix this Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: 05 May 2005 18:08 To: wtr-general at rubyforge.org Subject: RE: RE: [Wtr-general] Re: How to access a CheckBox inside a Table Well, I added some more tests, and its NOT doing the right thing... Watch this space Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: 05 May 2005 17:24 To: wtr-general at rubyforge.org Subject: RE: RE: [Wtr-general] Re: How to access a CheckBox inside a Table I added some unit tests for this sort of condition, and it looks like watir does the Right Thing. I'll see if I can either find some code like this to really try it, or maybe write some Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 10:35 To: wtr-general at rubyforge.org Subject: RE: RE: [Wtr-general] Re: How to access a CheckBox inside a Table You got it right about what I'm trying to do -- I want to click the first image in any row in the table. My example wasn't right though because the image sources are actually the same until one's clicked. This is a tree type structure so there's a "plus" image and a "minus" image. If the first level's expanded and the second's collapsed, it'll look like ...
...
...
When I do ie.table(:index, 1)[1][1].image(:index, 1).src I get "minus.png", but when I do ie.table(:index, 1)[2][1].image(:index, 1).src I also get "minus.png" instead of "plus.png". The only way to click the second image is ie.table(:index, 1)[2][1].image(:index, 2).click or ie.image(:index, 2).click Am I missing something? If it matters, the version of watir I'm using is 1.161 (from "puts IE::REVISION"). Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Thu, 05 May 2005 09:54:09 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <002b01c5518a$ad0db2e0$afd29044 at NewDell> Content-Type: text/plain; charset=us-ascii ie.table(:id, 'my_table)[1[2].checkbox(:index,1).set This refers to the first checkbox in the 2nd cell of the first row Im not sure understand what you're trying to do? ie.table(:index, 1)[1][1].image(:index,1).click Would click the first image in the first cell of the first row of the first table You can of course just use the src of the image Ie.image(:src, /image1/).click Does that solve the problem? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 09:30 To: wtr-general at rubyforge.org Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Paul, in the response you gave below, is the index of the checkbox related to the table or table cell in any way? Or is this the same as saying "ie.checkbox(:index,1).set"? The problem I'm having is clicking an image inside a table cell without having to know what the image's index is. The code I'm testing is structured like this: ...
...
...
How do I click an image in the table without looping through based on the images' indexes? I want to be able to be able to do something like "ie.table(:index, 1).image.click" instead of "ie.image(:index, 2).click". Is there a way I can do this? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From alex at verk.info Thu May 5 23:29:41 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Thu, 05 May 2005 23:29:41 -0400 Subject: [Wtr-general] Starting/stopping app under test from within Watir test script In-Reply-To: <004e01c551dc$a525f3b0$afd29044@NewDell> References: <004e01c551dc$a525f3b0$afd29044@NewDell> Message-ID: Few days ago, I asked a question here how to start/stop a Webrick (or anmy other application under test) on Windows from the Ruby program. Starting is no big deal, but stopping is quite a problem. I'\ve asked the same question on ruby-talk, and with some help from Jon A. Lambert figured out the way to do it. See E2EInstikiTest::startup and E2EInstikiTest::shutdown at http://dev.instiki.org/file/instiki/trunk/test/watir/e2e.rb The whole exercise takes ~11 seconds on my PC (about half for starting and stopping the Webrick, and the other half for running the "test" - which is merely a placeholder for now. Caveat: usually I write much better code than this... at least, it works in fair weather :) Bret, Paul: in the light of my earlier suggestion to make Instiki the sample app under test for Watir, please note how _right now_ you are able to run the Watir test suite (what there is of it) for Instiki in three easy steps: Step1. svn co http://dev.instiki.org/svn/trunk instiki Step 2. test\watir\e2e Step 3. Chuckle... there is no Step 3 [(C) David H. Hansson, of Rails fame] -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) From paul.rogers at shaw.ca Fri May 6 00:18:25 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 05 May 2005 22:18:25 -0600 Subject: [Wtr-general] Starting/stopping app under test from within Watir test script In-Reply-To: Message-ID: <005501c551f2$a5ed3950$afd29044@NewDell> A simper way may be to use Winclicker#winsystem I think this returns the pid of the started process, then you can probably just kill that process Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alexey Verkhovsky Sent: 05 May 2005 21:30 To: wtr-general at rubyforge.org Subject: [Wtr-general] Starting/stopping app under test from within Watir test script Few days ago, I asked a question here how to start/stop a Webrick (or anmy other application under test) on Windows from the Ruby program. Starting is no big deal, but stopping is quite a problem. I'\ve asked the same question on ruby-talk, and with some help from Jon A. Lambert figured out the way to do it. See E2EInstikiTest::startup and E2EInstikiTest::shutdown at http://dev.instiki.org/file/instiki/trunk/test/watir/e2e.rb The whole exercise takes ~11 seconds on my PC (about half for starting and stopping the Webrick, and the other half for running the "test" - which is merely a placeholder for now. Caveat: usually I write much better code than this... at least, it works in fair weather :) Bret, Paul: in the light of my earlier suggestion to make Instiki the sample app under test for Watir, please note how _right now_ you are able to run the Watir test suite (what there is of it) for Instiki in three easy steps: Step1. svn co http://dev.instiki.org/svn/trunk instiki Step 2. test\watir\e2e Step 3. Chuckle... there is no Step 3 [(C) David H. Hansson, of Rails fame] -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Fri May 6 01:16:24 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 05 May 2005 23:16:24 -0600 Subject: [Wtr-general] Watir 1.3 is released Message-ID: <005801c551fa$bf8b52e0$afd29044@NewDell> This release contains many new features and bug fixes. Many thanks to everyone who has contributed to this project. If any problems are found during installation or running, please report them to thelist as soon as possible. Paul ------------------------------------------------ Watir 1.3 added new row_values and column_value methods to tables added ability to save an image - ie.image(:index,1).save('c:\temp\mypic.gif') new method, html that applies to objects, not just a page - ie.button(:index,1).html => now throws a NavigationException on 404, 500 errors iterators now mixin Enumerable added support for labels added support for frames by index added screen_capture added hidden field support, and iterator method table cells, span and div now act as containers, so can do ie.div(:index,1).button(:index.2).click added index to print out from show_xx methods. Link shows img src if an image is used added onKeyUp and onKeyDown to text_fields#set installer now installs AutoIt to deal with javascript popups, file uploads etc the spinner is now off by default bug fix in text_fields iterator where it wasnt iterating through password or text ares. Added test for password fields bug fix for flash for tables bug fixes for images and links in cells From paul.rogers at shaw.ca Fri May 6 01:19:12 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 05 May 2005 23:19:12 -0600 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table In-Reply-To: <004e01c551dc$a525f3b0$afd29044@NewDell> Message-ID: <005901c551fb$236b6890$afd29044@NewDell> I fixed this and included it in the 1.3 release -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: 05 May 2005 19:41 To: wtr-general at rubyforge.org Subject: RE: RE: [Wtr-general] Re: How to access a CheckBox inside a Table This is actually going to cause a lot of problems If you had 2 links in a table cell, I think you would see the same behaviour. Im not sure Im going to be able to fix this soon. I need to do a release today for the Star East class next week, then I can try and fix this Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: 05 May 2005 18:08 To: wtr-general at rubyforge.org Subject: RE: RE: [Wtr-general] Re: How to access a CheckBox inside a Table Well, I added some more tests, and its NOT doing the right thing... Watch this space Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: 05 May 2005 17:24 To: wtr-general at rubyforge.org Subject: RE: RE: [Wtr-general] Re: How to access a CheckBox inside a Table I added some unit tests for this sort of condition, and it looks like watir does the Right Thing. I'll see if I can either find some code like this to really try it, or maybe write some Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 10:35 To: wtr-general at rubyforge.org Subject: RE: RE: [Wtr-general] Re: How to access a CheckBox inside a Table You got it right about what I'm trying to do -- I want to click the first image in any row in the table. My example wasn't right though because the image sources are actually the same until one's clicked. This is a tree type structure so there's a "plus" image and a "minus" image. If the first level's expanded and the second's collapsed, it'll look like ...
...
...
When I do ie.table(:index, 1)[1][1].image(:index, 1).src I get "minus.png", but when I do ie.table(:index, 1)[2][1].image(:index, 1).src I also get "minus.png" instead of "plus.png". The only way to click the second image is ie.table(:index, 1)[2][1].image(:index, 2).click or ie.image(:index, 2).click Am I missing something? If it matters, the version of watir I'm using is 1.161 (from "puts IE::REVISION"). Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Thu, 05 May 2005 09:54:09 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <002b01c5518a$ad0db2e0$afd29044 at NewDell> Content-Type: text/plain; charset=us-ascii ie.table(:id, 'my_table)[1[2].checkbox(:index,1).set This refers to the first checkbox in the 2nd cell of the first row Im not sure understand what you're trying to do? ie.table(:index, 1)[1][1].image(:index,1).click Would click the first image in the first cell of the first row of the first table You can of course just use the src of the image Ie.image(:src, /image1/).click Does that solve the problem? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 09:30 To: wtr-general at rubyforge.org Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Paul, in the response you gave below, is the index of the checkbox related to the table or table cell in any way? Or is this the same as saying "ie.checkbox(:index,1).set"? The problem I'm having is clicking an image inside a table cell without having to know what the image's index is. The code I'm testing is structured like this: ...
...
...
How do I click an image in the table without looping through based on the images' indexes? I want to be able to be able to do something like "ie.table(:index, 1).image.click" instead of "ie.image(:index, 2).click". Is there a way I can do this? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From zeljko.filipin at gmail.com Fri May 6 02:49:34 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Fri, 6 May 2005 08:49:34 +0200 Subject: [Wtr-general] Watir 1.3 is released In-Reply-To: <005801c551fa$bf8b52e0$afd29044@NewDell> Message-ID: <427b135b.49053d02.493b.598d@mx.gmail.com> I have just installed watir 1.3 and performed all_tests.rb: Finished in 265.287 seconds. 1) Error: test_save_remote_image(TC_Images): Watir::Exception::CacheItemNotFound: Match not found in C:\Documents and Settings\zfilipin\Local Settings\Temporary Internet Files using (?-mix:triangle\[\d +\].jpg) C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3065:in `save' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `each' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:134:in `test_save_remote_image' C:/watir_bonus/unitTests/../unittests/images_test.rb:132:in `run_webrick' C:/watir_bonus/unitTests/../unittests/images_test.rb:132:in `test_save_remote_image' 2) Error: test_save_remote_image_overwrites(TC_Images): Watir::Exception::CacheItemNotFound: Match not found in C:\Documents and Settings\zfilipin\Local Settings\Temporary Internet Files using (?-mix:triangle\[\d +\].jpg) C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3065:in `save' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `each' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:143:in `test_save_remote_image_overwrites' C:/watir_bonus/unitTests/../unittests/images_test.rb:141:in `run_webrick' C:/watir_bonus/unitTests/../unittests/images_test.rb:141:in `test_save_remote_image_overwrites' 3) Failure: test_http_errors(TC_Navigate) [C:/watir_bonus/unitTests/../unittests/navigate_test.rb:51]: exception expected but none was thrown. 163 tests, 983 assertions, 1 failures, 2 errors Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Friday, May 06, 2005 7:16 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Watir 1.3 is released This release contains many new features and bug fixes. Many thanks to everyone who has contributed to this project. If any problems are found during installation or running, please report them to thelist as soon as possible. Paul ------------------------------------------------ Watir 1.3 added new row_values and column_value methods to tables added ability to save an image - ie.image(:index,1).save('c:\temp\mypic.gif') new method, html that applies to objects, not just a page - ie.button(:index,1).html => now throws a NavigationException on 404, 500 errors iterators now mixin Enumerable added support for labels added support for frames by index added screen_capture added hidden field support, and iterator method table cells, span and div now act as containers, so can do ie.div(:index,1).button(:index.2).click added index to print out from show_xx methods. Link shows img src if an image is used added onKeyUp and onKeyDown to text_fields#set installer now installs AutoIt to deal with javascript popups, file uploads etc the spinner is now off by default bug fix in text_fields iterator where it wasnt iterating through password or text ares. Added test for password fields bug fix for flash for tables bug fixes for images and links in cells _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From ati.ozgur at gmail.com Fri May 6 05:26:55 2005 From: ati.ozgur at gmail.com (Atilla Ozgur) Date: Fri, 6 May 2005 12:26:55 +0300 Subject: [Wtr-general] showModalDialog In-Reply-To: <002c01c5518a$c7ae1ae0$afd29044@NewDell> References: <593b9ae805050508054fc93b94@mail.gmail.com> <002c01c5518a$c7ae1ae0$afd29044@NewDell> Message-ID: If I find some time, I would look at it. I plan to use AutoIt for this. > does anyone know how to get WATIR to click on ModalDialog? > IE.attach(:title, "blahblah") doesn't work From andy__s at hotmail.com Fri May 6 08:15:42 2005 From: andy__s at hotmail.com (Andy Sipe) Date: Fri, 06 May 2005 08:15:42 -0400 Subject: [Wtr-general] Watir 1.3 is released (test failures) In-Reply-To: <427b135b.49053d02.493b.598d@mx.gmail.com> Message-ID: Some of the image tests do not work on some configurations. I'm reworking the Image.save method to not use the IE cache. I should have have the changes in sometime this weekend. -andy From andy__s at hotmail.com Fri May 6 08:35:43 2005 From: andy__s at hotmail.com (Andy Sipe) Date: Fri, 06 May 2005 08:35:43 -0400 Subject: [Wtr-general] images_tests.rb failures In-Reply-To: <5.1.0.14.2.20050504004248.03793da8@127.0.0.1> Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050506/f218e991/attachment.html From shaorobics at gmail.com Fri May 6 08:51:37 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Fri, 6 May 2005 08:51:37 -0400 Subject: [Wtr-general] counting :name Message-ID: <593b9ae805050605513faebf23@mail.gmail.com> if I have a group of radio buttons that share the same name, is there a way to count how many there are? for example they're all named GB and I want to see how many there are to validate certain things. Thanks Shao From andy__s at hotmail.com Fri May 6 09:22:28 2005 From: andy__s at hotmail.com (Andy Sipe) Date: Fri, 06 May 2005 09:22:28 -0400 Subject: [Wtr-general] counting :name In-Reply-To: <593b9ae805050605513faebf23@mail.gmail.com> Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050506/ae18a24d/attachment.html From DBoyt at anteon.com Fri May 6 09:25:03 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Fri, 6 May 2005 09:25:03 -0400 Subject: [Wtr-general] (no subject) Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC85DBDDD@HQ-EXVS02.anteon.com> (1) Yes to your first question, the page is being reloaded. By "you will need to recreate the my_table", do you mean just re-executing the "My_table = ie.table(index,1)" line? And is there a difference or benefit in accessing a table through a variable (My_table[1][1]) versus the ie object (ie.table(index,1)[1][1]) other than the fact that using a variable requires less typing? Javascript isn't being used to add rows to the table...thankfully...and the minus.png is not in a hidden div. This is actually pretty straightforward HTML with a little Javascript to determine which image to display, which page to load, etc. Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- [Wtr-general] Re: How to access a CheckBox inside a Table Paul Rogers paul.rogers at shaw.ca Thu May 5 15:22:24 EDT 2005 So, my first question is, when you click the plus, is there a page reload? If you are doing somethig like My_table = ie.table(index,1) My_table[1][1].image(:index,1).click Then you will need torecreate the my_table, as it refers to the old page If your app use javascript to add a row to the table that's now visible, you may need to do this Ie.table(:index,1).update_rows This causes the watir representaion of the table to get refreshed. Is the minus.png in a hidden div? that may account for watir getting the wrong image. If I get some time I'll try something like this out Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 10:35 To: wtr-general at rubyforge.org Subject: RE: RE: [Wtr-general] Re: How to access a CheckBox inside a Table You got it right about what I'm trying to do -- I want to click the first image in any row in the table. My example wasn't right though because the image sources are actually the same until one's clicked. This is a tree type structure so there's a "plus" image and a "minus" image. If the first level's expanded and the second's collapsed, it'll look like ...
...
...
When I do ie.table(:index, 1)[1][1].image(:index, 1).src I get "minus.png", but when I do ie.table(:index, 1)[2][1].image(:index, 1).src I also get "minus.png" instead of "plus.png". The only way to click the second image is ie.table(:index, 1)[2][1].image(:index, 2).click or ie.image(:index, 2).click Am I missing something? If it matters, the version of watir I'm using is 1.161 (from "puts IE::REVISION"). Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Thu, 05 May 2005 09:54:09 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <002b01c5518a$ad0db2e0$afd29044 at NewDell> Content-Type: text/plain; charset=us-ascii ie.table(:id, 'my_table)[1[2].checkbox(:index,1).set This refers to the first checkbox in the 2nd cell of the first row Im not sure understand what you're trying to do? ie.table(:index, 1)[1][1].image(:index,1).click Would click the first image in the first cell of the first row of the first table You can of course just use the src of the image Ie.image(:src, /image1/).click Does that solve the problem? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 09:30 To: wtr-general at rubyforge.org Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Paul, in the response you gave below, is the index of the checkbox related to the table or table cell in any way? Or is this the same as saying "ie.checkbox(:index,1).set"? The problem I'm having is clicking an image inside a table cell without having to know what the image's index is. The code I'm testing is structured like this: ...
...
...
How do I click an image in the table without looping through based on the images' indexes? I want to be able to be able to do something like "ie.table(:index, 1).image.click" instead of "ie.image(:index, 2).click". Is there a way I can do this? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama From DBoyt at anteon.com Fri May 6 09:26:57 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Fri, 6 May 2005 09:26:57 -0400 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC85DBDE3@HQ-EXVS02.anteon.com> (1) Yes to your first question, the page is being reloaded. By "you will need to recreate the my_table", do you mean just re-executing the "My_table = ie.table(index,1)" line? And is there a difference or benefit in accessing a table through a variable (My_table[1][1]) versus the ie object (ie.table(index,1)[1][1]) other than the fact that using a variable requires less typing? Javascript isn't being used to add rows to the table...thankfully...and the minus.png is not in a hidden div. This is actually pretty straightforward HTML with a little Javascript to determine which image to display, which page to load, etc. Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- [Wtr-general] Re: How to access a CheckBox inside a Table Paul Rogers paul.rogers at shaw.ca Thu May 5 15:22:24 EDT 2005 So, my first question is, when you click the plus, is there a page reload? If you are doing somethig like My_table = ie.table(index,1) My_table[1][1].image(:index,1).click Then you will need torecreate the my_table, as it refers to the old page If your app use javascript to add a row to the table that's now visible, you may need to do this Ie.table(:index,1).update_rows This causes the watir representaion of the table to get refreshed. Is the minus.png in a hidden div? that may account for watir getting the wrong image. If I get some time I'll try something like this out Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 10:35 To: wtr-general at rubyforge.org Subject: RE: RE: [Wtr-general] Re: How to access a CheckBox inside a Table You got it right about what I'm trying to do -- I want to click the first image in any row in the table. My example wasn't right though because the image sources are actually the same until one's clicked. This is a tree type structure so there's a "plus" image and a "minus" image. If the first level's expanded and the second's collapsed, it'll look like ...
...
...
When I do ie.table(:index, 1)[1][1].image(:index, 1).src I get "minus.png", but when I do ie.table(:index, 1)[2][1].image(:index, 1).src I also get "minus.png" instead of "plus.png". The only way to click the second image is ie.table(:index, 1)[2][1].image(:index, 2).click or ie.image(:index, 2).click Am I missing something? If it matters, the version of watir I'm using is 1.161 (from "puts IE::REVISION"). Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Thu, 05 May 2005 09:54:09 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <002b01c5518a$ad0db2e0$afd29044 at NewDell> Content-Type: text/plain; charset=us-ascii ie.table(:id, 'my_table)[1[2].checkbox(:index,1).set This refers to the first checkbox in the 2nd cell of the first row Im not sure understand what you're trying to do? ie.table(:index, 1)[1][1].image(:index,1).click Would click the first image in the first cell of the first row of the first table You can of course just use the src of the image Ie.image(:src, /image1/).click Does that solve the problem? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 09:30 To: wtr-general at rubyforge.org Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Paul, in the response you gave below, is the index of the checkbox related to the table or table cell in any way? Or is this the same as saying "ie.checkbox(:index,1).set"? The problem I'm having is clicking an image inside a table cell without having to know what the image's index is. The code I'm testing is structured like this: ...
...
...
How do I click an image in the table without looping through based on the images' indexes? I want to be able to be able to do something like "ie.table(:index, 1).image.click" instead of "ie.image(:index, 2).click". Is there a way I can do this? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama From DBoyt at anteon.com Fri May 6 09:39:16 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Fri, 6 May 2005 09:39:16 -0400 Subject: [Wtr-general] show_tables error message Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC85DBDEC@HQ-EXVS02.anteon.com> Any ideas why I keep getting the following error message when irb(main):004:0> ie1.frame("mainFrame").show_tables Found 8 tables 1 id= rows=1 columns=1 2 id= rows=3 columns=2 3 id= rows=1 columns=12 4 id= rows=6 columns=1 5 id= rows=1 columns=2 6 id= rows=88 columns=3 7 id= rows=1 columns=2 WIN32OLERuntimeError: Unknown property or method `0' HRESULT error code:0x80020006 Unknown name. from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1678:in `[]' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1678:in `show_tables' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1677:in `each' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1677:in `show_tables' from (irb):4 from :0 Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama From paul.rogers at shaw.ca Fri May 6 09:48:14 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 07:48:14 -0600 Subject: [Wtr-general] show_tables error message In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC85DBDEC@HQ-EXVS02.anteon.com> Message-ID: <001201c55242$40513470$afd29044@NewDell> Is that in todays release? -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 07:39 To: wtr-general at rubyforge.org Subject: [Wtr-general] show_tables error message Any ideas why I keep getting the following error message when irb(main):004:0> ie1.frame("mainFrame").show_tables Found 8 tables 1 id= rows=1 columns=1 2 id= rows=3 columns=2 3 id= rows=1 columns=12 4 id= rows=6 columns=1 5 id= rows=1 columns=2 6 id= rows=88 columns=3 7 id= rows=1 columns=2 WIN32OLERuntimeError: Unknown property or method `0' HRESULT error code:0x80020006 Unknown name. from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1678:in `[]' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1678:in `show_tables' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1677:in `each' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1677:in `show_tables' from (irb):4 from :0 Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Fri May 6 09:49:21 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 07:49:21 -0600 Subject: [Wtr-general] counting :name In-Reply-To: Message-ID: <001301c55242$67fdc290$afd29044@NewDell> probably better to use the radios collection count=0 ie.radios.each do |r| count+=1 if r.name=='GB' end -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andy Sipe Sent: 06 May 2005 07:22 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] counting :name Would this work for you: ie.html.scan(/name='GB'/).length ----Original Message Follows---- From: Shao Kang Tat Reply-To: wtr-general at rubyforge.org To: wtr-general at rubyforge.org Subject: [Wtr-general] counting :name Date: Fri, 6 May 2005 08:51:37 -0400 if I have a group of radio buttons that share the same name, is there a way to count how many there are? for example they're all named GB and I want to see how many there are to validate certain things. Thanks Shao _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050506/a00487d6/attachment.html From shaorobics at gmail.com Fri May 6 09:50:31 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Fri, 6 May 2005 09:50:31 -0400 Subject: [Wtr-general] counting :name In-Reply-To: References: <593b9ae805050605513faebf23@mail.gmail.com> Message-ID: <593b9ae805050606506382b179@mail.gmail.com> Hi I tried exactly that, not much luck. any other ideas or maybe I'm not using it right somehow :) On 5/6/05, Andy Sipe wrote: > > > > Would this work for you: > > ie.html.scan(/name='GB'/).length > > ----Original Message Follows---- > From: Shao Kang Tat > Reply-To: wtr-general at rubyforge.org > To: wtr-general at rubyforge.org > Subject: [Wtr-general] counting :name > Date: Fri, 6 May 2005 08:51:37 -0400 > > > if I have a group of radio buttons that share the same name, is there > a way to count how many there are? for example > > > > > > > they're all named GB and I want to see how many there are to validate > certain things. > > Thanks > Shao > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > From DBoyt at anteon.com Fri May 6 09:51:46 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Fri, 6 May 2005 09:51:46 -0400 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC85DBDF0@HQ-EXVS02.anteon.com> Is it possible to do the same thing with links? I executed the following to try to display the href of all the "View" links on a page, just to see if it works: ie.links.each do |link| link.href if /View/.match(link.text) end and I got this error: NoMethodError: undefined method `document' for nil:NilClass from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2273:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `links' from (irb):16 from ?:0 Am I doing something wrong? Or is this just something that's not do-able, yet? Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- [Wtr-general] Re: How to access a CheckBox inside a Table Paul Rogers paul.rogers at shaw.ca Thu May 5 15:17:54 EDT 2005 If you get a more recent versoin from cvs ( release coming soon, I promise) the iterators mixin in enumerable. There is probably something there you can use, although Im not sure what exactly. Grep seems like its should work, but Im not sure how to make it work on the image.src You can use the iterator in a simple way too: ie.images.each do |image| image.click if /plus/.match(image.src) end From paul.rogers at shaw.ca Fri May 6 09:58:33 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 07:58:33 -0600 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC85DBDF0@HQ-EXVS02.anteon.com> Message-ID: <001801c55243$b0cb7f20$afd29044@NewDell> That certainly should work Using the 1.3 release, at google I got irb(main):021:0> ie.links.each do |link| irb(main):022:1* puts link.href if /o/i.match(link.text) irb(main):023:1> end http://www.google.ca/grphp?hl=en&tab=wg http://www.google.ca/lochp?hl=en&tab=wl http://127.0.0.1:4664/&s=575547794 http://www.google.ca/options/ http://www.google.ca/language_tools?hl=en http://www.google.ca/ads/ http://www.google.ca/services/ http://www.google.ca/intl/en/about.html http://www.google.com/ncr http://www.google.ca/mgyhp.html It may have been caused by the bug you found yesterday Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 07:52 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Re: How to access a CheckBox inside a Table Is it possible to do the same thing with links? I executed the following to try to display the href of all the "View" links on a page, just to see if it works: ie.links.each do |link| link.href if /View/.match(link.text) end and I got this error: NoMethodError: undefined method `document' for nil:NilClass from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2273:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `links' from (irb):16 from ?:0 Am I doing something wrong? Or is this just something that's not do- able, yet? Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- [Wtr-general] Re: How to access a CheckBox inside a Table Paul Rogers paul.rogers at shaw.ca Thu May 5 15:17:54 EDT 2005 If you get a more recent versoin from cvs ( release coming soon, I promise) the iterators mixin in enumerable. There is probably something there you can use, although Im not sure what exactly. Grep seems like its should work, but Im not sure how to make it work on the image.src You can use the iterator in a simple way too: ie.images.each do |image| image.click if /plus/.match(image.src) end _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr- general From paul.rogers at shaw.ca Fri May 6 10:01:16 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 08:01:16 -0600 Subject: [Wtr-general] Watir 1.3 is released In-Reply-To: <427b135b.49053d02.493b.598d@mx.gmail.com> Message-ID: <001901c55244$122efc10$afd29044@NewDell> The navigation exception failure may have been caused by your browser setting. What do you get if you goto this site http://www.fxruby.org/dfdf Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: 06 May 2005 00:50 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Watir 1.3 is released I have just installed watir 1.3 and performed all_tests.rb: Finished in 265.287 seconds. 1) Error: test_save_remote_image(TC_Images): Watir::Exception::CacheItemNotFound: Match not found in C:\Documents and Settings\zfilipin\Local Settings\Temporary Internet Files using (?-mix:triangle\[\d +\].jpg) C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3065:in `save' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `each' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:134:in `test_save_remote_image' C:/watir_bonus/unitTests/../unittests/images_test.rb:132:in `run_webrick' C:/watir_bonus/unitTests/../unittests/images_test.rb:132:in `test_save_remote_image' 2) Error: test_save_remote_image_overwrites(TC_Images): Watir::Exception::CacheItemNotFound: Match not found in C:\Documents and Settings\zfilipin\Local Settings\Temporary Internet Files using (?-mix:triangle\[\d +\].jpg) C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3065:in `save' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `each' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:143:in `test_save_remote_image_overwrites' C:/watir_bonus/unitTests/../unittests/images_test.rb:141:in `run_webrick' C:/watir_bonus/unitTests/../unittests/images_test.rb:141:in `test_save_remote_image_overwrites' 3) Failure: test_http_errors(TC_Navigate) [C:/watir_bonus/unitTests/../unittests/navigate_test.rb:51]: exception expected but none was thrown. 163 tests, 983 assertions, 1 failures, 2 errors Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Friday, May 06, 2005 7:16 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Watir 1.3 is released This release contains many new features and bug fixes. Many thanks to everyone who has contributed to this project. If any problems are found during installation or running, please report them to thelist as soon as possible. Paul ------------------------------------------------ Watir 1.3 added new row_values and column_value methods to tables added ability to save an image - ie.image(:index,1).save('c:\temp\mypic.gif') new method, html that applies to objects, not just a page - ie.button(:index,1).html => now throws a NavigationException on 404, 500 errors iterators now mixin Enumerable added support for labels added support for frames by index added screen_capture added hidden field support, and iterator method table cells, span and div now act as containers, so can do ie.div(:index,1).button(:index.2).click added index to print out from show_xx methods. Link shows img src if an image is used added onKeyUp and onKeyDown to text_fields#set installer now installs AutoIt to deal with javascript popups, file uploads etc the spinner is now off by default bug fix in text_fields iterator where it wasnt iterating through password or text ares. Added test for password fields bug fix for flash for tables bug fixes for images and links in cells _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From dallenusa at yahoo.com Fri May 6 10:03:41 2005 From: dallenusa at yahoo.com (Richard Allen) Date: Fri, 6 May 2005 07:03:41 -0700 (PDT) Subject: [Wtr-general] Development for automation Message-ID: <20050506140341.53010.qmail@web30502.mail.mud.yahoo.com> If development of a new product is starting, in our case .net, what suggestions might be made to make test automation easier. Some things might be: Unique control names object naming convention . . . Maybe things that people have run into that ... if the coders had done this or that ... the automated tests could have been more effective. Thanks, Richard __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From paul.rogers at shaw.ca Fri May 6 10:04:07 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 08:04:07 -0600 Subject: [Wtr-general] (no subject) In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC85DBDDD@HQ-EXVS02.anteon.com> Message-ID: <001c01c55244$7841a930$afd29044@NewDell> By "you will need to recreate the my_table", do you mean just re-executing the "My_table = ie.table(index,1)" line? Yes! And is there a difference or benefit in accessing a table through a variable (My_table[1][1]) Possibly. If the table should change ( a row added dynamically, or content changing) im not sure what may happen. It seems that it all just works, ( there is a unit test for it) but Im not sure I would rely on it Take a lookt at simple_table_buttons.html in the 1.3 release, and see if the table there is similar to what you are doing Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 07:25 To: wtr-general at rubyforge.org Subject: [Wtr-general] (no subject) (1) Yes to your first question, the page is being reloaded. By "you will need to recreate the my_table", do you mean just re-executing the "My_table = ie.table(index,1)" line? And is there a difference or benefit in accessing a table through a variable (My_table[1][1]) versus the ie object (ie.table(index,1)[1][1]) other than the fact that using a variable requires less typing? Javascript isn't being used to add rows to the table...thankfully...and the minus.png is not in a hidden div. This is actually pretty straightforward HTML with a little Javascript to determine which image to display, which page to load, etc. Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- [Wtr-general] Re: How to access a CheckBox inside a Table Paul Rogers paul.rogers at shaw.ca Thu May 5 15:22:24 EDT 2005 So, my first question is, when you click the plus, is there a page reload? If you are doing somethig like My_table = ie.table(index,1) My_table[1][1].image(:index,1).click Then you will need torecreate the my_table, as it refers to the old page If your app use javascript to add a row to the table that's now visible, you may need to do this Ie.table(:index,1).update_rows This causes the watir representaion of the table to get refreshed. Is the minus.png in a hidden div? that may account for watir getting the wrong image. If I get some time I'll try something like this out Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 10:35 To: wtr-general at rubyforge.org Subject: RE: RE: [Wtr-general] Re: How to access a CheckBox inside a Table You got it right about what I'm trying to do -- I want to click the first image in any row in the table. My example wasn't right though because the image sources are actually the same until one's clicked. This is a tree type structure so there's a "plus" image and a "minus" image. If the first level's expanded and the second's collapsed, it'll look like ...
...
...
When I do ie.table(:index, 1)[1][1].image(:index, 1).src I get "minus.png", but when I do ie.table(:index, 1)[2][1].image(:index, 1).src I also get "minus.png" instead of "plus.png". The only way to click the second image is ie.table(:index, 1)[2][1].image(:index, 2).click or ie.image(:index, 2).click Am I missing something? If it matters, the version of watir I'm using is 1.161 (from "puts IE::REVISION"). Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Thu, 05 May 2005 09:54:09 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <002b01c5518a$ad0db2e0$afd29044 at NewDell> Content-Type: text/plain; charset=us-ascii ie.table(:id, 'my_table)[1[2].checkbox(:index,1).set This refers to the first checkbox in the 2nd cell of the first row Im not sure understand what you're trying to do? ie.table(:index, 1)[1][1].image(:index,1).click Would click the first image in the first cell of the first row of the first table You can of course just use the src of the image Ie.image(:src, /image1/).click Does that solve the problem? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 05 May 2005 09:30 To: wtr-general at rubyforge.org Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Paul, in the response you gave below, is the index of the checkbox related to the table or table cell in any way? Or is this the same as saying "ie.checkbox(:index,1).set"? The problem I'm having is clicking an image inside a table cell without having to know what the image's index is. The code I'm testing is structured like this: ...
...
...
How do I click an image in the table without looping through based on the images' indexes? I want to be able to be able to do something like "ie.table(:index, 1).image.click" instead of "ie.image(:index, 2).click". Is there a way I can do this? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Fri May 6 10:09:03 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 08:09:03 -0600 Subject: [Wtr-general] show_tables error message In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC85DBDEC@HQ-EXVS02.anteon.com> Message-ID: <001d01c55245$28da8dc0$afd29044@NewDell> Looking at the code, it could be caused by a table with no rows, possibly the first row being a tablehead. I'll add a rescue in there to stop the error. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 07:39 To: wtr-general at rubyforge.org Subject: [Wtr-general] show_tables error message Any ideas why I keep getting the following error message when irb(main):004:0> ie1.frame("mainFrame").show_tables Found 8 tables 1 id= rows=1 columns=1 2 id= rows=3 columns=2 3 id= rows=1 columns=12 4 id= rows=6 columns=1 5 id= rows=1 columns=2 6 id= rows=88 columns=3 7 id= rows=1 columns=2 WIN32OLERuntimeError: Unknown property or method `0' HRESULT error code:0x80020006 Unknown name. from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1678:in `[]' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1678:in `show_tables' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1677:in `each' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1677:in `show_tables' from (irb):4 from :0 Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From DBoyt at anteon.com Fri May 6 10:13:42 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Fri, 6 May 2005 10:13:42 -0400 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC85DBDFF@HQ-EXVS02.anteon.com> Do you think my problem may be that I'm working within a frame? I tried your google test and got the same results as you, but when I tried it within a frame I got irb(main):058:0> ie.frame("mainFrame").links.each do |link| irb(main):059:1* puts link.href if /o/i.match(link.text) irb(main):060:1> end NoMethodError: undefined method `document' for nil:NilClass from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2273:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `links' from (irb):58 from ?:0 Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Fri, 06 May 2005 07:58:33 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <001801c55243$b0cb7f20$afd29044 at NewDell> Content-Type: text/plain; charset=ks_c_5601-1987 That certainly should work Using the 1.3 release, at google I got irb(main):021:0> ie.links.each do |link| irb(main):022:1* puts link.href if /o/i.match(link.text) irb(main):023:1> end http://www.google.ca/grphp?hl=en&tab=wg http://www.google.ca/lochp?hl=en&tab=wl http://127.0.0.1:4664/&s=575547794 http://www.google.ca/options/ http://www.google.ca/language_tools?hl=en http://www.google.ca/ads/ http://www.google.ca/services/ http://www.google.ca/intl/en/about.html http://www.google.com/ncr http://www.google.ca/mgyhp.html It may have been caused by the bug you found yesterday Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 07:52 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Re: How to access a CheckBox inside a Table Is it possible to do the same thing with links? I executed the following to try to display the href of all the "View" links on a page, just to see if it works: ie.links.each do |link| link.href if /View/.match(link.text) end and I got this error: NoMethodError: undefined method `document' for nil:NilClass from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2273:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `links' from (irb):16 from ??:0 Am I doing something wrong? Or is this just something that's not do- able, yet? Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama From paul.rogers at shaw.ca Fri May 6 10:20:04 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 08:20:04 -0600 Subject: [Wtr-general] Development for automation In-Reply-To: <20050506140341.53010.qmail@web30502.mail.mud.yahoo.com> Message-ID: <001e01c55246$b29dedd0$afd29044@NewDell> Get your developers to use unit tests on the code to start with. Id on as much as possible Use Css for layout ( many people use tables) Use html comments to help you Use agile development, then if you cant automate something, in the next iteration you can add a story to make it easier to automate. As far as your test code, use tdd, use classes whereever possible ( gives reuse, you can unit test your own code( not the browser based stuff) and you can use rdoc ) Come back and tell us how it went! Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Richard Allen Sent: 06 May 2005 08:04 To: Wtr-general at rubyforge.org Subject: [Wtr-general] Development for automation If development of a new product is starting, in our case .net, what suggestions might be made to make test automation easier. Some things might be: Unique control names object naming convention . . . Maybe things that people have run into that ... if the coders had done this or that ... the automated tests could have been more effective. Thanks, Richard __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From DBoyt at anteon.com Fri May 6 10:23:17 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Fri, 6 May 2005 10:23:17 -0400 Subject: [Wtr-general] show_tables error message Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC85DBE06@HQ-EXVS02.anteon.com> Yes Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Fri, 06 May 2005 07:48:14 -0600 From: Paul Rogers Subject: RE: [Wtr-general] show_tables error message To: wtr-general at rubyforge.org Message-ID: <001201c55242$40513470$afd29044 at NewDell> Content-Type: text/plain; charset=us-ascii Is that in todays release? -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 07:39 To: wtr-general at rubyforge.org Subject: [Wtr-general] show_tables error message Any ideas why I keep getting the following error message when irb(main):004:0> ie1.frame("mainFrame").show_tables Found 8 tables 1 id= rows=1 columns=1 2 id= rows=3 columns=2 3 id= rows=1 columns=12 4 id= rows=6 columns=1 5 id= rows=1 columns=2 6 id= rows=88 columns=3 7 id= rows=1 columns=2 WIN32OLERuntimeError: Unknown property or method `0' HRESULT error code:0x80020006 Unknown name. from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1678:in `[]' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1678:in `show_tables' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1677:in `each' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1677:in `show_tables' from (irb):4 from :0 Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama From paul.rogers at shaw.ca Fri May 6 10:25:49 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 08:25:49 -0600 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC85DBDFF@HQ-EXVS02.anteon.com> Message-ID: <001f01c55247$7fe3ac30$afd29044@NewDell> Which version is this? There was a bug with frames/document method that caused something else to fail, that may have fixed this, as it appears to work for me now ( and Im to lazy to go back a version ;-) ) irb(main):032:0> ie.frame(:index,1).show_links index name id href 1 file:///C:/watir_bonus/unitTests/html/links2.html 2 file:///C:/watir_bonus/unitTests/html/link_pass.html 3 file:///C:/watir_bonus/unitTests/html/pass3.html 4 file:///C:/watir_bonus/unitTests/html/textarea.html 5 file:///C:/watir_bonus/unitTests/html/textarea.html 6 link_id file:///C:/watir_bonus/unitTests/html/links1.HTML 7 link_name file:///C:/watir_bonus/unitTests/html/links1.HTML 8 file:///C:/watir_bonus/unitTests/html/links1.HTML 9 file:///C:/watir_bonus/unitTests/html/pass.html l/images/triangle.jpg => nil ( I cut off the text as it wouldn?t show in the email correctly) Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 08:14 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table Do you think my problem may be that I'm working within a frame? I tried your google test and got the same results as you, but when I tried it within a frame I got irb(main):058:0> ie.frame("mainFrame").links.each do |link| irb(main):059:1* puts link.href if /o/i.match(link.text) irb(main):060:1> end NoMethodError: undefined method `document' for nil:NilClass from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2273:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `links' from (irb):58 from ?:0 Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Fri, 06 May 2005 07:58:33 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <001801c55243$b0cb7f20$afd29044 at NewDell> Content-Type: text/plain; charset=ks_c_5601-1987 That certainly should work Using the 1.3 release, at google I got irb(main):021:0> ie.links.each do |link| irb(main):022:1* puts link.href if /o/i.match(link.text) irb(main):023:1> end http://www.google.ca/grphp?hl=en&tab=wg http://www.google.ca/lochp?hl=en&tab=wl http://127.0.0.1:4664/&s=575547794 http://www.google.ca/options/ http://www.google.ca/language_tools?hl=en http://www.google.ca/ads/ http://www.google.ca/services/ http://www.google.ca/intl/en/about.html http://www.google.com/ncr http://www.google.ca/mgyhp.html It may have been caused by the bug you found yesterday Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 07:52 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Re: How to access a CheckBox inside a Table Is it possible to do the same thing with links? I executed the following to try to display the href of all the "View" links on a page, just to see if it works: ie.links.each do |link| link.href if /View/.match(link.text) end and I got this error: NoMethodError: undefined method `document' for nil:NilClass from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2273:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `links' from (irb):16 from ??:0 Am I doing something wrong? Or is this just something that's not do- able, yet? Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From shaorobics at gmail.com Fri May 6 10:27:13 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Fri, 6 May 2005 10:27:13 -0400 Subject: [Wtr-general] counting :name In-Reply-To: <001301c55242$67fdc290$afd29044@NewDell> References: <001301c55242$67fdc290$afd29044@NewDell> Message-ID: <593b9ae80505060727523afea7@mail.gmail.com> Hi Paul when I try that, I get this message: c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1493:in `invoke': Unknown property or method `name' HRESULT error code:0x80020006 Unknown name. any ideas? Thanks Shao On 5/6/05, Paul Rogers wrote: > probably better to use the radios collection > > count=0 > ie.radios.each do |r| > count+=1 if r.name=='GB' > end > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of > Andy Sipe > Sent: 06 May 2005 07:22 > To: wtr-general at rubyforge.org > Subject: RE: [Wtr-general] counting :name > > > > > Would this work for you: > > ie.html.scan(/name='GB'/).length > > ----Original Message Follows---- > From: Shao Kang Tat > Reply-To: wtr-general at rubyforge.org > To: wtr-general at rubyforge.org > Subject: [Wtr-general] counting :name > Date: Fri, 6 May 2005 08:51:37 -0400 > > if I have a group of radio buttons that share the same name, is there > a way to count how many there are? for example > > > > > > > they're all named GB and I want to see how many there are to validate > certain things. > > Thanks > Shao > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > From paul.rogers at shaw.ca Fri May 6 10:29:59 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 08:29:59 -0600 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table In-Reply-To: <001f01c55247$7fe3ac30$afd29044@NewDell> Message-ID: <002001c55248$14f2b320$afd29044@NewDell> Ok, so now Ive read your mail correctly, I get the same failure! Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: 06 May 2005 08:26 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table Which version is this? There was a bug with frames/document method that caused something else to fail, that may have fixed this, as it appears to work for me now ( and Im to lazy to go back a version ;-) ) irb(main):032:0> ie.frame(:index,1).show_links index name id href 1 file:///C:/watir_bonus/unitTests/html/links2.html 2 file:///C:/watir_bonus/unitTests/html/link_pass.html 3 file:///C:/watir_bonus/unitTests/html/pass3.html 4 file:///C:/watir_bonus/unitTests/html/textarea.html 5 file:///C:/watir_bonus/unitTests/html/textarea.html 6 link_id file:///C:/watir_bonus/unitTests/html/links1.HTML 7 link_name file:///C:/watir_bonus/unitTests/html/links1.HTML 8 file:///C:/watir_bonus/unitTests/html/links1.HTML 9 file:///C:/watir_bonus/unitTests/html/pass.html l/images/triangle.jpg => nil ( I cut off the text as it wouldn?t show in the email correctly) Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 08:14 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table Do you think my problem may be that I'm working within a frame? I tried your google test and got the same results as you, but when I tried it within a frame I got irb(main):058:0> ie.frame("mainFrame").links.each do |link| irb(main):059:1* puts link.href if /o/i.match(link.text) irb(main):060:1> end NoMethodError: undefined method `document' for nil:NilClass from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2273:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `links' from (irb):58 from ?:0 Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Fri, 06 May 2005 07:58:33 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <001801c55243$b0cb7f20$afd29044 at NewDell> Content-Type: text/plain; charset=ks_c_5601-1987 That certainly should work Using the 1.3 release, at google I got irb(main):021:0> ie.links.each do |link| irb(main):022:1* puts link.href if /o/i.match(link.text) irb(main):023:1> end http://www.google.ca/grphp?hl=en&tab=wg http://www.google.ca/lochp?hl=en&tab=wl http://127.0.0.1:4664/&s=575547794 http://www.google.ca/options/ http://www.google.ca/language_tools?hl=en http://www.google.ca/ads/ http://www.google.ca/services/ http://www.google.ca/intl/en/about.html http://www.google.com/ncr http://www.google.ca/mgyhp.html It may have been caused by the bug you found yesterday Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 07:52 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Re: How to access a CheckBox inside a Table Is it possible to do the same thing with links? I executed the following to try to display the href of all the "View" links on a page, just to see if it works: ie.links.each do |link| link.href if /View/.match(link.text) end and I got this error: NoMethodError: undefined method `document' for nil:NilClass from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2273:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `links' from (irb):16 from ??:0 Am I doing something wrong? Or is this just something that's not do- able, yet? Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Fri May 6 10:40:02 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 08:40:02 -0600 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table In-Reply-To: <002001c55248$14f2b320$afd29044@NewDell> Message-ID: <002101c55249$7c750060$afd29044@NewDell> Ive found the problem , and its easily fixed. However I think I need to add some unit tests for this. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: 06 May 2005 08:30 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table Ok, so now Ive read your mail correctly, I get the same failure! Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: 06 May 2005 08:26 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table Which version is this? There was a bug with frames/document method that caused something else to fail, that may have fixed this, as it appears to work for me now ( and Im to lazy to go back a version ;-) ) irb(main):032:0> ie.frame(:index,1).show_links index name id href 1 file:///C:/watir_bonus/unitTests/html/links2.html 2 file:///C:/watir_bonus/unitTests/html/link_pass.html 3 file:///C:/watir_bonus/unitTests/html/pass3.html 4 file:///C:/watir_bonus/unitTests/html/textarea.html 5 file:///C:/watir_bonus/unitTests/html/textarea.html 6 link_id file:///C:/watir_bonus/unitTests/html/links1.HTML 7 link_name file:///C:/watir_bonus/unitTests/html/links1.HTML 8 file:///C:/watir_bonus/unitTests/html/links1.HTML 9 file:///C:/watir_bonus/unitTests/html/pass.html l/images/triangle.jpg => nil ( I cut off the text as it wouldn?t show in the email correctly) Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 08:14 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table Do you think my problem may be that I'm working within a frame? I tried your google test and got the same results as you, but when I tried it within a frame I got irb(main):058:0> ie.frame("mainFrame").links.each do |link| irb(main):059:1* puts link.href if /o/i.match(link.text) irb(main):060:1> end NoMethodError: undefined method `document' for nil:NilClass from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2273:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `links' from (irb):58 from ?:0 Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Fri, 06 May 2005 07:58:33 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <001801c55243$b0cb7f20$afd29044 at NewDell> Content-Type: text/plain; charset=ks_c_5601-1987 That certainly should work Using the 1.3 release, at google I got irb(main):021:0> ie.links.each do |link| irb(main):022:1* puts link.href if /o/i.match(link.text) irb(main):023:1> end http://www.google.ca/grphp?hl=en&tab=wg http://www.google.ca/lochp?hl=en&tab=wl http://127.0.0.1:4664/&s=575547794 http://www.google.ca/options/ http://www.google.ca/language_tools?hl=en http://www.google.ca/ads/ http://www.google.ca/services/ http://www.google.ca/intl/en/about.html http://www.google.com/ncr http://www.google.ca/mgyhp.html It may have been caused by the bug you found yesterday Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 07:52 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Re: How to access a CheckBox inside a Table Is it possible to do the same thing with links? I executed the following to try to display the href of all the "View" links on a page, just to see if it works: ie.links.each do |link| link.href if /View/.match(link.text) end and I got this error: NoMethodError: undefined method `document' for nil:NilClass from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2273:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `links' from (irb):16 from ??:0 Am I doing something wrong? Or is this just something that's not do- able, yet? Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Fri May 6 10:42:43 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 08:42:43 -0600 Subject: [Wtr-general] counting :name In-Reply-To: <593b9ae80505060727523afea7@mail.gmail.com> Message-ID: <002201c55249$dc5ade00$afd29044@NewDell> What version is it in? The 1.3 release works ok ( I know Ive said that already this morning, but Im sure this time!) irb(main):054:0> ie.radios.each do |r| irb(main):055:1* puts r.name irb(main):056:1> end box1 box2 box3 box4 box4 box4 box4 box4 box5 box5 => 0 -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 06 May 2005 08:27 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] counting :name Hi Paul when I try that, I get this message: c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1493:in `invoke': Unknown property or method `name' HRESULT error code:0x80020006 Unknown name. any ideas? Thanks Shao On 5/6/05, Paul Rogers wrote: > probably better to use the radios collection > > count=0 > ie.radios.each do |r| > count+=1 if r.name=='GB' > end > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andy Sipe > Sent: 06 May 2005 07:22 > To: wtr-general at rubyforge.org > Subject: RE: [Wtr-general] counting :name > > > > > Would this work for you: > > ie.html.scan(/name='GB'/).length > > ----Original Message Follows---- > From: Shao Kang Tat > Reply-To: wtr-general at rubyforge.org > To: wtr-general at rubyforge.org > Subject: [Wtr-general] counting :name > Date: Fri, 6 May 2005 08:51:37 -0400 > > if I have a group of radio buttons that share the same name, is there > a way to count how many there are? for example > > > > > > > they're all named GB and I want to see how many there are to validate > certain things. > > Thanks > Shao > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Fri May 6 10:53:13 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 08:53:13 -0600 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC85DBDFF@HQ-EXVS02.anteon.com> Message-ID: <002301c5524b$53c7e040$afd29044@NewDell> Fix for this is in cvs. Theres also a unit test and some new html Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 08:14 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table Do you think my problem may be that I'm working within a frame? I tried your google test and got the same results as you, but when I tried it within a frame I got irb(main):058:0> ie.frame("mainFrame").links.each do |link| irb(main):059:1* puts link.href if /o/i.match(link.text) irb(main):060:1> end NoMethodError: undefined method `document' for nil:NilClass from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2273:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `links' from (irb):58 from ?:0 Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Fri, 06 May 2005 07:58:33 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <001801c55243$b0cb7f20$afd29044 at NewDell> Content-Type: text/plain; charset=ks_c_5601-1987 That certainly should work Using the 1.3 release, at google I got irb(main):021:0> ie.links.each do |link| irb(main):022:1* puts link.href if /o/i.match(link.text) irb(main):023:1> end http://www.google.ca/grphp?hl=en&tab=wg http://www.google.ca/lochp?hl=en&tab=wl http://127.0.0.1:4664/&s=575547794 http://www.google.ca/options/ http://www.google.ca/language_tools?hl=en http://www.google.ca/ads/ http://www.google.ca/services/ http://www.google.ca/intl/en/about.html http://www.google.com/ncr http://www.google.ca/mgyhp.html It may have been caused by the bug you found yesterday Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 07:52 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Re: How to access a CheckBox inside a Table Is it possible to do the same thing with links? I executed the following to try to display the href of all the "View" links on a page, just to see if it works: ie.links.each do |link| link.href if /View/.match(link.text) end and I got this error: NoMethodError: undefined method `document' for nil:NilClass from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2273:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `links' from (irb):16 from ??:0 Am I doing something wrong? Or is this just something that's not do- able, yet? Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From DBoyt at anteon.com Fri May 6 11:27:41 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Fri, 6 May 2005 11:27:41 -0400 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC85DBE24@HQ-EXVS02.anteon.com> You're right, show_links works, but I still can't iterate through the links object inside a frame using "each". Executing ie.frame(:index,1).links.each do |link| link.href if /View/.match(link.text) end Still gives me NoMethodError: undefined method `document' for nil:NilClass from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2273:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `links' from (irb):117 from ?:0 By the way, IE::REVISION shows 1.164. I downloaded and installed watir 1.3 this morning. Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Fri, 06 May 2005 08:25:49 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <001f01c55247$7fe3ac30$afd29044 at NewDell> Content-Type: text/plain; charset=utf-8 Which version is this? There was a bug with frames/document method that caused something else to fail, that may have fixed this, as it appears to work for me now ( and Im to lazy to go back a version ;-) ) irb(main):032:0> ie.frame(:index,1).show_links index name id href 1 file:///C:/watir_bonus/unitTests/html/links2.html 2 file:///C:/watir_bonus/unitTests/html/link_pass.html 3 file:///C:/watir_bonus/unitTests/html/pass3.html 4 file:///C:/watir_bonus/unitTests/html/textarea.html 5 file:///C:/watir_bonus/unitTests/html/textarea.html 6 link_id file:///C:/watir_bonus/unitTests/html/links1.HTML 7 link_name file:///C:/watir_bonus/unitTests/html/links1.HTML 8 file:///C:/watir_bonus/unitTests/html/links1.HTML 9 file:///C:/watir_bonus/unitTests/html/pass.html l/images/triangle.jpg => nil ( I cut off the text as it wouldn???t show in the email correctly) Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 08:14 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table Do you think my problem may be that I'm working within a frame? I tried your google test and got the same results as you, but when I tried it within a frame I got irb(main):058:0> ie.frame("mainFrame").links.each do |link| irb(main):059:1* puts link.href if /o/i.match(link.text) irb(main):060:1> end NoMethodError: undefined method `document' for nil:NilClass from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2273:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `links' from (irb):58 from ???:0 Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama -----Original Message----- Date: Fri, 06 May 2005 07:58:33 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Re: How to access a CheckBox inside a Table To: wtr-general at rubyforge.org Message-ID: <001801c55243$b0cb7f20$afd29044 at NewDell> Content-Type: text/plain; charset=ks_c_5601-1987 That certainly should work Using the 1.3 release, at google I got irb(main):021:0> ie.links.each do |link| irb(main):022:1* puts link.href if /o/i.match(link.text) irb(main):023:1> end http://www.google.ca/grphp?hl=en&tab=wg http://www.google.ca/lochp?hl=en&tab=wl http://127.0.0.1:4664/&s=575547794 http://www.google.ca/options/ http://www.google.ca/language_tools?hl=en http://www.google.ca/ads/ http://www.google.ca/services/ http://www.google.ca/intl/en/about.html http://www.google.com/ncr http://www.google.ca/mgyhp.html It may have been caused by the bug you found yesterday Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 07:52 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Re: How to access a CheckBox inside a Table Is it possible to do the same thing with links? I executed the following to try to display the href of all the "View" links on a page, just to see if it works: ie.links.each do |link| link.href if /View/.match(link.text) end and I got this error: NoMethodError: undefined method `document' for nil:NilClass from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2273:in `initialize' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `new' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:550:in `links' from (irb):16 from ????:0 Am I doing something wrong? Or is this just something that's not do- able, yet? Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama From DBoyt at anteon.com Fri May 6 12:01:41 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Fri, 6 May 2005 12:01:41 -0400 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC85DBE44@HQ-EXVS02.anteon.com> I've got a work-around using a variable to access the contents of the frame: mainFrame = ie.frame("mainFrame") mainFrame.links.each do |link| puts link.href if /View/.match(link.text) end But I'm still bothered about not being able to access the links collection inside a frame directly. From a Ruby point of view, is one way better than the other -- i.e., assigning the frame to a variable to access its contents versus accessing the frame's contents directly? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama From paul.rogers at shaw.ca Fri May 6 12:13:56 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 10:13:56 -0600 Subject: [Wtr-general] Re: How to access a CheckBox inside a Table In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC85DBE44@HQ-EXVS02.anteon.com> Message-ID: <002901c55256$9a67dbd0$afd29044@NewDell> Looks like something went wrong on the mail server. There is a fix in cvs now, with a unit test and some html Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 06 May 2005 10:02 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Re: How to access a CheckBox inside a Table I've got a work-around using a variable to access the contents of the frame: mainFrame = ie.frame("mainFrame") mainFrame.links.each do |link| puts link.href if /View/.match(link.text) end But I'm still bothered about not being able to access the links collection inside a frame directly. From a Ruby point of view, is one way better than the other -- i.e., assigning the frame to a variable to access its contents versus accessing the frame's contents directly? Thanks, Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From shaorobics at gmail.com Fri May 6 12:20:28 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Fri, 6 May 2005 12:20:28 -0400 Subject: [Wtr-general] counting :name In-Reply-To: <002201c55249$dc5ade00$afd29044@NewDell> References: <593b9ae80505060727523afea7@mail.gmail.com> <002201c55249$dc5ade00$afd29044@NewDell> Message-ID: <593b9ae805050609203b66d786@mail.gmail.com> well I just installed version 1.3 on top of the older version I have. I tried it again...same error. I installed 1.3 in the default directories and then ran install.rb in the CVS folder... WIN32OLERuntimeError: Unknown property or method `name' HRESULT error code:0x80020006 Unknown name. from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1966:in `invoke' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1966:in `name' from (irb):10 from (irb):9:in `each' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2155:in `upto' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2155:in `each' from (irb):9 On 5/6/05, Paul Rogers wrote: > What version is it in? The 1.3 release works ok ( I know Ive said that > already this morning, but Im sure this time!) > > irb(main):054:0> ie.radios.each do |r| > irb(main):055:1* puts r.name > irb(main):056:1> end > box1 > > box2 > box3 > box4 > box4 > box4 > box4 > box4 > box5 > box5 > => 0 > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 06 May 2005 08:27 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] counting :name > > Hi Paul > > when I try that, I get this message: > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1493:in `invoke': Unknown > property or method `name' HRESULT error code:0x80020006 Unknown name. > > any ideas? > Thanks > > Shao > > On 5/6/05, Paul Rogers wrote: > > probably better to use the radios collection > > > > count=0 > > ie.radios.each do |r| > > count+=1 if r.name=='GB' > > end > > > > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andy Sipe > > Sent: 06 May 2005 07:22 > > To: wtr-general at rubyforge.org > > Subject: RE: [Wtr-general] counting :name > > > > > > > > > > Would this work for you: > > > > ie.html.scan(/name='GB'/).length > > > > ----Original Message Follows---- > > From: Shao Kang Tat > > Reply-To: wtr-general at rubyforge.org > > To: wtr-general at rubyforge.org > > Subject: [Wtr-general] counting :name > > Date: Fri, 6 May 2005 08:51:37 -0400 > > > > if I have a group of radio buttons that share the same name, is there > > a way to count how many there are? for example > > > > > > > > > > > > > > they're all named GB and I want to see how many there are to validate > > certain things. > > > > Thanks > > Shao > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Fri May 6 12:28:36 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 10:28:36 -0600 Subject: [Wtr-general] counting :name In-Reply-To: <593b9ae805050609203b66d786@mail.gmail.com> Message-ID: <002a01c55258$a7810f60$afd29044@NewDell> I tried this using the html you sent earlier, and it works ok. Can you post the html and ruby/watir again? Thanks Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 06 May 2005 10:20 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] counting :name well I just installed version 1.3 on top of the older version I have. I tried it again...same error. I installed 1.3 in the default directories and then ran install.rb in the CVS folder... WIN32OLERuntimeError: Unknown property or method `name' HRESULT error code:0x80020006 Unknown name. from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1966:in `invoke' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1966:in `name' from (irb):10 from (irb):9:in `each' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2155:in `upto' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2155:in `each' from (irb):9 On 5/6/05, Paul Rogers wrote: > What version is it in? The 1.3 release works ok ( I know Ive said that > already this morning, but Im sure this time!) > > irb(main):054:0> ie.radios.each do |r| > irb(main):055:1* puts r.name > irb(main):056:1> end > box1 > > box2 > box3 > box4 > box4 > box4 > box4 > box4 > box5 > box5 > => 0 > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 06 May 2005 08:27 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] counting :name > > Hi Paul > > when I try that, I get this message: > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1493:in `invoke': Unknown > property or method `name' HRESULT error code:0x80020006 Unknown name. > > any ideas? > Thanks > > Shao > > On 5/6/05, Paul Rogers wrote: > > probably better to use the radios collection > > > > count=0 > > ie.radios.each do |r| > > count+=1 if r.name=='GB' > > end > > > > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andy Sipe > > Sent: 06 May 2005 07:22 > > To: wtr-general at rubyforge.org > > Subject: RE: [Wtr-general] counting :name > > > > > > > > > > Would this work for you: > > > > ie.html.scan(/name='GB'/).length > > > > ----Original Message Follows---- > > From: Shao Kang Tat > > Reply-To: wtr-general at rubyforge.org > > To: wtr-general at rubyforge.org > > Subject: [Wtr-general] counting :name > > Date: Fri, 6 May 2005 08:51:37 -0400 > > > > if I have a group of radio buttons that share the same name, is > > there a way to count how many there are? for example > > > > > > > > > > > > > > they're all named GB and I want to see how many there are to > > validate certain things. > > > > Thanks > > Shao > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From shaorobics at gmail.com Fri May 6 12:34:11 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Fri, 6 May 2005 12:34:11 -0400 Subject: [Wtr-general] counting :name In-Reply-To: <002a01c55258$a7810f60$afd29044@NewDell> References: <593b9ae805050609203b66d786@mail.gmail.com> <002a01c55258$a7810f60$afd29044@NewDell> Message-ID: <593b9ae8050506093441a45f5d@mail.gmail.com> Hi Paul I can't post the HTML exactly cuz the page I'm testing requires an admin login. Maybe the new version didn't install properly? how do I use IRB to check which version I'm currently running again? Thanks On 5/6/05, Paul Rogers wrote: > I tried this using the html you sent earlier, and it works ok. > Can you post the html and ruby/watir again? > > Thanks > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 06 May 2005 10:20 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] counting :name > > well I just installed version 1.3 on top of the older version I have. I > tried it again...same error. I installed 1.3 in the default directories > and then ran install.rb in the CVS folder... > > WIN32OLERuntimeError: Unknown property or method `name' > HRESULT error code:0x80020006 > Unknown name. > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1966:in `invoke' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1966:in `name' > from (irb):10 > from (irb):9:in `each' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2155:in `upto' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2155:in `each' > from (irb):9 > > On 5/6/05, Paul Rogers wrote: > > What version is it in? The 1.3 release works ok ( I know Ive said that > > > already this morning, but Im sure this time!) > > > > irb(main):054:0> ie.radios.each do |r| > > irb(main):055:1* puts r.name > > irb(main):056:1> end > > box1 > > > > box2 > > box3 > > box4 > > box4 > > box4 > > box4 > > box4 > > box5 > > box5 > > => 0 > > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > > Sent: 06 May 2005 08:27 > > To: wtr-general at rubyforge.org > > Subject: Re: [Wtr-general] counting :name > > > > Hi Paul > > > > when I try that, I get this message: > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1493:in `invoke': Unknown > > property or method `name' HRESULT error code:0x80020006 Unknown name. > > > > any ideas? > > Thanks > > > > Shao > > > > On 5/6/05, Paul Rogers wrote: > > > probably better to use the radios collection > > > > > > count=0 > > > ie.radios.each do |r| > > > count+=1 if r.name=='GB' > > > end > > > > > > > > > -----Original Message----- > > > From: wtr-general-bounces at rubyforge.org > > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andy Sipe > > > Sent: 06 May 2005 07:22 > > > To: wtr-general at rubyforge.org > > > Subject: RE: [Wtr-general] counting :name > > > > > > > > > > > > > > > Would this work for you: > > > > > > ie.html.scan(/name='GB'/).length > > > > > > ----Original Message Follows---- > > > From: Shao Kang Tat > > > Reply-To: wtr-general at rubyforge.org > > > To: wtr-general at rubyforge.org > > > Subject: [Wtr-general] counting :name > > > Date: Fri, 6 May 2005 08:51:37 -0400 > > > > > > if I have a group of radio buttons that share the same name, is > > > there a way to count how many there are? for example > > > > > > > > > > > > > > > > > > > > > they're all named GB and I want to see how many there are to > > > validate certain things. > > > > > > Thanks > > > Shao > > > > > > _______________________________________________ > > > Wtr-general mailing list > > > Wtr-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > _______________________________________________ > > > Wtr-general mailing list > > > Wtr-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From shaorobics at gmail.com Fri May 6 12:59:25 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Fri, 6 May 2005 12:59:25 -0400 Subject: [Wtr-general] counting :name In-Reply-To: <002a01c55258$a7810f60$afd29044@NewDell> References: <593b9ae805050609203b66d786@mail.gmail.com> <002a01c55258$a7810f60$afd29044@NewDell> Message-ID: <593b9ae805050609597789fbfa@mail.gmail.com> the funni thing is when I try the r.name thing in the hotmail page which doesn't have any radio buttons I get => 0 but on the page I want to test which has the HTML: and I type in the exact thing I get the error I mentioned b4... On 5/6/05, Paul Rogers wrote: > I tried this using the html you sent earlier, and it works ok. > Can you post the html and ruby/watir again? > > Thanks > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 06 May 2005 10:20 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] counting :name > > well I just installed version 1.3 on top of the older version I have. I > tried it again...same error. I installed 1.3 in the default directories > and then ran install.rb in the CVS folder... > > WIN32OLERuntimeError: Unknown property or method `name' > HRESULT error code:0x80020006 > Unknown name. > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1966:in `invoke' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1966:in `name' > from (irb):10 > from (irb):9:in `each' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2155:in `upto' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2155:in `each' > from (irb):9 > > On 5/6/05, Paul Rogers wrote: > > What version is it in? The 1.3 release works ok ( I know Ive said that > > > already this morning, but Im sure this time!) > > > > irb(main):054:0> ie.radios.each do |r| > > irb(main):055:1* puts r.name > > irb(main):056:1> end > > box1 > > > > box2 > > box3 > > box4 > > box4 > > box4 > > box4 > > box4 > > box5 > > box5 > > => 0 > > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > > Sent: 06 May 2005 08:27 > > To: wtr-general at rubyforge.org > > Subject: Re: [Wtr-general] counting :name > > > > Hi Paul > > > > when I try that, I get this message: > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1493:in `invoke': Unknown > > property or method `name' HRESULT error code:0x80020006 Unknown name. > > > > any ideas? > > Thanks > > > > Shao > > > > On 5/6/05, Paul Rogers wrote: > > > probably better to use the radios collection > > > > > > count=0 > > > ie.radios.each do |r| > > > count+=1 if r.name=='GB' > > > end > > > > > > > > > -----Original Message----- > > > From: wtr-general-bounces at rubyforge.org > > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andy Sipe > > > Sent: 06 May 2005 07:22 > > > To: wtr-general at rubyforge.org > > > Subject: RE: [Wtr-general] counting :name > > > > > > > > > > > > > > > Would this work for you: > > > > > > ie.html.scan(/name='GB'/).length > > > > > > ----Original Message Follows---- > > > From: Shao Kang Tat > > > Reply-To: wtr-general at rubyforge.org > > > To: wtr-general at rubyforge.org > > > Subject: [Wtr-general] counting :name > > > Date: Fri, 6 May 2005 08:51:37 -0400 > > > > > > if I have a group of radio buttons that share the same name, is > > > there a way to count how many there are? for example > > > > > > > > > > > > > > > > > > > > > they're all named GB and I want to see how many there are to > > > validate certain things. > > > > > > Thanks > > > Shao > > > > > > _______________________________________________ > > > Wtr-general mailing list > > > Wtr-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > _______________________________________________ > > > Wtr-general mailing list > > > Wtr-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From sgtn2000 at gmail.com Fri May 6 13:08:16 2005 From: sgtn2000 at gmail.com (Sean Gallagher) Date: Fri, 6 May 2005 10:08:16 -0700 Subject: [Wtr-general] runtime error in wait Message-ID: <7f8ae47d050506100871667651@mail.gmail.com> Hi- I am getting a runtime error similar to one that I reported on Wed Mar 23, although the message is slightly different. I am using the latest code from CVS on Win2k. irb(main):001:0> require 'watir' => true irb(main):002:0> $ie = Watir::IE.new => #], @typingspeed=0.08, @activeObj ectHighLightColor="yellow", @logger=#, @shift_size=nil>> , @enable_spinner=false, @url_list=[], @form=nil, @ie=#> irb(main):003:0> $ie.goto("http://losangeles.citysearch.com") W, [06-May-2005 09:31:06#1912] 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:1438:in `method_missing' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1438:in `waitForIE' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1437:in `upto' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1437:in `waitForIE' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1300:in `goto' (irb):3:in `irb_binding' c:/ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' :0 W, [06-May-2005 09:31:06#1912] WARN -- : runtime error in wait => 1.532 irb(main):004:0> Can this error be ignored? Any recommendations? Thanks. -sean From paul.rogers at shaw.ca Fri May 6 13:36:47 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 11:36:47 -0600 Subject: [Wtr-general] runtime error in wait In-Reply-To: <7f8ae47d050506100871667651@mail.gmail.com> Message-ID: <003901c55262$2dab4980$afd29044@NewDell> The page you are going to ( http://losangeles.citysearch.com/ ) has several iframes. Im guessing these are for advertrs and so are probably served from a different domain, and so you are getting access denied errors ( when we try to see if they are loaded ) If everything seems to be working, I wouldn't worry about it irb(main):014:0> ie.show_frames there are 5 frames frame index: 0 --Access Denied-- frame index: 1 name: frame index: 2 --Access Denied-- frame index: 3 --Access Denied-- frame index: 4 --Access Denied-- Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Sean Gallagher Sent: 06 May 2005 11:08 To: wtr-general at rubyforge.org Subject: [Wtr-general] runtime error in wait Hi- I am getting a runtime error similar to one that I reported on Wed Mar 23, although the message is slightly different. I am using the latest code from CVS on Win2k. irb(main):001:0> require 'watir' => true irb(main):002:0> $ie = Watir::IE.new => #], @typingspeed=0.08, @activeObj ectHighLightColor="yellow", @logger=#, @shift_size=nil>> , @enable_spinner=false, @url_list=[], @form=nil, @ie=#> irb(main):003:0> $ie.goto("http://losangeles.citysearch.com") W, [06-May-2005 09:31:06#1912] 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:1438:in `method_missing' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1438:in `waitForIE' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1437:in `upto' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1437:in `waitForIE' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1300:in `goto' (irb):3:in `irb_binding' c:/ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' :0 W, [06-May-2005 09:31:06#1912] WARN -- : runtime error in wait => 1.532 irb(main):004:0> Can this error be ignored? Any recommendations? Thanks. -sean _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Fri May 6 13:44:16 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 11:44:16 -0600 Subject: [Wtr-general] counting :name In-Reply-To: <593b9ae805050609597789fbfa@mail.gmail.com> Message-ID: <003a01c55263$39251a60$afd29044@NewDell> I still cant reproduce this! Try this html, and see what happens for you. Paul I get irb(main):018:0> ie.radios.each do |r| irb(main):019:1* puts r.name irb(main):020:1> end GB GB GB GB GB => 0 irb(main):021:0> ie.show_all_objects -----------Objects in page ------------- radio name=GB id=GB_2004 value=2004 alt= src= radio name=GB id=GB_2004 value=on alt= src= radio name=GB id=GB_2005 value=on alt= src= radio name=GB id=GB_2006 value=on alt= src= radio name=GB id=GB_2007 value=on alt= src= irb(main):022:0> count = 0 => 0 irb(main):023:0> ie.radios.each do |r| irb(main):024:1* count+=1 if r.name=='GB' irb(main):025:1> end => 0 irb(main):026:0> puts count 5 => nil irb(main):027:0> -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 06 May 2005 10:59 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] counting :name the funni thing is when I try the r.name thing in the hotmail page which doesn't have any radio buttons I get => 0 but on the page I want to test which has the HTML: and I type in the exact thing I get the error I mentioned b4... On 5/6/05, Paul Rogers wrote: > I tried this using the html you sent earlier, and it works ok. Can you > post the html and ruby/watir again? > > Thanks > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 06 May 2005 10:20 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] counting :name > > well I just installed version 1.3 on top of the older version I have. > I tried it again...same error. I installed 1.3 in the default > directories and then ran install.rb in the CVS folder... > > WIN32OLERuntimeError: Unknown property or method `name' > HRESULT error code:0x80020006 > Unknown name. > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1966:in `invoke' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1966:in `name' > from (irb):10 > from (irb):9:in `each' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2155:in `upto' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2155:in `each' > from (irb):9 > > On 5/6/05, Paul Rogers wrote: > > What version is it in? The 1.3 release works ok ( I know Ive said > > that > > > already this morning, but Im sure this time!) > > > > irb(main):054:0> ie.radios.each do |r| > > irb(main):055:1* puts r.name > > irb(main):056:1> end > > box1 > > > > box2 > > box3 > > box4 > > box4 > > box4 > > box4 > > box4 > > box5 > > box5 > > => 0 > > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang > > Tat > > Sent: 06 May 2005 08:27 > > To: wtr-general at rubyforge.org > > Subject: Re: [Wtr-general] counting :name > > > > Hi Paul > > > > when I try that, I get this message: > > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1493:in `invoke': Unknown > > property or method `name' HRESULT error code:0x80020006 Unknown > > name. > > > > any ideas? > > Thanks > > > > Shao > > > > On 5/6/05, Paul Rogers wrote: > > > probably better to use the radios collection > > > > > > count=0 > > > ie.radios.each do |r| > > > count+=1 if r.name=='GB' > > > end > > > > > > > > > -----Original Message----- > > > From: wtr-general-bounces at rubyforge.org > > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Andy Sipe > > > Sent: 06 May 2005 07:22 > > > To: wtr-general at rubyforge.org > > > Subject: RE: [Wtr-general] counting :name > > > > > > > > > > > > > > > Would this work for you: > > > > > > ie.html.scan(/name='GB'/).length > > > > > > ----Original Message Follows---- > > > From: Shao Kang Tat > > > Reply-To: wtr-general at rubyforge.org > > > To: wtr-general at rubyforge.org > > > Subject: [Wtr-general] counting :name > > > Date: Fri, 6 May 2005 08:51:37 -0400 > > > > > > if I have a group of radio buttons that share the same name, is > > > there a way to count how many there are? for example > > > > > > > > > > > > > > > > > > > > > they're all named GB and I want to see how many there are to > > > validate certain things. > > > > > > Thanks > > > Shao > > > > > > _______________________________________________ > > > Wtr-general mailing list > > > Wtr-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > _______________________________________________ > > > Wtr-general mailing list > > > Wtr-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From shaorobics at gmail.com Fri May 6 13:49:10 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Fri, 6 May 2005 13:49:10 -0400 Subject: [Wtr-general] counting :name In-Reply-To: <003a01c55263$39251a60$afd29044@NewDell> References: <593b9ae805050609597789fbfa@mail.gmail.com> <003a01c55263$39251a60$afd29044@NewDell> Message-ID: <593b9ae805050610492564610e@mail.gmail.com> Hi, when I put it in plain HTML it is fine. The page in question has radio and text fields. The VERY odd thing is that when I do a ie.text_fields.each do |r| puts r.name end I get all the names no problems. when I do it for radios it dies. Here is the EXACT HTML which includes both the radios and the text fields (well a snippet of it anyway). 2004 (100) From paul.rogers at shaw.ca Fri May 6 14:16:41 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 12:16:41 -0600 Subject: [Wtr-general] counting :name In-Reply-To: <593b9ae805050610492564610e@mail.gmail.com> Message-ID: <004201c55267$c0e242d0$afd29044@NewDell> Still works for me! Heres the html 2004 (100) Heres the irb irb(main):004:0> ie.show_all_objects -----------Objects in page ------------- hidden name=SomePeriodsClosed_2004 id= value=true alt= src= radio name=GB id=GB_2004 value=2004 alt= src= text name=AnnualBudget_2004 id=AnnualBudget_2004 value=200 alt= src= text name=ContingencyAmount_2004 id=ContingencyAmount_2004 value=300 alt= src= => nil irb(main):005:0> ie.radios.each do |r| irb(main):006:1* puts r.name irb(main):007:1> end GB => 0 -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 06 May 2005 11:49 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] counting :name Hi, when I put it in plain HTML it is fine. The page in question has radio and text fields. The VERY odd thing is that when I do a ie.text_fields.each do |r| puts r.name end I get all the names no problems. when I do it for radios it dies. Here is the EXACT HTML which includes both the radios and the text fields (well a snippet of it anyway). 2004 (100) _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Fri May 6 14:25:53 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 06 May 2005 13:25:53 -0500 Subject: [Wtr-general] Development for automation In-Reply-To: <20050506140341.53010.qmail@web30502.mail.mud.yahoo.com> Message-ID: <5.1.0.14.2.20050506132536.03a2fa28@127.0.0.1> At 09:03 AM 5/6/2005, Richard Allen wrote: >Unique control names unique id's to be specific. _____________________ Bret Pettichord www.pettichord.com From iain.rose at responsetek.com Fri May 6 17:53:53 2005 From: iain.rose at responsetek.com (Iain) Date: Fri, 6 May 2005 14:53:53 -0700 Subject: [Wtr-general] Problem with WindowLogonExample.rb In-Reply-To: <200505061654.j46GsjdT008294@rubyforge.org> Message-ID: Hi Guys, Firstly, let me say thanks for the tool and the new release. I've been eagerly waiting for the new functionality and can't wait to get started with it. I've never programmed before but in the last month, through using your tool, I've learnt the basics of Ruby and am amazed by the results I've been getting. Up until now there's only been a few things I've wanted to do with Watir but haven't yet been able to. 1. Enter the network login information when accessing my test site. 2. Accepting Security Certificate warnings in Security Alert popups. I understand that both these issues have been addressed by the new build. I'm trying to figure out how to do this so have gone to the Watir API and the sample unit tests to try and find some similar code but I'm having some problems getting them to work. 1.) Unfortunately the WindowLogonExample.rb unit test isn't working for me. The clio.lyris.com login prompt appears but nothing else happens. Is anyone else having this problem? 2.) I couldn't find any working examples for Security Alerts but in the API I can see the clearSecurityAlertBox method in the WinClicker class. I've tried to following $ie = IE.new $ie.goto($Z_Login) w = WinClicker.new w.clearSecurityAlertBox() The security alert appears immediately after I navigate to Login URL of my test site but like before nothing happens. If I abort the test I get the following output: getWindowHandle - looking for: Security Alert Found window: CiceroUIWndFrame Caption =TF_FloatingLangBar_WndTitle Found window: CiceroUIWndFrame Caption =CiceroUIWndFrame Found window: tooltips_class32 Caption = Found window: WorkerW Caption = Found window: tooltips_class32 Caption = Found window: tooltips_class32 Caption = Found window: Shell_TrayWnd Caption = Found window: Auto-Suggest Dropdown Caption = Found window: Caption = Found window: tooltips_class32 Caption = Found window: UltraMon Taskbar Caption = Found window: tooltips_class32 Caption = Found window: OfficeTooltip Caption =Align Left Found window: tooltips_class32 Caption = Found window: Auto-Suggest Dropdown Caption = Found window: Auto-Suggest Dropdown Caption = Found window: tooltips_class32 Caption = Found window: Auto-Suggest Dropdown Caption = Found window: SysFader Caption =SysFader Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: Trillian: List Tooltip Entry Caption =Trillian: List Tooltip Entry Found window: BaseBar Caption = Found window: tooltips_class32 Caption = Found window: BaseBar Caption = >Exit code: -1073741510 >ruby login.rb >Exit code: -1073741510 Can anyone help? Many thanks Iain From bret at pettichord.com Fri May 6 18:13:26 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 06 May 2005 17:13:26 -0500 Subject: [Wtr-general] counting :name In-Reply-To: <004201c55267$c0e242d0$afd29044@NewDell> References: <593b9ae805050610492564610e@mail.gmail.com> Message-ID: <5.1.0.14.2.20050506164729.03657610@127.0.0.1> Shao, Try this: ie.radios.find_all {|r| begin; r.name == 'GB'; end}.length Whenever you want to count elements in a collection, you can use find_all{}.length instead of initializing and incrementing a counting variable. The begin/end block here skips OLE errors like the ones you reported. That part is a workaround for the problem you reported. I think you've found a bug in Watir, and if you can send us an html page that demonstrates the error, that would be a big help to us in fixing the problem. I see that sometimes our calls to Object#name are wrapped in begin/end blocks and sometimes they aren't. We really should be using object wrappers consistently, and if we need guards, they would be in only one place, and apply all the time. >I can't post the HTML exactly cuz the page I'm testing requires an admin >login. All you have to do is do a save-as of the page and save off the html to a file. Then you can write a demo script that loads this file and then runs your code. If it still fails, you can send it to us, and rest assured that we'll be able to reproduce the problem. Bret _____________________ Bret Pettichord www.pettichord.com From christopher.mcmahon at gmail.com Fri May 6 18:42:00 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 6 May 2005 16:42:00 -0600 Subject: [Wtr-general] unittest bug: setFileDialog.rb location Message-ID: <72799cd705050615427609dce7@mail.gmail.com> Hi... Silly nit to pick. If you install watir anywhere other than C:/, all_tests fails with what seems to be a hardcoded call to C:/watir/watir/setFileDialog. I installed WATIR in a directory C:/watir, so all_tests should look for setFileDialog one level deeper, at C:/watir/watir/watir/setFileDialog. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050506/7bf645e6/attachment.html From shaorobics at gmail.com Fri May 6 18:43:38 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Fri, 6 May 2005 18:43:38 -0400 Subject: [Wtr-general] counting :name In-Reply-To: <5.1.0.14.2.20050506164729.03657610@127.0.0.1> References: <593b9ae805050610492564610e@mail.gmail.com> <004201c55267$c0e242d0$afd29044@NewDell> <5.1.0.14.2.20050506164729.03657610@127.0.0.1> Message-ID: <593b9ae805050615434e24a4f9@mail.gmail.com> Hi Bret Thanks for the tip on that. I will try it on Monday when I get to work. I will do as you suggested (saving the html) on Monday as well since I don't have access to the development site from home. But I'm looking forward to trying it! :) Shao On 5/6/05, Bret Pettichord wrote: > Shao, > > Try this: > > ie.radios.find_all {|r| begin; r.name == 'GB'; end}.length > > Whenever you want to count elements in a collection, you can use > find_all{}.length instead of initializing and incrementing a counting > variable. > > The begin/end block here skips OLE errors like the ones you reported. That > part is a workaround for the problem you reported. > > I think you've found a bug in Watir, and if you can send us an html page > that demonstrates the error, that would be a big help to us in fixing the > problem. > > I see that sometimes our calls to Object#name are wrapped in begin/end > blocks and sometimes they aren't. We really should be using object wrappers > consistently, and if we need guards, they would be in only one place, and > apply all the time. > > >I can't post the HTML exactly cuz the page I'm testing requires an admin > >login. > > All you have to do is do a save-as of the page and save off the html to a > file. Then you can write a demo script that loads this file and then runs > your code. If it still fails, you can send it to us, and rest assured that > we'll be able to reproduce the problem. > > Bret > > > _____________________ > Bret Pettichord > www.pettichord.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Fri May 6 19:20:39 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 06 May 2005 17:20:39 -0600 Subject: [Wtr-general] Problem with WindowLogonExample.rb In-Reply-To: Message-ID: <008401c55292$374a5b90$afd29044@NewDell> Unfortunately, the new release doesn't help with either of these problems.... Please don't use the Winclicker code. We're trying to get rid of it. We now install part of AutoIt which lets us get at these dialogs easier. I have access to a server that has both the security alert and network stuff, so I will try and add these into watir over the weekend. I have some stuff to do for the star east class before that, so I may not get onto it Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Iain Sent: 06 May 2005 15:54 To: wtr-general at rubyforge.org Subject: [Wtr-general] Problem with WindowLogonExample.rb Hi Guys, Firstly, let me say thanks for the tool and the new release. I've been eagerly waiting for the new functionality and can't wait to get started with it. I've never programmed before but in the last month, through using your tool, I've learnt the basics of Ruby and am amazed by the results I've been getting. Up until now there's only been a few things I've wanted to do with Watir but haven't yet been able to. 1. Enter the network login information when accessing my test site. 2. Accepting Security Certificate warnings in Security Alert popups. I understand that both these issues have been addressed by the new build. I'm trying to figure out how to do this so have gone to the Watir API and the sample unit tests to try and find some similar code but I'm having some problems getting them to work. 1.) Unfortunately the WindowLogonExample.rb unit test isn't working for me. The clio.lyris.com login prompt appears but nothing else happens. Is anyone else having this problem? 2.) I couldn't find any working examples for Security Alerts but in the API I can see the clearSecurityAlertBox method in the WinClicker class. I've tried to following $ie = IE.new $ie.goto($Z_Login) w = WinClicker.new w.clearSecurityAlertBox() The security alert appears immediately after I navigate to Login URL of my test site but like before nothing happens. If I abort the test I get the following output: getWindowHandle - looking for: Security Alert Found window: CiceroUIWndFrame Caption =TF_FloatingLangBar_WndTitle Found window: CiceroUIWndFrame Caption =CiceroUIWndFrame Found window: tooltips_class32 Caption = Found window: WorkerW Caption = Found window: tooltips_class32 Caption = Found window: tooltips_class32 Caption = Found window: Shell_TrayWnd Caption = Found window: Auto-Suggest Dropdown Caption = Found window: Caption = Found window: tooltips_class32 Caption = Found window: UltraMon Taskbar Caption = Found window: tooltips_class32 Caption = Found window: OfficeTooltip Caption =Align Left Found window: tooltips_class32 Caption = Found window: Auto-Suggest Dropdown Caption = Found window: Auto-Suggest Dropdown Caption = Found window: tooltips_class32 Caption = Found window: Auto-Suggest Dropdown Caption = Found window: SysFader Caption =SysFader Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: Trillian: List Tooltip Entry Caption =Trillian: List Tooltip Entry Found window: BaseBar Caption = Found window: tooltips_class32 Caption = Found window: BaseBar Caption = >Exit code: -1073741510 >ruby login.rb >Exit code: -1073741510 Can anyone help? Many thanks Iain _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From lsusilo at rsasecurity.com Fri May 6 19:29:36 2005 From: lsusilo at rsasecurity.com (Susilo, Laudhi) Date: Fri, 6 May 2005 16:29:36 -0700 Subject: [Wtr-general] Watir RubyGem Message-ID: <2548B245CD5B9D45AC32CF3889D2E6D0021460CB@rsana-ex-va1.NA.RSA.NET> I was wondering if there is a plan to bundle Watir with RubyGem. - Laudhi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050506/8031df36/attachment.html From paul.rogers at shaw.ca Sat May 7 20:15:09 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sat, 07 May 2005 18:15:09 -0600 Subject: [Wtr-general] Problem with WindowLogonExample.rb In-Reply-To: Message-ID: <003c01c55362$feb5b9b0$72d39044@NewDell> Iain, Here is a zip that contains some ruby files that will clear the security alert for you. You'll also need to get the latest code from cvs, especially the WindowHelper.rb file In future versions of watir we hope to have this code a bit clearer and easier to use Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Iain Sent: 06 May 2005 15:54 To: wtr-general at rubyforge.org Subject: [Wtr-general] Problem with WindowLogonExample.rb Hi Guys, Firstly, let me say thanks for the tool and the new release. I've been eagerly waiting for the new functionality and can't wait to get started with it. I've never programmed before but in the last month, through using your tool, I've learnt the basics of Ruby and am amazed by the results I've been getting. Up until now there's only been a few things I've wanted to do with Watir but haven't yet been able to. 1. Enter the network login information when accessing my test site. 2. Accepting Security Certificate warnings in Security Alert popups. I understand that both these issues have been addressed by the new build. I'm trying to figure out how to do this so have gone to the Watir API and the sample unit tests to try and find some similar code but I'm having some problems getting them to work. 1.) Unfortunately the WindowLogonExample.rb unit test isn't working for me. The clio.lyris.com login prompt appears but nothing else happens. Is anyone else having this problem? 2.) I couldn't find any working examples for Security Alerts but in the API I can see the clearSecurityAlertBox method in the WinClicker class. I've tried to following $ie = IE.new $ie.goto($Z_Login) w = WinClicker.new w.clearSecurityAlertBox() The security alert appears immediately after I navigate to Login URL of my test site but like before nothing happens. If I abort the test I get the following output: getWindowHandle - looking for: Security Alert Found window: CiceroUIWndFrame Caption =TF_FloatingLangBar_WndTitle Found window: CiceroUIWndFrame Caption =CiceroUIWndFrame Found window: tooltips_class32 Caption = Found window: WorkerW Caption = Found window: tooltips_class32 Caption = Found window: tooltips_class32 Caption = Found window: Shell_TrayWnd Caption = Found window: Auto-Suggest Dropdown Caption = Found window: Caption = Found window: tooltips_class32 Caption = Found window: UltraMon Taskbar Caption = Found window: tooltips_class32 Caption = Found window: OfficeTooltip Caption =Align Left Found window: tooltips_class32 Caption = Found window: Auto-Suggest Dropdown Caption = Found window: Auto-Suggest Dropdown Caption = Found window: tooltips_class32 Caption = Found window: Auto-Suggest Dropdown Caption = Found window: SysFader Caption =SysFader Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: Trillian: List Tooltip Entry Caption =Trillian: List Tooltip Entry Found window: BaseBar Caption = Found window: tooltips_class32 Caption = Found window: BaseBar Caption = >Exit code: -1073741510 >ruby login.rb >Exit code: -1073741510 Can anyone help? Many thanks Iain _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- A non-text attachment was scrubbed... Name: security_alert.zip Type: application/x-zip-compressed Size: 536 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050507/28ace4d0/attachment.bin From bret at pettichord.com Sun May 8 13:49:41 2005 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 08 May 2005 12:49:41 -0500 Subject: [Wtr-general] Watir RubyGem In-Reply-To: <2548B245CD5B9D45AC32CF3889D2E6D0021460CB@rsana-ex-va1.NA.R SA.NET> Message-ID: <5.1.0.14.2.20050508124906.01b2edd8@127.0.0.1> At 06:29 PM 5/6/2005, Susilo, Laudhi wrote: >I was wondering if there is a plan to bundle Watir with RubyGem. This would be great but no one has yet signed up to do it. Any volunteers? _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Sun May 8 13:55:45 2005 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 08 May 2005 12:55:45 -0500 Subject: [Wtr-general] unittest bug: setFileDialog.rb location In-Reply-To: <72799cd705050615427609dce7@mail.gmail.com> Message-ID: <5.1.0.14.2.20050508125331.03aa68e8@127.0.0.1> Actually the testsuite is using a relative path for this: @path_to_clicker = File.expand_path(File.dirname(__FILE__)) I don't quite understand why you have so many nested 'watir' directories. Can you post the complete error message that you are getting? At 05:42 PM 5/6/2005, Chris McMahon wrote: >Hi... > Silly nit to pick. If you install watir anywhere other than C:/, > all_tests fails with what seems to be a hardcoded call to > C:/watir/watir/setFileDialog. > >I installed WATIR in a directory C:/watir, so all_tests should look for >setFileDialog one level deeper, at C:/watir/watir/watir/setFileDialog. > >-Chris >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From iain.rose at responsetek.com Sun May 8 19:22:31 2005 From: iain.rose at responsetek.com (Iain) Date: Sun, 8 May 2005 16:22:31 -0700 Subject: [Wtr-general] Problem with WindowLogonExample.rb In-Reply-To: <003c01c55362$feb5b9b0$72d39044@NewDell> Message-ID: Thanks Paul, I really appreciate the help. I'll let you know how I get on. Iain -----Original Message----- From: Paul Rogers [mailto:paul.rogers at shaw.ca] Sent: Saturday, May 07, 2005 5:15 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Problem with WindowLogonExample.rb Iain, Here is a zip that contains some ruby files that will clear the security alert for you. You'll also need to get the latest code from cvs, especially the WindowHelper.rb file In future versions of watir we hope to have this code a bit clearer and easier to use Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Iain Sent: 06 May 2005 15:54 To: wtr-general at rubyforge.org Subject: [Wtr-general] Problem with WindowLogonExample.rb Hi Guys, Firstly, let me say thanks for the tool and the new release. I've been eagerly waiting for the new functionality and can't wait to get started with it. I've never programmed before but in the last month, through using your tool, I've learnt the basics of Ruby and am amazed by the results I've been getting. Up until now there's only been a few things I've wanted to do with Watir but haven't yet been able to. 1. Enter the network login information when accessing my test site. 2. Accepting Security Certificate warnings in Security Alert popups. I understand that both these issues have been addressed by the new build. I'm trying to figure out how to do this so have gone to the Watir API and the sample unit tests to try and find some similar code but I'm having some problems getting them to work. 1.) Unfortunately the WindowLogonExample.rb unit test isn't working for me. The clio.lyris.com login prompt appears but nothing else happens. Is anyone else having this problem? 2.) I couldn't find any working examples for Security Alerts but in the API I can see the clearSecurityAlertBox method in the WinClicker class. I've tried to following $ie = IE.new $ie.goto($Z_Login) w = WinClicker.new w.clearSecurityAlertBox() The security alert appears immediately after I navigate to Login URL of my test site but like before nothing happens. If I abort the test I get the following output: getWindowHandle - looking for: Security Alert Found window: CiceroUIWndFrame Caption =TF_FloatingLangBar_WndTitle Found window: CiceroUIWndFrame Caption =CiceroUIWndFrame Found window: tooltips_class32 Caption = Found window: WorkerW Caption = Found window: tooltips_class32 Caption = Found window: tooltips_class32 Caption = Found window: Shell_TrayWnd Caption = Found window: Auto-Suggest Dropdown Caption = Found window: Caption = Found window: tooltips_class32 Caption = Found window: UltraMon Taskbar Caption = Found window: tooltips_class32 Caption = Found window: OfficeTooltip Caption =Align Left Found window: tooltips_class32 Caption = Found window: Auto-Suggest Dropdown Caption = Found window: Auto-Suggest Dropdown Caption = Found window: tooltips_class32 Caption = Found window: Auto-Suggest Dropdown Caption = Found window: SysFader Caption =SysFader Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: Trillian: List Tooltip Entry Caption =Trillian: List Tooltip Entry Found window: BaseBar Caption = Found window: tooltips_class32 Caption = Found window: BaseBar Caption = >Exit code: -1073741510 >ruby login.rb >Exit code: -1073741510 Can anyone help? Many thanks Iain _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Sun May 8 19:46:38 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 08 May 2005 17:46:38 -0600 Subject: [Wtr-general] Problem with WindowLogonExample.rb In-Reply-To: Message-ID: <000701c55428$2d19fcb0$72d39044@NewDell> I think there is already a network logon method. You can probably use it in a similar manner -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Iain Sent: 08 May 2005 17:23 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Problem with WindowLogonExample.rb Thanks Paul, I really appreciate the help. I'll let you know how I get on. Iain -----Original Message----- From: Paul Rogers [mailto:paul.rogers at shaw.ca] Sent: Saturday, May 07, 2005 5:15 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Problem with WindowLogonExample.rb Iain, Here is a zip that contains some ruby files that will clear the security alert for you. You'll also need to get the latest code from cvs, especially the WindowHelper.rb file In future versions of watir we hope to have this code a bit clearer and easier to use Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Iain Sent: 06 May 2005 15:54 To: wtr-general at rubyforge.org Subject: [Wtr-general] Problem with WindowLogonExample.rb Hi Guys, Firstly, let me say thanks for the tool and the new release. I've been eagerly waiting for the new functionality and can't wait to get started with it. I've never programmed before but in the last month, through using your tool, I've learnt the basics of Ruby and am amazed by the results I've been getting. Up until now there's only been a few things I've wanted to do with Watir but haven't yet been able to. 1. Enter the network login information when accessing my test site. 2. Accepting Security Certificate warnings in Security Alert popups. I understand that both these issues have been addressed by the new build. I'm trying to figure out how to do this so have gone to the Watir API and the sample unit tests to try and find some similar code but I'm having some problems getting them to work. 1.) Unfortunately the WindowLogonExample.rb unit test isn't working for me. The clio.lyris.com login prompt appears but nothing else happens. Is anyone else having this problem? 2.) I couldn't find any working examples for Security Alerts but in the API I can see the clearSecurityAlertBox method in the WinClicker class. I've tried to following $ie = IE.new $ie.goto($Z_Login) w = WinClicker.new w.clearSecurityAlertBox() The security alert appears immediately after I navigate to Login URL of my test site but like before nothing happens. If I abort the test I get the following output: getWindowHandle - looking for: Security Alert Found window: CiceroUIWndFrame Caption =TF_FloatingLangBar_WndTitle Found window: CiceroUIWndFrame Caption =CiceroUIWndFrame Found window: tooltips_class32 Caption = Found window: WorkerW Caption = Found window: tooltips_class32 Caption = Found window: tooltips_class32 Caption = Found window: Shell_TrayWnd Caption = Found window: Auto-Suggest Dropdown Caption = Found window: Caption = Found window: tooltips_class32 Caption = Found window: UltraMon Taskbar Caption = Found window: tooltips_class32 Caption = Found window: OfficeTooltip Caption =Align Left Found window: tooltips_class32 Caption = Found window: Auto-Suggest Dropdown Caption = Found window: Auto-Suggest Dropdown Caption = Found window: tooltips_class32 Caption = Found window: Auto-Suggest Dropdown Caption = Found window: SysFader Caption =SysFader Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: Trillian: List Tooltip Entry Caption =Trillian: List Tooltip Entry Found window: BaseBar Caption = Found window: tooltips_class32 Caption = Found window: BaseBar Caption = >Exit code: -1073741510 >ruby login.rb >Exit code: -1073741510 Can anyone help? Many thanks Iain _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From alex at verk.info Sun May 8 22:11:36 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Sun, 08 May 2005 22:11:36 -0400 Subject: [Wtr-general] Watir RubyGem In-Reply-To: <5.1.0.14.2.20050508124906.01b2edd8@127.0.0.1> References: <5.1.0.14.2.20050508124906.01b2edd8@127.0.0.1> Message-ID: Bret Pettichord wrote: > This would be great but no one has yet signed up to do it. Any > volunteers? Bret, I've sent you an email about three days ago, volunteering for exactly that :) I'll cook up something next week. -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) From zeljko.filipin at gmail.com Mon May 9 01:33:28 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Mon, 9 May 2005 07:33:28 +0200 Subject: [Wtr-general] Watir 1.3 is released In-Reply-To: <001901c55244$122efc10$afd29044@NewDell> Message-ID: <427ef608.5c05bfa3.6e75.5266@mx.gmail.com> Not Found The requested URL /dfdf was not found on this server. Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Friday, May 06, 2005 4:01 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Watir 1.3 is released The navigation exception failure may have been caused by your browser setting. What do you get if you goto this site http://www.fxruby.org/dfdf Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: 06 May 2005 00:50 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Watir 1.3 is released I have just installed watir 1.3 and performed all_tests.rb: Finished in 265.287 seconds. 1) Error: test_save_remote_image(TC_Images): Watir::Exception::CacheItemNotFound: Match not found in C:\Documents and Settings\zfilipin\Local Settings\Temporary Internet Files using (?-mix:triangle\[\d +\].jpg) C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3065:in `save' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `each' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:134:in `test_save_remote_image' C:/watir_bonus/unitTests/../unittests/images_test.rb:132:in `run_webrick' C:/watir_bonus/unitTests/../unittests/images_test.rb:132:in `test_save_remote_image' 2) Error: test_save_remote_image_overwrites(TC_Images): Watir::Exception::CacheItemNotFound: Match not found in C:\Documents and Settings\zfilipin\Local Settings\Temporary Internet Files using (?-mix:triangle\[\d +\].jpg) C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3065:in `save' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `each' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:143:in `test_save_remote_image_overwrites' C:/watir_bonus/unitTests/../unittests/images_test.rb:141:in `run_webrick' C:/watir_bonus/unitTests/../unittests/images_test.rb:141:in `test_save_remote_image_overwrites' 3) Failure: test_http_errors(TC_Navigate) [C:/watir_bonus/unitTests/../unittests/navigate_test.rb:51]: exception expected but none was thrown. 163 tests, 983 assertions, 1 failures, 2 errors Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Friday, May 06, 2005 7:16 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Watir 1.3 is released This release contains many new features and bug fixes. Many thanks to everyone who has contributed to this project. If any problems are found during installation or running, please report them to thelist as soon as possible. Paul ------------------------------------------------ Watir 1.3 added new row_values and column_value methods to tables added ability to save an image - ie.image(:index,1).save('c:\temp\mypic.gif') new method, html that applies to objects, not just a page - ie.button(:index,1).html => now throws a NavigationException on 404, 500 errors iterators now mixin Enumerable added support for labels added support for frames by index added screen_capture added hidden field support, and iterator method table cells, span and div now act as containers, so can do ie.div(:index,1).button(:index.2).click added index to print out from show_xx methods. Link shows img src if an image is used added onKeyUp and onKeyDown to text_fields#set installer now installs AutoIt to deal with javascript popups, file uploads etc the spinner is now off by default bug fix in text_fields iterator where it wasnt iterating through password or text ares. Added test for password fields bug fix for flash for tables bug fixes for images and links in cells _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From ati.ozgur at gmail.com Mon May 9 03:42:33 2005 From: ati.ozgur at gmail.com (Atilla Ozgur) Date: Mon, 9 May 2005 10:42:33 +0300 Subject: [Wtr-general] Development for automation In-Reply-To: <5.1.0.14.2.20050506132536.03a2fa28@127.0.0.1> References: <20050506140341.53010.qmail@web30502.mail.mud.yahoo.com> <5.1.0.14.2.20050506132536.03a2fa28@127.0.0.1> Message-ID: Make them use naming convention. .Net web controls automatically creates unique names. If they use anything in server side, it will have a unique name. Ask them to use meaningfull names for web controls. VS.Net creates unique name for every control but they will be something like this. TextBox1,TextBox2,TextBox3 etc. But below names would be more meaningfull. txtFirstName,txtLastName,txtSecondName. I do not normally use hungarian naming convention but for gui i find it usefull. Distinguishing which controls are textbox, which are datagrid (GridView in .net 2.0), which are dropdownlist is good. But make them decide a naming convention and stick to it. If there is no naming convention **document**, you will find that they will not use that naming convention. I will also offer daily build though it is not specifically related to testing. We are daily building our code. In a project 13 coders and 2 testers work daily build heps us to find integrating problems more easily. Which .net version you are going to use? if I know I may offer more advice. From alex at verk.info Mon May 9 09:14:30 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Mon, 09 May 2005 09:14:30 -0400 Subject: [Wtr-general] Watir RubyGem In-Reply-To: References: <5.1.0.14.2.20050508124906.01b2edd8@127.0.0.1> Message-ID: Alexey Verkhovsky wrote: > I'll cook up something next week. Here goes the first approximation. This was easier than I expected. There are two files here - a gemspec and a rakefile. Since these are two new files, I am attaching the files themselves, not a diff patch. To use: 1. Put into the root directory of Watir project 2. 'gem install rake' (or 'gem update rake') 3. 'rake package' 4. 'dir pkg' => ... watir-1.3.gem watir-1.3.tgz watir-1.3.zip ... 5. 'cd pkg' 6. 'gem install watir' 7. 'gem list watir' => *** LOCAL GEMS *** watir (1.3) Automated testing tool for web applications. This does execute Instiki's test suite successfully, I didn't test it otherwise yet. One thing that I worry about is the .dll library among the Ruby sources - this is unusual. -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: rakefile.rb Url: http://rubyforge.org/pipermail/wtr-general/attachments/20050509/e950dec8/attachment.pl -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: watir.gemspec Url: http://rubyforge.org/pipermail/wtr-general/attachments/20050509/e950dec8/attachment-0001.pl From bret at pettichord.com Mon May 9 14:37:26 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 09 May 2005 13:37:26 -0500 Subject: [Wtr-general] Watir 1.3 is released In-Reply-To: <427b135b.49053d02.493b.598d@mx.gmail.com> References: <005801c551fa$bf8b52e0$afd29044@NewDell> Message-ID: <5.1.0.14.2.20050509133644.03aadcb0@127.0.0.1> The first two errors are known bugs: http://rubyforge.org/tracker/index.php?func=detail&aid=1854&group_id=104&atid=487 At 01:49 AM 5/6/2005, Zeljko Filipin wrote: >I have just installed watir 1.3 and performed all_tests.rb: > >Finished in 265.287 seconds. > > 1) Error: >test_save_remote_image(TC_Images): >Watir::Exception::CacheItemNotFound: Match not found in C:\Documents and >Settings\zfilipin\Local Settings\Temporary Internet Files using >(?-mix:triangle\[\d >+\].jpg) > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3065:in `save' > C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in >`safe_file_block' > C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `each' > C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in >`safe_file_block' > C:/watir_bonus/unitTests/../unittests/images_test.rb:134:in >`test_save_remote_image' > C:/watir_bonus/unitTests/../unittests/images_test.rb:132:in >`run_webrick' > C:/watir_bonus/unitTests/../unittests/images_test.rb:132:in >`test_save_remote_image' > > 2) Error: >test_save_remote_image_overwrites(TC_Images): >Watir::Exception::CacheItemNotFound: Match not found in C:\Documents and >Settings\zfilipin\Local Settings\Temporary Internet Files using >(?-mix:triangle\[\d >+\].jpg) > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3065:in `save' > C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in >`safe_file_block' > C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `each' > C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in >`safe_file_block' > C:/watir_bonus/unitTests/../unittests/images_test.rb:143:in >`test_save_remote_image_overwrites' > C:/watir_bonus/unitTests/../unittests/images_test.rb:141:in >`run_webrick' > C:/watir_bonus/unitTests/../unittests/images_test.rb:141:in >`test_save_remote_image_overwrites' > > 3) Failure: >test_http_errors(TC_Navigate) >[C:/watir_bonus/unitTests/../unittests/navigate_test.rb:51]: > exception expected but none was >thrown. > >163 tests, 983 assertions, 1 failures, 2 errors > >Zeljko > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers >Sent: Friday, May 06, 2005 7:16 AM >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Watir 1.3 is released > >This release contains many new features and bug fixes. > >Many thanks to everyone who has contributed to this project. > >If any problems are found during installation or running, please report >them to thelist as soon as possible. > >Paul > >------------------------------------------------ > >Watir 1.3 > > >added new row_values and column_value methods to tables >added ability to save an image - >ie.image(:index,1).save('c:\temp\mypic.gif') >new method, html that applies to objects, not just a page - >ie.button(:index,1).html => onclick="javascript:document.location='pass.html';" type=button >value="Click Me" name=b1> >now throws a NavigationException on 404, 500 errors >iterators now mixin Enumerable >added support for labels >added support for frames by index >added screen_capture >added hidden field support, and iterator method >table cells, span and div now act as containers, so can do >ie.div(:index,1).button(:index.2).click >added index to print out from show_xx methods. Link shows img src if an >image is used >added onKeyUp and onKeyDown to text_fields#set >installer now installs AutoIt to deal with javascript popups, file >uploads etc >the spinner is now off by default > > >bug fix in text_fields iterator where it wasnt iterating through >password or text ares. Added test for password fields >bug fix for flash for tables >bug fixes for images and links in cells > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From paul.rogers at shaw.ca Mon May 9 14:51:38 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 09 May 2005 12:51:38 -0600 Subject: [Wtr-general] Watir 1.3 is released In-Reply-To: <427ef608.5c05bfa3.6e75.5266@mx.gmail.com> Message-ID: <001001c554c8$21b26920$72d39044@NewDell> I think this is a browser setting, or possibly your isp. I wrote the code to look for res://C:\WINDOWS\system32\shdoclc.dll/http_404.htm#http://www.fxruby.org /dfdf in the url And then parse the error from the page like this The page cannot be found The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. ------------------------------------------------------------------------ -------- Please try the following: If you typed the page address in the Address bar, make sure that it is spelled correctly. Open the www.fxruby.org home page, and then look for links to the information you want. Click the Back button to try another link. Click Search to look for information on the Internet. HTTP 404 - File not found Internet Explorer -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: 08 May 2005 23:33 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Watir 1.3 is released Not Found The requested URL /dfdf was not found on this server. Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Friday, May 06, 2005 4:01 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Watir 1.3 is released The navigation exception failure may have been caused by your browser setting. What do you get if you goto this site http://www.fxruby.org/dfdf Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: 06 May 2005 00:50 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Watir 1.3 is released I have just installed watir 1.3 and performed all_tests.rb: Finished in 265.287 seconds. 1) Error: test_save_remote_image(TC_Images): Watir::Exception::CacheItemNotFound: Match not found in C:\Documents and Settings\zfilipin\Local Settings\Temporary Internet Files using (?-mix:triangle\[\d +\].jpg) C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3065:in `save' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `each' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:134:in `test_save_remote_image' C:/watir_bonus/unitTests/../unittests/images_test.rb:132:in `run_webrick' C:/watir_bonus/unitTests/../unittests/images_test.rb:132:in `test_save_remote_image' 2) Error: test_save_remote_image_overwrites(TC_Images): Watir::Exception::CacheItemNotFound: Match not found in C:\Documents and Settings\zfilipin\Local Settings\Temporary Internet Files using (?-mix:triangle\[\d +\].jpg) C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3065:in `save' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `each' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:143:in `test_save_remote_image_overwrites' C:/watir_bonus/unitTests/../unittests/images_test.rb:141:in `run_webrick' C:/watir_bonus/unitTests/../unittests/images_test.rb:141:in `test_save_remote_image_overwrites' 3) Failure: test_http_errors(TC_Navigate) [C:/watir_bonus/unitTests/../unittests/navigate_test.rb:51]: exception expected but none was thrown. 163 tests, 983 assertions, 1 failures, 2 errors Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Friday, May 06, 2005 7:16 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Watir 1.3 is released This release contains many new features and bug fixes. Many thanks to everyone who has contributed to this project. If any problems are found during installation or running, please report them to thelist as soon as possible. Paul ------------------------------------------------ Watir 1.3 added new row_values and column_value methods to tables added ability to save an image - ie.image(:index,1).save('c:\temp\mypic.gif') new method, html that applies to objects, not just a page - ie.button(:index,1).html => now throws a NavigationException on 404, 500 errors iterators now mixin Enumerable added support for labels added support for frames by index added screen_capture added hidden field support, and iterator method table cells, span and div now act as containers, so can do ie.div(:index,1).button(:index.2).click added index to print out from show_xx methods. Link shows img src if an image is used added onKeyUp and onKeyDown to text_fields#set installer now installs AutoIt to deal with javascript popups, file uploads etc the spinner is now off by default bug fix in text_fields iterator where it wasnt iterating through password or text ares. Added test for password fields bug fix for flash for tables bug fixes for images and links in cells _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Mon May 9 16:01:17 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 09 May 2005 14:01:17 -0600 Subject: [Wtr-general] Watir RubyGem In-Reply-To: Message-ID: <001701c554d1$dd94c620$72d39044@NewDell> Doesn't work for me: ln readme.txt pkg/watir-1.3/readme.txt cd pkg tar zcvf watir-1.3.tgz watir-1.3 rake aborted! undefined method `exitstatus' for nil:NilClass -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alexey Verkhovsky Sent: 09 May 2005 07:15 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Watir RubyGem Alexey Verkhovsky wrote: > I'll cook up something next week. Here goes the first approximation. This was easier than I expected. There are two files here - a gemspec and a rakefile. Since these are two new files, I am attaching the files themselves, not a diff patch. To use: 1. Put into the root directory of Watir project 2. 'gem install rake' (or 'gem update rake') 3. 'rake package' 4. 'dir pkg' => ... watir-1.3.gem watir-1.3.tgz watir-1.3.zip ... 5. 'cd pkg' 6. 'gem install watir' 7. 'gem list watir' => *** LOCAL GEMS *** watir (1.3) Automated testing tool for web applications. This does execute Instiki's test suite successfully, I didn't test it otherwise yet. One thing that I worry about is the .dll library among the Ruby sources - this is unusual. -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) From alex at verk.info Mon May 9 19:32:09 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Mon, 09 May 2005 19:32:09 -0400 Subject: [Wtr-general] Watir RubyGem In-Reply-To: <001701c554d1$dd94c620$72d39044@NewDell> References: <001701c554d1$dd94c620$72d39044@NewDell> Message-ID: Paul Rogers wrote: >Doesn't work for me: > >ln readme.txt pkg/watir-1.3/readme.txt >cd pkg >tar zcvf watir-1.3.tgz watir-1.3 >rake aborted! >undefined method `exitstatus' for nil:NilClass > > Yikes...sorry. There appears to be a dependency on having tar.exe and zip.exe on your PATH. I've never noticed this until now because, as a proper Unix junkie, I have the whole Cygwin's /usr/bin on it :) Either put these two utilitries on your PATH, or (if you only need it to produce a gem file, not .tgz and not .zip) edit rakefile.rb:29,30 as follows: - p.need_tar = true - p.need_zip = true + p.need_tar = false + p.need_zip = false and then 'rake repackage'. By the way, we can teach Rake to do all of the following: 1. Run unit tests 2. Generate RDoc documentation (although the Rake's own task is broken on Win32, it's easy to hand-code something that will work) 3. Clean any derived files (including the RDoc documentation) from the project directory Please email me off-list if interested. -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) From paul.rogers at shaw.ca Mon May 9 21:21:45 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 09 May 2005 19:21:45 -0600 Subject: [Wtr-general] Watir RubyGem In-Reply-To: Message-ID: <001e01c554fe$a16e3d70$72d39044@NewDell> Thanks! I was thinking when I ran it that it should be a cygwin thing. I'll try again some other time. I want to do a 1.31( adds P tag support and fixes some bugs) release, so maybe on that. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alexey Verkhovsky Sent: 09 May 2005 17:32 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Watir RubyGem Paul Rogers wrote: >Doesn't work for me: > >ln readme.txt pkg/watir-1.3/readme.txt >cd pkg >tar zcvf watir-1.3.tgz watir-1.3 >rake aborted! >undefined method `exitstatus' for nil:NilClass > > Yikes...sorry. There appears to be a dependency on having tar.exe and zip.exe on your PATH. I've never noticed this until now because, as a proper Unix junkie, I have the whole Cygwin's /usr/bin on it :) Either put these two utilitries on your PATH, or (if you only need it to produce a gem file, not .tgz and not .zip) edit rakefile.rb:29,30 as follows: - p.need_tar = true - p.need_zip = true + p.need_tar = false + p.need_zip = false and then 'rake repackage'. By the way, we can teach Rake to do all of the following: 1. Run unit tests 2. Generate RDoc documentation (although the Rake's own task is broken on Win32, it's easy to hand-code something that will work) 3. Clean any derived files (including the RDoc documentation) from the project directory Please email me off-list if interested. -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From alex at verk.info Mon May 9 21:29:28 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Mon, 09 May 2005 21:29:28 -0400 Subject: [Wtr-general] Starting/stopping app under test from within Watir test script In-Reply-To: <005501c551f2$a5ed3950$afd29044@NewDell> References: <005501c551f2$a5ed3950$afd29044@NewDell> Message-ID: Paul Rogers wrote: >A simper way may be to use Winclicker#winsystem > >I think this returns the pid of the started process, then you can >probably just kill that process > > On my PC winsystem blocks until the invoked process dies itself. Not what I need. -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) From chrismo at clabs.org Mon May 9 21:58:43 2005 From: chrismo at clabs.org (Chris Morris) Date: Mon, 09 May 2005 20:58:43 -0500 Subject: [Wtr-general] Starting/stopping app under test from within Watir test script In-Reply-To: References: <005501c551f2$a5ed3950$afd29044@NewDell> Message-ID: <42801553.8000205@clabs.org> Alexey Verkhovsky wrote: > On my PC winsystem blocks until the invoked process dies itself. Not > what I need. How 'bout this: def async_system(command) # http://msdn.microsoft.com/library/en-us/vccore98/html/_crt__spawnv.2c_._wspawnv.asp # this is working -- but frequently Segfaults ruby 1.6.6 mswin32 spawn = Win32API.new("crtdll", "_spawnvp", ['I', 'P', 'P'] ,'L') res = spawn.Call(P_NOWAIT, command, '') if res == -1 Win32API.new("crtdll", "perror", ['P'], 'V').call('async_system') end res end I've used it with some success. -- Chris http://clabs.org/blogki From paul.rogers at shaw.ca Mon May 9 22:44:11 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 09 May 2005 20:44:11 -0600 Subject: [Wtr-general] Starting/stopping app under test from within Watirtest script In-Reply-To: Message-ID: <000001c5550a$258f7640$72d39044@NewDell> How about win_System('start my_new_process') -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alexey Verkhovsky Sent: 09 May 2005 19:29 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Starting/stopping app under test from within Watirtest script Paul Rogers wrote: >A simper way may be to use Winclicker#winsystem > >I think this returns the pid of the started process, then you can >probably just kill that process > > On my PC winsystem blocks until the invoked process dies itself. Not what I need. -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Tue May 10 00:44:37 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 09 May 2005 23:44:37 -0500 Subject: [Wtr-general] Scripting 101 v. 1.5 is released Message-ID: <5.1.0.14.2.20050509231215.03b2cc50@127.0.0.1> Posted By: Bret Pettichord Date: 2005-05-09 23:36 Summary: Scripting 101 version 1.5 is released Project: Web Testing with Ruby Scripting 101 contains the class materials used in the Scripting for Testers (aka Scripting Web Tests) class that Paul Rogers and I teach. This class teaches people how to automate acceptance tests for web applications using Watir and Ruby. We are teaching this class this summer at Star East (Orlando) and Agile 2005 (Denver). Watir 1.3: http://rubyforge.org/frs/?group_id=104&release_id=2133 Scripting 101 1.5: http://rubyforge.org/frs/?group_id=104&release_id=2160 The materials are intended to support instructor-based training. The documentation and class exercises are also available on our website: http://wtr.rubyforge.org/s101/doc/ _____________________ Bret Pettichord www.pettichord.com From zeljko.filipin at gmail.com Tue May 10 01:39:18 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 10 May 2005 07:39:18 +0200 Subject: [Wtr-general] Watir 1.3 is released In-Reply-To: <001001c554c8$21b26920$72d39044@NewDell> Message-ID: <428048e3.409d26b1.6e63.0c4e@mx.gmail.com> The page cannot be found The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. ---------------------------------------------------------------------------- ---- Please try the following: If you typed the page address in the Address bar, make sure that it is spelled correctly. Open the res://C:\WINDOWS\system32\shdoclc.dll/http_404.htm#http:// home page, and then look for links to the information you want. Click the Back button to try another link. Click Search to look for information on the Internet. HTTP 404 - File not found Internet Explorer Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Monday, May 09, 2005 8:52 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Watir 1.3 is released I think this is a browser setting, or possibly your isp. I wrote the code to look for res://C:\WINDOWS\system32\shdoclc.dll/http_404.htm#http://www.fxruby.org /dfdf in the url And then parse the error from the page like this The page cannot be found The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. ------------------------------------------------------------------------ -------- Please try the following: If you typed the page address in the Address bar, make sure that it is spelled correctly. Open the www.fxruby.org home page, and then look for links to the information you want. Click the Back button to try another link. Click Search to look for information on the Internet. HTTP 404 - File not found Internet Explorer -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: 08 May 2005 23:33 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Watir 1.3 is released Not Found The requested URL /dfdf was not found on this server. Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Friday, May 06, 2005 4:01 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Watir 1.3 is released The navigation exception failure may have been caused by your browser setting. What do you get if you goto this site http://www.fxruby.org/dfdf Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Zeljko Filipin Sent: 06 May 2005 00:50 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Watir 1.3 is released I have just installed watir 1.3 and performed all_tests.rb: Finished in 265.287 seconds. 1) Error: test_save_remote_image(TC_Images): Watir::Exception::CacheItemNotFound: Match not found in C:\Documents and Settings\zfilipin\Local Settings\Temporary Internet Files using (?-mix:triangle\[\d +\].jpg) C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3065:in `save' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `each' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:134:in `test_save_remote_image' C:/watir_bonus/unitTests/../unittests/images_test.rb:132:in `run_webrick' C:/watir_bonus/unitTests/../unittests/images_test.rb:132:in `test_save_remote_image' 2) Error: test_save_remote_image_overwrites(TC_Images): Watir::Exception::CacheItemNotFound: Match not found in C:\Documents and Settings\zfilipin\Local Settings\Temporary Internet Files using (?-mix:triangle\[\d +\].jpg) C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3065:in `save' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `each' C:/watir_bonus/unitTests/../unittests/images_test.rb:181:in `safe_file_block' C:/watir_bonus/unitTests/../unittests/images_test.rb:143:in `test_save_remote_image_overwrites' C:/watir_bonus/unitTests/../unittests/images_test.rb:141:in `run_webrick' C:/watir_bonus/unitTests/../unittests/images_test.rb:141:in `test_save_remote_image_overwrites' 3) Failure: test_http_errors(TC_Navigate) [C:/watir_bonus/unitTests/../unittests/navigate_test.rb:51]: exception expected but none was thrown. 163 tests, 983 assertions, 1 failures, 2 errors Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Friday, May 06, 2005 7:16 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Watir 1.3 is released This release contains many new features and bug fixes. Many thanks to everyone who has contributed to this project. If any problems are found during installation or running, please report them to thelist as soon as possible. Paul ------------------------------------------------ Watir 1.3 added new row_values and column_value methods to tables added ability to save an image - ie.image(:index,1).save('c:\temp\mypic.gif') new method, html that applies to objects, not just a page - ie.button(:index,1).html => now throws a NavigationException on 404, 500 errors iterators now mixin Enumerable added support for labels added support for frames by index added screen_capture added hidden field support, and iterator method table cells, span and div now act as containers, so can do ie.div(:index,1).button(:index.2).click added index to print out from show_xx methods. Link shows img src if an image is used added onKeyUp and onKeyDown to text_fields#set installer now installs AutoIt to deal with javascript popups, file uploads etc the spinner is now off by default bug fix in text_fields iterator where it wasnt iterating through password or text ares. Added test for password fields bug fix for flash for tables bug fixes for images and links in cells _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Mark_Cain at rl.gov Tue May 10 10:08:45 2005 From: Mark_Cain at rl.gov (Cain, Mark) Date: Tue, 10 May 2005 07:08:45 -0700 Subject: [Wtr-general] Watir RubyGem Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D1F0@EX5V.rl.gov> This may sound like the ultimate stupid question, but what is Cygwin and what is it used for? What benefit is there in using? Do you run ruby from it? Is this something I should make the time to learn and use? Thanks in advance, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Monday, May 09, 2005 6:22 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Watir RubyGem Thanks! I was thinking when I ran it that it should be a cygwin thing. I'll try again some other time. I want to do a 1.31( adds P tag support and fixes some bugs) release, so maybe on that. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alexey Verkhovsky Sent: 09 May 2005 17:32 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Watir RubyGem Paul Rogers wrote: >Doesn't work for me: > >ln readme.txt pkg/watir-1.3/readme.txt >cd pkg >tar zcvf watir-1.3.tgz watir-1.3 >rake aborted! >undefined method `exitstatus' for nil:NilClass > > Yikes...sorry. There appears to be a dependency on having tar.exe and zip.exe on your PATH. I've never noticed this until now because, as a proper Unix junkie, I have the whole Cygwin's /usr/bin on it :) Either put these two utilitries on your PATH, or (if you only need it to produce a gem file, not .tgz and not .zip) edit rakefile.rb:29,30 as follows: - p.need_tar = true - p.need_zip = true + p.need_tar = false + p.need_zip = false and then 'rake repackage'. By the way, we can teach Rake to do all of the following: 1. Run unit tests 2. Generate RDoc documentation (although the Rake's own task is broken on Win32, it's easy to hand-code something that will work) 3. Clean any derived files (including the RDoc documentation) from the project directory Please email me off-list if interested. -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From shaorobics at gmail.com Tue May 10 10:32:37 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Tue, 10 May 2005 10:32:37 -0400 Subject: [Wtr-general] assert_false Message-ID: <593b9ae805051007325535fb75@mail.gmail.com> hey guys I have watir 1.3 installed. Was there an assert_false in the previous version? There doesn't seem to be one in this release. what I need to do is confirm that some regular expression DOES NOT exist on the page...so I had assert_false($ie.contains_text(someRegEx)) is there some opposite to contains_text then? Thanks From shaorobics at gmail.com Tue May 10 10:36:46 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Tue, 10 May 2005 10:36:46 -0400 Subject: [Wtr-general] Re: assert_false In-Reply-To: <593b9ae805051007325535fb75@mail.gmail.com> References: <593b9ae805051007325535fb75@mail.gmail.com> Message-ID: <593b9ae805051007362357d33a@mail.gmail.com> Never Mind guys...I found it under the /watir directory Sorry :) Shao On 5/10/05, Shao Kang Tat wrote: > hey guys > > I have watir 1.3 installed. Was there an assert_false in the previous version? > There doesn't seem to be one in this release. > > what I need to do is confirm that some regular expression DOES NOT > exist on the page...so I had > > assert_false($ie.contains_text(someRegEx)) > > is there some opposite to contains_text then? > > Thanks > From paul.rogers at shaw.ca Tue May 10 10:56:43 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 10 May 2005 08:56:43 -0600 Subject: [Wtr-general] assert_false In-Reply-To: <593b9ae805051007325535fb75@mail.gmail.com> Message-ID: <000a01c55570$7ac2c4d0$72d39044@NewDell> Assert_false is in watir/testunit_addons.rb. You'll have to do somethinglike this: require 'test/unit' require 'test/unit/ui/console/testrunner' require 'watir/testUnitAddons' Class MyTest Message-ID: <000b01c55570$de673110$72d39044@NewDell> Cygwin gives a bash ( I think ) shell for windows. Its like unix/linux on top of windows. Its very powerful, very useful. All the watir code should run from it ( although I havent tried recently). I use it extensively. http://www.cygwin.com/ -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: 10 May 2005 08:09 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Watir RubyGem This may sound like the ultimate stupid question, but what is Cygwin and what is it used for? What benefit is there in using? Do you run ruby from it? Is this something I should make the time to learn and use? Thanks in advance, --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Paul Rogers Sent: Monday, May 09, 2005 6:22 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Watir RubyGem Thanks! I was thinking when I ran it that it should be a cygwin thing. I'll try again some other time. I want to do a 1.31( adds P tag support and fixes some bugs) release, so maybe on that. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alexey Verkhovsky Sent: 09 May 2005 17:32 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Watir RubyGem Paul Rogers wrote: >Doesn't work for me: > >ln readme.txt pkg/watir-1.3/readme.txt >cd pkg >tar zcvf watir-1.3.tgz watir-1.3 >rake aborted! >undefined method `exitstatus' for nil:NilClass > > Yikes...sorry. There appears to be a dependency on having tar.exe and zip.exe on your PATH. I've never noticed this until now because, as a proper Unix junkie, I have the whole Cygwin's /usr/bin on it :) Either put these two utilitries on your PATH, or (if you only need it to produce a gem file, not .tgz and not .zip) edit rakefile.rb:29,30 as follows: - p.need_tar = true - p.need_zip = true + p.need_tar = false + p.need_zip = false and then 'rake repackage'. By the way, we can teach Rake to do all of the following: 1. Run unit tests 2. Generate RDoc documentation (although the Rake's own task is broken on Win32, it's easy to hand-code something that will work) 3. Clean any derived files (including the RDoc documentation) from the project directory Please email me off-list if interested. -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From shaorobics at gmail.com Tue May 10 12:11:46 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Tue, 10 May 2005 12:11:46 -0400 Subject: [Wtr-general] is there a way to ignore case while doing contains_text Message-ID: <593b9ae805051009113cd8e57@mail.gmail.com> Just wondering if there is a way to do $ie.contains_text(someRegEx) where the RegEx is not case specific Thanks Shao From lorenzo_jorquera at yahoo.com Tue May 10 12:25:05 2005 From: lorenzo_jorquera at yahoo.com (Lorenzo Jorquera) Date: Tue, 10 May 2005 11:25:05 -0500 (CDT) Subject: [Wtr-general] Problem with multiple frames Message-ID: <20050510162505.57802.qmail@web32208.mail.mud.yahoo.com> Hi, I am having a problem while testing an aplication. After clicking in a Div object, it looks like watir is returning control to the test script before the page has finished loading, causing that the script can?t find objects that are suposed to be there... The application has frames nested in several levels. I took a look into waitForIE, and it looks like it waits for the ie to be ready and then it waits for each frame in ie to be ready too. Does this cover also the frames nested in the top level frames? Thanks in advance, Lorenzo. --------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050510/abd20bfd/attachment.html From paul.rogers at shaw.ca Tue May 10 12:26:20 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 10 May 2005 10:26:20 -0600 Subject: [Wtr-general] is there a way to ignore case while doing contains_text In-Reply-To: <593b9ae805051009113cd8e57@mail.gmail.com> Message-ID: <003401c5557c$ff9297b0$72d39044@NewDell> /some_text/I The I at the end means ignore case. http://phrogz.net/ProgrammingRuby/ There is a section on reg-exp under standard types -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 10 May 2005 10:12 To: wtr-general at rubyforge.org Subject: [Wtr-general] is there a way to ignore case while doing contains_text Just wondering if there is a way to do $ie.contains_text(someRegEx) where the RegEx is not case specific Thanks Shao _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From shaorobics at gmail.com Tue May 10 12:44:09 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Tue, 10 May 2005 12:44:09 -0400 Subject: [Wtr-general] is there a way to ignore case while doing contains_text In-Reply-To: <003401c5557c$ff9297b0$72d39044@NewDell> References: <593b9ae805051009113cd8e57@mail.gmail.com> <003401c5557c$ff9297b0$72d39044@NewDell> Message-ID: <593b9ae80505100944207e5d94@mail.gmail.com> Hi Paul I actually gave this a try: regEx = "JXEYW`1MP" assert($ie.contains_text(/regEx/i)) and it tells me it can't find it on the page...on the page it's some random string: Jxeyw`1mp In fact, when I tried making regEx the exact same as it appears in the source (regEx = "Jxeyw`1mp"), it fails to find it as well... Shao On 5/10/05, Paul Rogers wrote: > /some_text/I > > The I at the end means ignore case. > > http://phrogz.net/ProgrammingRuby/ > > There is a section on reg-exp under standard types > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 10 May 2005 10:12 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] is there a way to ignore case while doing > contains_text > > Just wondering if there is a way to do > > $ie.contains_text(someRegEx) > > where the RegEx is not case specific > > Thanks > > Shao > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From shaorobics at gmail.com Tue May 10 13:02:11 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Tue, 10 May 2005 13:02:11 -0400 Subject: [Wtr-general] phone numbers & regEx/i Message-ID: <593b9ae80505101002253c15e2@mail.gmail.com> A very interesting situation... $regEx = "(703) 727-5040" assert($ie.contains_text(/#$regEx/i)) it keeps failing for every phone number I'm asserting for but passes for everything else... any idea why? Shao From shaorobics at gmail.com Tue May 10 12:53:31 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Tue, 10 May 2005 12:53:31 -0400 Subject: [Wtr-general] is there a way to ignore case while doing contains_text In-Reply-To: <593b9ae80505100944207e5d94@mail.gmail.com> References: <593b9ae805051009113cd8e57@mail.gmail.com> <003401c5557c$ff9297b0$72d39044@NewDell> <593b9ae80505100944207e5d94@mail.gmail.com> Message-ID: <593b9ae8050510095352bf5cf@mail.gmail.com> Never mind Figured it out...needed to put a "#" in front of the variable name ;) On 5/10/05, Shao Kang Tat wrote: > Hi Paul > > I actually gave this a try: > > regEx = "JXEYW`1MP" > assert($ie.contains_text(/regEx/i)) > > and it tells me it can't find it on the page...on the page it's some > random string: > > Jxeyw`1mp > > In fact, when I tried making regEx the exact same as it appears in the > source (regEx = "Jxeyw`1mp"), it fails to find it as well... > > Shao > > > On 5/10/05, Paul Rogers wrote: > > /some_text/I > > > > The I at the end means ignore case. > > > > http://phrogz.net/ProgrammingRuby/ > > > > There is a section on reg-exp under standard types > > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > > Sent: 10 May 2005 10:12 > > To: wtr-general at rubyforge.org > > Subject: [Wtr-general] is there a way to ignore case while doing > > contains_text > > > > Just wondering if there is a way to do > > > > $ie.contains_text(someRegEx) > > > > where the RegEx is not case specific > > > > Thanks > > > > Shao > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > From paul.rogers at shaw.ca Tue May 10 17:48:00 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 10 May 2005 15:48:00 -0600 Subject: [Wtr-general] Watir 1.31 is released Message-ID: <004b01c555a9$ef8c4af0$72d39044@NewDell> This is a minor release, mostly to help with the star east tutorial. The only significant addition is the inclusion of p tags ( if anyone can suggest a better name for these methods, please let me know) ie.p(:index,1).click ie.ps.each do |p| puts p.to_s end From bret at pettichord.com Tue May 10 18:28:10 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 10 May 2005 17:28:10 -0500 Subject: [Wtr-general] Problem with multiple frames In-Reply-To: <20050510162505.57802.qmail@web32208.mail.mud.yahoo.com> Message-ID: <5.1.0.14.2.20050510172720.03b79df8@127.0.0.1> Yes, but not if the frames are hosted by a different server -- in this case you'll get an access denied warning. At 11:25 AM 5/10/2005, Lorenzo Jorquera wrote: >Hi, > I am having a problem while testing an aplication. After clicking in a > Div object, it looks like watir is returning control to the test script > before the page has finished loading, causing that the script can?t find > objects that are suposed to be there... > The application has frames nested in several levels. I took a look into > waitForIE, and it looks like it waits for the ie to be ready and then it > waits for each frame in ie to be ready too. Does this cover also the > frames nested in the top level frames? > Thanks in advance, > Lorenzo. > > > >Do You Yahoo!? >Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del >Mundo. >Vis?ta >Yahoo! >Noticias. >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Tue May 10 18:25:11 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 10 May 2005 17:25:11 -0500 Subject: [Wtr-general] assert_false In-Reply-To: <000a01c55570$7ac2c4d0$72d39044@NewDell> References: <593b9ae805051007325535fb75@mail.gmail.com> Message-ID: <5.1.0.14.2.20050510171056.03b83eb8@127.0.0.1> Actually assert_false and assert_nil are synonyms. We should probably just be using assert_nil in our tests instead. At 09:56 AM 5/10/2005, Paul Rogers wrote: >Note that contains_text returns either a nil or match object so you >probably want to use > >Assert_nil( $ie.contains_test() ) _____________________ Bret Pettichord www.pettichord.com From paul.rogers at shaw.ca Tue May 10 18:34:29 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 10 May 2005 16:34:29 -0600 Subject: [Wtr-general] assert_false In-Reply-To: <5.1.0.14.2.20050510171056.03b83eb8@127.0.0.1> Message-ID: <004d01c555b0$6e016f40$72d39044@NewDell> Are you sure? I wrote assert_false to check for falseness in booleans, rather than nil conditions Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 10 May 2005 16:25 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] assert_false Actually assert_false and assert_nil are synonyms. We should probably just be using assert_nil in our tests instead. At 09:56 AM 5/10/2005, Paul Rogers wrote: >Note that contains_text returns either a nil or match object so you >probably want to use > >Assert_nil( $ie.contains_test() ) _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Tue May 10 18:58:59 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 10 May 2005 17:58:59 -0500 Subject: [Wtr-general] assert_false In-Reply-To: <004d01c555b0$6e016f40$72d39044@NewDell> References: <5.1.0.14.2.20050510171056.03b83eb8@127.0.0.1> Message-ID: <5.1.0.14.2.20050510175652.03b94050@127.0.0.1> I stand corrected. assert_false is a synonym for assert ! irb(main):008:0> assert_nil false Test::Unit::AssertionFailedError: expected but was . from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:30:in `assert_block' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:28:in `_wrap_assertion ' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:28:in `assert_block' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:54:in `assert_equal' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:122:in `assert_nil' from (irb):8 from c:/ruby/lib/ruby/1.8/prettyprint.rb:662 irb(main):009:0> assert_false false => nil At 05:34 PM 5/10/2005, Paul Rogers wrote: >Are you sure? >I wrote assert_false to check for falseness in booleans, rather than nil >conditions _____________________ Bret Pettichord www.pettichord.com From paul.rogers at shaw.ca Tue May 10 21:02:27 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 10 May 2005 19:02:27 -0600 Subject: [Wtr-general] assert_false In-Reply-To: <5.1.0.14.2.20050510175652.03b94050@127.0.0.1> Message-ID: <004e01c555c5$1a678f80$72d39044@NewDell> I hope they arent synonimous! Most of our unit test would be wrong! irb(main):014:0> assert_false(false) => nil irb(main):015:0> assert(true) => nil irb(main):016:0> assert_false( true) Test::Unit::AssertionFailedError: is not false. from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:30:in `assert_block' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:28:in `_wrap_assertion' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:28:in `assert_block' from c:/ruby/lib/ruby/site_ruby/1.8/watir/testunitaddons.rb:9:in `assert_false' from c:/ruby/lib/ruby/site_ruby/1.8/watir/testunitaddons.rb:7:in `_wrap_assertio from c:/ruby/lib/ruby/site_ruby/1.8/watir/testunitaddons.rb:7:in `assert_false' from (irb):16 irb(main):017:0> assert( false ) Test::Unit::AssertionFailedError: is not true. from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:30:in `assert_block' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:28:in `_wrap_assertion' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:28:in `assert_block' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:40:in `assert' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:38:in `_wrap_assertion' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:38:in `assert' from (irb):17 irb(main):018:0> -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 10 May 2005 16:59 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] assert_false I stand corrected. assert_false is a synonym for assert ! irb(main):008:0> assert_nil false Test::Unit::AssertionFailedError: expected but was . from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:30:in `assert_block' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:28:in `_wrap_assertion ' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:28:in `assert_block' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:54:in `assert_equal' from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:122:in `assert_nil' from (irb):8 from c:/ruby/lib/ruby/1.8/prettyprint.rb:662 irb(main):009:0> assert_false false => nil At 05:34 PM 5/10/2005, Paul Rogers wrote: >Are you sure? >I wrote assert_false to check for falseness in booleans, rather than >nil conditions _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From iain.rose at responsetek.com Tue May 10 21:15:23 2005 From: iain.rose at responsetek.com (Iain) Date: Tue, 10 May 2005 18:15:23 -0700 Subject: [Wtr-general] Problem with WindowLogonExample.rb In-Reply-To: <003c01c55362$feb5b9b0$72d39044@NewDell> Message-ID: Paul, This zip file apears to be corrupt. Would you mind reposting? Also, I notice that version 1.3.1 was released today. Does this release include the updated WindowHelper.rb file you refered to below? Thanks Iain -----Original Message----- From: Paul Rogers [mailto:paul.rogers at shaw.ca] Sent: Saturday, May 07, 2005 5:15 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Problem with WindowLogonExample.rb Iain, Here is a zip that contains some ruby files that will clear the security alert for you. You'll also need to get the latest code from cvs, especially the WindowHelper.rb file In future versions of watir we hope to have this code a bit clearer and easier to use Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Iain Sent: 06 May 2005 15:54 To: wtr-general at rubyforge.org Subject: [Wtr-general] Problem with WindowLogonExample.rb Hi Guys, Firstly, let me say thanks for the tool and the new release. I've been eagerly waiting for the new functionality and can't wait to get started with it. I've never programmed before but in the last month, through using your tool, I've learnt the basics of Ruby and am amazed by the results I've been getting. Up until now there's only been a few things I've wanted to do with Watir but haven't yet been able to. 1. Enter the network login information when accessing my test site. 2. Accepting Security Certificate warnings in Security Alert popups. I understand that both these issues have been addressed by the new build. I'm trying to figure out how to do this so have gone to the Watir API and the sample unit tests to try and find some similar code but I'm having some problems getting them to work. 1.) Unfortunately the WindowLogonExample.rb unit test isn't working for me. The clio.lyris.com login prompt appears but nothing else happens. Is anyone else having this problem? 2.) I couldn't find any working examples for Security Alerts but in the API I can see the clearSecurityAlertBox method in the WinClicker class. I've tried to following $ie = IE.new $ie.goto($Z_Login) w = WinClicker.new w.clearSecurityAlertBox() The security alert appears immediately after I navigate to Login URL of my test site but like before nothing happens. If I abort the test I get the following output: getWindowHandle - looking for: Security Alert Found window: CiceroUIWndFrame Caption =TF_FloatingLangBar_WndTitle Found window: CiceroUIWndFrame Caption =CiceroUIWndFrame Found window: tooltips_class32 Caption = Found window: WorkerW Caption = Found window: tooltips_class32 Caption = Found window: tooltips_class32 Caption = Found window: Shell_TrayWnd Caption = Found window: Auto-Suggest Dropdown Caption = Found window: Caption = Found window: tooltips_class32 Caption = Found window: UltraMon Taskbar Caption = Found window: tooltips_class32 Caption = Found window: OfficeTooltip Caption =Align Left Found window: tooltips_class32 Caption = Found window: Auto-Suggest Dropdown Caption = Found window: Auto-Suggest Dropdown Caption = Found window: tooltips_class32 Caption = Found window: Auto-Suggest Dropdown Caption = Found window: SysFader Caption =SysFader Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: Trillian: List Tooltip Entry Caption =Trillian: List Tooltip Entry Found window: BaseBar Caption = Found window: tooltips_class32 Caption = Found window: BaseBar Caption = >Exit code: -1073741510 >ruby login.rb >Exit code: -1073741510 Can anyone help? Many thanks Iain _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Tue May 10 21:51:21 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 10 May 2005 19:51:21 -0600 Subject: [Wtr-general] Problem with WindowLogonExample.rb In-Reply-To: Message-ID: <004f01c555cb$ee1fca30$72d39044@NewDell> Here it is. I think I used a program called 7za to zip it, but it obviously didn't work quite right! The new release will have the windowshelper that you need Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Iain Sent: 10 May 2005 19:15 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Problem with WindowLogonExample.rb Paul, This zip file apears to be corrupt. Would you mind reposting? Also, I notice that version 1.3.1 was released today. Does this release include the updated WindowHelper.rb file you refered to below? Thanks Iain -----Original Message----- From: Paul Rogers [mailto:paul.rogers at shaw.ca] Sent: Saturday, May 07, 2005 5:15 PM To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Problem with WindowLogonExample.rb Iain, Here is a zip that contains some ruby files that will clear the security alert for you. You'll also need to get the latest code from cvs, especially the WindowHelper.rb file In future versions of watir we hope to have this code a bit clearer and easier to use Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Iain Sent: 06 May 2005 15:54 To: wtr-general at rubyforge.org Subject: [Wtr-general] Problem with WindowLogonExample.rb Hi Guys, Firstly, let me say thanks for the tool and the new release. I've been eagerly waiting for the new functionality and can't wait to get started with it. I've never programmed before but in the last month, through using your tool, I've learnt the basics of Ruby and am amazed by the results I've been getting. Up until now there's only been a few things I've wanted to do with Watir but haven't yet been able to. 1. Enter the network login information when accessing my test site. 2. Accepting Security Certificate warnings in Security Alert popups. I understand that both these issues have been addressed by the new build. I'm trying to figure out how to do this so have gone to the Watir API and the sample unit tests to try and find some similar code but I'm having some problems getting them to work. 1.) Unfortunately the WindowLogonExample.rb unit test isn't working for me. The clio.lyris.com login prompt appears but nothing else happens. Is anyone else having this problem? 2.) I couldn't find any working examples for Security Alerts but in the API I can see the clearSecurityAlertBox method in the WinClicker class. I've tried to following $ie = IE.new $ie.goto($Z_Login) w = WinClicker.new w.clearSecurityAlertBox() The security alert appears immediately after I navigate to Login URL of my test site but like before nothing happens. If I abort the test I get the following output: getWindowHandle - looking for: Security Alert Found window: CiceroUIWndFrame Caption =TF_FloatingLangBar_WndTitle Found window: CiceroUIWndFrame Caption =CiceroUIWndFrame Found window: tooltips_class32 Caption = Found window: WorkerW Caption = Found window: tooltips_class32 Caption = Found window: tooltips_class32 Caption = Found window: Shell_TrayWnd Caption = Found window: Auto-Suggest Dropdown Caption = Found window: Caption = Found window: tooltips_class32 Caption = Found window: UltraMon Taskbar Caption = Found window: tooltips_class32 Caption = Found window: OfficeTooltip Caption =Align Left Found window: tooltips_class32 Caption = Found window: Auto-Suggest Dropdown Caption = Found window: Auto-Suggest Dropdown Caption = Found window: tooltips_class32 Caption = Found window: Auto-Suggest Dropdown Caption = Found window: SysFader Caption =SysFader Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: MozillaDropShadowWindowClass Caption = Found window: Trillian: List Tooltip Entry Caption =Trillian: List Tooltip Entry Found window: BaseBar Caption = Found window: tooltips_class32 Caption = Found window: BaseBar Caption = >Exit code: -1073741510 >ruby login.rb >Exit code: -1073741510 Can anyone help? Many thanks Iain _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- A non-text attachment was scrubbed... Name: sec.zip Type: application/x-zip-compressed Size: 603 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050510/a0a61f3a/attachment.bin From jared at kilmore.info Tue May 10 22:37:52 2005 From: jared at kilmore.info (Jared Quinert) Date: Wed, 11 May 2005 12:37:52 +1000 Subject: [Wtr-general] Watir 1.31 is released In-Reply-To: <004b01c555a9$ef8c4af0$72d39044@NewDell> References: <004b01c555a9$ef8c4af0$72d39044@NewDell> Message-ID: <42817000.7070802@kilmore.info> How about paragraph? I'm assuming 'p tags' refers to

in the html? Paul Rogers wrote: >This is a minor release, mostly to help with the star east tutorial. > >The only significant addition is the inclusion of p tags ( if anyone can >suggest a better name for these methods, please let me know) > > >ie.p(:index,1).click >ie.ps.each do |p| > puts p.to_s >end > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > > > From jkohl at telusplanet.net Tue May 10 22:43:09 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Tue, 10 May 2005 20:43:09 -0600 Subject: [Wtr-general] Watir 1.31 is released In-Reply-To: <42817000.7070802@kilmore.info> Message-ID: <20050511024220.FJUC5058.priv-edtnes56.telusplanet.net@tintin> I like "paragraph" too. "p" is what I use for inspecting objects with Ruby, and I'm likely to get mixed up. :) -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of Jared Quinert > Sent: May 10, 2005 8:38 PM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Watir 1.31 is released > > How about paragraph? I'm assuming 'p tags' refers to

in the html? > > Paul Rogers wrote: > > >This is a minor release, mostly to help with the star east tutorial. > > > >The only significant addition is the inclusion of p tags ( if anyone can > >suggest a better name for these methods, please let me know) > > > > > >ie.p(:index,1).click > >ie.ps.each do |p| > > puts p.to_s > >end > > > >_______________________________________________ > >Wtr-general mailing list > >Wtr-general at rubyforge.org > >http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Wed May 11 00:32:09 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 10 May 2005 22:32:09 -0600 Subject: [Wtr-general] Watir 1.31 is released In-Reply-To: <42817000.7070802@kilmore.info> Message-ID: <005a01c555e2$655471d0$72d39044@NewDell> I think that's a good idea -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Quinert Sent: 10 May 2005 20:38 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Watir 1.31 is released How about paragraph? I'm assuming 'p tags' refers to

in the html? Paul Rogers wrote: >This is a minor release, mostly to help with the star east tutorial. > >The only significant addition is the inclusion of p tags ( if anyone >can suggest a better name for these methods, please let me know) > > >ie.p(:index,1).click >ie.ps.each do |p| > puts p.to_s >end > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > > > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Tue May 10 22:52:41 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 10 May 2005 21:52:41 -0500 Subject: [Wtr-general] assert_false In-Reply-To: <004e01c555c5$1a678f80$72d39044@NewDell> References: <5.1.0.14.2.20050510175652.03b94050@127.0.0.1> Message-ID: <5.1.0.14.2.20050510215051.03bb5e50@127.0.0.1> I was unclear. assert_false(x) is the same as assert(!x) I used the exclamation point as a part of ruby syntax, not as an emphatic. Bret At 08:02 PM 5/10/2005, Paul Rogers wrote: >I hope they arent synonimous! Most of our unit test would be wrong! > >irb(main):014:0> assert_false(false) >=> nil >irb(main):015:0> assert(true) >=> nil >irb(main):016:0> assert_false( true) >Test::Unit::AssertionFailedError: is not false. > from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:30:in >`assert_block' > from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:28:in >`_wrap_assertion' > from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:28:in >`assert_block' > from c:/ruby/lib/ruby/site_ruby/1.8/watir/testunitaddons.rb:9:in >`assert_false' > from c:/ruby/lib/ruby/site_ruby/1.8/watir/testunitaddons.rb:7:in >`_wrap_assertio > from c:/ruby/lib/ruby/site_ruby/1.8/watir/testunitaddons.rb:7:in >`assert_false' > from (irb):16 >irb(main):017:0> assert( false ) >Test::Unit::AssertionFailedError: is not true. > from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:30:in >`assert_block' > from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:28:in >`_wrap_assertion' > from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:28:in >`assert_block' > from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:40:in `assert' > from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:38:in >`_wrap_assertion' > from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:38:in `assert' > from (irb):17 >irb(main):018:0> > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord >Sent: 10 May 2005 16:59 >To: wtr-general at rubyforge.org >Subject: RE: [Wtr-general] assert_false > > >I stand corrected. assert_false is a synonym for assert ! > >irb(main):008:0> assert_nil false >Test::Unit::AssertionFailedError: expected but was . > from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:30:in >`assert_block' > from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:28:in >`_wrap_assertion >' > from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:28:in >`assert_block' > from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:54:in >`assert_equal' > from c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:122:in >`assert_nil' > from (irb):8 > from c:/ruby/lib/ruby/1.8/prettyprint.rb:662 >irb(main):009:0> assert_false false >=> nil > >At 05:34 PM 5/10/2005, Paul Rogers wrote: > >Are you sure? > >I wrote assert_false to check for falseness in booleans, rather than > >nil conditions > >_____________________ > Bret Pettichord > www.pettichord.com > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From lorenzo_jorquera at yahoo.com Wed May 11 09:10:07 2005 From: lorenzo_jorquera at yahoo.com (Lorenzo Jorquera) Date: Wed, 11 May 2005 08:10:07 -0500 (CDT) Subject: [Wtr-general] Problem with multiple frames In-Reply-To: 6667 Message-ID: <20050511131008.26335.qmail@web32201.mail.mud.yahoo.com> No, all the frames are hosted by the same server (and I am not getting any access denied warning). If I put an sleep after clicking the div, everything works fine... The server is running very slowly and the page takes for ever to load, could this be fooling waitForIE ? Bret Pettichord escribi?: Yes, but not if the frames are hosted by a different server -- in this case you'll get an access denied warning. At 11:25 AM 5/10/2005, Lorenzo Jorquera wrote: >Hi, > I am having a problem while testing an aplication. After clicking in a > Div object, it looks like watir is returning control to the test script > before the page has finished loading, causing that the script can?t find > objects that are suposed to be there... > The application has frames nested in several levels. I took a look into > waitForIE, and it looks like it waits for the ie to be ready and then it > waits for each frame in ie to be ready too. Does this cover also the > frames nested in the top level frames? > Thanks in advance, > Lorenzo. > > > >Do You Yahoo!? >Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del >Mundo. >Vis?ta >Yahoo! >Noticias. >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general --------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050511/143b2862/attachment.html From lorenzo_jorquera at yahoo.com Wed May 11 10:57:38 2005 From: lorenzo_jorquera at yahoo.com (Lorenzo Jorquera) Date: Wed, 11 May 2005 09:57:38 -0500 (CDT) Subject: [Wtr-general] Problem with multiple frames In-Reply-To: <20050511131008.26335.qmail@web32201.mail.mud.yahoo.com> Message-ID: <20050511145738.46286.qmail@web32212.mail.mud.yahoo.com> I added some code to waitForIE to check that sub-frames (frames whitin frames) where ready. I wrote this method to check that: def wait_sub_frames(doc) if allFrames = doc.frames count = allFrames.length for i in 0..count-1 do until allFrames.frames[i.to_s].document.readyState == "complete" puts("waiting for: " + allFrames[i.to_s].name.to_s) sleep 0.02 end wait_sub_frames(allFrames[i.to_s]) end end end And added a call to it in waitForIE, just after it checks that a frame is ready: def wait( noSleep = false ) begin @down_load_time=0 pageLoadStart = Time.now @pageHasReloaded= false s= Spinner.new(@enable_spinner) while @ie.busy @pageHasReloaded = true sleep 0.02 s.spin end s.reverse log "waitForIE: readystate=" + @ie.readyState.to_s until @ie.readyState == READYSTATE_COMPLETE @pageHasReloaded = true sleep 0.02 s.spin end sleep 0.02 until @ie.document.readyState == "complete" sleep 0.02 s.spin end if @ie.document.frames.length > 1 begin 0.upto @ie.document.frames.length-1 do |i| until @ie.document.frames[i.to_s].document.readyState == "complete" sleep 0.02 s.spin end wait_sub_frames(@ie.document.frames[i.to_s].document) @url_list << @ie.document.frames[i.to_s].document.url unless url_list.include?(@ie.document.frames[i.to_s].document.url) end rescue=>e @logger.warn 'frame error in wait' + e.to_s + "\n" + e.backtrace.join("\n") end else @url_list << @ie.document.url unless @url_list.include?(@ie.document.url) end @down_load_time = Time.now - pageLoadStart run_error_checks() print "\b" unless @enable_spinner == false s=nil rescue WIN32OLERuntimeError => e @logger.warn 'runtime error in wait ' # + e.to_s end sleep 0.01 sleep @defaultSleepTime unless noSleep == true end alias waitForIE wait . The result was that a number of messages "waiting for ...." where printed. This messages (printed by wait_sub_frames) should only be printed if a frame is ready but a frame within it is not. So, I would say that checking only that the top level frames are ready is not enough to be sure that a page has loaded, and that subframes should also be checked. What do you think? Lorenzo Jorquera escribi?: No, all the frames are hosted by the same server (and I am not getting any access denied warning). If I put an sleep after clicking the div, everything works fine... The server is running very slowly and the page takes for ever to load, could this be fooling waitForIE ? Bret Pettichord escribi?: Yes, but not if the frames are hosted by a different server -- in this case you'll get an access denied warning. At 11:25 AM 5/10/2005, Lorenzo Jorquera wrote: >Hi, > I am having a problem while testing an aplication. After clicking in a > Div object, it looks like watir is returning control to the test script > before the page has finished loading, causing that the script can?t find > objects that are suposed to be there... > The application has frames nested in several levels. I took a look into > waitForIE, and it looks like it waits for the ie to be ready and then it > waits for each frame in ie to be ready too. Does this cover also the > frames nested in the top level frames? > Thanks in advance, > Lorenzo. > > > >Do You Yahoo!? >Todo lo que quieres saber de E! stados Unidos, Am?rica Latina y el resto del >Mundo. >Vis?ta >Yahoo! >Noticias. >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general --------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general --------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050511/a7cb3f76/attachment.html From paul.rogers at shaw.ca Wed May 11 11:10:55 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 11 May 2005 09:10:55 -0600 Subject: [Wtr-general] Problem with multiple frames In-Reply-To: <20050511131008.26335.qmail@web32201.mail.mud.yahoo.com> Message-ID: <000b01c5563b$a0f0c500$72d39044@NewDell> I think this is a bug in the frames code. Im not sure I'll be able to fix it for another week or so though Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lorenzo Jorquera Sent: 11 May 2005 07:10 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Problem with multiple frames No, all the frames are hosted by the same server (and I am not getting any access denied warning). If I put an sleep after clicking the div, everything works fine... The server is running very slowly and the page takes for ever to load, could this be fooling waitForIE ? Bret Pettichord escribi?: Yes, but not if the frames are hosted by a different server -- in this case you'll get an access denied warning. At 11:25 AM 5/10/2005, Lorenzo Jorquera wrote: >Hi, > I am having a problem while testing an aplication. After clicking in a > Div object, it looks like watir is returning control to the test script > before the page has finished loading, causing that the script can?t find > objects that are suposed to be there... > The application has frames nested in several levels. I took a look into > waitForIE, and it looks like it waits for the ie to be ready and then it > waits for each frame in ie to be ready too. Does this cover also the > frames nested in the top level frames? > Thanks in advance, > Lorenzo. > > > >Do You Yahoo!? >Todo lo que quieres saber de E! stados Unidos, Am?rica Latina y el resto del >Mundo. >Vis?ta >Yahoo! >Noticias. >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _____ Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050511/06930212/attachment.html From jfry at lyris.com Wed May 11 13:23:32 2005 From: jfry at lyris.com (Jeff Fry) Date: Wed, 11 May 2005 10:23:32 -0700 Subject: [Wtr-general] watir on Mac? Message-ID: <42823F94.8050508@lyris.com> Hi, Just curious if watir can run on a mac (v. Mac IE)? Has anyone tried it out? Thanks, Jeff From christopher.mcmahon at gmail.com Wed May 11 13:58:10 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 11 May 2005 11:58:10 -0600 Subject: [Wtr-general] watir on Mac? In-Reply-To: <42823F94.8050508@lyris.com> References: <42823F94.8050508@lyris.com> Message-ID: <72799cd7050511105880566@mail.gmail.com> I know that at least some WATIR functions only work on IE version 6.*, and the last IE for Mac was 5.5. That said, I'd sure like to hear if someone tries this. -Chris On 5/11/05, Jeff Fry wrote: > Hi, > Just curious if watir can run on a mac (v. Mac IE)? Has anyone tried it out? > Thanks, > Jeff > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Wed May 11 14:36:39 2005 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 11 May 2005 13:36:39 -0500 Subject: [Wtr-general] watir on Mac? In-Reply-To: <72799cd7050511105880566@mail.gmail.com> References: <42823F94.8050508@lyris.com> <42823F94.8050508@lyris.com> Message-ID: <5.1.0.14.2.20050511132716.03be3d58@127.0.0.1> It won't work on Mac. Watir use's COM to access IE. Ruby does not support COM on Mac. I'm also unsure whether Mac IE has the same COM interface. Sorry At 12:58 PM 5/11/2005, Chris McMahon wrote: >I know that at least some WATIR functions only work on IE version 6.*, >and the last IE for Mac was 5.5. That said, I'd sure like to hear if >someone tries this. >-Chris > >On 5/11/05, Jeff Fry wrote: > > Hi, > > Just curious if watir can run on a mac (v. Mac IE)? Has anyone tried it > out? > > Thanks, > > Jeff > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Wed May 11 14:46:50 2005 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 11 May 2005 13:46:50 -0500 Subject: [Wtr-general] Problem with multiple frames In-Reply-To: <20050511145738.46286.qmail@web32212.mail.mud.yahoo.com> References: <20050511131008.26335.qmail@web32201.mail.mud.yahoo.com> Message-ID: <5.1.0.14.2.20050511133943.03bdfa10@127.0.0.1> Can you write a unit test for this code? I am very concerned about both the stability and the performance of our wait code. And also the fact that we have no unit tests for it. Unit testing it is non-trivial. We probably need to use mocks. We can't use static tests like we do for other parts of Watir. One problem is that, unlike elsewhere in the Watir code base, we can't assume that the page is static -- it is still being loaded. I think your code makes this assumption, by assuming that the number of subframes won't change while waiting for the load. The other problem is that it is easy to fix problems by adding delays that also cause everybodies tests to slow down. We need some mechanism to make sure this doesn't happen. We don't currently have one. I'd appreciate help with these problems. I would really like to refactor the wait code, but can't till we get tests in place. Bret At 09:57 AM 5/11/2005, Lorenzo Jorquera wrote: >I added some code to waitForIE to check that sub-frames (frames whitin >frames) where ready. >I wrote this method to check that: > > def wait_sub_frames(doc) > if allFrames = doc.frames > count = allFrames.length > for i in 0..count-1 do > until allFrames.frames[i.to_s].document.readyState == > "complete" > puts("waiting for: " + allFrames[i.to_s].name.to_s) > sleep 0.02 > end > wait_sub_frames(allFrames[i.to_s]) > end > end > end > >And added a call to it in waitForIE, just after it checks that a frame is >ready: > > def wait( noSleep = false ) > begin > @down_load_time=0 > pageLoadStart = Time.now > @pageHasReloaded= false > > s= Spinner.new(@enable_spinner) > while @ie.busy > @pageHasReloaded = true > sleep 0.02 > s.spin > end > s.reverse > > log "waitForIE: readystate=" + @ie.readyState.to_s > until @ie.readyState == READYSTATE_COMPLETE > @pageHasReloaded = true > sleep 0.02 > s.spin > end > sleep 0.02 > > until @ie.document.readyState == "complete" > sleep 0.02 > s.spin > end > > if @ie.document.frames.length > 1 > begin > 0.upto @ie.document.frames.length-1 do |i| > until > @ie.document.frames[i.to_s].document.readyState == "complete" > sleep 0.02 > s.spin > end > >wait_sub_frames(@ie.document.frames[i.to_s].document) > @url_l! ist << > @ie.document.frames[i.to_s].document.url unless > url_list.include?(@ie.document.frames[i.to_s].document.url) > end > rescue=>e > @logger.warn 'frame error in wait' + e.to_s + > "\n" + e.backtrace.join("\n") > end > else > @url_list << @ie.document.url unless > @url_list.include?(@ie.document.url) > end > > @down_load_time = Time.now - pageLoadStart > run_error_checks() > print "\b" unless @enable_spinner == false > > s=nil > rescue WIN32OLERuntimeError => e > @logger.warn 'runtime error in wait ' # + e.to_s > end > sleep 0.01 > sleep @defaultSleepTime unless noSleep == true > end > alias waitForIE wait >. ! > > > >The result was that a number of messages "waiting for ...." where printed. >This messages (printed by wait_sub_frames) should only be printed if a >frame is ready but a frame within it is not. >So, I would say that checking only that the top level frames are ready is >not enough to be sure that a page has loaded, and that subframes should >also be checked. What do you think? > > > > > > > >Lorenzo Jorquera escribi?: >No, all the frames are hosted by the same server (and I am not getting any >access denied warning). If I put an sleep after clicking the div, >everything works fine... > >The server is running very slowly and the page takes for ever to load, >could this be fooling waitForIE ? > > > >Bret Pettichord escribi?: >Yes, but not if the frames are hosted by a different server -- in this case >you'll get an access denied warning. > >At 11:25 AM 5/10/2005, Lorenzo Jorquera wrote: > >Hi, > > I am having a problem while testing an aplication. After clicking in a > > Div object, it looks like watir is returning control to the test script > > before the page has finished loading, causing that the script can?t find > > objects that are suposed to be there... > > The application has frames nested in several levels. I took a look into > > waitForIE, and it looks like it waits for the ie to be ready and then it > > waits for each frame in ie to be ready too. Does this cover also the > > frames nested in the top level frames? > > Thanks in advance, > > Lorenzo. > > > > > > > >Do You Yahoo!? > >Todo lo que quieres saber de E! ! stados Unidos, Am?rica Latina y el > resto del > >Mundo. > >Vis?ta > >Yahoo! > >Noticias. > >_______________________________________________ > >Wtr-general mailing list > >Wtr-general at rubyforge.org > >http://rubyforge.org/mailman/listinfo/wtr-general > >_____________________ >Bret Pettichord >www.pettichord.com > > > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > >Do You Yahoo!? >Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del >Mundo. >Vis?ta >Yahoo! >Noticias. >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > >Do You Yahoo!? >Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del >Mundo. >Vis?ta >Yahoo! >Noticias. >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From paul.rogers at shaw.ca Wed May 11 15:02:13 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 11 May 2005 13:02:13 -0600 Subject: [Wtr-general] Problem with multiple frames In-Reply-To: <5.1.0.14.2.20050511133943.03bdfa10@127.0.0.1> Message-ID: <001a01c5565b$f15b91d0$72d39044@NewDell> I think I know what the problem with this sub-frmae problem actually is. However, as you?ve said its very difficult to test. We can discuss it next week, and me pointing at the problematic lines will be much easier than doing it via email! Its not a big fix, but I think it requires a lot of methods/variables to be renamed to make the situation clearer. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 11 May 2005 12:47 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Problem with multiple frames Can you write a unit test for this code? I am very concerned about both the stability and the performance of our wait code. And also the fact that we have no unit tests for it. Unit testing it is non-trivial. We probably need to use mocks. We can't use static tests like we do for other parts of Watir. One problem is that, unlike elsewhere in the Watir code base, we can't assume that the page is static -- it is still being loaded. I think your code makes this assumption, by assuming that the number of subframes won't change while waiting for the load. The other problem is that it is easy to fix problems by adding delays that also cause everybodies tests to slow down. We need some mechanism to make sure this doesn't happen. We don't currently have one. I'd appreciate help with these problems. I would really like to refactor the wait code, but can't till we get tests in place. Bret At 09:57 AM 5/11/2005, Lorenzo Jorquera wrote: >I added some code to waitForIE to check that sub-frames (frames whitin >frames) where ready. >I wrote this method to check that: > > def wait_sub_frames(doc) > if allFrames = doc.frames > count = allFrames.length > for i in 0..count-1 do > until allFrames.frames[i.to_s].document.readyState > == > "complete" > puts("waiting for: " + allFrames[i.to_s].name.to_s) > sleep 0.02 > end > wait_sub_frames(allFrames[i.to_s]) > end > end > end > >And added a call to it in waitForIE, just after it checks that a frame >is >ready: > > def wait( noSleep = false ) > begin > @down_load_time=0 > pageLoadStart = Time.now > @pageHasReloaded= false > > s= Spinner.new(@enable_spinner) > while @ie.busy > @pageHasReloaded = true > sleep 0.02 > s.spin > end > s.reverse > > log "waitForIE: readystate=" + @ie.readyState.to_s > until @ie.readyState == READYSTATE_COMPLETE > @pageHasReloaded = true > sleep 0.02 > s.spin > end > sleep 0.02 > > until @ie.document.readyState == "complete" > sleep 0.02 > s.spin > end > > if @ie.document.frames.length > 1 > begin > 0.upto @ie.document.frames.length-1 do |i| > until > @ie.document.frames[i.to_s].document.readyState == "complete" > sleep 0.02 > s.spin > end > >wait_sub_frames(@ie.document.frames[i.to_s].document) > @url_l! ist << > @ie.document.frames[i.to_s].document.url unless > url_list.include?(@ie.document.frames[i.to_s].document.url) > end > rescue=>e > @logger.warn 'frame error in wait' + e.to_s + > "\n" + e.backtrace.join("\n") > end > else > @url_list << @ie.document.url unless > @url_list.include?(@ie.document.url) > end > > @down_load_time = Time.now - pageLoadStart > run_error_checks() > print "\b" unless @enable_spinner == false > > s=nil > rescue WIN32OLERuntimeError => e > @logger.warn 'runtime error in wait ' # + e.to_s > end > sleep 0.01 > sleep @defaultSleepTime unless noSleep == true > end > alias waitForIE wait >. ! > > > >The result was that a number of messages "waiting for ...." where >printed. >This messages (printed by wait_sub_frames) should only be printed if a >frame is ready but a frame within it is not. >So, I would say that checking only that the top level frames are ready is >not enough to be sure that a page has loaded, and that subframes should >also be checked. What do you think? > > > > > > > >Lorenzo Jorquera escribi?: >No, all the frames are hosted by the same server (and I am not getting >any >access denied warning). If I put an sleep after clicking the div, >everything works fine... > >The server is running very slowly and the page takes for ever to load, >could this be fooling waitForIE ? > > > >Bret Pettichord escribi?: >Yes, but not if the frames are hosted by a different server -- in this >case you'll get an access denied warning. > >At 11:25 AM 5/10/2005, Lorenzo Jorquera wrote: > >Hi, > > I am having a problem while testing an aplication. After clicking in > >a Div object, it looks like watir is returning control to the test > >script before the page has finished loading, causing that the script > >can?t find objects that are suposed to be there... The application > >has frames nested in several levels. I took a look into waitForIE, > >and it looks like it waits for the ie to be ready and then it waits > >for each frame in ie to be ready too. Does this cover also the > >frames nested in the top level frames? Thanks in advance, > > Lorenzo. > > > > > > > >Do You Yahoo!? > >Todo lo que quieres saber de E! ! stados Unidos, Am?rica Latina y el > resto del > >Mundo. > >Vis?ta > >Yahoo! > >Noticias. > >_______________________________________________ > >Wtr-general mailing list > >Wtr-general at rubyforge.org > >http://rubyforge.org/mailman/listinfo/wtr-general > >_____________________ >Bret Pettichord >www.pettichord.com > > > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > >Do You Yahoo!? >Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto >del >Mundo. >Vis?ta >Y ahoo! >Noticias. >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > >Do You Yahoo!? >Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto >del >Mundo. >Vis?ta >Y ahoo! >Noticias. >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From lorenzo_jorquera at yahoo.com Wed May 11 15:34:32 2005 From: lorenzo_jorquera at yahoo.com (Lorenzo Jorquera) Date: Wed, 11 May 2005 14:34:32 -0500 (CDT) Subject: [Wtr-general] Problem with multiple frames In-Reply-To: <5.1.0.14.2.20050511133943.03bdfa10@127.0.0.1> Message-ID: <20050511193432.41903.qmail@web32208.mail.mud.yahoo.com> First of all, I completly understand your concern about changing such an important part of watir. And I can't think of a way of unittesting this. May be this is a good question for the XP or TDD list... I was not thinking of the code that I sent as a patch, but as way of showing that there is a bug in the current implementation of waitForIE, that is returning control before all the frames are loaded. In the current version, waitForIE waits until the IE object is complete and after that waits for each frame from the top document to be complete too. My code extends that by waiting also for all the subframes to be complete. I don?t think my code is making any new assumption about the number of subframes not changing while waiting for the load... it is the same assumption waitForIE is doing now when waiting for the top level frames to load. Also, this code won?t add any delay, unless there is a subframe that is not loaded yet, in wich case I think it is ok to wait for it to be complete. Lorenzo Bret Pettichord escribi?: Can you write a unit test for this code? I am very concerned about both the stability and the performance of our wait code. And also the fact that we have no unit tests for it. Unit testing it is non-trivial. We probably need to use mocks. We can't use static tests like we do for other parts of Watir. One problem is that, unlike elsewhere in the Watir code base, we can't assume that the page is static -- it is still being loaded. I think your code makes this assumption, by assuming that the number of subframes won't change while waiting for the load. The other problem is that it is easy to fix problems by adding delays that also cause everybodies tests to slow down. We need some mechanism to make sure this doesn't happen. We don't currently have one. I'd appreciate help with these problems. I would really like to refactor the wait code, but can't till we get tests in place. Bret At 09:57 AM 5/11/2005, Lorenzo Jorquera wrote: >I added some code to waitForIE to check that sub-frames (frames whitin >frames) where ready. >I wrote this method to check that: > > def wait_sub_frames(doc) > if allFrames = doc.frames > count = allFrames.length > for i in 0..count-1 do > until allFrames.frames[i.to_s].document.readyState == > "complete" > puts("waiting for: " + allFrames[i.to_s].name.to_s) > sleep 0.02 > end > wait_sub_frames(allFrames[i.to_s]) > end > end > end > >And added a call to it in waitForIE, just after it checks that a frame is >ready: > > def wait( noSleep = false ) > begin > @down_load_time=0 > pageLoadStart = Time.now > @pageHasReloaded= false > > s= Spinner.new(@enable_spinner) > while @ie.busy > @pageHasReloaded = true > sleep 0.02 > s.spin > end > s.reverse > > log "waitForIE: readystate=" + @ie.readyState.to_s > until @ie.readyState == READYSTATE_COMPLETE > @pageHasReloaded = true > sleep 0.02 > s.spin > end > sleep 0.02 > > until @ie.document.readyState == "complete" > sleep 0.02 > s.spin > end > > if @ie.document.frames.length > 1 > begin > 0.upto @ie.document.frames.length-1 do |i| > until > @ie.document.frames[i.to_s].document.readyState == "complete" > sleep 0.02 > s.spin > end > >wait_sub_frames(@ie.document.frames[i.to_s].document) > @url_l! ist << > @ie.document.frames[i.to_s].document.url unless > url_list.include?(@ie.document.frames[i.to_s].document.url) > end > rescue=>e > @logger.warn 'frame error in wait' + e.to_s + > "\n" + e.backtrace.join("\n") > end > else > @url_list << @ie.document.url unless > @url_list.include?(@ie.document.url) > end > > @down_load_time = Time.now - pageLoadStart > run_error_checks() > print "\b" unless @enable_spinner == false > > s=nil > rescue WIN32OLERuntimeError => e > @logger.warn 'runtime error in wait ' # + e.to_s > end > sleep 0.01 > sleep @defaultSleepTime unless noSleep == true > end > alias waitForIE wait >. ! > > > >The result was that a number of messages "waiting for ...." where printed. >This messages (printed by wait_sub_frames) should only be printed if a >frame is ready but a frame within it is not. >So, I would say that checking only that the top level frames are ready is >not enough to be sure that a page has loaded, and that subframes should >also be checked. What do you think? > > > > > > > >Lorenzo Jorquera escribi?: >No, all the frames are hosted by the same server (and I am not getting any >access denied warning). If I put an sleep after clicking the div, >everything works fine... > >The server is running very slowly and the page takes for ever to load, >could this be fooling waitForIE ? > > > >Bret Pettichord escribi?: >Yes, but not if the frames are hosted by a different server -- in this case >you'll get an access denied warning. > >At 11:25 AM 5/10/2005, Lorenzo Jorquera wrote: > >Hi, > > I am having a problem while testing an aplication. After clicking in a > > Div object, it looks like watir is returning control to the test script > > before the page has finished loading, causing that the script can?t find > > objects that are suposed to be there... > > The application has frames nested in several levels. I took a look into > > waitForIE, and it looks like it waits for the ie to be ready and then it > > waits for each frame in ie to be ready too. Does this cover also the > > frames nested in the top level frames? > > Thanks in advance, > > Lorenzo. > > > > > > > >Do You Yahoo!? > >Todo lo que quieres saber de E! ! stados Unidos, Am?rica Latina y el > resto del > >Mundo. > >Vis?ta > >Yahoo! > >Noticias. > >_______________________________________________ > >Wtr-general mailing list > >Wtr-general at rubyforge.org > >http://rubyforge.org/mailman/listinfo/wtr-general > >_____________________ >Bret Pettichord >www.pettichord.com > > > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > >Do You Yahoo!? >Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del >Mundo. >Vis?ta >Yahoo! >Noticias. >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > >Do You Yahoo!? >Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del >Mundo. >Vis?ta >Yahoo! >Noticias. >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general --------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050511/9bfee74a/attachment.html From paul.rogers at shaw.ca Wed May 11 15:37:35 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 11 May 2005 13:37:35 -0600 Subject: [Wtr-general] Problem with multiple frames In-Reply-To: <20050511145738.46286.qmail@web32212.mail.mud.yahoo.com> Message-ID: <002101c55660$e1ef6960$72d39044@NewDell> my mail is all out of order! There is a bug in here when you use subframes. Its not hard to fix it, but may have repurcussions. I'll discuss it with Bret next week. Is the sleep solution ok for you to use for now? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lorenzo Jorquera Sent: 11 May 2005 08:58 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Problem with multiple frames I added some code to waitForIE to check that sub-frames (frames whitin frames) where ready. I wrote this method to check that: def wait_sub_frames(doc) if allFrames = doc.frames count = allFrames.length for i in 0..count-1 do until allFrames.frames[i.to_s].document.readyState == "complete" puts("waiting for: " + allFrames[i.to_s].name.to_s) sleep 0.02 end wait_sub_frames(allFrames[i.to_s]) end end end And added a call to it in waitForIE, just after it checks that a frame is ready: def wait( noSleep = false ) begin @down_load_time=0 pageLoadStart = Time.now @pageHasReloaded= false s= Spinner.new(@enable_spinner) while @ie.busy @pageHasReloaded = true sleep 0.02 s.spin end s.reverse log "waitForIE: readystate=" + @ie.readyState.to_s until @ie.readyState == READYSTATE_COMPLETE @pageHasReloaded = true sleep 0.02 s.spin end sleep 0.02 until @ie.document.readyState == "complete" sleep 0.02 s.spin end if @ie.document.frames.length > 1 begin 0.upto @ie.document.frames.length-1 do |i| until @ie.document.frames[i.to_s].document.readyState == "complete" sleep 0.02 s.spin end wait_sub_frames(@ie.document.frames[i.to_s].document) @url_l! ist << @ie.document.frames[i.to_s].document.url unless url_list.include?(@ie.document.frames[i.to_s].document.url) end rescue=>e @logger.warn 'frame error in wait' + e.to_s + "\n" + e.backtrace.join("\n") end else @url_list << @ie.document.url unless @url_list.include?(@ie.document.url) end @down_load_time = Time.now - pageLoadStart run_error_checks() print "\b" unless @enable_spinner == false s=nil rescue WIN32OLERuntimeError => e @logger.warn 'runtime error in wait ' # + e.to_s end sleep 0.01 sleep @defaultSleepTime unless noSleep == true end alias waitForIE wait . ! The result was that a number of messages "waiting for ...." where printed. This messages (printed by wait_sub_frames) should only be printed if a frame is ready but a frame within it is not. So, I would say that checking only that the top level frames are ready is not enough to be sure that a page has loaded, and that subframes should also be checked. What do you think? Lorenzo Jorquera escribi?: No, all the frames are hosted by the same server (and I am not getting any access denied warning). If I put an sleep after clicking the div, everything works fine... The server is running very slowly and the page takes for ever to load, could this be fooling waitForIE ? Bret Pettichord escribi?: Yes, but not if the frames are hosted by a different server -- in this case you'll get an access denied warning. At 11:25 AM 5/10/2005, Lorenzo Jorquera wrote: >Hi, > I am having a problem while testing an aplication. After clicking in a > Div object, it looks like watir is returning control to the test script > before the page has finished loading, causing that the script can?t find > objects that are suposed to be there... > The application has frames nested in several levels. I took a look into > waitForIE, and it looks like it waits for the ie to be ready and then it > waits for each frame in ie to be ready too. Does this cover also the > frames nested in the top level frames? > Thanks in advance, > Lorenzo. > > > >Do You Yahoo!? >Todo lo que quieres saber de E! ! stados Unidos, Am?rica Latina y el resto del >Mundo. >Vis?ta >Yahoo! >Noticias. >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _____ Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _____ Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050511/05cae4bb/attachment.html From bret at pettichord.com Wed May 11 15:43:01 2005 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 11 May 2005 14:43:01 -0500 Subject: [Wtr-general] Problem with multiple frames In-Reply-To: <20050511193432.41903.qmail@web32208.mail.mud.yahoo.com> References: <5.1.0.14.2.20050511133943.03bdfa10@127.0.0.1> Message-ID: <5.1.0.14.2.20050511144020.03c4a7b0@127.0.0.1> At 02:34 PM 5/11/2005, Lorenzo Jorquera wrote: >I don?t think my code is making any new assumption about the number of >subframes not changing while waiting for the load... it is the same >assumption waitForIE is doing now when waiting for the top level frames to >load. I saw that. Still it's possible that one assumption ends up being safer than the other -- for whatever reason. The best of course is not not assume in either case. Ideally, everytime we fix this code we first write a motivating unit test. See ie_test.rb for an example of the kind of techniques we'd have to use to test the wait logic. Thanks for suggesting a fix -- it's very helpful. _____________________ Bret Pettichord www.pettichord.com From linglu1228 at hotmail.com Wed May 11 15:52:58 2005 From: linglu1228 at hotmail.com (ling lu) Date: Wed, 11 May 2005 19:52:58 +0000 Subject: [Wtr-general] Is there any way to access Security Alert popup window using Watir? Message-ID: Hi, I'm writing a web application testing using watir 1.3. I encountered a problem with accessing pop up windows. Does any one know how to access a security alert window and press 'Yes' button on the window using Watir? It will be highly appreciated if you can help me to solve this problem. This issue has been blocking me to proceed my test for several days now. Thanks, Ling From lorenzo_jorquera at yahoo.com Wed May 11 15:53:15 2005 From: lorenzo_jorquera at yahoo.com (Lorenzo Jorquera) Date: Wed, 11 May 2005 14:53:15 -0500 (CDT) Subject: [Wtr-general] Problem with multiple frames In-Reply-To: <002101c55660$e1ef6960$72d39044@NewDell> Message-ID: <20050511195315.35935.qmail@web32213.mail.mud.yahoo.com> Well, I am using the modified version of waitForIE that I sent in the begining of this thread (Ruby ability to modify existent classes in the fly is so cool!), and it is working OK. Lorenzo. Paul Rogers escribi?: my mail is all out of order! There is a bug in here when you use subframes. Its not hard to fix it, but may have repurcussions. I'll discuss it with Bret next week. Is the sleep solution ok for you to use for now? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lorenzo Jorquera Sent: 11 May 2005 08:58 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Problem with multiple frames I added some code to waitForIE to check that sub-frames (frames whitin frames) where ready. I wrote this method to check that: def wait_sub_frames(doc) if allFrames = doc.frames count = allFrames.length for i in 0..count-1 do until allFrames.frames[i.to_s].document.readyState == "complete" puts("waiting for: " + allFrames[i.to_s].name.to_s) sleep 0.02 end wait_sub_frames(allFrames[i.to_s]) end end end And added a call to it in waitForIE, just after it checks that a frame is ready: def wait( noSleep = false ) begin @down_load_time=0 pageLoadStart = Time.now @pageHasReloaded= false s= Spinner.new(@enable_spinner) while @ie.busy @pageHasReloaded = true sleep 0.02 s.spin end s.reverse log "waitForIE: readystate=" + @ie.readyState.to_s until @ie.readyState == READYSTATE_COMPLETE @pageHasReloaded = true sleep 0.02 s.spin end sleep 0.02 until @ie.document.readyState == "complete" sleep 0.02 s.spin end if @ie.document.frames.length > 1 begin 0.upto @ie.document.frames.length-1 do |i| until @ie.document.frames[i.to_s].document.readyState == "complete" sleep 0.02 s.spin end wait_sub_frames(@ie.document.frames[i.to_s].document) @url_l! ist << @ie.document.frames[i.to_s].document.url unless url_list.include?(@ie.document.frames[i.to_s].document.url) end rescue=>e @logger.warn 'frame error in wait' + e.to_s + "\n" + e.backtrace.join("\n") end else @url_list << @ie.document.url unless @url_list.include?(@ie.document.url) end @down_load_time = Time.now - pageLoadStart run_error_checks() print "\b" unless @enable_spinner == false s=nil rescue WIN32OLERuntimeError => e @logger.warn 'runtime error in wait ' # + e.to_s end sleep 0.01 sleep @defaultSleepTime unless noSleep == true end alias waitForIE wait . ! The result was that a number of messages "waiting for ...." where printed. This messages (printed by wait_sub_frames) should only be printed if a frame is ready but a frame within it is not. So, I would say that checking only that the top level frames are ready is not enough to be sure that a page has loaded, and that subframes should also be checked. What do you think? Lorenzo Jorquera escribi?: No, all the frames are hosted by the same server (and I am not getting any access denied warning). If I put an sleep after clicking the div, everything works fine... The server is running very slowly and the page takes for ever to load, could this be fooling waitForIE ? Bret Pettichord escribi?: Yes, but not if the frames are hosted by a different server -- in this case you'll get an access denied warning. At 11:25 AM 5/10/2005, Lorenzo Jorquera wrote: >Hi, > I am having a problem while testing an aplication. After clicking in a > Div object, it looks like watir is returning control to the test script > before the page has finished loading, causing that the script can?t find > objects that are suposed to be there... > The application has frames nested in several levels. I took a look into > waitForIE, and it looks like it waits for the ie to be ready and then it > waits for each frame in ie to be ready too. Does this cover also the > frames nested in the top level frames? > Thanks in advance, > Lorenzo. > > > >Do You Yahoo!? >Todo lo que quieres saber de E! ! stados Unidos, Am?rica Latina y el resto del >Mundo. >Vis?ta >Yahoo! >Noticias. >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general --------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general --------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general --------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050511/1aa44510/attachment.html From paul.rogers at shaw.ca Wed May 11 16:00:35 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 11 May 2005 14:00:35 -0600 Subject: [Wtr-general] Is there any way to access Security Alert popup window using Watir? In-Reply-To: Message-ID: <002d01c55664$18dc8270$72d39044@NewDell> See an email with the subject RE: [Wtr-general] Problem with WindowLogonExample.rb >From yesterday, and several other posts in the last few days from Iain Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of ling lu Sent: 11 May 2005 13:53 To: wtr-general at rubyforge.org Subject: [Wtr-general] Is there any way to access Security Alert popup window using Watir? Hi, I'm writing a web application testing using watir 1.3. I encountered a problem with accessing pop up windows. Does any one know how to access a security alert window and press 'Yes' button on the window using Watir? It will be highly appreciated if you can help me to solve this problem. This issue has been blocking me to proceed my test for several days now. Thanks, Ling _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Wed May 11 16:51:16 2005 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 11 May 2005 15:51:16 -0500 Subject: [Wtr-general] Is there any way to access Security Alert popup window using Watir? In-Reply-To: <002d01c55664$18dc8270$72d39044@NewDell> References: Message-ID: <5.1.0.14.2.20050511155103.03c4d308@127.0.0.1> Added to the FAQ http://wtr.rubyforge.org/wiki/wiki.pl?FrequentQuestions At 03:00 PM 5/11/2005, Paul Rogers wrote: >See an email with the subject > >RE: [Wtr-general] Problem with WindowLogonExample.rb > > >From yesterday, and several other posts in the last few days from Iain > >Paul _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Wed May 11 21:50:30 2005 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 11 May 2005 20:50:30 -0500 Subject: [Wtr-general] Using ri with Watir Message-ID: <5.1.0.14.2.20050511204737.03bfc420@127.0.0.1> Here's something cool. In your copy of the extracted Watir zip file, run: rdoc --exclude "unittests|examples|install.rb" -r Now you can do ri Watir::IE and get documentation on Watir's IE class. See a method you want to know more about? ri Watir::IE.attach And there it is. Give it a shot! _____________________ Bret Pettichord www.pettichord.com From paul.rogers at shaw.ca Thu May 12 18:13:18 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 12 May 2005 16:13:18 -0600 Subject: [Wtr-general] List went down Message-ID: <004101c5573f$cd277b00$72d39044@NewDell> The list went down sometime last night. I believe its fixed, but havent seen any mail.... From paul.rogers at shaw.ca Thu May 12 18:51:35 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 12 May 2005 16:51:35 -0600 Subject: [Wtr-general] H tags Message-ID: <004601c55745$264a9870$72d39044@NewDell> Html supports this

Text

Text

Does any one use these, need support for these? Im kind of interested, as this site http://brothercake.com/site/resources/scripts/dbx/# has some really cool stuff, but uses h tags. If I add these tags we can probably automate some of the stuff on that site, which would be very cool. However, Im not going to do it unless there is some overwhelming need. Paul From bret at pettichord.com Fri May 13 15:27:47 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 13 May 2005 14:27:47 -0500 Subject: [Wtr-general] H tags In-Reply-To: <004601c55745$264a9870$72d39044@NewDell> Message-ID: <5.1.0.14.2.20050513142334.03cbb408@127.0.0.1> Paul, In Ruby it is easy to write methods that generate methods or classes. Using this technique we could refactor the existing code so that it would only take one line of code to provide support for a new tag. This would also remove a lot of duplication from the existing code base. It's like code-generation, except easier. When this is done, your issue becomes less of a dilemma. Because with Ruby, you could always just add the support for the new tag outside of the Watir library itself. Bret At 05:51 PM 5/12/2005, Paul Rogers wrote: >Html supports this >

Text

>

Text

> >Does any one use these, need support for these? > >Im kind of interested, as this site >http://brothercake.com/site/resources/scripts/dbx/# has some really cool >stuff, but uses h tags. >If I add these tags we can probably automate some of the stuff on that >site, which would be very cool. However, Im not going to do it unless >there is some overwhelming need. > >Paul > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From paul.rogers at shaw.ca Fri May 13 16:08:07 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 13 May 2005 14:08:07 -0600 Subject: [Wtr-general] H tags In-Reply-To: <5.1.0.14.2.20050513142334.03cbb408@127.0.0.1> Message-ID: <002901c557f7$7ad22c20$72d39044@NewDell> As you're always telling me, write the test first. So the issue is not so much of wether to add the h methods, but wether I need to write the html and unit tests ;-) Unfortunately, I don't think its quite as easy, as just adding a method. Some objects behave differently, eg, tables have no name attribute, so the name method in the table class has to be overridden to support it. Unless Im misunderstanidg how you would approach it. All I really wanted to do was write an autotest for frogger ;-) Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 13 May 2005 13:28 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] H tags Paul, In Ruby it is easy to write methods that generate methods or classes. Using this technique we could refactor the existing code so that it would only take one line of code to provide support for a new tag. This would also remove a lot of duplication from the existing code base. It's like code-generation, except easier. When this is done, your issue becomes less of a dilemma. Because with Ruby, you could always just add the support for the new tag outside of the Watir library itself. Bret At 05:51 PM 5/12/2005, Paul Rogers wrote: >Html supports this >

Text

>

Text

> >Does any one use these, need support for these? > >Im kind of interested, as this site >http://brothercake.com/site/resources/scripts/dbx/# has some really >cool stuff, but uses h tags. If I add these tags we can probably >automate some of the stuff on that site, which would be very cool. >However, Im not going to do it unless there is some overwhelming need. > >Paul > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From scott.pack at vykor.com Mon May 16 22:02:03 2005 From: scott.pack at vykor.com (Scott Pack) Date: Mon, 16 May 2005 19:02:03 -0700 Subject: [Wtr-general] Watir cannot find deep links Message-ID: <72CF38BC279AE24A83E96B9D67B45D870110D85F@mail.vykor.com> In my application under test, I have objects that are inside tables that are inside div tags. Watir cannot see these. Any ideas? Here is an example:
  • Home
From Mark_Cain at rl.gov Tue May 17 10:28:54 2005 From: Mark_Cain at rl.gov (Cain, Mark) Date: Tue, 17 May 2005 07:28:54 -0700 Subject: [Wtr-general] Watir cannot find deep links Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D217@EX5V.rl.gov> Scott, what I had to do was access the table by index--which I got by doing a find on the page source and counting
  • Home
_______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050517/c9f16ee7/attachment.html From alex at verk.info Tue May 17 17:53:20 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Tue, 17 May 2005 17:53:20 -0400 Subject: [Wtr-general] Handling non-existant links (and other objects) Message-ID: I'm puzzled by the fact that ie.link(:url, '/non/existant/path') returns some sort of Null Object, instead of raising an error straight away? This behavior seems unintuitive and needs 60+ lines of repetitive code to support it (all references to object_exist_check, plus some more). Is there a reason why it can be useful? -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) From chrismo at clabs.org Thu May 19 01:16:24 2005 From: chrismo at clabs.org (Chris Morris) Date: Thu, 19 May 2005 00:16:24 -0500 Subject: [Wtr-general] phone numbers & regEx/i In-Reply-To: <593b9ae80505101002253c15e2@mail.gmail.com> References: <593b9ae80505101002253c15e2@mail.gmail.com> Message-ID: <428C2128.30503@clabs.org> Shao Kang Tat wrote: >A very interesting situation... > >$regEx = "(703) 727-5040" > >assert($ie.contains_text(/#$regEx/i)) > > You need braces in addition to the #: assert($ie.contains_text(/#{$regEx}/i)) -- Chris http://clabs.org/blogki From tomfeo at presslogic.com Thu May 19 10:14:45 2005 From: tomfeo at presslogic.com (Tom) Date: Thu, 19 May 2005 08:14:45 -0600 Subject: [Wtr-general] Term Position Job Posting In-Reply-To: <428C2128.30503@clabs.org> Message-ID: Presslogic Inc. here in Calgary AB. is looking to fill a 2 month term position to assist our QA in writing automation tests using WATIR. Primarily we are looking for a student wishing to enter the field of Quality Assurance. Knowledge of WATIR is an asset, but not required. The successful candidate should have some knowledge of object oriented programming, be a quick learner and be able to work independently. This person will be working closely with our QA and Development team. If you or someone you know would be interested in this position, please forward your resumes to: tomfeo at presslogic.com Thank you, Tom Feodoroff Presslogic Inc. From softwarespack at yahoo.com Thu May 19 12:47:15 2005 From: softwarespack at yahoo.com (Scott Pack) Date: Thu, 19 May 2005 09:47:15 -0700 (PDT) Subject: [Wtr-general] Tag attributes Message-ID: <20050519164716.90192.qmail@web32202.mail.mud.yahoo.com> Where can I find a list of supported tag attributes for each object type? For example - :name, :id, :index, :value, :url, etc? Or all implicitly defined for all objects? What is the complete set of tags? Thanks. Scott __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From shaorobics at gmail.com Thu May 19 13:02:17 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Thu, 19 May 2005 13:02:17 -0400 Subject: [Wtr-general] Tag attributes In-Reply-To: <20050519164716.90192.qmail@web32202.mail.mud.yahoo.com> References: <20050519164716.90192.qmail@web32202.mail.mud.yahoo.com> Message-ID: <593b9ae805051910025f12ba8b@mail.gmail.com> If you wanted to find out the supported tag attr's, the easiest way is to do something like (my example here uses drop down lists) ie.select_lists.each do|s| puts s end this prints out all the properties of all the dropdown lists on the current page and you can conveniently see everything: on the page I tested this on I got: type: select-one id: FiscalYear name: FiscalYear value: 2005 disabled: false On 5/19/05, Scott Pack wrote: > Where can I find a list of supported tag attributes > for each object type? For example - :name, :id, > :index, :value, :url, etc? > > Or all implicitly defined for all objects? What is the > complete set of tags? > > Thanks. > > Scott > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From shaorobics at gmail.com Thu May 19 13:12:11 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Thu, 19 May 2005 13:12:11 -0400 Subject: [Wtr-general] anyway to get all options from a selectbox? Message-ID: <593b9ae8050519101233f89b2b@mail.gmail.com> say I have some select box with 10 options 1. is there a way to get the selecbox's size? 2. is there a way to return all of the options in some sort of array? (I ask this because I want to randomize between the options available) w/o knowing in advance what the options are. Thanks From christopher.mcmahon at gmail.com Thu May 19 13:24:53 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 19 May 2005 11:24:53 -0600 Subject: [Wtr-general] Tag attributes In-Reply-To: <20050519164716.90192.qmail@web32202.mail.mud.yahoo.com> References: <20050519164716.90192.qmail@web32202.mail.mud.yahoo.com> Message-ID: <72799cd7050519102478859e55@mail.gmail.com> On 5/19/05, Scott Pack wrote: > Where can I find a list of supported tag attributes > for each object type? For example - :name, :id, > :index, :value, :url, etc? I usually just read the source in watir.rb. -Chris From jkohl at telusplanet.net Thu May 19 13:29:09 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Thu, 19 May 2005 10:29:09 -0700 Subject: [Wtr-general] anyway to get all options from a selectbox? In-Reply-To: <593b9ae8050519101233f89b2b@mail.gmail.com> References: <593b9ae8050519101233f89b2b@mail.gmail.com> Message-ID: <1116523749.428ccce5d05b2@webmail.telusplanet.net> > say I have some select box with 10 options > > 1. is there a way to get the selecbox's size? a = ie.select_list(:name, "my_select_list").getAllContents #a is an array of the contents assume a => ["Option 1", "Option 2", "Option 3", "Option 4"] a.length #get the length of the array =>4 > 2. is there a way to return all of the options in some sort of array? a = ie.select_list(:name, "my_select_list").getAllContents #guess I already answered that > (I ask this because I want to randomize between the options available) > w/o knowing in advance what the options are. you should be able to select a value by its array index. Warning! None of the scripting code above has been tested! This is off the top of my head. :) Hope this helps; -Jonathan > Thanks > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From jkohl at telusplanet.net Thu May 19 15:13:58 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Thu, 19 May 2005 12:13:58 -0700 Subject: [Wtr-general] Tag attributes In-Reply-To: <20050519164716.90192.qmail@web32202.mail.mud.yahoo.com> References: <20050519164716.90192.qmail@web32202.mail.mud.yahoo.com> Message-ID: <1116530038.428ce576e4202@webmail.telusplanet.net> As far as I know, we have to look in the source, or find out by trial and error. If an attribute you are using is missing, please let us know and we can add it. -Jonathan Quoting Scott Pack : > Where can I find a list of supported tag attributes > for each object type? For example - :name, :id, > :index, :value, :url, etc? > > Or all implicitly defined for all objects? What is the > complete set of tags? > > Thanks. > > Scott > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From tuyet.ctn at mscibarra.com Thu May 19 17:55:11 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Thu, 19 May 2005 14:55:11 -0700 Subject: [Wtr-general] JavaScript and WATIR Message-ID: Hello, I am using the WATIR User Guide to start developing one test case for our Web application Login page. The problem is that in View/Source Code, there are no objects that I can manipulate like text_field HTML tags, or submit HTML buttons. I only see the javascript names: irb(main):025:0> show_all_objects NameError: undefined local variable or method `show_all_objects' for main:Object from (irb):25 from :0 irb(main):026:0> ie.show_all_objects -----------Objects in page ------------- id= src=/include/top.js HTML Document name=relay id= src=/include/blank.htm l HTML Document name=main id= src=/araneae/login Any ideas how I can get to these fields? -----Original Message----- From: wtr-general-request at rubyforge.org [mailto:wtr-general-request at rubyforge.org] Sent: Tuesday, May 17, 2005 7:20 AM To: wtr-general at rubyforge.org Subject: Wtr-general Digest, Vol 18, Issue 24 Send Wtr-general mailing list submissions to wtr-general at rubyforge.org To subscribe or unsubscribe via the World Wide Web, visit http://rubyforge.org/mailman/listinfo/wtr-general or, via email, send a message with subject or body 'help' to wtr-general-request at rubyforge.org You can reach the person managing the list at wtr-general-owner at rubyforge.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Wtr-general digest..." Today's Topics: 1. RE: Is there any way to access Security Alert popup window using Watir? (Bret Pettichord) 2. Using ri with Watir (Bret Pettichord) 3. List went down (Paul Rogers) 4. H tags (Paul Rogers) 5. Re: H tags (Bret Pettichord) 6. RE: H tags (Paul Rogers) 7. Watir cannot find deep links (Scott Pack) 8. RE: Watir cannot find deep links (Cain, Mark) ---------------------------------------------------------------------- Message: 1 Date: Wed, 11 May 2005 15:51:16 -0500 From: Bret Pettichord Subject: RE: [Wtr-general] Is there any way to access Security Alert popup window using Watir? To: wtr-general at rubyforge.org Message-ID: <5.1.0.14.2.20050511155103.03c4d308 at 127.0.0.1> Content-Type: text/plain; charset="us-ascii"; format=flowed Added to the FAQ http://wtr.rubyforge.org/wiki/wiki.pl?FrequentQuestions At 03:00 PM 5/11/2005, Paul Rogers wrote: >See an email with the subject > >RE: [Wtr-general] Problem with WindowLogonExample.rb > > >From yesterday, and several other posts in the last few days from Iain > >Paul _____________________ Bret Pettichord www.pettichord.com ------------------------------ Message: 2 Date: Wed, 11 May 2005 20:50:30 -0500 From: Bret Pettichord Subject: [Wtr-general] Using ri with Watir To: wtr-general at rubyforge.org Message-ID: <5.1.0.14.2.20050511204737.03bfc420 at 127.0.0.1> Content-Type: text/plain; charset="us-ascii"; format=flowed Here's something cool. In your copy of the extracted Watir zip file, run: rdoc --exclude "unittests|examples|install.rb" -r Now you can do ri Watir::IE and get documentation on Watir's IE class. See a method you want to know more about? ri Watir::IE.attach And there it is. Give it a shot! _____________________ Bret Pettichord www.pettichord.com ------------------------------ Message: 3 Date: Thu, 12 May 2005 16:13:18 -0600 From: Paul Rogers Subject: [Wtr-general] List went down To: wtr-general at rubyforge.org Message-ID: <004101c5573f$cd277b00$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii The list went down sometime last night. I believe its fixed, but havent seen any mail.... ------------------------------ Message: 4 Date: Thu, 12 May 2005 16:51:35 -0600 From: Paul Rogers Subject: [Wtr-general] H tags To: wtr-general at rubyforge.org Message-ID: <004601c55745$264a9870$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii Html supports this

Text

Text

Does any one use these, need support for these? Im kind of interested, as this site http://brothercake.com/site/resources/scripts/dbx/# has some really cool stuff, but uses h tags. If I add these tags we can probably automate some of the stuff on that site, which would be very cool. However, Im not going to do it unless there is some overwhelming need. Paul ------------------------------ Message: 5 Date: Fri, 13 May 2005 14:27:47 -0500 From: Bret Pettichord Subject: Re: [Wtr-general] H tags To: wtr-general at rubyforge.org Message-ID: <5.1.0.14.2.20050513142334.03cbb408 at 127.0.0.1> Content-Type: text/plain; charset="us-ascii"; format=flowed Paul, In Ruby it is easy to write methods that generate methods or classes. Using this technique we could refactor the existing code so that it would only take one line of code to provide support for a new tag. This would also remove a lot of duplication from the existing code base. It's like code-generation, except easier. When this is done, your issue becomes less of a dilemma. Because with Ruby, you could always just add the support for the new tag outside of the Watir library itself. Bret At 05:51 PM 5/12/2005, Paul Rogers wrote: >Html supports this >

Text

>

Text

> >Does any one use these, need support for these? > >Im kind of interested, as this site >http://brothercake.com/site/resources/scripts/dbx/# has some really cool >stuff, but uses h tags. >If I add these tags we can probably automate some of the stuff on that >site, which would be very cool. However, Im not going to do it unless >there is some overwhelming need. > >Paul > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com ------------------------------ Message: 6 Date: Fri, 13 May 2005 14:08:07 -0600 From: Paul Rogers Subject: RE: [Wtr-general] H tags To: wtr-general at rubyforge.org Message-ID: <002901c557f7$7ad22c20$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii As you're always telling me, write the test first. So the issue is not so much of wether to add the h methods, but wether I need to write the html and unit tests ;-) Unfortunately, I don't think its quite as easy, as just adding a method. Some objects behave differently, eg, tables have no name attribute, so the name method in the table class has to be overridden to support it. Unless Im misunderstanidg how you would approach it. All I really wanted to do was write an autotest for frogger ;-) Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 13 May 2005 13:28 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] H tags Paul, In Ruby it is easy to write methods that generate methods or classes. Using this technique we could refactor the existing code so that it would only take one line of code to provide support for a new tag. This would also remove a lot of duplication from the existing code base. It's like code-generation, except easier. When this is done, your issue becomes less of a dilemma. Because with Ruby, you could always just add the support for the new tag outside of the Watir library itself. Bret At 05:51 PM 5/12/2005, Paul Rogers wrote: >Html supports this >

Text

>

Text

> >Does any one use these, need support for these? > >Im kind of interested, as this site >http://brothercake.com/site/resources/scripts/dbx/# has some really >cool stuff, but uses h tags. If I add these tags we can probably >automate some of the stuff on that site, which would be very cool. >However, Im not going to do it unless there is some overwhelming need. > >Paul > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------ Message: 7 Date: Mon, 16 May 2005 19:02:03 -0700 From: "Scott Pack" Subject: [Wtr-general] Watir cannot find deep links To: Message-ID: <72CF38BC279AE24A83E96B9D67B45D870110D85F at mail.vykor.com> Content-Type: text/plain; charset="iso-8859-1" In my application under test, I have objects that are inside tables that are inside div tags. Watir cannot see these. Any ideas? Here is an example:
  • Home
------------------------------ Message: 8 Date: Tue, 17 May 2005 07:28:54 -0700 From: "Cain, Mark" Subject: RE: [Wtr-general] Watir cannot find deep links To: Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D217 at EX5V.rl.gov> Content-Type: text/plain; charset="us-ascii" Scott, what I had to do was access the table by index--which I got by doing a find on the page source and counting
  • Home
_______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050517/c9f16ee7/att achment.htm ------------------------------ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general End of Wtr-general Digest, Vol 18, Issue 24 ******************************************* From softwarespack at yahoo.com Thu May 19 18:32:45 2005 From: softwarespack at yahoo.com (Scott Pack) Date: Thu, 19 May 2005 15:32:45 -0700 (PDT) Subject: [Wtr-general] Tag attributes Message-ID: <20050519223245.59883.qmail@web32205.mail.mud.yahoo.com> Thanks for the information. As a suggestion, it would be great if this were in the rdocs for each element type. It's also not clear what types of actions elements support, except by trial and error or as you suggest - source review. For example being able to click a div tag. But believe me, I am not complaining! I am extremely impressed by the capabilities of Watir. Scott >As far as I know, we have to look in the source, or find >out by trial and >error. If an attribute you are using is missing, please >let us know and we can >add it. >-Jonathan Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html From christopher.mcmahon at gmail.com Thu May 19 18:44:16 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 19 May 2005 16:44:16 -0600 Subject: [Wtr-general] JavaScript and WATIR In-Reply-To: References: Message-ID: <72799cd7050519154439a45d9e@mail.gmail.com> > HTML Document name=relay id= > src=/include/blank.htm > l > HTML Document name=main id= > src=/araneae/login > > > Any ideas how I can get to these fields? What you have here are frames. One frame has name "relay", the other frame has name "main. See the code examples in the watir "unittests" folder having to do with frames, and you should be able to get going pretty quickly. -Chris From jkohl at telusplanet.net Thu May 19 18:47:33 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Thu, 19 May 2005 15:47:33 -0700 Subject: [Wtr-general] JavaScript and WATIR In-Reply-To: References: Message-ID: <1116542853.428d17853f51b@webmail.telusplanet.net> It looks like there are a couple of frames on that page. I'd right click on the page you want to manipulate with Watir and find the HTML tags. To access the frames, you can do something like this: ie.frame("main") if your login field was the first text field on that page you could do this: ie.frame("main").text_field(:index , "1" ).set("user") Chris McMahon or one of our other frames experts could probably help more. -Jonathan Quoting Tuyet Cong-Ton-Nu : > Hello, > > I am using the WATIR User Guide to start developing one test case for > our Web application Login page. > > The problem is that in View/Source Code, there are no objects that I can > manipulate like text_field HTML tags, or submit HTML buttons. > I only see the javascript names: > > irb(main):025:0> show_all_objects > NameError: undefined local variable or method `show_all_objects' for > main:Object > > from (irb):25 > from :0 > irb(main):026:0> ie.show_all_objects > -----------Objects in page ------------- > id= src=/include/top.js > HTML Document name=relay id= > src=/include/blank.htm > l > HTML Document name=main id= > src=/araneae/login > > > Any ideas how I can get to these fields? > > -----Original Message----- > From: wtr-general-request at rubyforge.org > [mailto:wtr-general-request at rubyforge.org] > Sent: Tuesday, May 17, 2005 7:20 AM > To: wtr-general at rubyforge.org > Subject: Wtr-general Digest, Vol 18, Issue 24 > > > Send Wtr-general mailing list submissions to > wtr-general at rubyforge.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://rubyforge.org/mailman/listinfo/wtr-general > or, via email, send a message with subject or body 'help' to > wtr-general-request at rubyforge.org > > You can reach the person managing the list at > wtr-general-owner at rubyforge.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Wtr-general digest..." > > > Today's Topics: > > 1. RE: Is there any way to access Security Alert popup window > using Watir? (Bret Pettichord) > 2. Using ri with Watir (Bret Pettichord) > 3. List went down (Paul Rogers) > 4. H tags (Paul Rogers) > 5. Re: H tags (Bret Pettichord) > 6. RE: H tags (Paul Rogers) > 7. Watir cannot find deep links (Scott Pack) > 8. RE: Watir cannot find deep links (Cain, Mark) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 11 May 2005 15:51:16 -0500 > From: Bret Pettichord > Subject: RE: [Wtr-general] Is there any way to access Security Alert > popup window using Watir? > To: wtr-general at rubyforge.org > Message-ID: <5.1.0.14.2.20050511155103.03c4d308 at 127.0.0.1> > Content-Type: text/plain; charset="us-ascii"; format=flowed > > Added to the FAQ > > http://wtr.rubyforge.org/wiki/wiki.pl?FrequentQuestions > > At 03:00 PM 5/11/2005, Paul Rogers wrote: > >See an email with the subject > > > >RE: [Wtr-general] Problem with WindowLogonExample.rb > > > > >From yesterday, and several other posts in the last few days from Iain > > > >Paul > > _____________________ > Bret Pettichord > www.pettichord.com > > > > ------------------------------ > > Message: 2 > Date: Wed, 11 May 2005 20:50:30 -0500 > From: Bret Pettichord > Subject: [Wtr-general] Using ri with Watir > To: wtr-general at rubyforge.org > Message-ID: <5.1.0.14.2.20050511204737.03bfc420 at 127.0.0.1> > Content-Type: text/plain; charset="us-ascii"; format=flowed > > Here's something cool. > > In your copy of the extracted Watir zip file, run: > > rdoc --exclude "unittests|examples|install.rb" -r > > Now you can do > > ri Watir::IE > > and get documentation on Watir's IE class. See a method you want to know > more about? > > ri Watir::IE.attach > > And there it is. > > Give it a shot! > > _____________________ > Bret Pettichord > www.pettichord.com > > > > ------------------------------ > > Message: 3 > Date: Thu, 12 May 2005 16:13:18 -0600 > From: Paul Rogers > Subject: [Wtr-general] List went down > To: wtr-general at rubyforge.org > Message-ID: <004101c5573f$cd277b00$72d39044 at NewDell> > Content-Type: text/plain; charset=us-ascii > > The list went down sometime last night. I believe its fixed, but havent > seen any mail.... > > > > ------------------------------ > > Message: 4 > Date: Thu, 12 May 2005 16:51:35 -0600 > From: Paul Rogers > Subject: [Wtr-general] H tags > To: wtr-general at rubyforge.org > Message-ID: <004601c55745$264a9870$72d39044 at NewDell> > Content-Type: text/plain; charset=us-ascii > > Html supports this >

Text

>

Text

> > Does any one use these, need support for these? > > Im kind of interested, as this site > http://brothercake.com/site/resources/scripts/dbx/# has some really cool > stuff, but uses h tags. > If I add these tags we can probably automate some of the stuff on that > site, which would be very cool. However, Im not going to do it unless > there is some overwhelming need. > > Paul > > > > ------------------------------ > > Message: 5 > Date: Fri, 13 May 2005 14:27:47 -0500 > From: Bret Pettichord > Subject: Re: [Wtr-general] H tags > To: wtr-general at rubyforge.org > Message-ID: <5.1.0.14.2.20050513142334.03cbb408 at 127.0.0.1> > Content-Type: text/plain; charset="us-ascii"; format=flowed > > Paul, > > In Ruby it is easy to write methods that generate methods or classes. Using > this technique we could refactor the existing code so that it would only > take one line of code to provide support for a new tag. This would also > remove a lot of duplication from the existing code base. It's like > code-generation, except easier. > > When this is done, your issue becomes less of a dilemma. Because with Ruby, > you could always just add the support for the new tag outside of the Watir > library itself. > > Bret > > At 05:51 PM 5/12/2005, Paul Rogers wrote: > >Html supports this > >

Text

> >

Text

> > > >Does any one use these, need support for these? > > > >Im kind of interested, as this site > >http://brothercake.com/site/resources/scripts/dbx/# has some really cool > >stuff, but uses h tags. > >If I add these tags we can probably automate some of the stuff on that > >site, which would be very cool. However, Im not going to do it unless > >there is some overwhelming need. > > > >Paul > > > >_______________________________________________ > >Wtr-general mailing list > >Wtr-general at rubyforge.org > >http://rubyforge.org/mailman/listinfo/wtr-general > > _____________________ > Bret Pettichord > www.pettichord.com > > > > ------------------------------ > > Message: 6 > Date: Fri, 13 May 2005 14:08:07 -0600 > From: Paul Rogers > Subject: RE: [Wtr-general] H tags > To: wtr-general at rubyforge.org > Message-ID: <002901c557f7$7ad22c20$72d39044 at NewDell> > Content-Type: text/plain; charset=us-ascii > > As you're always telling me, write the test first. So the issue is not > so much of wether to add the h methods, but wether I need to write the > html and unit tests ;-) > > Unfortunately, I don't think its quite as easy, as just adding a method. > Some objects behave differently, eg, tables have no name attribute, so > the name method in the table class has to be overridden to support it. > Unless Im misunderstanidg how you would approach it. > > All I really wanted to do was write an autotest for frogger ;-) > > Paul > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord > Sent: 13 May 2005 13:28 > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] H tags > > > Paul, > > In Ruby it is easy to write methods that generate methods or classes. > Using > this technique we could refactor the existing code so that it would only > > take one line of code to provide support for a new tag. This would also > remove a lot of duplication from the existing code base. It's like > code-generation, except easier. > > When this is done, your issue becomes less of a dilemma. Because with > Ruby, > you could always just add the support for the new tag outside of the > Watir > library itself. > > Bret > > At 05:51 PM 5/12/2005, Paul Rogers wrote: > >Html supports this > >

Text

> >

Text

> > > >Does any one use these, need support for these? > > > >Im kind of interested, as this site > >http://brothercake.com/site/resources/scripts/dbx/# has some really > >cool stuff, but uses h tags. If I add these tags we can probably > >automate some of the stuff on that site, which would be very cool. > >However, Im not going to do it unless there is some overwhelming need. > > > >Paul > > > >_______________________________________________ > >Wtr-general mailing list > >Wtr-general at rubyforge.org > >http://rubyforge.org/mailman/listinfo/wtr-general > > _____________________ > Bret Pettichord > www.pettichord.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > > ------------------------------ > > Message: 7 > Date: Mon, 16 May 2005 19:02:03 -0700 > From: "Scott Pack" > Subject: [Wtr-general] Watir cannot find deep links > To: > Message-ID: <72CF38BC279AE24A83E96B9D67B45D870110D85F at mail.vykor.com> > Content-Type: text/plain; charset="iso-8859-1" > > In my application under test, I have objects that are inside tables that are > inside div tags. Watir cannot see these. Any ideas? Here is an example: > >
> > > > >
nowrap="nowrap"> > >
>
> > > > > > ------------------------------ > > Message: 8 > Date: Tue, 17 May 2005 07:28:54 -0700 > From: "Cain, Mark" > Subject: RE: [Wtr-general] Watir cannot find deep links > To: > Message-ID: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D217 at EX5V.rl.gov> > Content-Type: text/plain; charset="us-ascii" > > Scott, what I had to do was access the table by index--which I got by > doing a find on the page source and counting until the desired table is reached. > > > > table = $ie.table(:index, 8) > > > > # this is row 2 column 3 of table index 8 > > > > table[2][3].link(:text, /Administration/).click > > > > You could also try this using :url instead of :text, see the link > example in the unittest folder > > > > # Note if your click dynamically changes the table count (e.g. an > invisible # table is now visible or table rows are added/removed) then > you may need > > # to reinitialize your table for additional action. > > > > table = $ie.table(:index, 8) > > > > I hope this helps, > > > > --Mark > > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Scott Pack > Sent: Monday, May 16, 2005 7:02 PM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] Watir cannot find deep links > > > > In my application under test, I have objects that are inside tables that > are inside div tags. Watir cannot see these. Any ideas? Here is an > example: > > > >
> >
> > > > > > > >
align="left" nowrap="nowrap"> > > > >
> > > > > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://rubyforge.org/pipermail/wtr-general/attachments/20050517/c9f16ee7/att > achment.htm > > ------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > End of Wtr-general Digest, Vol 18, Issue 24 > ******************************************* > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From jkohl at telusplanet.net Thu May 19 18:48:55 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Thu, 19 May 2005 15:48:55 -0700 Subject: [Wtr-general] Tag attributes In-Reply-To: <20050519223245.59883.qmail@web32205.mail.mud.yahoo.com> References: <20050519223245.59883.qmail@web32205.mail.mud.yahoo.com> Message-ID: <1116542935.428d17d71f2fc@webmail.telusplanet.net> Thanks for the suggestion. Those are things we should get documented. I forgot to mention that the unit tests are a good place to look as well. I use them a lot to see how something works. -Jonathan Quoting Scott Pack : > Thanks for the information. > > As a suggestion, it would be great if this were in the > rdocs for each element type. It's also not clear what > types of actions elements support, except by trial and > error or as you suggest - source review. For example > being able to click a div tag. > > But believe me, I am not complaining! I am extremely > impressed by the capabilities of Watir. > > Scott > > >As far as I know, we have to look in the source, or > find >out by trial and > >error. If an attribute you are using is missing, > please >let us know and we can > >add it. > > >-Jonathan > > > > > > Yahoo! Mail > Stay connected, organized, and protected. Take the tour: > http://tour.mail.yahoo.com/mailtour.html > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From kc.baltz at firefox.co.uk Thu May 19 19:27:19 2005 From: kc.baltz at firefox.co.uk (K.C. Baltz) Date: Thu, 19 May 2005 16:27:19 -0700 Subject: [Wtr-general] Proper way to parameterize a test script? Message-ID: <428D20D7.2010502@firefox.co.uk> I'm not very familiar with Ruby, my expertise is in Java, so I need some help writing tests for my web app. I've gotten some scripts written, but before I distribute them to my fellow developers, I'd like to move all the values that are hardcoded in the scripts into some kind of .properties or .ini file. Values like hostname, username, password, etc. The options specific to the machine being tested. Specifically, I'd like to see a sample properties file and some sample Ruby code to read it. I'm going to go do some googling, but I thought I'd post this now so it has time to gather insight overnight. K.C. From alex at verk.info Thu May 19 20:17:08 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Thu, 19 May 2005 20:17:08 -0400 Subject: [Wtr-general] Proper way to parameterize a test script? In-Reply-To: <428D20D7.2010502@firefox.co.uk> References: <428D20D7.2010502@firefox.co.uk> Message-ID: K.C. Baltz wrote: > I'm not very familiar with Ruby, my expertise is in Java, so I need > some help writing tests for my web app. > > I've gotten some scripts written, but before I distribute them to my > fellow developers, I'd like to move all the values that are hardcoded > in the scripts into some kind of .properties or .ini file. Values > like hostname, username, password, etc. The options specific to the > machine being tested. > > Specifically, I'd like to see a sample properties file and some sample > Ruby code to read it. > > I'm going to go do some googling, but I thought I'd post this now so > it has time to gather insight overnight. > K.C. The easiest way to do it is to write your configuration file in pure Ruby, such as: --- config/properties.rb FOO = :value_of_foo BAR = :value_of_bar --- application.rb require 'config/properties.rb' -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) From ffrassaint at hotmail.com Fri May 20 03:58:56 2005 From: ffrassaint at hotmail.com (Fabrice FRASSAINT) Date: Fri, 20 May 2005 07:58:56 +0000 Subject: [Wtr-general] Proper way to parameterize a test script? In-Reply-To: <428D20D7.2010502@firefox.co.uk> Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050520/e72cd2b8/attachment.html From bret at pettichord.com Fri May 20 13:12:05 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 20 May 2005 12:12:05 -0500 Subject: [Wtr-general] Another Job Opening asking for Watir skills Message-ID: <5.1.0.14.2.20050520121120.032d5d18@127.0.0.1> >My company (http://www.DataCert.com) has an opening for a senior >tester in our Austin office. We're hoping to find a tester with >familiarity with agile processes and test automation with open source >tools like NFit/FitNesse, Selenium, or WATIR. The company is still >relatively new to agile development, so this is a good opportunity to >put your own stamp onto the company's processes and testing >infrastructure. > >If you or anybody you know would be interested, please contact me at: >jeremydmiller at yahoo.com. > >Thanks, > >Jeremy D. Miller _____________________ Bret Pettichord www.pettichord.com From kc.baltz at firefox.co.uk Fri May 20 13:50:34 2005 From: kc.baltz at firefox.co.uk (K.C. Baltz) Date: Fri, 20 May 2005 10:50:34 -0700 Subject: [Wtr-general] Proper way to parameterize a test script? In-Reply-To: References: <428D20D7.2010502@firefox.co.uk> Message-ID: <428E236A.9050100@firefox.co.uk> I knew it would be simple. Thanks! K.C. Alexey Verkhovsky wrote: > K.C. Baltz wrote: > >> I'm not very familiar with Ruby, my expertise is in Java, so I need >> some help writing tests for my web app. >> >> I've gotten some scripts written, but before I distribute them to my >> fellow developers, I'd like to move all the values that are hardcoded >> in the scripts into some kind of .properties or .ini file. Values >> like hostname, username, password, etc. The options specific to the >> machine being tested. >> >> Specifically, I'd like to see a sample properties file and some >> sample Ruby code to read it. >> >> I'm going to go do some googling, but I thought I'd post this now so >> it has time to gather insight overnight. >> K.C. > > > The easiest way to do it is to write your configuration file in pure > Ruby, such as: > > --- config/properties.rb > FOO = :value_of_foo > BAR = :value_of_bar > > --- application.rb > require 'config/properties.rb' > From david.a.boyd at boeing.com Fri May 20 16:28:59 2005 From: david.a.boyd at boeing.com (Boyd, David A) Date: Fri, 20 May 2005 16:28:59 -0400 Subject: [Wtr-general] Input Via onchange Message-ID: Hello! I have to test this: . Set ($ie.text_field(:name, "userid1").set("dave")) puts the userid1 in correctly, but doesn't trigger the onchange event. Nothing works unless the javascript code UseridBlur() is executed. UseridBlur sets the input to uppercase, checks for null input and shuffles the ID into another hidden field for use at Logon. What to do? Thanks, Dave Boyd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050520/a309ec8e/attachment.html From bret at pettichord.com Fri May 20 17:59:13 2005 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 20 May 2005 16:59:13 -0500 Subject: [Wtr-general] IE.attach Message-ID: <5.1.0.14.2.20050520165626.042409e8@127.0.0.1> I'd like to write code like this: ie = Watir::IE.attach(:title, /Timeclock/) ie.close if ie The problem is that IE.attach raises an exception if there is no matching window, rather than returning nil. Is this how attach should work? As it stands now, this is what i have to write: begin ie = Watir::IE.attach(:title, /Timeclock/) ie.close end _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Sat May 21 04:12:33 2005 From: bret at pettichord.com (Bret Pettichord) Date: Sat, 21 May 2005 03:12:33 -0500 Subject: [Wtr-general] Tag attributes In-Reply-To: <20050519223245.59883.qmail@web32205.mail.mud.yahoo.com> Message-ID: <5.1.0.14.2.20050521031009.0441aff8@127.0.0.1> At 05:32 PM 5/19/2005, Scott Pack wrote: >As a suggestion, it would be great if this were in the >rdocs for each element type. It's also not clear what >types of actions elements support, except by trial and >error or as you suggest - source review. For example >being able to click a div tag. Although the Rdocs for the attributes are sometimes incomplete, i believe all of the supported methods are there. In some cases -- such as Div#click -- you will have to look at the superclasses of the class. Bret _____________________ Bret Pettichord www.pettichord.com From alex at verk.info Sun May 22 16:49:58 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Sun, 22 May 2005 16:49:58 -0400 Subject: [Wtr-general] Proper way to parameterize a test script? In-Reply-To: <428E236A.9050100@firefox.co.uk> References: <428D20D7.2010502@firefox.co.uk> <428E236A.9050100@firefox.co.uk> Message-ID: K.C. Baltz wrote: > I knew it would be simple. Thanks! LOL. Did you know it would be THAT simple? :) From andy__s at hotmail.com Sun May 22 17:39:22 2005 From: andy__s at hotmail.com (Andy Sipe) Date: Sun, 22 May 2005 17:39:22 -0400 Subject: [Wtr-general] IE.attach In-Reply-To: <5.1.0.14.2.20050520165626.042409e8@127.0.0.1> Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050522/8e52eaff/attachment.html From paul.rogers at shaw.ca Sun May 22 23:34:06 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 22 May 2005 21:34:06 -0600 Subject: [Wtr-general] Handling non-existant links (and other objects) In-Reply-To: Message-ID: <008501c55f48$46125de0$72d39044@NewDell> It was done this way to support the exists? method. Wether that is still useful, or if this code needs refactoring... Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alexey Verkhovsky Sent: 17 May 2005 15:53 To: wtr-general at rubyforge.org Subject: [Wtr-general] Handling non-existant links (and other objects) I'm puzzled by the fact that ie.link(:url, '/non/existant/path') returns some sort of Null Object, instead of raising an error straight away? This behavior seems unintuitive and needs 60+ lines of repetitive code to support it (all references to object_exist_check, plus some more). Is there a reason why it can be useful? -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Sun May 22 23:37:49 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 22 May 2005 21:37:49 -0600 Subject: [Wtr-general] Input Via onchange In-Reply-To: Message-ID: <008601c55f48$caef4690$72d39044@NewDell> can you add it into the bugs tracker. Its not difficult to add this feature, but Id ned to do unit tests too. In the meantime you can do this: ie.text_field(:name , 'userid1').set('foo') ie.text_field(:name , 'userid1').fireEvent('onChange') this is valid in your case as the onchange only gets fired once the control loses focus Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyd, David A Sent: 20 May 2005 14:29 To: wtr-general at rubyforge.org Subject: [Wtr-general] Input Via onchange Hello! I have to test this: . Set ($ie.text_field(:name, "userid1").set("dave")) puts the userid1 in correctly, but doesn't trigger the onchange event. Nothing works unless the javascript code UseridBlur() is executed. UseridBlur sets the input to uppercase, checks for null input and shuffles the ID into another hidden field for use at Logon. What to do? Thanks, Dave Boyd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050522/878ad352/attachment.html From paul.rogers at shaw.ca Sun May 22 23:39:15 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 22 May 2005 21:39:15 -0600 Subject: [Wtr-general] Watir cannot find deep links In-Reply-To: <9C0BD1E3DAF1204D842D72E2DCE2A04ED1D217@EX5V.rl.gov> Message-ID: <008b01c55f48$fe400660$72d39044@NewDell> instead of looking at the html, try this ie.show_tables you should get a list of them all, then you can use ie.table(:index, x).flash to see if you got the right one -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: 17 May 2005 08:29 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Watir cannot find deep links Scott, what I had to do was access the table by index--which I got by doing a find on the page source and counting
  • Home
_______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050522/1e1a84d6/attachment.html From paul.rogers at shaw.ca Sun May 22 23:44:14 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 22 May 2005 21:44:14 -0600 Subject: [Wtr-general] Tag attributes In-Reply-To: <20050519223245.59883.qmail@web32205.mail.mud.yahoo.com> Message-ID: <009601c55f49$b0947da0$72d39044@NewDell> Im updating many of the docs for the next release. I'll try and update all this too. There are some fairly big changes happening too, that Bret and myself discussed last week, many of which Ive done, I just need to get checked in Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Scott Pack Sent: 19 May 2005 16:33 To: wtr-general at rubyforge.org Subject: [Wtr-general] Tag attributes Thanks for the information. As a suggestion, it would be great if this were in the rdocs for each element type. It's also not clear what types of actions elements support, except by trial and error or as you suggest - source review. For example being able to click a div tag. But believe me, I am not complaining! I am extremely impressed by the capabilities of Watir. Scott >As far as I know, we have to look in the source, or find >out by trial and >error. If an attribute you are using is missing, please >let us know and we can >add it. >-Jonathan Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From david.a.boyd at gmail.com Mon May 23 11:16:35 2005 From: david.a.boyd at gmail.com (David Boyd) Date: Mon, 23 May 2005 11:16:35 -0400 Subject: [Wtr-general] Input Via onchange In-Reply-To: <008601c55f48$caef4690$72d39044@NewDell> References: <008601c55f48$caef4690$72d39044@NewDell> Message-ID: Paul, That works great, thanks. Just didn't know about fireEvent. I'll try to put this in the bug list. Dave On 5/22/05, Paul Rogers wrote: > > can you add it into the bugs tracker. Its not difficult to add this feature, > but Id ned to do unit tests too. > > In the meantime you can do this: > > ie.text_field(:name , 'userid1').set('foo') > ie.text_field(:name , 'userid1').fireEvent('onChange') > > > this is valid in your case as the onchange only gets fired once the control > loses focus > > Paul > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of > Boyd, David A > Sent: 20 May 2005 14:29 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] Input Via onchange > > > > > Hello! > > I have to test this: onchange="UseridBlur()" >. > > Set ($ie.text_field(:name, "userid1").set("dave")) puts the userid1 in > correctly, but doesn't trigger the onchange event. Nothing works unless the > javascript code UseridBlur() is executed. UseridBlur sets the input to > uppercase, checks for null input and shuffles the ID into another hidden > field for use at Logon. > > What to do? > > Thanks, > > Dave Boyd > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > From kc.baltz at firefox.co.uk Mon May 23 12:08:56 2005 From: kc.baltz at firefox.co.uk (K.C. Baltz) Date: Mon, 23 May 2005 09:08:56 -0700 Subject: [Wtr-general] Proper way to parameterize a test script? In-Reply-To: References: Message-ID: <42920018.6070708@firefox.co.uk> I would like to see this code if you don't mind posting it. K.C. Fabrice FRASSAINT wrote: > Hello, > > You can also find a properties class in Ruby, I used it to create a > property file and get my parameters from it ! It is relatively easy to > use. > I could send the code if needed. > > Bye > > > >From: "K.C. Baltz" > >Reply-To: wtr-general at rubyforge.org > >To: wtr-general at rubyforge.org > >Subject: [Wtr-general] Proper way to parameterize a test script? > >Date: Thu, 19 May 2005 16:27:19 -0700 > > > >I'm not very familiar with Ruby, my expertise is in Java, so I need > >some help writing tests for my web app. > > > >I've gotten some scripts written, but before I distribute them to my > >fellow developers, I'd like to move all the values that are > >hardcoded in the scripts into some kind of .properties or .ini file. > > Values like hostname, username, password, etc. The options > >specific to the machine being tested. > > > >Specifically, I'd like to see a sample properties file and some > >sample Ruby code to read it. > > > >I'm going to go do some googling, but I thought I'd post this now so > >it has time to gather insight overnight. > > > >K.C. > > > >_______________________________________________ > >Wtr-general mailing list > >Wtr-general at rubyforge.org > >http://rubyforge.org/mailman/listinfo/wtr-general > >------------------------------------------------------------------------ > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > From paul.rogers at shaw.ca Mon May 23 13:15:57 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 23 May 2005 11:15:57 -0600 Subject: [Wtr-general] New features, bug fixes etc Message-ID: <000901c55fbb$158332d0$72d39044@NewDell> Ive added some new featuress and fixed a few bugs, summarised below. Bret has also been workin gon select boxes. Ie.form.flash is now supported Fix for ie.table(:index,1)[1][1].button(:index,1).flash Default attributes: You can now do ie.set_default_attribute( :index) ie.button(3).click It can be overridden for a specific element by ie.set_default_attribute_for_element( :select_list, :id) ie.select_list('my_id') I'll do a new release towards the end of this week, so shout if there are any urgent things you want Paul From paul.rogers at shaw.ca Mon May 23 13:17:45 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 23 May 2005 11:17:45 -0600 Subject: [Wtr-general] RE: New features, bug fixes etc Message-ID: <000a01c55fbb$55e76bc0$72d39044@NewDell> Also The iterators method now has a show method: Ie.buttons.show Ie.images.show For the default attribute, not all elements currently support it, but they should be done by the end of the week -----Original Message----- From: Paul Rogers [mailto:paul.rogers at shaw.ca] Sent: 23 May 2005 11:16 To: 'wtr-general at rubyforge.org' Subject: New features, bug fixes etc Ive added some new featuress and fixed a few bugs, summarised below. Bret has also been workin gon select boxes. Ie.form.flash is now supported Fix for ie.table(:index,1)[1][1].button(:index,1).flash Default attributes: You can now do ie.set_default_attribute( :index) ie.button(3).click It can be overridden for a specific element by ie.set_default_attribute_for_element( :select_list, :id) ie.select_list('my_id') I'll do a new release towards the end of this week, so shout if there are any urgent things you want Paul From jkohl at telusplanet.net Mon May 23 13:52:07 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Mon, 23 May 2005 11:52:07 -0600 Subject: [Wtr-general] Input Via onchange In-Reply-To: Message-ID: <20050523175211.MXES19994.priv-edtnes46.telusplanet.net@tintin> Added to the FAQ. This kind of thing is what prompted me "fire_event" support to Watir. There can be any number of events triggered that make JavaScript calls, so fire_event provides a way to trigger them when there isn't a mouse movement to do it. I worked on a web app that had tons of JavaScript with different events wired to different objects, which changed from page to page, (one would have an "onmouseup", another would do the same thing with "onmouseover" etc.) so it was hard to just have them included in a text_field method. -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of David Boyd > Sent: May 23, 2005 9:17 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Input Via onchange > > Paul, > > That works great, thanks. Just didn't know about fireEvent. I'll try > to put this in the bug list. > > Dave > > On 5/22/05, Paul Rogers wrote: > > > > can you add it into the bugs tracker. Its not difficult to add this > feature, > > but Id ned to do unit tests too. > > > > In the meantime you can do this: > > > > ie.text_field(:name , 'userid1').set('foo') > > ie.text_field(:name , 'userid1').fireEvent('onChange') > > > > > > this is valid in your case as the onchange only gets fired once the > control > > loses focus > > > > Paul > > > > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of > > Boyd, David A > > Sent: 20 May 2005 14:29 > > To: wtr-general at rubyforge.org > > Subject: [Wtr-general] Input Via onchange > > > > > > > > > > Hello! > > > > I have to test this: type="text" > > onchange="UseridBlur()" >. > > > > Set ($ie.text_field(:name, "userid1").set("dave")) puts the userid1 in > > correctly, but doesn't trigger the onchange event. Nothing works unless > the > > javascript code UseridBlur() is executed. UseridBlur sets the input to > > uppercase, checks for null input and shuffles the ID into another hidden > > field for use at Logon. > > > > What to do? > > > > Thanks, > > > > Dave Boyd > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From alex at verk.info Mon May 23 15:23:18 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Mon, 23 May 2005 15:23:18 -0400 Subject: [Wtr-general] IE.attach In-Reply-To: References: Message-ID: Andy Sipe wrote: > Ideally we could do something more along the lines of a null object > pattern implementation, but I'm unsure what default behavior could be > given. > In what sense is it ideal? What is the benefit? In my humble opinion, there is no problem here that needs to be solved by Null Object pattern. Raising an exception is precisely what the doctor prescribed. Same for ie.link(:name, 'non-existant-name') and the likes. -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) From paul.rogers at shaw.ca Mon May 23 17:08:10 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 23 May 2005 15:08:10 -0600 Subject: [Wtr-general] IE.attach In-Reply-To: Message-ID: <000f01c55fdb$86973460$72d39044@NewDell> Im not wishing to be argumentative, just that my response may come out that way ;-) What are the benefits of ie.link(:id, 'missing') raising an exception against using the exists method? I personally like the exists? Method as it's a simple way to determine if Ive gone to the place I think Ive gone to - using the Timeclock as an exapmple, if I log in as a new user, im taken to the 'create first job' page This has a check box on it. It's the only checkbox in the application, so a check on exists? Guarantees Im in the right place. If ie.checkbox(:name, 'background_job').exists? == false # not in the right place end Of course it could be done with an exception: Begin ie.checkbox(:name, 'background_job').?? # what method do I use that returns something meaningful?? to_s # maybe no method is needed Rescue # no check box, must be on the wrong page end Both seem equally valid, and as Alexey has pointed out the exception method takes less code internally There are several other situations where we do thigs differently, for example a frames throws the exception straithaway ( there is no exist? Method) Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alexey Verkhovsky Sent: 23 May 2005 13:23 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] IE.attach Andy Sipe wrote: > Ideally we could do something more along the lines of a null object > pattern implementation, but I'm unsure what default behavior could be > given. > In what sense is it ideal? What is the benefit? In my humble opinion, there is no problem here that needs to be solved by Null Object pattern. Raising an exception is precisely what the doctor prescribed. Same for ie.link(:name, 'non-existant-name') and the likes. -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Mon May 23 17:41:06 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 23 May 2005 16:41:06 -0500 Subject: [Wtr-general] IE.attach In-Reply-To: References: Message-ID: <5.1.0.14.2.20050523163905.02cb4870@127.0.0.1> This situation arises in the context of some training, and the current design forces me to teach how to catch exceptions. That's a bit more than what i wanted to do, but i don't want to over-design Watir just to avoid something like this. After all, it's not that hard to teach. Thanks for the perspective on this. Bret At 02:23 PM 5/23/2005, Alexey Verkhovsky wrote: >Andy Sipe wrote: > >>Ideally we could do something more along the lines of a null object >>pattern implementation, but I'm unsure what default behavior could be given. >In what sense is it ideal? What is the benefit? > >In my humble opinion, there is no problem here that needs to be solved by >Null Object pattern. Raising an exception is precisely what the doctor >prescribed. >Same for ie.link(:name, 'non-existant-name') and the likes. > >-- >Best regards, > >Alexey Verkhovsky > >Ruby Forum: http://ruby-forum.org (moderator) >RForum: http://rforum.andreas-s.net (co-author) >Instiki: http://instiki.org (maintainer) > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From alex at verk.info Mon May 23 20:06:53 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Mon, 23 May 2005 20:06:53 -0400 Subject: [Wtr-general] IE.attach In-Reply-To: <5.1.0.14.2.20050523163905.02cb4870@127.0.0.1> References: <5.1.0.14.2.20050523163905.02cb4870@127.0.0.1> Message-ID: Bret Pettichord wrote: > This situation arises in the context of some training, and the current > design forces me to teach how to catch exceptions. Aha, now I understand. :) Well, you can hide the concept of exception by wrapping 'assert_nothing_raised { link(:name, /foo/) }' as 'assert_exists link(:name, /foo/)', I guess. But on the other hand, the typical usage is: ie = Watir.IE 'google.com' ie.button(:name, 'non-existant').click This raises an exception anyway, so you still need to explain it, unless you want typical usage to look like ie = Watir.IE 'google.com' if ie.button(:name, 'non-existant').exists? ie.button(:name, 'non-existant').click else # what??? end Which obfuscates the actual purpose the code and just looks so... 1980s :) -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) From bret at pettichord.com Mon May 23 23:42:35 2005 From: bret at pettichord.com (Bret Pettichord) Date: Mon, 23 May 2005 22:42:35 -0500 Subject: [Wtr-general] New features, bug fixes etc In-Reply-To: <000901c55fbb$158332d0$72d39044@NewDell> Message-ID: <5.1.0.14.2.20050523224014.02cb1568@127.0.0.1> At 12:15 PM 5/23/2005, Paul Rogers wrote: >ie.set_default_attribute( :index) My sense is that explicit set- and get- methods smack of Java. I think it is more Ruby-esque (and more properly OO in a Bertrand Meyer's sense) to do this with attributes (or methods that expose an attribute interface). Thus: ie.default_attribute = :index Comments? _____________________ Bret Pettichord www.pettichord.com From paul.rogers at shaw.ca Mon May 23 23:57:18 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 23 May 2005 21:57:18 -0600 Subject: [Wtr-general] New features, bug fixes etc In-Reply-To: <5.1.0.14.2.20050523224014.02cb1568@127.0.0.1> Message-ID: <000201c56014$ae81c600$72d39044@NewDell> Ok, I'll update later in the week Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 23 May 2005 21:43 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] New features, bug fixes etc At 12:15 PM 5/23/2005, Paul Rogers wrote: >ie.set_default_attribute( :index) My sense is that explicit set- and get- methods smack of Java. I think it is more Ruby-esque (and more properly OO in a Bertrand Meyer's sense) to do this with attributes (or methods that expose an attribute interface). Thus: ie.default_attribute = :index Comments? _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Tue May 24 01:10:25 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 24 May 2005 00:10:25 -0500 Subject: [Wtr-general] Handling non-existant links (and other objects) In-Reply-To: <008501c55f48$46125de0$72d39044@NewDell> References: Message-ID: <5.1.0.14.2.20050524000259.02d33d90@127.0.0.1> I've shared Alexey's discomfort, but had accepted this as the price to pay for an exists? method. But now i see that it might be simpler all around to: 1. add assert_exists (it would verify that an object-not-found exception isn't thrown) 2. add assert_not_exists (it would verify that an object-not-found exception *is* thrown) (Note that this implicitly means that we're support the assertions.rb extensions in the watir package -- there is some other stuff in there that needs to be cleaned up.) What other situations would you want to use the exists? method in test scripts? Anyone? Bret At 10:34 PM 5/22/2005, Paul Rogers wrote: >It was done this way to support the exists? method. Wether that is still >useful, or if this code needs refactoring... > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alexey >Verkhovsky >Sent: 17 May 2005 15:53 >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Handling non-existant links (and other objects) > > >I'm puzzled by the fact that ie.link(:url, '/non/existant/path') returns > >some sort of Null Object, instead of raising an error straight away? >This behavior seems unintuitive and needs 60+ lines of repetitive code >to support it (all references to object_exist_check, plus some more). > >Is there a reason why it can be useful? > >-- >Best regards, > >Alexey Verkhovsky > >Ruby Forum: http://ruby-forum.org (moderator) >RForum: http://rforum.andreas-s.net (co-author) >Instiki: http://instiki.org (maintainer) > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Tue May 24 01:23:55 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 24 May 2005 00:23:55 -0500 Subject: [Wtr-general] Human and Hacker API's In-Reply-To: <20050523175211.MXES19994.priv-edtnes46.telusplanet.net@tin tin> References: Message-ID: <5.1.0.14.2.20050524001647.02d77400@127.0.0.1> I've been working on a new interface to the select_list object. I'm partway through and have checked in my current work. One thing that i've realized is that some of our methods are intended to replicate things that human users can do. But we also have methods that are back-doors, and open up the possibility of doing things that a human couldn't do (or to fix mistakes in how we replicate the human action, as is the case here). I'm thinking that the official API should only include things that humans can do. And if we are going to include other methods that expose the ability to do more than this, we should make it very clear. In the case of select_list, we have a clearSelection method that resets a option list. As far as i know, there is no way to do this by hand. So this method would be renamed _clear_selection, with an underscore in the front, to indicate that you aren't really testing like a human anymore. Or should we just remove this method? But then we have things like fire_event, which we don't want to remove, because it allows you to workaround all kinds of things (it's very hard to get all the right javascript events triggered, although we may eventually get it right.) So this would be _fire_event. Comments? At 12:52 PM 5/23/2005, Jonathan Kohl wrote: >Added to the FAQ. > >This kind of thing is what prompted me "fire_event" support to Watir. There >can be any number of events triggered that make JavaScript calls, so >fire_event provides a way to trigger them when there isn't a mouse movement >to do it. I worked on a web app that had tons of JavaScript with different >events wired to different objects, which changed from page to page, (one >would have an "onmouseup", another would do the same thing with >"onmouseover" etc.) so it was hard to just have them included in a >text_field method. > >-Jonathan > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > > bounces at rubyforge.org] On Behalf Of David Boyd > > Sent: May 23, 2005 9:17 AM > > To: wtr-general at rubyforge.org > > Subject: Re: [Wtr-general] Input Via onchange > > > > Paul, > > > > That works great, thanks. Just didn't know about fireEvent. I'll try > > to put this in the bug list. > > > > Dave > > > > On 5/22/05, Paul Rogers wrote: > > > > > > can you add it into the bugs tracker. Its not difficult to add this > > feature, > > > but Id ned to do unit tests too. > > > > > > In the meantime you can do this: > > > > > > ie.text_field(:name , 'userid1').set('foo') > > > ie.text_field(:name , 'userid1').fireEvent('onChange') > > > > > > > > > this is valid in your case as the onchange only gets fired once the > > control > > > loses focus > > > > > > Paul > > > > > > > > > -----Original Message----- > > > From: wtr-general-bounces at rubyforge.org > > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of > > > Boyd, David A > > > Sent: 20 May 2005 14:29 > > > To: wtr-general at rubyforge.org > > > Subject: [Wtr-general] Input Via onchange > > > > > > > > > > > > > > > Hello! > > > > > > I have to test this: > type="text" > > > onchange="UseridBlur()" >. > > > > > > Set ($ie.text_field(:name, "userid1").set("dave")) puts the userid1 in > > > correctly, but doesn't trigger the onchange event. Nothing works unless > > the > > > javascript code UseridBlur() is executed. UseridBlur sets the input to > > > uppercase, checks for null input and shuffles the ID into another hidden > > > field for use at Logon. > > > > > > What to do? > > > > > > Thanks, > > > > > > Dave Boyd > > > _______________________________________________ > > > Wtr-general mailing list > > > Wtr-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From jkohl at telusplanet.net Tue May 24 01:36:52 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Mon, 23 May 2005 23:36:52 -0600 Subject: [Wtr-general] Human and Hacker API's In-Reply-To: <5.1.0.14.2.20050524001647.02d77400@127.0.0.1> Message-ID: <20050524053650.RSFN16409.priv-edtnes40.telusplanet.net@tintin> I like your thoughts here. I would like to have support for the "non-human" methods because they are useful for different testing techniques. I frequently use these kinds of things for troubleshooting when tracking down a difficult bug, or for security testing. I'm not sure about only publicizing the human emulation kind of controls, but it would be good to differentiate between them as you mention. The other kinds of controls can be useful for simulating events that are hard to do as one person testing at a machine. I do like making the distinction between user emulation controls and the behind the scenes controls. I like doing simulation kinds of tests over doing regression tests, so being able to tinker with things programmatically helps. The fact that I can do something with Watir that I can't as a human helps with some of the testing I do. As for "clearSelection" for the option list, I wrote something like this using the old IE Controller to track down a so-called "unrepeatable bug". It ended up that it was a Struts bug that caused a select list to decrement on a form submit. It was tricky to nail down, but being able to loop submits and clear the selection list programmatically helped me nail it down quickly: http://www.kohl.ca/blog/archives/000003.html I did a combination of manual exploratory testing and Ruby scripting. -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of Bret Pettichord > Sent: May 23, 2005 11:24 PM > To: wtr-general at rubyforge.org > Subject: [Wtr-general] Human and Hacker API's > > I've been working on a new interface to the select_list object. I'm > partway > through and have checked in my current work. > > One thing that i've realized is that some of our methods are intended to > replicate things that human users can do. But we also have methods that > are > back-doors, and open up the possibility of doing things that a human > couldn't do (or to fix mistakes in how we replicate the human action, as > is > the case here). > > I'm thinking that the official API should only include things that humans > can do. > > And if we are going to include other methods that expose the ability to do > more than this, we should make it very clear. > > In the case of select_list, we have a clearSelection method that resets a > option list. As far as i know, there is no way to do this by hand. So this > method would be renamed _clear_selection, with an underscore in the front, > to indicate that you aren't really testing like a human anymore. Or should > we just remove this method? > > But then we have things like fire_event, which we don't want to remove, > because it allows you to workaround all kinds of things (it's very hard to > get all the right javascript events triggered, although we may eventually > get it right.) > > So this would be _fire_event. > > Comments? > > At 12:52 PM 5/23/2005, Jonathan Kohl wrote: > >Added to the FAQ. > > > >This kind of thing is what prompted me "fire_event" support to Watir. > There > >can be any number of events triggered that make JavaScript calls, so > >fire_event provides a way to trigger them when there isn't a mouse > movement > >to do it. I worked on a web app that had tons of JavaScript with > different > >events wired to different objects, which changed from page to page, (one > >would have an "onmouseup", another would do the same thing with > >"onmouseover" etc.) so it was hard to just have them included in a > >text_field method. > > > >-Jonathan > > > > > -----Original Message----- > > > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > > > bounces at rubyforge.org] On Behalf Of David Boyd > > > Sent: May 23, 2005 9:17 AM > > > To: wtr-general at rubyforge.org > > > Subject: Re: [Wtr-general] Input Via onchange > > > > > > Paul, > > > > > > That works great, thanks. Just didn't know about fireEvent. I'll try > > > to put this in the bug list. > > > > > > Dave > > > > > > On 5/22/05, Paul Rogers wrote: > > > > > > > > can you add it into the bugs tracker. Its not difficult to add this > > > feature, > > > > but Id ned to do unit tests too. > > > > > > > > In the meantime you can do this: > > > > > > > > ie.text_field(:name , 'userid1').set('foo') > > > > ie.text_field(:name , 'userid1').fireEvent('onChange') > > > > > > > > > > > > this is valid in your case as the onchange only gets fired once the > > > control > > > > loses focus > > > > > > > > Paul > > > > > > > > > > > > -----Original Message----- > > > > From: wtr-general-bounces at rubyforge.org > > > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of > > > > Boyd, David A > > > > Sent: 20 May 2005 14:29 > > > > To: wtr-general at rubyforge.org > > > > Subject: [Wtr-general] Input Via onchange > > > > > > > > > > > > > > > > > > > > Hello! > > > > > > > > I have to test this: > > type="text" > > > > onchange="UseridBlur()" >. > > > > > > > > Set ($ie.text_field(:name, "userid1").set("dave")) puts the userid1 > in > > > > correctly, but doesn't trigger the onchange event. Nothing works > unless > > > the > > > > javascript code UseridBlur() is executed. UseridBlur sets the input > to > > > > uppercase, checks for null input and shuffles the ID into another > hidden > > > > field for use at Logon. > > > > > > > > What to do? > > > > > > > > Thanks, > > > > > > > > Dave Boyd > > > > _______________________________________________ > > > > Wtr-general mailing list > > > > Wtr-general at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > > > > > > > _______________________________________________ > > > Wtr-general mailing list > > > Wtr-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > >_______________________________________________ > >Wtr-general mailing list > >Wtr-general at rubyforge.org > >http://rubyforge.org/mailman/listinfo/wtr-general > > _____________________ > Bret Pettichord > www.pettichord.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Tue May 24 01:55:33 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 24 May 2005 00:55:33 -0500 Subject: [Wtr-general] Human and Hacker API's In-Reply-To: <20050524053650.RSFN16409.priv-edtnes40.telusplanet.net@tintin> References: <5.1.0.14.2.20050524001647.02d77400@127.0.0.1> <20050524053650.RSFN16409.priv-edtnes40.telusplanet.net@tintin> Message-ID: <72799cd7050523225516e808d@mail.gmail.com> > I'm not sure about only publicizing the human emulation kind of controls, > but it would be good to differentiate between them as you mention. The other > kinds of controls can be useful for simulating events that are hard to do as > one person testing at a machine. I do like making the distinction between > user emulation controls and the behind the scenes controls. I like doing > simulation kinds of tests over doing regression tests, so being able to > tinker with things programmatically helps. The fact that I can do something > with Watir that I can't as a human helps with some of the testing I do. OK, first of all, "fire_event" is possibly the coolest part of WATIR. That and frames. I never distinguished between human stuff and API stuff-- once you've committed yourself to reading the HTML, doesn't that distinction disappear somewhat? While I'm not necessarily averse to leading underscores, it seems to me that methods are methods, and HTML is code, and distinguishing between clicky things and hacker things will only make trouble down the road. As usual, I could be wrong. -Chris From Jan.Montano at thomson.com Tue May 24 03:02:12 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Tue, 24 May 2005 15:02:12 +0800 Subject: [Wtr-general] Watir/ruby assistance. Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE09@tfphmanilmul01.ERF.THOMSON.COM> Hi! I'm new to Watir, and also new to ruby. I'm having a hard time searching for documents regarding the IE class. I just want to have a list of properties and methods or events of IE.text_field, IE.forms... etc. I want to know the different functions of each so that I can code my test scripts well. Please point me in the right direction. Suggestions will be appreciated. Thank you. From zeljko.filipin at gmail.com Tue May 24 03:21:22 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 24 May 2005 09:21:22 +0200 Subject: [Wtr-general] Watir/ruby assistance. In-Reply-To: <71EA7CA4B789864F9B3AC722A7F016B68DBE09@tfphmanilmul01.ERF.THOMSON.COM> Message-ID: <4292d5ca.421a4eaa.7eeb.2e95@mx.gmail.com> Go to start > All programs > Watir > Watir API reference (or C:\watir_bonus\rdoc\index.html, both paths are informative only). In Classes frame select Watir::IE (then Watir::TextField, then Watir::Form...) and read all about it. :) If I was not clear enough, do not hesitate to ask again. Zeljko -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jan.Montano at thomson.com Sent: Tuesday, May 24, 2005 9:02 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Watir/ruby assistance. Hi! I'm new to Watir, and also new to ruby. I'm having a hard time searching for documents regarding the IE class. I just want to have a list of properties and methods or events of IE.text_field, IE.forms... etc. I want to know the different functions of each so that I can code my test scripts well. Please point me in the right direction. Suggestions will be appreciated. Thank you. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Jan.Montano at thomson.com Tue May 24 04:11:03 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Tue, 24 May 2005 16:11:03 +0800 Subject: [Wtr-general] alertbox Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE0A@tfphmanilmul01.ERF.THOMSON.COM> Hi. It's me again. I've already found the document for CIE. I have another question though. Does watir support alertbox/messagebox/confirmationbox? What are watir's limitation. Thanks! From Jan.Montano at thomson.com Tue May 24 04:35:57 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Tue, 24 May 2005 16:35:57 +0800 Subject: [Wtr-general] alertbox Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE0B@tfphmanilmul01.ERF.THOMSON.COM> Found it already. Sorry for the trouble. Thanks. From Jan.Montano at thomson.com Tue May 24 05:39:00 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Tue, 24 May 2005 17:39:00 +0800 Subject: [Wtr-general] Alertmessage/messagebox/popup Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE0C@tfphmanilmul01.ERF.THOMSON.COM> I know I've been flooding the group the whole day. I just nid to finish my test script in time, so whenever there's something I can't solve right away, I email you guys just in case. Sorry again to bother you its regarding the alertmessage. whenever this pops up whether it's from a link or a button, irb waits for the popup to be clicked before any command can be processed. If this is the case, how can I programatically click the box (OK) using watir. I tried to assert, but the popup still appears. Is there a way to bypass this one, and retrieve the result of the click at the same time? Please advise. From zeljko.filipin at gmail.com Tue May 24 05:48:36 2005 From: zeljko.filipin at gmail.com (Zeljko Filipin) Date: Tue, 24 May 2005 11:48:36 +0200 Subject: [Wtr-general] Alertmessage/messagebox/popup In-Reply-To: <71EA7CA4B789864F9B3AC722A7F016B68DBE0C@tfphmanilmul01.ERF.THOMSON.COM> Message-ID: <4292f84b.39797f44.799d.0720@mx.gmail.com> I did not work with watir and pop-ups, but here you can find some answers. http://wtr.rubyforge.org/wiki/wiki.pl?FrequentQuestions -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jan.Montano at thomson.com Sent: Tuesday, May 24, 2005 11:39 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Alertmessage/messagebox/popup I know I've been flooding the group the whole day. I just nid to finish my test script in time, so whenever there's something I can't solve right away, I email you guys just in case. Sorry again to bother you its regarding the alertmessage. whenever this pops up whether it's from a link or a button, irb waits for the popup to be clicked before any command can be processed. If this is the case, how can I programatically click the box (OK) using watir. I tried to assert, but the popup still appears. Is there a way to bypass this one, and retrieve the result of the click at the same time? Please advise. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From ati.ozgur at gmail.com Tue May 24 08:27:03 2005 From: ati.ozgur at gmail.com (Atilla Ozgur) Date: Tue, 24 May 2005 15:27:03 +0300 Subject: [Wtr-general] Alertmessage/messagebox/popup In-Reply-To: <4292f84b.39797f44.799d.0720@mx.gmail.com> References: <71EA7CA4B789864F9B3AC722A7F016B68DBE0C@tfphmanilmul01.ERF.THOMSON.COM> <4292f84b.39797f44.799d.0720@mx.gmail.com> Message-ID: There is a test named jscript_test in unit tests. Look for that tests and related html files. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050524/fd6d9a13/attachment.html From alex at verk.info Tue May 24 09:09:20 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Tue, 24 May 2005 09:09:20 -0400 Subject: [Wtr-general] New features, bug fixes etc In-Reply-To: <5.1.0.14.2.20050523224014.02cb1568@127.0.0.1> References: <5.1.0.14.2.20050523224014.02cb1568@127.0.0.1> Message-ID: Bret Pettichord wrote: > I think it is more Ruby-esque (and more properly OO in a Bertrand > Meyer's sense) to do this with attributes (or methods that expose an > attribute interface). Thus: > ie.default_attribute = :index You are right. -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) From paul.rogers at shaw.ca Tue May 24 09:27:35 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 07:27:35 -0600 Subject: [Wtr-general] Human and Hacker API's In-Reply-To: <5.1.0.14.2.20050524001647.02d77400@127.0.0.1> Message-ID: <000d01c56064$594509e0$72d39044@NewDell> Clear_selection does have a human api On a multi list box ( C:\watir_bonus\unitTests\html\selectboxes1.html - the second list ) , click an item to select it, hold ctrl and click it again, its unselected I don't think there is any equivalent for single item boxes. I think that your idea is worthwhile doing. I assume that this will be a watir 2.0 thing as the api will now be different? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 23 May 2005 23:24 To: wtr-general at rubyforge.org Subject: [Wtr-general] Human and Hacker API's I've been working on a new interface to the select_list object. I'm partway through and have checked in my current work. One thing that i've realized is that some of our methods are intended to replicate things that human users can do. But we also have methods that are back-doors, and open up the possibility of doing things that a human couldn't do (or to fix mistakes in how we replicate the human action, as is the case here). I'm thinking that the official API should only include things that humans can do. And if we are going to include other methods that expose the ability to do more than this, we should make it very clear. In the case of select_list, we have a clearSelection method that resets a option list. As far as i know, there is no way to do this by hand. So this method would be renamed _clear_selection, with an underscore in the front, to indicate that you aren't really testing like a human anymore. Or should we just remove this method? But then we have things like fire_event, which we don't want to remove, because it allows you to workaround all kinds of things (it's very hard to get all the right javascript events triggered, although we may eventually get it right.) So this would be _fire_event. Comments? At 12:52 PM 5/23/2005, Jonathan Kohl wrote: >Added to the FAQ. > >This kind of thing is what prompted me "fire_event" support to Watir. >There can be any number of events triggered that make JavaScript calls, >so fire_event provides a way to trigger them when there isn't a mouse >movement to do it. I worked on a web app that had tons of JavaScript >with different events wired to different objects, which changed from >page to page, (one would have an "onmouseup", another would do the same >thing with "onmouseover" etc.) so it was hard to just have them >included in a text_field method. > >-Jonathan > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > > bounces at rubyforge.org] On Behalf Of David Boyd > > Sent: May 23, 2005 9:17 AM > > To: wtr-general at rubyforge.org > > Subject: Re: [Wtr-general] Input Via onchange > > > > Paul, > > > > That works great, thanks. Just didn't know about fireEvent. I'll > > try to put this in the bug list. > > > > Dave > > > > On 5/22/05, Paul Rogers wrote: > > > > > > can you add it into the bugs tracker. Its not difficult to add > > > this > > feature, > > > but Id ned to do unit tests too. > > > > > > In the meantime you can do this: > > > > > > ie.text_field(:name , 'userid1').set('foo') ie.text_field(:name , > > > 'userid1').fireEvent('onChange') > > > > > > > > > this is valid in your case as the onchange only gets fired once > > > the > > control > > > loses focus > > > > > > Paul > > > > > > > > > -----Original Message----- > > > From: wtr-general-bounces at rubyforge.org > > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyd, > > > David A > > > Sent: 20 May 2005 14:29 > > > To: wtr-general at rubyforge.org > > > Subject: [Wtr-general] Input Via onchange > > > > > > > > > > > > > > > Hello! > > > > > > I have to test this: > type="text" > > > onchange="UseridBlur()" >. > > > > > > Set ($ie.text_field(:name, "userid1").set("dave")) puts the > > > userid1 in correctly, but doesn't trigger the onchange event. > > > Nothing works unless > > the > > > javascript code UseridBlur() is executed. UseridBlur sets the > > > input to uppercase, checks for null input and shuffles the ID into > > > another hidden field for use at Logon. > > > > > > What to do? > > > > > > Thanks, > > > > > > Dave Boyd > > > _______________________________________________ > > > Wtr-general mailing list > > > Wtr-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From andy__s at hotmail.com Tue May 24 10:23:33 2005 From: andy__s at hotmail.com (Andy Sipe) Date: Tue, 24 May 2005 10:23:33 -0400 Subject: [Wtr-general] IE.attach In-Reply-To: <42922DA6.6080707@verk.info> Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050524/d551adad/attachment.html From jkohl at telusplanet.net Tue May 24 10:35:01 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Tue, 24 May 2005 07:35:01 -0700 Subject: [Wtr-general] Human and Hacker API's In-Reply-To: <72799cd7050523225516e808d@mail.gmail.com> References: <5.1.0.14.2.20050524001647.02d77400@127.0.0.1> <20050524053650.RSFN16409.priv-edtnes40.telusplanet.net@tintin> <72799cd7050523225516e808d@mail.gmail.com> Message-ID: <1116945301.42933b9522f59@webmail.telusplanet.net> > OK, first of all, "fire_event" is possibly the coolest part of WATIR. > That and frames. I never distinguished between human stuff and API > stuff-- once you've committed yourself to reading the HTML, doesn't > that distinction disappear somewhat? While I'm not necessarily > averse to leading underscores, it seems to me that methods are > methods, and HTML is code, and distinguishing between clicky things > and hacker things will only make trouble down the road. > > As usual, I could be wrong. I thought about this some more this morning, and I started to get worried about the leading underscores being confusing from a usability standpoint. I agree with what you've said here, and if we are afraid of exposing "hacker" things that people might abuse, that ship has probably sailed with other tools. It makes more sense to do those kinds of things at the HTTP layer anyway. I agree with Chris - and I think it could be confusing. -Jonathan From paul.rogers at shaw.ca Tue May 24 11:19:43 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 09:19:43 -0600 Subject: [Wtr-general] Problem with multiple frames In-Reply-To: <20050511195315.35935.qmail@web32213.mail.mud.yahoo.com> Message-ID: <001301c56074$0318ffd0$72d39044@NewDell> so the bug I thought was causing this wasnt the problem. I'd like to add your code to fix this problem, but Im reluctant to do so until we have a failing test. I will look into using webbrick as the source for a slow page and see if we can get some tests to fail Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lorenzo Jorquera Sent: 11 May 2005 13:53 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Problem with multiple frames Well, I am using the modified version of waitForIE that I sent in the begining of this thread (Ruby ability to modify existent classes in the fly is so cool!), and it is working OK. Lorenzo. Paul Rogers escribi?: my mail is all out of order! There is a bug in here when you use subframes. Its not hard to fix it, but may have repurcussions. I'll discuss it with Bret next week. Is the sleep solution ok for you to use for now? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lorenzo Jorquera Sent: 11 May 2005 08:58 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Problem with multiple frames I added some code to waitForIE to check that sub-frames (frames whitin frames) where ready. I wrote this method to check that: def wait_sub_frames(doc) if allFrames = doc.frames count = allFrames.length for i in 0..count-1 do until allFrames.frames[i.to_s].document.readyState == "complete" puts("waiting for: " + allFrames[i.to_s].name.to_s) sleep 0.02 end wait_sub_frames(allFrames[i.to_s]) end end end And added a call to it in waitForIE, just after it checks that a frame is ready: def wait( noSleep = false ) begin @down_load_time=0 pageLoadStart = Time.now @pageHasReloaded= false s= Spinner.new(@enable_spinner) while @ie.busy @pageHasReloaded = true sleep 0.02 s.spin end s.reverse log "waitForIE: readystate=" + @ie.readyState.to_s until @ie.readyState == READYSTATE_COMPLETE @pageHasReloaded = true sleep 0.02 s.spin end sleep 0.02 until @ie.document.readyState == "complete" sleep 0.02 s.spin end if @ie.document.frames.length > 1 begin 0.upto @ie.document.frames.length-1 do |i| until @ie.document.frames[i.to_s].document.readyState == "complete" sleep 0.02 s.spin end wait_sub_frames(@ie.document.frames[i.to_s].document) @url_l! ! ist << @ie.document.frames[i.to_s].document.url unless url_list.include?(@ie.document.frames[i.to_s].document.url) end rescue=>e @logger.warn 'frame error in wait' + e.to_s + "\n" + e.backtrace.join("\n") end else @url_list << @ie.document.url unless @url_list.include?(@ie.document.url) end @down_load_time = Time.now - pageLoadStart run_error_checks() print "\b" unless @enable_spinner == false s=nil rescue WIN32OLERuntimeError => e @logger.warn 'runtime error in wait ' # + e.to_s end sleep 0.01 sleep @defaultSleepTime unless noSleep == true end alias waitForIE wait . ! ! The result was that a number of messages "waiting for ...." where printed. This messages (printed by wait_sub_frames) should only be printed if a frame is ready but a frame within it is not. So, I would say that checking only that the top level frames are ready is not enough to be sure that a page has loaded, and that subframes should also be checked. What do you think? Lorenzo Jorquera escribi?: No, all the frames are hosted by the same server (and I am not getting any access denied warning). If I put an sleep after clicking the div, everything works fine... The server is running very slowly and the page takes for ever to load, could this be fooling waitForIE ? Bret Pettichord escribi?: Yes, but not if the frames are hosted by a different server -- in this case you'll get an access denied warning. At 11:25 AM 5/10/2005, Lorenzo Jorquera wrote: >Hi, > I am having a problem while testing an aplication. After clicking in a > Div object, it looks like watir is returning control to the test script > before the page has finished loading, causing that the script can?t find > objects that are suposed to be there... > The application has frames nested in several levels. I took a look into > waitForIE, and it looks like it waits for the ie to be ready and then it > waits for each frame in ie to be ready too. Does this cover also the > frames nested in the top level frames? > Thanks in advance, > Lorenzo. > > > >Do You Yahoo!? >Todo lo que quieres saber de E! ! ! stados Unidos, Am?rica Latina y el resto del >Mundo. >Vis?ta >Yahoo! >Noticias. >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _____ Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _____ Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _____ Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050524/74525591/attachment.html From paul.rogers at shaw.ca Tue May 24 11:19:24 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 09:19:24 -0600 Subject: [Wtr-general] Input Via onchange In-Reply-To: <20050523175211.MXES19994.priv-edtnes46.telusplanet.net@tintin> Message-ID: <001201c56073$f7f325e0$72d39044@NewDell> This keeps coming up, and then you remind me why I never added it ;-) I have a suggestion here to address your concerns about which events to fire, it also ties in well with Brets suggestion for a hacker api and a human api We have the value= method on a text field that sets the value and fires no events. So the set method should probably fire all appropriate events. That way we get a human form (set) and a hacker form( value= ) which we can customize to do any event by using the fire_event method Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jonathan Kohl Sent: 23 May 2005 11:52 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Input Via onchange Added to the FAQ. This kind of thing is what prompted me "fire_event" support to Watir. There can be any number of events triggered that make JavaScript calls, so fire_event provides a way to trigger them when there isn't a mouse movement to do it. I worked on a web app that had tons of JavaScript with different events wired to different objects, which changed from page to page, (one would have an "onmouseup", another would do the same thing with "onmouseover" etc.) so it was hard to just have them included in a text_field method. -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of David Boyd > Sent: May 23, 2005 9:17 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Input Via onchange > > Paul, > > That works great, thanks. Just didn't know about fireEvent. I'll try > to put this in the bug list. > > Dave > > On 5/22/05, Paul Rogers wrote: > > > > can you add it into the bugs tracker. Its not difficult to add this > feature, > > but Id ned to do unit tests too. > > > > In the meantime you can do this: > > > > ie.text_field(:name , 'userid1').set('foo') ie.text_field(:name , > > 'userid1').fireEvent('onChange') > > > > > > this is valid in your case as the onchange only gets fired once the > control > > loses focus > > > > Paul > > > > > > -----Original Message----- > > From: wtr-general-bounces at rubyforge.org > > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyd, David > > A > > Sent: 20 May 2005 14:29 > > To: wtr-general at rubyforge.org > > Subject: [Wtr-general] Input Via onchange > > > > > > > > > > Hello! > > > > I have to test this: type="text" > > onchange="UseridBlur()" >. > > > > Set ($ie.text_field(:name, "userid1").set("dave")) puts the userid1 > > in correctly, but doesn't trigger the onchange event. Nothing works > > unless > the > > javascript code UseridBlur() is executed. UseridBlur sets the input > > to uppercase, checks for null input and shuffles the ID into another > > hidden field for use at Logon. > > > > What to do? > > > > Thanks, > > > > Dave Boyd > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From lorenzo_jorquera at yahoo.com Tue May 24 11:47:41 2005 From: lorenzo_jorquera at yahoo.com (Lorenzo Jorquera) Date: Tue, 24 May 2005 10:47:41 -0500 (CDT) Subject: [Wtr-general] Problem with multiple frames In-Reply-To: <001301c56074$0318ffd0$72d39044@NewDell> Message-ID: <20050524154741.90304.qmail@web32214.mail.mud.yahoo.com> I was wondering if it is posible to serve two frames from two different threads in the webbrick server... that way you could make one of the threads much slower. If I have the time I will give it a shot. Paul Rogers escribi?: so the bug I thought was causing this wasnt the problem. I'd like to add your code to fix this problem, but Im reluctant to do so until we have a failing test. I will look into using webbrick as the source for a slow page and see if we can get some tests to fail Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lorenzo Jorquera Sent: 11 May 2005 13:53 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Problem with multiple frames Well, I am using the modified version of waitForIE that I sent in the begining of this thread (Ruby ability to modify existent classes in the fly is so cool!), and it is working OK. Lorenzo. Paul Rogers escribi?: my mail is all out of order! There is a bug in here when you use subframes. Its not hard to fix it, but may have repurcussions. I'll discuss it with Bret next week. Is the sleep solution ok for you to use for now? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lorenzo Jorquera Sent: 11 May 2005 08:58 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Problem with multiple frames I added some code to waitForIE to check that sub-frames (frames whitin frames) where ready. I wrote this method to check that: def wait_sub_frames(doc) if allFrames = doc.frames count = allFrames.length for i in 0..count-1 do until allFrames.frames[i.to_s].document.readyState == "complete" puts("waiting for: " + allFrames[i.to_s].name.to_s) sleep 0.02 end wait_sub_frames(allFrames[i.to_s]) end end end And added a call to it in waitForIE, just after it checks that a frame is ready: def wait( noSleep = false ) begin @down_load_time=0 pageLoadStart = Time.now @pageHasReloaded= false s= Spinner.new(@enable_spinner) while @ie.busy @pageHasReloaded = true sleep 0.02 s.spin end s.reverse log "waitForIE: readystate=" + @ie.readyState.to_s until @ie.readyState == READYSTATE_COMPLETE @pageHasReloaded = true sleep 0.02 s.spin end sleep 0.02 until @ie.document.readyState == "complete" sleep 0.02 s.spin end if @ie.document.frames.length > 1 begin 0.upto @ie.document.frames.length-1 do |i| until @ie.document.frames[i.to_s].document.readyState == "complete" sleep 0.02 s.spin end wait_sub_frames(@ie.document.frames[i.to_s].document) @url_l! ! ist << @ie.document.frames[i.to_s].document.url unless url_list.include?(@ie.document.frames[i.to_s].document.url) end rescue=>e @logger.warn 'frame error in wait' + e.to_s + "\n" + e.backtrace.join("\n") end else @url_list << @ie.document.url unless @url_list.include?(@ie.document.url) end @down_load_time = Time.now - pageLoadStart run_error_checks() print "\b" unless @enable_spinner == false s=nil rescue WIN32OLERuntimeError => e @logger.warn 'runtime error in wait ' # + e.to_s end sleep 0.01 sleep @defaultSleepTime unless noSleep == true end alias waitForIE wait . ! ! The result was that a number of messages "waiting for ...." where printed. This messages (printed by wait_sub_frames) should only be printed if a frame is ready but a frame within it is not. So, I would say that checking only that the top level frames are ready is not enough to be sure that a page has loaded, and that subframes should also be checked. What do you think? Lorenzo Jorquera escribi?: No, all the frames are hosted by the same server (and I am not getting any access denied warning). If I put an sleep after clicking the div, everything works fine... The server is running very slowly and the page takes for ever to load, could this be fooling waitForIE ? Bret Pettichord escribi?: Yes, but not if the frames are hosted by a different server -- in this case you'll get an access denied warning. At 11:25 AM 5/10/2005, Lorenzo Jorquera wrote: >Hi, > I am having a problem while testing an aplication. After clicking in a > Div object, it looks like watir is returning control to the test script > before the page has finished loading, causing that the script can?t find > objects that are suposed to be there... > The application has frames nested in several levels. I took a look into > waitForIE, and it looks like it waits for the ie to be ready and then it > waits for each frame in ie to be ready too. Does this cover also the > frames nested in the top level frames? > Thanks in advance, > Lorenzo. > > > >Do You Yahoo!? >Todo lo que quieres saber de E! ! ! stados Unidos, Am?rica Latina y el resto del >Mundo. >Vis?ta >Yahoo! >Noticias. >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general --------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general --------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general --------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general --------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050524/a5e28a2b/attachment.html From shaorobics at gmail.com Tue May 24 13:13:46 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Tue, 24 May 2005 13:13:46 -0400 Subject: [Wtr-general] problem with page refresh & variables Message-ID: <593b9ae80505241013ecdc45d@mail.gmail.com> I'm testing a webpage that has a table with rows of products and a few columns for each product that contains check boxes that can be checked off Right when I get to this page, I locate the row (product) I'm interested in and I SAVE all of the objects in each column for that product into variables. for example a = $ie.checkbox(:id, /BF/) b = $ie.checkbox(:id, /TF/) ... I check off some checkboxes, by doing a.set --> which works fine hit the update button, which then refreshes the page. If I now try to access the checkbox and do a.clear I get the error: ERROR: Error!! Aborting Test Case --> c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2 112:in `invoke': Unknown property or method `disabled' HRESULT error code:0x80070005 Access is denied. Any idea why a saved object b4 a page refresh can't be accessed after a page refresh? From jfry at lyris.com Tue May 24 13:14:15 2005 From: jfry at lyris.com (Jeff Fry) Date: Tue, 24 May 2005 10:14:15 -0700 Subject: [Wtr-general] Human and Hacker API's In-Reply-To: <1116945301.42933b9522f59@webmail.telusplanet.net> References: <5.1.0.14.2.20050524001647.02d77400@127.0.0.1> <20050524053650.RSFN16409.priv-edtnes40.telusplanet.net@tintin> <72799cd7050523225516e808d@mail.gmail.com> <1116945301.42933b9522f59@webmail.telusplanet.net> Message-ID: <429360E7.9070607@lyris.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050524/7331a462/attachment.html From jkohl at telusplanet.net Tue May 24 13:45:41 2005 From: jkohl at telusplanet.net (jkohl at telusplanet.net) Date: Tue, 24 May 2005 10:45:41 -0700 Subject: [Wtr-general] two API's In-Reply-To: <429360E7.9070607@lyris.com> References: <5.1.0.14.2.20050524001647.02d77400@127.0.0.1> <20050524053650.RSFN16409.priv-edtnes40.telusplanet.net@tintin> <72799cd7050523225516e808d@mail.gmail.com> <1116945301.42933b9522f59@webmail.telusplanet.net> <429360E7.9070607@lyris.com> Message-ID: <1116956741.429368459de38@webmail.telusplanet.net> Whatever we choose, I feel very strongly that we should not be using the term "hacker API" at all. It has way too many negative connotations, and could really come back to haunt us. I'm starting to cringe whenever I see the term in the emails today (even my own). :) While technically, a "hacker" isn't someone who is malicious, it has come to be accepted that disfavoured stakeholders who are up to no good are called "hackers". I don't think we want the tool to be associated with that kind of behaviour. Furthermore, doing a fire_event or clearing a selection box and those sorts of things are not really effective for web site exploitation. SQL Injection, Cross site scripting, etc. etc. are the common exploit methods. We could do some of these things to test apps using Watir, just as you can with HTTPUnit and other tools. So whatever we decide, can we stop using the term "hacker API"? I'd feel a lot better. :) Thanks; -Jonathan From ziplux at comcast.net Tue May 24 16:11:32 2005 From: ziplux at comcast.net (Jared Luxenberg) Date: Tue, 24 May 2005 16:11:32 -0400 Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript alert box Message-ID: <42938A74.3030403@comcast.net> On my computer, when I run the unittests/jscript_test.rb unit test, a Javascript alert() box comes up that says "Press OK". The box does not go away automatically. If I press OK, the box goes away but nothing else happens and it looks like the unit test is waiting for something to happen. This happens with the latest release (1.3.1) and the CVS as of 5/24/05 at 4pm. Isn't WATIR supposed to click the button automatically? I ask because I'm trying to use WATIR to test my applicaiton, and I need to be able to click the OK button in javascript alerts. Any help would be appreciated, Jared -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 254 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050524/eda5d9d2/attachment.bin From paul.rogers at shaw.ca Tue May 24 16:57:26 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 14:57:26 -0600 Subject: [Wtr-general] problem with page refresh & variables In-Reply-To: <593b9ae80505241013ecdc45d@mail.gmail.com> Message-ID: <005101c560a3$30cbde50$72d39044@NewDell> The objects that use assign to a and b no longer exist once the page has reloaded, so you would need to do a = $ie.checkbox(:id, /BF/) b = $ie.checkbox(:id, /TF/) a.set --> which works fine #hit the update button, which then refreshes the page. If I now try to access the checkbox and do # a and b no longer exist, so need to redifene them a = $ie.checkbox(:id, /BF/) b = $ie.checkbox(:id, /TF/) a.clear Perhaps we need a refresh method, so that ou could do a = $ie.checkbox(:id, /BF/) b = $ie.checkbox(:id, /TF/) a.set --> which works fine #hit the update button, which then refreshes the page. If I now try to access the checkbox and do # a and b no longer exist, so need to redifene them a.refresh b.refresh a.clear -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 24 May 2005 11:14 To: wtr-general at rubyforge.org Subject: [Wtr-general] problem with page refresh & variables I'm testing a webpage that has a table with rows of products and a few columns for each product that contains check boxes that can be checked off Right when I get to this page, I locate the row (product) I'm interested in and I SAVE all of the objects in each column for that product into variables. for example a = $ie.checkbox(:id, /BF/) b = $ie.checkbox(:id, /TF/) ... I check off some checkboxes, by doing a.set --> which works fine hit the update button, which then refreshes the page. If I now try to access the checkbox and do a.clear I get the error: ERROR: Error!! Aborting Test Case --> c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2 112:in `invoke': Unknown property or method `disabled' HRESULT error code:0x80070005 Access is denied. Any idea why a saved object b4 a page refresh can't be accessed after a page refresh? _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From shaorobics at gmail.com Tue May 24 17:10:00 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Tue, 24 May 2005 17:10:00 -0400 Subject: [Wtr-general] problem with page refresh & variables In-Reply-To: <005101c560a3$30cbde50$72d39044@NewDell> References: <593b9ae80505241013ecdc45d@mail.gmail.com> <005101c560a3$30cbde50$72d39044@NewDell> Message-ID: <593b9ae8050524141030e05545@mail.gmail.com> Hi Paul, that would be helpful if Ruby would have such a method :) I think it is important because 1. if you have a lot of data to sort through, (going row by row) and once you find it, you want to store it's information conveniently for quick retrieval during later use. 2. right now, to find all objects associated with a certain row, I have to search from the top of the table to the bottom (which is fine if I only do that once) but since those objects lose its values after a refresh, I have to perform that search all over again and reassign those variables which takes up time Regardless, I'm still extremely happy with Watir! :) Shao On 5/24/05, Paul Rogers wrote: > The objects that use assign to a and b no longer exist once the page has > reloaded, so you would need to do > > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > > a.set --> which works fine > > > #hit the update button, which then refreshes the page. If I now try to > access the checkbox and do > > # a and b no longer exist, so need to redifene them > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > > > a.clear > > > Perhaps we need a refresh method, so that ou could do > > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > > a.set --> which works fine > > > #hit the update button, which then refreshes the page. If I now try to > access the checkbox and do > > # a and b no longer exist, so need to redifene them > > a.refresh > b.refresh > a.clear > > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 24 May 2005 11:14 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] problem with page refresh & variables > > > I'm testing a webpage that has a table with rows of products and a few > columns for each product that contains check boxes that can be checked > off > > > Right when I get to this page, I locate the row (product) I'm interested > in and I SAVE all of the objects in each column for that product into > variables. > > for example > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > ... > > I check off some checkboxes, by doing > > a.set --> which works fine > > hit the update button, which then refreshes the page. If I now try to > access the checkbox and do > > a.clear > > I get the error: > > ERROR: Error!! Aborting Test Case --> > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2 > 112:in `invoke': Unknown property or method `disabled' > HRESULT error code:0x80070005 > Access is denied. > > > Any idea why a saved object b4 a page refresh can't be accessed after a > page refresh? > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Tue May 24 17:18:05 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 15:18:05 -0600 Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript alert box In-Reply-To: <42938A74.3030403@comcast.net> Message-ID: <005301c560a6$1374b360$72d39044@NewDell> Works ok for me c:\watir_bonus\unitTests>jscript_test.rb Loaded suite c:/watir_bonus/unitTests/jscript_test Started .... Finished in 4.141 seconds. 4 tests, 4 assertions, 0 failures, 0 errors If you goto irb, and type the following, does that work ( you should get an extra line appear in the console) require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') autoit.Send "{ENTER}" -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg Sent: 24 May 2005 14:12 To: wtr-general at rubyforge.org Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript alert box On my computer, when I run the unittests/jscript_test.rb unit test, a Javascript alert() box comes up that says "Press OK". The box does not go away automatically. If I press OK, the box goes away but nothing else happens and it looks like the unit test is waiting for something to happen. This happens with the latest release (1.3.1) and the CVS as of 5/24/05 at 4pm. Isn't WATIR supposed to click the button automatically? I ask because I'm trying to use WATIR to test my applicaiton, and I need to be able to click the OK button in javascript alerts. Any help would be appreciated, Jared From paul.rogers at shaw.ca Tue May 24 17:32:57 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 15:32:57 -0600 Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript alert box In-Reply-To: <42938A74.3030403@comcast.net> Message-ID: <005801c560a8$26d28430$72d39044@NewDell> It looks to me like you don't have autoit installed. We need to fix the code to raise an excepton if the autoit activex control isnt found Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg Sent: 24 May 2005 14:12 To: wtr-general at rubyforge.org Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript alert box On my computer, when I run the unittests/jscript_test.rb unit test, a Javascript alert() box comes up that says "Press OK". The box does not go away automatically. If I press OK, the box goes away but nothing else happens and it looks like the unit test is waiting for something to happen. This happens with the latest release (1.3.1) and the CVS as of 5/24/05 at 4pm. Isn't WATIR supposed to click the button automatically? I ask because I'm trying to use WATIR to test my applicaiton, and I need to be able to click the OK button in javascript alerts. Any help would be appreciated, Jared From ziplux at comcast.net Tue May 24 17:42:40 2005 From: ziplux at comcast.net (Jared Luxenberg) Date: Tue, 24 May 2005 17:42:40 -0400 Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript alert box In-Reply-To: <005801c560a8$26d28430$72d39044@NewDell> References: <005801c560a8$26d28430$72d39044@NewDell> Message-ID: <42939FD0.3020300@comcast.net> Ah, yes that was the problem. I found AutoIt and installed it. The AutoIt install step should be added to the user guide, and the tests should probably raise an exception Thanks for the quick response, Jared Paul Rogers wrote: >It looks to me like you don't have autoit installed. > >We need to fix the code to raise an excepton if the autoit activex >control isnt found > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 14:12 >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >alert box > > >On my computer, when I run the unittests/jscript_test.rb unit test, a >Javascript alert() box comes up that says "Press OK". The box does not >go away automatically. If I press OK, the box goes away but nothing >else happens and it looks like the unit test is waiting for something to > >happen. This happens with the latest release (1.3.1) and the CVS as of >5/24/05 at 4pm. > >Isn't WATIR supposed to click the button automatically? I ask because >I'm trying to use WATIR to test my applicaiton, and I need to be able to > >click the OK button in javascript alerts. > >Any help would be appreciated, >Jared > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 254 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050524/960d14d2/attachment.bin From paul.rogers at shaw.ca Tue May 24 17:50:17 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 15:50:17 -0600 Subject: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box In-Reply-To: <42939FD0.3020300@comcast.net> Message-ID: <005f01c560aa$93368de0$72d39044@NewDell> The installer should install the autoit activex control for you. Did you use the gui installer? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg Sent: 24 May 2005 15:43 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box Ah, yes that was the problem. I found AutoIt and installed it. The AutoIt install step should be added to the user guide, and the tests should probably raise an exception Thanks for the quick response, Jared Paul Rogers wrote: >It looks to me like you don't have autoit installed. > >We need to fix the code to raise an excepton if the autoit activex >control isnt found > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 14:12 >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >alert box > > >On my computer, when I run the unittests/jscript_test.rb unit test, a >Javascript alert() box comes up that says "Press OK". The box does not >go away automatically. If I press OK, the box goes away but nothing >else happens and it looks like the unit test is waiting for something to > >happen. This happens with the latest release (1.3.1) and the CVS as of >5/24/05 at 4pm. > >Isn't WATIR supposed to click the button automatically? I ask because >I'm trying to use WATIR to test my applicaiton, and I need to be able to > >click the OK button in javascript alerts. > >Any help would be appreciated, >Jared > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > From tuyet.ctn at mscibarra.com Tue May 24 18:11:11 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Tue, 24 May 2005 15:11:11 -0700 Subject: [Wtr-general] Access is denied and Exception Errors Message-ID: Hi, I am not sure why I am getting this "Access is denied" error. How do I find out what the HRESILT code means or what the Exceptions mean? I also tried to follow your suggestions Chris and Jonathan, but can't seem to get to the "main" frame or the "relay" frame due to the Access Denied problem. Sorry, I am a newbie, and it's hard to tell whether the problem is caused by the real application, or maybe my settings/file locations are not correct. Any help is very much appreciated! I just want to prove to my manager that we can use Watir and I have to at least get my 1 test case working (which is to Login to the application). Thanks! irb(main):004:0> ie.goto("https://qa-common-b4.dev.com") W, [24-May-2005 14:48:58#2132] WARN -- : frame error in waitdocument OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `method_missing' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `upto' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1332:in `goto' (irb):4:in `irb_binding' C:/ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' :0 W, [24-May-2005 14:48:58#2132] WARN -- : runtime error in wait => 0.281 irb(main):005:0> ie.show_all_objects -----------Objects in page ------------- id= src=/include/top.js HTML Document name=relay id= src=/include/blank.htm l HTML Document name=main id= src=/araneae/login => nil irb(main):006:0> ie.show_frames there are 2 frames frame index: 0 --Access Denied-- frame index: 1 --Access Denied-- => 0..1 From paul.rogers at shaw.ca Tue May 24 18:24:43 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 16:24:43 -0600 Subject: [Wtr-general] Access is denied and Exception Errors In-Reply-To: Message-ID: <006201c560af$6277f860$72d39044@NewDell> Don't worry about the OLE exception you see. The access denied means that we cant access parts of the page as its hosted on a different domain. Im curious why the 2 show_ methods do different things though, I'll try and look into it You can probably access the frames using this puts ie.frame(:index,1).text puts ie.frame(:index,2).text You should see the text from each frame displayed in the console Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Tuyet Cong-Ton-Nu Sent: 24 May 2005 16:11 To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] Access is denied and Exception Errors Hi, I am not sure why I am getting this "Access is denied" error. How do I find out what the HRESILT code means or what the Exceptions mean? I also tried to follow your suggestions Chris and Jonathan, but can't seem to get to the "main" frame or the "relay" frame due to the Access Denied problem. Sorry, I am a newbie, and it's hard to tell whether the problem is caused by the real application, or maybe my settings/file locations are not correct. Any help is very much appreciated! I just want to prove to my manager that we can use Watir and I have to at least get my 1 test case working (which is to Login to the application). Thanks! irb(main):004:0> ie.goto("https://qa-common-b4.dev.com") W, [24-May-2005 14:48:58#2132] WARN -- : frame error in waitdocument OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `method_missing' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `upto' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1332:in `goto' (irb):4:in `irb_binding' C:/ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' :0 W, [24-May-2005 14:48:58#2132] WARN -- : runtime error in wait => 0.281 irb(main):005:0> ie.show_all_objects -----------Objects in page ------------- id= src=/include/top.js HTML Document name=relay id= src=/include/blank.htm l HTML Document name=main id= src=/araneae/login => nil irb(main):006:0> ie.show_frames there are 2 frames frame index: 0 --Access Denied-- frame index: 1 --Access Denied-- => 0..1 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Tue May 24 18:28:15 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 16:28:15 -0600 Subject: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box In-Reply-To: <42939FD0.3020300@comcast.net> Message-ID: <006301c560af$e0ae74c0$72d39044@NewDell> Ive checked in a version of this test that raises an exception if autoit isnt found Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg Sent: 24 May 2005 15:43 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box Ah, yes that was the problem. I found AutoIt and installed it. The AutoIt install step should be added to the user guide, and the tests should probably raise an exception Thanks for the quick response, Jared Paul Rogers wrote: >It looks to me like you don't have autoit installed. > >We need to fix the code to raise an excepton if the autoit activex >control isnt found > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 14:12 >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >alert box > > >On my computer, when I run the unittests/jscript_test.rb unit test, a >Javascript alert() box comes up that says "Press OK". The box does not >go away automatically. If I press OK, the box goes away but nothing >else happens and it looks like the unit test is waiting for something to > >happen. This happens with the latest release (1.3.1) and the CVS as of >5/24/05 at 4pm. > >Isn't WATIR supposed to click the button automatically? I ask because >I'm trying to use WATIR to test my applicaiton, and I need to be able to > >click the OK button in javascript alerts. > >Any help would be appreciated, >Jared > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > From paul.rogers at shaw.ca Tue May 24 18:47:42 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 16:47:42 -0600 Subject: [Wtr-general] problem with page refresh & variables In-Reply-To: <593b9ae8050524141030e05545@mail.gmail.com> Message-ID: <006401c560b2$9827d680$72d39044@NewDell> Ive added it for spans, divs and p tags, and there is a unit test too. I'll add it for other objects now Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 24 May 2005 15:10 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] problem with page refresh & variables Hi Paul, that would be helpful if Ruby would have such a method :) I think it is important because 1. if you have a lot of data to sort through, (going row by row) and once you find it, you want to store it's information conveniently for quick retrieval during later use. 2. right now, to find all objects associated with a certain row, I have to search from the top of the table to the bottom (which is fine if I only do that once) but since those objects lose its values after a refresh, I have to perform that search all over again and reassign those variables which takes up time Regardless, I'm still extremely happy with Watir! :) Shao On 5/24/05, Paul Rogers wrote: > The objects that use assign to a and b no longer exist once the page > has reloaded, so you would need to do > > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > > a.set --> which works fine > > > #hit the update button, which then refreshes the page. If I now try > to access the checkbox and do > > # a and b no longer exist, so need to redifene them > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > > > a.clear > > > Perhaps we need a refresh method, so that ou could do > > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > > a.set --> which works fine > > > #hit the update button, which then refreshes the page. If I now try > to access the checkbox and do > > # a and b no longer exist, so need to redifene them > > a.refresh > b.refresh > a.clear > > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 24 May 2005 11:14 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] problem with page refresh & variables > > > I'm testing a webpage that has a table with rows of products and a few > columns for each product that contains check boxes that can be checked > off > > > Right when I get to this page, I locate the row (product) I'm > interested in and I SAVE all of the objects in each column for that > product into variables. > > for example > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > ... > > I check off some checkboxes, by doing > > a.set --> which works fine > > hit the update button, which then refreshes the page. If I now try to > access the checkbox and do > > a.clear > > I get the error: > > ERROR: Error!! Aborting Test Case --> > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2 > 112:in `invoke': Unknown property or method `disabled' > HRESULT error code:0x80070005 > Access is denied. > > > Any idea why a saved object b4 a page refresh can't be accessed after > a page refresh? > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From ziplux at comcast.net Tue May 24 19:32:14 2005 From: ziplux at comcast.net (Jared Luxenberg) Date: Tue, 24 May 2005 19:32:14 -0400 Subject: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box In-Reply-To: <005f01c560aa$93368de0$72d39044@NewDell> References: <005f01c560aa$93368de0$72d39044@NewDell> Message-ID: <4293B97E.9010900@comcast.net> Yes, I ran the install.rb file and had the "Install AutoIt" checkbox checked. - Jared Paul Rogers wrote: >The installer should install the autoit activex control for you. Did you >use the gui installer? > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 15:43 >To: wtr-general at rubyforge.org >Subject: Re: [Wtr-general] Unable to click the "Ok" button in a >Javascriptalert box > > >Ah, yes that was the problem. I found AutoIt and installed it. The >AutoIt install step should be added to the user guide, and the tests >should probably raise an exception > >Thanks for the quick response, >Jared > >Paul Rogers wrote: > > > >>It looks to me like you don't have autoit installed. >> >>We need to fix the code to raise an excepton if the autoit activex >>control isnt found >> >>Paul >> >>-----Original Message----- >>From: wtr-general-bounces at rubyforge.org >>[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >>Sent: 24 May 2005 14:12 >>To: wtr-general at rubyforge.org >>Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >>alert box >> >> >>On my computer, when I run the unittests/jscript_test.rb unit test, a >>Javascript alert() box comes up that says "Press OK". The box does not >> >> > > > >>go away automatically. If I press OK, the box goes away but nothing >>else happens and it looks like the unit test is waiting for something >> >> >to > > >>happen. This happens with the latest release (1.3.1) and the CVS as of >>5/24/05 at 4pm. >> >>Isn't WATIR supposed to click the button automatically? I ask because >>I'm trying to use WATIR to test my applicaiton, and I need to be able >> >> >to > > >>click the OK button in javascript alerts. >> >>Any help would be appreciated, >>Jared >> >>_______________________________________________ >>Wtr-general mailing list >>Wtr-general at rubyforge.org >>http://rubyforge.org/mailman/listinfo/wtr-general >> >> >> >> >> > > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 254 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050524/3ab9ef97/attachment.bin From alex at verk.info Tue May 24 19:52:41 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Tue, 24 May 2005 19:52:41 -0400 Subject: [Wtr-general] IE.attach In-Reply-To: References: Message-ID: Andy Sipe wrote: > On another note, are you the Alexey who is the maintainer of the > Test/Unit Report project? > Email me. I'm surprised to hear that this project has any real users - except that I used it myself while I needed it :) -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) From ziplux at comcast.net Tue May 24 19:53:42 2005 From: ziplux at comcast.net (Jared Luxenberg) Date: Tue, 24 May 2005 19:53:42 -0400 Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript alert box (still not working) In-Reply-To: <005801c560a8$26d28430$72d39044@NewDell> References: <005801c560a8$26d28430$72d39044@NewDell> Message-ID: <4293BE86.3030309@comcast.net> This is odd. It turns out I did have AutoIt installed before I ran the AutoIt installer. After running the AutoIt installer, I re-ran the jscript_test.rb test and it worked. But I just ran the test again, and now it's not working anymore. I have the latest version of Ruby, and I just grabbed the most recent CVS copy of Watir a minute ago. If I un-register the AutoIt DLL, the test produces an error, but if I re-register the DLL the test does the same thing as before (doesn't give me an error, but doesn't work either). - Jared Paul Rogers wrote: >It looks to me like you don't have autoit installed. > >We need to fix the code to raise an excepton if the autoit activex >control isnt found > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 14:12 >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >alert box > > >On my computer, when I run the unittests/jscript_test.rb unit test, a >Javascript alert() box comes up that says "Press OK". The box does not >go away automatically. If I press OK, the box goes away but nothing >else happens and it looks like the unit test is waiting for something to > >happen. This happens with the latest release (1.3.1) and the CVS as of >5/24/05 at 4pm. > >Isn't WATIR supposed to click the button automatically? I ask because >I'm trying to use WATIR to test my applicaiton, and I need to be able to > >click the OK button in javascript alerts. > >Any help would be appreciated, >Jared > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 254 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050524/78ed43ab/attachment.bin From ziplux at comcast.net Tue May 24 19:55:55 2005 From: ziplux at comcast.net (Jared Luxenberg) Date: Tue, 24 May 2005 19:55:55 -0400 Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript alert box In-Reply-To: <005301c560a6$1374b360$72d39044@NewDell> References: <005301c560a6$1374b360$72d39044@NewDell> Message-ID: <4293BF0B.7090206@comcast.net> >If you goto irb, and type the following, does that work ( you should get >an extra line appear in the console) > > >require 'win32ole' >autoit = WIN32OLE.new('AutoItX3.Control') >autoit.Send "{ENTER}" > > Yes, that works fine. The unit test worked once, but I just tried it again and it's not working anymore. - Jared -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 254 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050524/83d69698/attachment.bin From ziplux at comcast.net Tue May 24 20:16:32 2005 From: ziplux at comcast.net (Jared Luxenberg) Date: Tue, 24 May 2005 20:16:32 -0400 Subject: [Wtr-general] [patch] Unable to click the "Ok" button in a Javascript alert box (resolved) In-Reply-To: <4293BE86.3030309@comcast.net> References: <005801c560a8$26d28430$72d39044@NewDell> <4293BE86.3030309@comcast.net> Message-ID: <4293C3E0.5060503@comcast.net> Ah, I see the problem. I was running the unit tests from a directory with a space in the name. When I run them from E:\watir_bonus\unittests\ they work fine. My fix is to put the Ruby script that you're running in quotes when the call to rubyw is made. I've attached patches to the files popups_test.rb and jscript_test.rb to fix this problem. - Jared P.S. sorry if this isn't the right place to submit patches but I didn't see a patch mailing list Jared Luxenberg wrote: > This is odd. It turns out I did have AutoIt installed before I ran > the AutoIt installer. > > After running the AutoIt installer, I re-ran the jscript_test.rb test > and it worked. But I just ran the test again, and now it's not > working anymore. I have the latest version of Ruby, and I just > grabbed the most recent CVS copy of Watir a minute ago. If I > un-register the AutoIt DLL, the test produces an error, but if I > re-register the DLL the test does the same thing as before (doesn't > give me an error, but doesn't work either). > > - Jared > > Paul Rogers wrote: > >> It looks to me like you don't have autoit installed. >> >> We need to fix the code to raise an excepton if the autoit activex >> control isnt found >> >> Paul >> >> -----Original Message----- >> From: wtr-general-bounces at rubyforge.org >> [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >> Sent: 24 May 2005 14:12 >> To: wtr-general at rubyforge.org >> Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >> alert box >> >> >> On my computer, when I run the unittests/jscript_test.rb unit test, a >> Javascript alert() box comes up that says "Press OK". The box does >> not go away automatically. If I press OK, the box goes away but >> nothing else happens and it looks like the unit test is waiting for >> something to >> >> happen. This happens with the latest release (1.3.1) and the CVS as >> of 5/24/05 at 4pm. >> >> Isn't WATIR supposed to click the button automatically? I ask >> because I'm trying to use WATIR to test my applicaiton, and I need to >> be able to >> >> click the OK button in javascript alerts. >> >> Any help would be appreciated, >> Jared >> >> _______________________________________________ >> Wtr-general mailing list >> Wtr-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-general >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: popups_test.patch Url: http://rubyforge.org/pipermail/wtr-general/attachments/20050524/3e3834b9/attachment.pl -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: jscript_test.patch Url: http://rubyforge.org/pipermail/wtr-general/attachments/20050524/3e3834b9/attachment-0001.pl -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 254 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050524/3e3834b9/attachment.bin From paul.rogers at shaw.ca Tue May 24 20:17:18 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 18:17:18 -0600 Subject: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box In-Reply-To: <4293BF0B.7090206@comcast.net> Message-ID: <007b01c560bf$1c805680$72d39044@NewDell> Odd, I just ran mine 6 times in a row. I don't know what could cause that. What windows are you using? Do you have any weird security settings? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg Sent: 24 May 2005 17:56 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box >If you goto irb, and type the following, does that work ( you should >get an extra line appear in the console) > > >require 'win32ole' >autoit = WIN32OLE.new('AutoItX3.Control') >autoit.Send "{ENTER}" > > Yes, that works fine. The unit test worked once, but I just tried it again and it's not working anymore. - Jared From tuyet.ctn at mscibarra.com Tue May 24 20:27:26 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Tue, 24 May 2005 17:27:26 -0700 Subject: [Wtr-general] RE: Access is denied and Exception Errors Message-ID: Hi Paul, I tried your suggestion and it still has the Access Denied issue. I am not sure what to do about the page being hosted on a different domain! Thanks again for your help. I don't want to give up!: irb(main):028:0> puts ie.frame(:index,1).text WIN32OLERuntimeError: document OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1844:in `method_missing' from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1844:in `getDocument' from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1534:in `text' from (irb):28 from :0 irb(main):029:0> puts ie.frame(:index,2).text WIN32OLERuntimeError: document OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1844:in `method_missing' from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1844:in `getDocument' from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1534:in `text' from (irb):29 from :0 -----Original Message----- From: wtr-general-request at rubyforge.org [mailto:wtr-general-request at rubyforge.org] Sent: Tuesday, May 24, 2005 4:47 PM To: wtr-general at rubyforge.org Subject: Wtr-general Digest, Vol 18, Issue 34 Send Wtr-general mailing list submissions to wtr-general at rubyforge.org To subscribe or unsubscribe via the World Wide Web, visit http://rubyforge.org/mailman/listinfo/wtr-general or, via email, send a message with subject or body 'help' to wtr-general-request at rubyforge.org You can reach the person managing the list at wtr-general-owner at rubyforge.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Wtr-general digest..." Today's Topics: 1. RE: Unable to click the "Ok" button in a Javascriptalert box (Paul Rogers) 2. Access is denied and Exception Errors (Tuyet Cong-Ton-Nu) 3. RE: Access is denied and Exception Errors (Paul Rogers) 4. RE: Unable to click the "Ok" button in a Javascriptalert box (Paul Rogers) 5. RE: problem with page refresh & variables (Paul Rogers) 6. Re: Unable to click the "Ok" button in a Javascriptalert box (Jared Luxenberg) 7. Re: IE.attach (Alexey Verkhovsky) 8. Re: Unable to click the "Ok" button in a Javascript alert box (still not working) (Jared Luxenberg) ---------------------------------------------------------------------- Message: 1 Date: Tue, 24 May 2005 15:50:17 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box To: wtr-general at rubyforge.org Message-ID: <005f01c560aa$93368de0$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii The installer should install the autoit activex control for you. Did you use the gui installer? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg Sent: 24 May 2005 15:43 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box Ah, yes that was the problem. I found AutoIt and installed it. The AutoIt install step should be added to the user guide, and the tests should probably raise an exception Thanks for the quick response, Jared Paul Rogers wrote: >It looks to me like you don't have autoit installed. > >We need to fix the code to raise an excepton if the autoit activex >control isnt found > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 14:12 >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >alert box > > >On my computer, when I run the unittests/jscript_test.rb unit test, a >Javascript alert() box comes up that says "Press OK". The box does not >go away automatically. If I press OK, the box goes away but nothing >else happens and it looks like the unit test is waiting for something to > >happen. This happens with the latest release (1.3.1) and the CVS as of >5/24/05 at 4pm. > >Isn't WATIR supposed to click the button automatically? I ask because >I'm trying to use WATIR to test my applicaiton, and I need to be able to > >click the OK button in javascript alerts. > >Any help would be appreciated, >Jared > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > ------------------------------ Message: 2 Date: Tue, 24 May 2005 15:11:11 -0700 From: Tuyet Cong-Ton-Nu Subject: [Wtr-general] Access is denied and Exception Errors To: "'wtr-general at rubyforge.org'" Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi, I am not sure why I am getting this "Access is denied" error. How do I find out what the HRESILT code means or what the Exceptions mean? I also tried to follow your suggestions Chris and Jonathan, but can't seem to get to the "main" frame or the "relay" frame due to the Access Denied problem. Sorry, I am a newbie, and it's hard to tell whether the problem is caused by the real application, or maybe my settings/file locations are not correct. Any help is very much appreciated! I just want to prove to my manager that we can use Watir and I have to at least get my 1 test case working (which is to Login to the application). Thanks! irb(main):004:0> ie.goto("https://qa-common-b4.dev.com") W, [24-May-2005 14:48:58#2132] WARN -- : frame error in waitdocument OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `method_missing' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `upto' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1332:in `goto' (irb):4:in `irb_binding' C:/ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' :0 W, [24-May-2005 14:48:58#2132] WARN -- : runtime error in wait => 0.281 irb(main):005:0> ie.show_all_objects -----------Objects in page ------------- id= src=/include/top.js HTML Document name=relay id= src=/include/blank.htm l HTML Document name=main id= src=/araneae/login => nil irb(main):006:0> ie.show_frames there are 2 frames frame index: 0 --Access Denied-- frame index: 1 --Access Denied-- => 0..1 ------------------------------ Message: 3 Date: Tue, 24 May 2005 16:24:43 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Access is denied and Exception Errors To: wtr-general at rubyforge.org Message-ID: <006201c560af$6277f860$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii Don't worry about the OLE exception you see. The access denied means that we cant access parts of the page as its hosted on a different domain. Im curious why the 2 show_ methods do different things though, I'll try and look into it You can probably access the frames using this puts ie.frame(:index,1).text puts ie.frame(:index,2).text You should see the text from each frame displayed in the console Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Tuyet Cong-Ton-Nu Sent: 24 May 2005 16:11 To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] Access is denied and Exception Errors Hi, I am not sure why I am getting this "Access is denied" error. How do I find out what the HRESILT code means or what the Exceptions mean? I also tried to follow your suggestions Chris and Jonathan, but can't seem to get to the "main" frame or the "relay" frame due to the Access Denied problem. Sorry, I am a newbie, and it's hard to tell whether the problem is caused by the real application, or maybe my settings/file locations are not correct. Any help is very much appreciated! I just want to prove to my manager that we can use Watir and I have to at least get my 1 test case working (which is to Login to the application). Thanks! irb(main):004:0> ie.goto("https://qa-common-b4.dev.com") W, [24-May-2005 14:48:58#2132] WARN -- : frame error in waitdocument OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `method_missing' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `upto' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1332:in `goto' (irb):4:in `irb_binding' C:/ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' :0 W, [24-May-2005 14:48:58#2132] WARN -- : runtime error in wait => 0.281 irb(main):005:0> ie.show_all_objects -----------Objects in page ------------- id= src=/include/top.js HTML Document name=relay id= src=/include/blank.htm l HTML Document name=main id= src=/araneae/login => nil irb(main):006:0> ie.show_frames there are 2 frames frame index: 0 --Access Denied-- frame index: 1 --Access Denied-- => 0..1 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------ Message: 4 Date: Tue, 24 May 2005 16:28:15 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box To: wtr-general at rubyforge.org Message-ID: <006301c560af$e0ae74c0$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii Ive checked in a version of this test that raises an exception if autoit isnt found Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg Sent: 24 May 2005 15:43 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box Ah, yes that was the problem. I found AutoIt and installed it. The AutoIt install step should be added to the user guide, and the tests should probably raise an exception Thanks for the quick response, Jared Paul Rogers wrote: >It looks to me like you don't have autoit installed. > >We need to fix the code to raise an excepton if the autoit activex >control isnt found > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 14:12 >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >alert box > > >On my computer, when I run the unittests/jscript_test.rb unit test, a >Javascript alert() box comes up that says "Press OK". The box does not >go away automatically. If I press OK, the box goes away but nothing >else happens and it looks like the unit test is waiting for something to > >happen. This happens with the latest release (1.3.1) and the CVS as of >5/24/05 at 4pm. > >Isn't WATIR supposed to click the button automatically? I ask because >I'm trying to use WATIR to test my applicaiton, and I need to be able to > >click the OK button in javascript alerts. > >Any help would be appreciated, >Jared > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > ------------------------------ Message: 5 Date: Tue, 24 May 2005 16:47:42 -0600 From: Paul Rogers Subject: RE: [Wtr-general] problem with page refresh & variables To: wtr-general at rubyforge.org Message-ID: <006401c560b2$9827d680$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii Ive added it for spans, divs and p tags, and there is a unit test too. I'll add it for other objects now Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 24 May 2005 15:10 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] problem with page refresh & variables Hi Paul, that would be helpful if Ruby would have such a method :) I think it is important because 1. if you have a lot of data to sort through, (going row by row) and once you find it, you want to store it's information conveniently for quick retrieval during later use. 2. right now, to find all objects associated with a certain row, I have to search from the top of the table to the bottom (which is fine if I only do that once) but since those objects lose its values after a refresh, I have to perform that search all over again and reassign those variables which takes up time Regardless, I'm still extremely happy with Watir! :) Shao On 5/24/05, Paul Rogers wrote: > The objects that use assign to a and b no longer exist once the page > has reloaded, so you would need to do > > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > > a.set --> which works fine > > > #hit the update button, which then refreshes the page. If I now try > to access the checkbox and do > > # a and b no longer exist, so need to redifene them > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > > > a.clear > > > Perhaps we need a refresh method, so that ou could do > > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > > a.set --> which works fine > > > #hit the update button, which then refreshes the page. If I now try > to access the checkbox and do > > # a and b no longer exist, so need to redifene them > > a.refresh > b.refresh > a.clear > > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 24 May 2005 11:14 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] problem with page refresh & variables > > > I'm testing a webpage that has a table with rows of products and a few > columns for each product that contains check boxes that can be checked > off > > > Right when I get to this page, I locate the row (product) I'm > interested in and I SAVE all of the objects in each column for that > product into variables. > > for example > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > ... > > I check off some checkboxes, by doing > > a.set --> which works fine > > hit the update button, which then refreshes the page. If I now try to > access the checkbox and do > > a.clear > > I get the error: > > ERROR: Error!! Aborting Test Case --> > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2 > 112:in `invoke': Unknown property or method `disabled' > HRESULT error code:0x80070005 > Access is denied. > > > Any idea why a saved object b4 a page refresh can't be accessed after > a page refresh? > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------ Message: 6 Date: Tue, 24 May 2005 19:32:14 -0400 From: Jared Luxenberg Subject: Re: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box To: wtr-general at rubyforge.org Message-ID: <4293B97E.9010900 at comcast.net> Content-Type: text/plain; charset="us-ascii" Yes, I ran the install.rb file and had the "Install AutoIt" checkbox checked. - Jared Paul Rogers wrote: >The installer should install the autoit activex control for you. Did you >use the gui installer? > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 15:43 >To: wtr-general at rubyforge.org >Subject: Re: [Wtr-general] Unable to click the "Ok" button in a >Javascriptalert box > > >Ah, yes that was the problem. I found AutoIt and installed it. The >AutoIt install step should be added to the user guide, and the tests >should probably raise an exception > >Thanks for the quick response, >Jared > >Paul Rogers wrote: > > > >>It looks to me like you don't have autoit installed. >> >>We need to fix the code to raise an excepton if the autoit activex >>control isnt found >> >>Paul >> >>-----Original Message----- >>From: wtr-general-bounces at rubyforge.org >>[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >>Sent: 24 May 2005 14:12 >>To: wtr-general at rubyforge.org >>Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >>alert box >> >> >>On my computer, when I run the unittests/jscript_test.rb unit test, a >>Javascript alert() box comes up that says "Press OK". The box does not >> >> > > > >>go away automatically. If I press OK, the box goes away but nothing >>else happens and it looks like the unit test is waiting for something >> >> >to > > >>happen. This happens with the latest release (1.3.1) and the CVS as of >>5/24/05 at 4pm. >> >>Isn't WATIR supposed to click the button automatically? I ask because >>I'm trying to use WATIR to test my applicaiton, and I need to be able >> >> >to > > >>click the OK button in javascript alerts. >> >>Any help would be appreciated, >>Jared >> >>_______________________________________________ >>Wtr-general mailing list >>Wtr-general at rubyforge.org >>http://rubyforge.org/mailman/listinfo/wtr-general >> >> >> >> >> > > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 254 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050524/3ab9ef97/sig nature-0001.bin ------------------------------ Message: 7 Date: Tue, 24 May 2005 19:52:41 -0400 From: Alexey Verkhovsky Subject: Re: [Wtr-general] IE.attach To: wtr-general at rubyforge.org Message-ID: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Andy Sipe wrote: > On another note, are you the Alexey who is the maintainer of the > Test/Unit Report project? > Email me. I'm surprised to hear that this project has any real users - except that I used it myself while I needed it :) -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) ------------------------------ Message: 8 Date: Tue, 24 May 2005 19:53:42 -0400 From: Jared Luxenberg Subject: Re: [Wtr-general] Unable to click the "Ok" button in a Javascript alert box (still not working) To: wtr-general at rubyforge.org Message-ID: <4293BE86.3030309 at comcast.net> Content-Type: text/plain; charset="iso-8859-1" This is odd. It turns out I did have AutoIt installed before I ran the AutoIt installer. After running the AutoIt installer, I re-ran the jscript_test.rb test and it worked. But I just ran the test again, and now it's not working anymore. I have the latest version of Ruby, and I just grabbed the most recent CVS copy of Watir a minute ago. If I un-register the AutoIt DLL, the test produces an error, but if I re-register the DLL the test does the same thing as before (doesn't give me an error, but doesn't work either). - Jared Paul Rogers wrote: >It looks to me like you don't have autoit installed. > >We need to fix the code to raise an excepton if the autoit activex >control isnt found > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 14:12 >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >alert box > > >On my computer, when I run the unittests/jscript_test.rb unit test, a >Javascript alert() box comes up that says "Press OK". The box does not >go away automatically. If I press OK, the box goes away but nothing >else happens and it looks like the unit test is waiting for something to > >happen. This happens with the latest release (1.3.1) and the CVS as of >5/24/05 at 4pm. > >Isn't WATIR supposed to click the button automatically? I ask because >I'm trying to use WATIR to test my applicaiton, and I need to be able to > >click the OK button in javascript alerts. > >Any help would be appreciated, >Jared > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 254 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050524/78ed43ab/sig nature.bin ------------------------------ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general End of Wtr-general Digest, Vol 18, Issue 34 ******************************************* From bret at pettichord.com Tue May 24 20:30:28 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 24 May 2005 19:30:28 -0500 Subject: [Wtr-general] Human and Hacker API's In-Reply-To: <000d01c56064$594509e0$72d39044@NewDell> References: <5.1.0.14.2.20050524001647.02d77400@127.0.0.1> Message-ID: <5.1.0.14.2.20050524192926.02e797f0@127.0.0.1> At 08:27 AM 5/24/2005, Paul Rogers wrote: >Clear_selection does have a human api > >On a multi list box ( C:\watir_bonus\unitTests\html\selectboxes1.html - >the second list ) , click an item to select it, hold ctrl and click it >again, its unselected > >I don't think there is any equivalent for single item boxes. Exactly. >I think that your idea is worthwhile doing. I assume that this will be a >watir 2.0 thing as the api will now be different? I'd like to make a lot of changes to the API along the lines of consistency and usability. Does that mean we'd have to call the next release 2.0? I see these changes as ongoing. _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Tue May 24 20:38:34 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 24 May 2005 19:38:34 -0500 Subject: [Wtr-general] two API's In-Reply-To: <1116956741.429368459de38@webmail.telusplanet.net> References: <429360E7.9070607@lyris.com> <5.1.0.14.2.20050524001647.02d77400@127.0.0.1> <20050524053650.RSFN16409.priv-edtnes40.telusplanet.net@tintin> <72799cd7050523225516e808d@mail.gmail.com> <1116945301.42933b9522f59@webmail.telusplanet.net> <429360E7.9070607@lyris.com> Message-ID: <5.1.0.14.2.20050524193816.02e9cb88@127.0.0.1> At 12:45 PM 5/24/2005, jkohl at telusplanet.net wrote: >So whatever we decide, can we stop using the term "hacker API"? I'd feel a >lot >better. :) What would you have us say instead? _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Tue May 24 20:40:02 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 24 May 2005 19:40:02 -0500 Subject: [Wtr-general] RE: New features, bug fixes etc In-Reply-To: <000a01c55fbb$55e76bc0$72d39044@NewDell> Message-ID: <5.1.0.14.2.20050524193923.02e95488@127.0.0.1> Will we be removing the old ie.show_foo methods? Replace these with calls to ie.foo.show? At 12:17 PM 5/23/2005, Paul Rogers wrote: >The iterators method now has a show method: > >Ie.buttons.show >Ie.images.show _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Tue May 24 21:02:15 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 24 May 2005 20:02:15 -0500 Subject: [Wtr-general] Another way of specifying attributes Message-ID: <5.1.0.14.2.20050524195717.02e85d88@127.0.0.1> A request from a collegue: He has a radio list and needs to select one item in the list. All the items in the list have the same name. Each has a different value (1, 2, 3). I believe this is the normal way to use radio lists. There are also other radio lists on the page with the same value. How does he specify which radio button to check? Two suggestions: 1. ie.radio({:name => 'foo', :value => 1}) 2. ie.radio{|r| r.name == 'foo' & r.value == 1} Thoughts? _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Tue May 24 21:04:21 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 24 May 2005 20:04:21 -0500 Subject: [Wtr-general] Watir/ruby assistance. In-Reply-To: <4292d5ca.421a4eaa.7eeb.2e95@mx.gmail.com> References: <71EA7CA4B789864F9B3AC722A7F016B68DBE09@tfphmanilmul01.ERF.THOMSON.COM> Message-ID: <5.1.0.14.2.20050524200237.02ea62f0@127.0.0.1> At 02:21 AM 5/24/2005, Zeljko Filipin wrote: >Go to start > All programs > Watir > Watir API reference (or >C:\watir_bonus\rdoc\index.html, both paths are informative only). >In Classes frame select Watir::IE (then Watir::TextField, then >Watir::Form...) and read all about it. :) >If I was not clear enough, do not hesitate to ask again. http://wtr.rubyforge.org/rdoc/ http://wtr.rubyforge.org/rdoc/classes/Watir/IE.html _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Tue May 24 21:09:39 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 24 May 2005 20:09:39 -0500 Subject: [Wtr-general] Input Via onchange In-Reply-To: <001201c56073$f7f325e0$72d39044@NewDell> References: <20050523175211.MXES19994.priv-edtnes46.telusplanet.net@tintin> Message-ID: <5.1.0.14.2.20050524200624.02eb4d70@127.0.0.1> At 10:19 AM 5/24/2005, Paul Rogers wrote: >We have the value= method on a text field that sets the value and fires >no events. So the set method should probably fire all appropriate >events. That way we get a human form (set) and a hacker form( value= ) >which we can customize to do any event by using the fire_event method This is a good example. My view that it is a bug if a the set method doesn't trigger the same javascript events that a human does. But not so for value=. At first, i thought we should be hiding the hacker methods, but the discussion here has convinced me otherwise. My question then is how do we communicate that some methods are intended to replicate human actions? I'd like to make these stand out for new users. Bret _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Tue May 24 21:14:10 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 24 May 2005 20:14:10 -0500 Subject: [Wtr-general] problem with page refresh & variables In-Reply-To: <005101c560a3$30cbde50$72d39044@NewDell> References: <593b9ae80505241013ecdc45d@mail.gmail.com> Message-ID: <5.1.0.14.2.20050524201151.02ed4920@127.0.0.1> At 03:57 PM 5/24/2005, Paul Rogers wrote: >Perhaps we need a refresh method, so that ou could do > > >a = $ie.checkbox(:id, /BF/) >b = $ie.checkbox(:id, /TF/) > >a.set --> which works fine > > >#hit the update button, which then refreshes the page. If I now try to >access the checkbox and do > ># a and b no longer exist, so need to redifene them > >a.refresh >b.refresh >a.clear No. The way to make this kind of thing work is to do 'lazy instantiation'. Effectively, we don't actually search for the checkbox with the specified id until we need it to process a method. I've been wanting to add this to our code base for a long time, but a lot of the duplicated code needs to be refactored out before i can consider it. I would do this with a separate class that wraps the IE class. We need something like this before we can do the Selenium integration anyhow. Bret _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Tue May 24 21:14:54 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 24 May 2005 20:14:54 -0500 Subject: [Wtr-general] problem with page refresh & variables In-Reply-To: <593b9ae8050524141030e05545@mail.gmail.com> References: <005101c560a3$30cbde50$72d39044@NewDell> <593b9ae80505241013ecdc45d@mail.gmail.com> <005101c560a3$30cbde50$72d39044@NewDell> Message-ID: <5.1.0.14.2.20050524201440.02eb6b30@127.0.0.1> At 04:10 PM 5/24/2005, Shao Kang Tat wrote: >2. right now, to find all objects associated with a certain row, I >have to search from the top of the table to the bottom (which is fine >if I only do that once) but since those objects lose its values after >a refresh, I have to perform that search all over again and reassign >those variables which takes up time Why can't you put this in a function? _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Tue May 24 21:16:02 2005 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 24 May 2005 20:16:02 -0500 Subject: [Wtr-general] problem with page refresh & variables In-Reply-To: <006401c560b2$9827d680$72d39044@NewDell> References: <593b9ae8050524141030e05545@mail.gmail.com> Message-ID: <5.1.0.14.2.20050524201538.02ec4c70@127.0.0.1> At 05:47 PM 5/24/2005, Paul Rogers wrote: >Ive added it for spans, divs and p tags, and there is a unit test too. >I'll add it for other objects now This ties us to the null object pattern. I thought we were thinking about going the other way? Also, will your solution work for this: a = ie.frame("foo").button("bar") a.refresh I suspect not, because the current code isn't really designed to handle this kind of thing. Bret _____________________ Bret Pettichord www.pettichord.com From paul.rogers at shaw.ca Tue May 24 21:28:06 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 19:28:06 -0600 Subject: [Wtr-general] problem with page refresh & variables In-Reply-To: <5.1.0.14.2.20050524201538.02ec4c70@127.0.0.1> Message-ID: <008001c560c9$00d9e4a0$72d39044@NewDell> Good point. Im not sure. I'll add a test for it ;-) As to the null pattern. Again Im not sure. Im not sure that the consensus was on this based on the emails from earlier. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 24 May 2005 19:16 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] problem with page refresh & variables At 05:47 PM 5/24/2005, Paul Rogers wrote: >Ive added it for spans, divs and p tags, and there is a unit test too. >I'll add it for other objects now This ties us to the null object pattern. I thought we were thinking about going the other way? Also, will your solution work for this: a = ie.frame("foo").button("bar") a.refresh I suspect not, because the current code isn't really designed to handle this kind of thing. Bret _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Tue May 24 21:30:21 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 19:30:21 -0600 Subject: [Wtr-general] [patch] Unable to click the "Ok" button in aJavascript alert box (resolved) In-Reply-To: <4293C3E0.5060503@comcast.net> Message-ID: <008701c560c9$50ef9a20$72d39044@NewDell> We decided some time back to only have the single mailing list, so this is the correct place to send it ;-) Thanks for the patches. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg Sent: 24 May 2005 18:17 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] [patch] Unable to click the "Ok" button in aJavascript alert box (resolved) Ah, I see the problem. I was running the unit tests from a directory with a space in the name. When I run them from E:\watir_bonus\unittests\ they work fine. My fix is to put the Ruby script that you're running in quotes when the call to rubyw is made. I've attached patches to the files popups_test.rb and jscript_test.rb to fix this problem. - Jared P.S. sorry if this isn't the right place to submit patches but I didn't see a patch mailing list Jared Luxenberg wrote: > This is odd. It turns out I did have AutoIt installed before I ran > the AutoIt installer. > > After running the AutoIt installer, I re-ran the jscript_test.rb test > and it worked. But I just ran the test again, and now it's not > working anymore. I have the latest version of Ruby, and I just > grabbed the most recent CVS copy of Watir a minute ago. If I > un-register the AutoIt DLL, the test produces an error, but if I > re-register the DLL the test does the same thing as before (doesn't > give me an error, but doesn't work either). > > - Jared > > Paul Rogers wrote: > >> It looks to me like you don't have autoit installed. >> >> We need to fix the code to raise an excepton if the autoit activex >> control isnt found >> >> Paul >> >> -----Original Message----- >> From: wtr-general-bounces at rubyforge.org >> [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared >> Luxenberg >> Sent: 24 May 2005 14:12 >> To: wtr-general at rubyforge.org >> Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >> alert box >> >> >> On my computer, when I run the unittests/jscript_test.rb unit test, a >> Javascript alert() box comes up that says "Press OK". The box does >> not go away automatically. If I press OK, the box goes away but >> nothing else happens and it looks like the unit test is waiting for >> something to >> >> happen. This happens with the latest release (1.3.1) and the CVS as >> of 5/24/05 at 4pm. >> >> Isn't WATIR supposed to click the button automatically? I ask >> because I'm trying to use WATIR to test my applicaiton, and I need to >> be able to >> >> click the OK button in javascript alerts. >> >> Any help would be appreciated, >> Jared >> >> _______________________________________________ >> Wtr-general mailing list >> Wtr-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-general >> >> >> > >----------------------------------------------------------------------- >- > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > From paul.rogers at shaw.ca Tue May 24 21:34:03 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 19:34:03 -0600 Subject: [Wtr-general] problem with page refresh & variables In-Reply-To: <5.1.0.14.2.20050524201151.02ed4920@127.0.0.1> Message-ID: <008801c560c9$d56842c0$72d39044@NewDell> The lazy instationation is certainly a much better way to go. Does it tie us to either the null object or exception pattern when an attempt is made to access a non-existant object? Im not sure how we could raise an exception for creating an object that doesn't exist: a=ie.button(:id, 'no_exist') # how can this raise an exception with lazy instatioation a.click # this can create an exception But Im not even sure what we decided to do ;-) Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 24 May 2005 19:14 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] problem with page refresh & variables At 03:57 PM 5/24/2005, Paul Rogers wrote: >Perhaps we need a refresh method, so that ou could do > > >a = $ie.checkbox(:id, /BF/) >b = $ie.checkbox(:id, /TF/) > >a.set --> which works fine > > >#hit the update button, which then refreshes the page. If I now try to >access the checkbox and do > ># a and b no longer exist, so need to redifene them > >a.refresh >b.refresh >a.clear No. The way to make this kind of thing work is to do 'lazy instantiation'. Effectively, we don't actually search for the checkbox with the specified id until we need it to process a method. I've been wanting to add this to our code base for a long time, but a lot of the duplicated code needs to be refactored out before i can consider it. I would do this with a separate class that wraps the IE class. We need something like this before we can do the Selenium integration anyhow. Bret _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From jkohl at telusplanet.net Tue May 24 23:15:38 2005 From: jkohl at telusplanet.net (Jonathan Kohl) Date: Tue, 24 May 2005 21:15:38 -0600 Subject: [Wtr-general] two API's In-Reply-To: <5.1.0.14.2.20050524193816.02e9cb88@127.0.0.1> Message-ID: <20050525031523.XFCU6066.priv-edtnes40.telusplanet.net@tintin> I had a feeling you might ask that. :) I haven't come up with anything right now. I was thinking of them as "internal browser" methods, but haven't come up with a nice alternative name. I don't think of them as particularly useful for hacking the way a tool like HTTPUnit or Tamper might be. You could do some injection into fields I suppose, but tampering with the http stream might be more effective. -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of Bret Pettichord > Sent: May 24, 2005 6:39 PM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] two API's > > At 12:45 PM 5/24/2005, jkohl at telusplanet.net wrote: > >So whatever we decide, can we stop using the term "hacker API"? I'd feel > a > >lot > >better. :) > > What would you have us say instead? > > > > _____________________ > Bret Pettichord > www.pettichord.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Tue May 24 23:20:50 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 21:20:50 -0600 Subject: [Wtr-general] two API's In-Reply-To: <20050525031523.XFCU6066.priv-edtnes40.telusplanet.net@tintin> Message-ID: <008a01c560d8$c04de520$72d39044@NewDell> I think im going off the idea of 2 apis. Perhaps we can just add comments to the rdoc about the usage of 'suspect' methods Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jonathan Kohl Sent: 24 May 2005 21:16 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] two API's I had a feeling you might ask that. :) I haven't come up with anything right now. I was thinking of them as "internal browser" methods, but haven't come up with a nice alternative name. I don't think of them as particularly useful for hacking the way a tool like HTTPUnit or Tamper might be. You could do some injection into fields I suppose, but tampering with the http stream might be more effective. -Jonathan > -----Original Message----- > From: wtr-general-bounces at rubyforge.org [mailto:wtr-general- > bounces at rubyforge.org] On Behalf Of Bret Pettichord > Sent: May 24, 2005 6:39 PM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] two API's > > At 12:45 PM 5/24/2005, jkohl at telusplanet.net wrote: > >So whatever we decide, can we stop using the term "hacker API"? I'd > >feel > a > >lot > >better. :) > > What would you have us say instead? > > > > _____________________ > Bret Pettichord > www.pettichord.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Tue May 24 23:21:43 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 21:21:43 -0600 Subject: [Wtr-general] problem with page refresh & variables In-Reply-To: <5.1.0.14.2.20050524201151.02ed4920@127.0.0.1> Message-ID: <008b01c560d8$e0257200$72d39044@NewDell> Ive checked all the code for this in anyway. Its actually a useful refactoring anyway, and perhaps goes some of the way to doing lazy instatiation Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 24 May 2005 19:14 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] problem with page refresh & variables At 03:57 PM 5/24/2005, Paul Rogers wrote: >Perhaps we need a refresh method, so that ou could do > > >a = $ie.checkbox(:id, /BF/) >b = $ie.checkbox(:id, /TF/) > >a.set --> which works fine > > >#hit the update button, which then refreshes the page. If I now try to >access the checkbox and do > ># a and b no longer exist, so need to redifene them > >a.refresh >b.refresh >a.clear No. The way to make this kind of thing work is to do 'lazy instantiation'. Effectively, we don't actually search for the checkbox with the specified id until we need it to process a method. I've been wanting to add this to our code base for a long time, but a lot of the duplicated code needs to be refactored out before i can consider it. I would do this with a separate class that wraps the IE class. We need something like this before we can do the Selenium integration anyhow. Bret _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Wed May 25 00:32:13 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 24 May 2005 22:32:13 -0600 Subject: [Wtr-general] Another way of specifying attributes In-Reply-To: <5.1.0.14.2.20050524195717.02e85d88@127.0.0.1> Message-ID: <008d01c560e2$b90a9100$72d39044@NewDell> Its already supported Ie.radio(:name, 'foo' , 1) >From radios_test.rb def test_onClick assert_false($ie.button(:value , "foo").enabled?) $ie.radio(:name, "box5" , 1).set assert($ie.button(:value , "foo").enabled?) $ie.radio(:name, "box5", 2).set assert_false($ie.button(:value , "foo").enabled?) end -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 24 May 2005 19:02 To: wtr-general at rubyforge.org Subject: [Wtr-general] Another way of specifying attributes A request from a collegue: He has a radio list and needs to select one item in the list. All the items in the list have the same name. Each has a different value (1, 2, 3). I believe this is the normal way to use radio lists. There are also other radio lists on the page with the same value. How does he specify which radio button to check? Two suggestions: 1. ie.radio({:name => 'foo', :value => 1}) 2. ie.radio{|r| r.name == 'foo' & r.value == 1} Thoughts? _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From bret at pettichord.com Wed May 25 01:00:08 2005 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 25 May 2005 00:00:08 -0500 Subject: [Wtr-general] Another way of specifying attributes In-Reply-To: <008d01c560e2$b90a9100$72d39044@NewDell> References: <5.1.0.14.2.20050524195717.02e85d88@127.0.0.1> Message-ID: <5.1.0.14.2.20050524235849.02f24260@127.0.0.1> OK. I guess i was thinking of providing a mechanism that would both work for radio's and also be available for other objects, instead of just having a special case. Bret At 11:32 PM 5/24/2005, Paul Rogers wrote: >Its already supported > >Ie.radio(:name, 'foo' , 1) > > > > >From radios_test.rb >def test_onClick > assert_false($ie.button(:value , "foo").enabled?) > $ie.radio(:name, "box5" , 1).set > assert($ie.button(:value , "foo").enabled?) > > $ie.radio(:name, "box5", 2).set > assert_false($ie.button(:value , "foo").enabled?) > end > > > > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord >Sent: 24 May 2005 19:02 >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Another way of specifying attributes > > >A request from a collegue: > >He has a radio list and needs to select one item in the list. All the >items >in the list have the same name. Each has a different value (1, 2, 3). I >believe this is the normal way to use radio lists. > >There are also other radio lists on the page with the same value. > >How does he specify which radio button to check? > >Two suggestions: > >1. ie.radio({:name => 'foo', :value => 1}) > >2. ie.radio{|r| r.name == 'foo' & r.value == 1} > >Thoughts? > > >_____________________ > Bret Pettichord > www.pettichord.com > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Wed May 25 02:01:24 2005 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 25 May 2005 01:01:24 -0500 Subject: [Wtr-general] problem with page refresh & variables In-Reply-To: <008801c560c9$d56842c0$72d39044@NewDell> References: <5.1.0.14.2.20050524201151.02ed4920@127.0.0.1> Message-ID: <5.1.0.14.2.20050525005603.02fa9908@127.0.0.1> At 08:34 PM 5/24/2005, Paul Rogers wrote: >But Im not even sure what we decided to do ;-) Alexei suggested that we get rid of the null objects and i seconded his suggestion, and asked for further comments. The proposal is to remove the exists? methods. Do you have an objection to this? Bret _____________________ Bret Pettichord www.pettichord.com From shaorobics at gmail.com Wed May 25 10:07:57 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Wed, 25 May 2005 10:07:57 -0400 Subject: [Wtr-general] problem with page refresh & variables In-Reply-To: <5.1.0.14.2.20050524201440.02eb6b30@127.0.0.1> References: <593b9ae80505241013ecdc45d@mail.gmail.com> <005101c560a3$30cbde50$72d39044@NewDell> <593b9ae8050524141030e05545@mail.gmail.com> <5.1.0.14.2.20050524201440.02eb6b30@127.0.0.1> Message-ID: <593b9ae805052507077d251813@mail.gmail.com> Hi Bret, That search is actually in a function: getProductInfo("someProductName") the page has X # of products on X different rows in a table with multiple columns. So my function is going through the table one row at a time until I find, in the first cell of that row, a link's innerText that matches the product name I'm interested in. When I'm at that row I save all the textboxes, checkboxes, dropdown lists, links, etc that are associated with that product, in that row, but that are in different columns. so for example I'll do: product.getProductInfo("Apples") product.dropdown.select("Macintosh") product.checkbox1.set "hit save button" product.dropdown.select("Granny Smith") --> which then dies so for now, to remedy this I have to do product.getProductInfo("Apples") product.dropdown.select("Granny Smith") --> an additional function call to iterate through the table rows again unless there's a better way to do it than by row iteration?... to get "Apples" dropwdown list which is in, say column 4 I'm currently doing: @dropdown = table[some_row][4].select_list(:id, / /) Shao On 5/24/05, Bret Pettichord wrote: > At 04:10 PM 5/24/2005, Shao Kang Tat wrote: > >2. right now, to find all objects associated with a certain row, I > >have to search from the top of the table to the bottom (which is fine > >if I only do that once) but since those objects lose its values after > >a refresh, I have to perform that search all over again and reassign > >those variables which takes up time > > Why can't you put this in a function? > > > _____________________ > Bret Pettichord > www.pettichord.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From shaorobics at gmail.com Wed May 25 10:44:42 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Wed, 25 May 2005 10:44:42 -0400 Subject: [Wtr-general] exists? vs assert_nothing_raised Message-ID: <593b9ae805052507446bad7eb5@mail.gmail.com> Hi guys, This is related to the previous posts about doing if ie.someObject.exists? do option 1 else do option 2 end Right now I"m stuck using exists? in certain spots where I want to ensure that a certain button does not exist under certain scenarios. if I do: assert_nil(ie.button(:id, /someButton/)) I get the error: undefined method `delete_if' for nil:NilClass whereas if I do if ie.button(:id, /someButton/).exists? it runs fine... Shao From shaorobics at gmail.com Wed May 25 10:48:42 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Wed, 25 May 2005 10:48:42 -0400 Subject: [Wtr-general] Re: exists? vs assert_nothing_raised In-Reply-To: <593b9ae805052507446bad7eb5@mail.gmail.com> References: <593b9ae805052507446bad7eb5@mail.gmail.com> Message-ID: <593b9ae805052507481def447a@mail.gmail.com> on that note, also if I do assert_false(ie.button(:id, /someButton/).exists?) it works fine...I can't seem to not use the exists? Thanks Shao On 5/25/05, Shao Kang Tat wrote: > Hi guys, > > This is related to the previous posts about doing > > if ie.someObject.exists? > do option 1 > else > do option 2 > end > > Right now I"m stuck using exists? in certain spots where I want to > ensure that a certain button does not exist under certain scenarios. > > if I do: > > assert_nil(ie.button(:id, /someButton/)) > > I get the error: > undefined method `delete_if' for nil:NilClass > > whereas if I do > > if ie.button(:id, /someButton/).exists? > > it runs fine... > > Shao > From bret at pettichord.com Wed May 25 11:36:25 2005 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 25 May 2005 10:36:25 -0500 Subject: [Wtr-general] Re: exists? vs assert_nothing_raised In-Reply-To: <593b9ae805052507481def447a@mail.gmail.com> References: <593b9ae805052507446bad7eb5@mail.gmail.com> <593b9ae805052507446bad7eb5@mail.gmail.com> Message-ID: <5.1.0.14.2.20050525102541.03127828@127.0.0.1> I'm thinking we should provide a module method exists? that would be used like this: exists?{ie.button(:id, /some_button/)} it would work the exact same way as ie.button(:id, /some_button/).exists?, but would allow us to greatly simplify the Watir code. Note that the new exists? method would be somewhat analogous to Ruby's defined? method. It would be defined like this: def exists? begin yield true rescue ObjectNotFoundException false end end At 09:48 AM 5/25/2005, Shao Kang Tat wrote: >on that note, also if I do > >assert_false(ie.button(:id, /someButton/).exists?) >it works fine...I can't seem to not use the exists? > >Thanks > >Shao > > > >On 5/25/05, Shao Kang Tat wrote: > > Hi guys, > > > > This is related to the previous posts about doing > > > > if ie.someObject.exists? > > do option 1 > > else > > do option 2 > > end > > > > Right now I"m stuck using exists? in certain spots where I want to > > ensure that a certain button does not exist under certain scenarios. > > > > if I do: > > > > assert_nil(ie.button(:id, /someButton/)) > > > > I get the error: > > undefined method `delete_if' for nil:NilClass > > > > whereas if I do > > > > if ie.button(:id, /someButton/).exists? > > > > it runs fine... > > > > Shao > > > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From shaorobics at gmail.com Wed May 25 11:39:10 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Wed, 25 May 2005 11:39:10 -0400 Subject: [Wtr-general] watir & databases Message-ID: <593b9ae80505250839202aab5f@mail.gmail.com> I'm back with more questions :) I want to connect to a database after a test runs, to delete something that was added to the database. Right now, the code is as follows: ********************************************************************** require 'dbi' # connects to database ConnectionString = "PROVIDER=SQLOLEDB;DATABASE=SOME_DB;Server=xx.x.x.xx;UID=yy;PWD=zz;Address=nn.n.n.nn,nnnn;network library=something" dbh = DBI.connect(ConnectionString, login, password) *********************************************************************** errors out to be: c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:519:in `parse_url': Invalid Data Sourc e Name (DBI::InterfaceError) from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:400:in `_get_full_driver' from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:381:in `connect' from C:/Documents and Settings/stat/Desktop/Watir/blah/DeleteGlobalBudg et.rb Any advice? I got this sample code off the internet. I'm sure the connection string is correct as it is part of a vb script that is currently being used to do the same thing... (I'm not too experienced with DB's other than knowing how to SQL). Is watir/ruby able to get into databases to manipulate tables that would otherwise be accessed through SQL Server Enterprise Manager? Thanks! Shao From shaorobics at gmail.com Wed May 25 11:41:47 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Wed, 25 May 2005 11:41:47 -0400 Subject: [Wtr-general] Re: exists? vs assert_nothing_raised In-Reply-To: <5.1.0.14.2.20050525102541.03127828@127.0.0.1> References: <593b9ae805052507446bad7eb5@mail.gmail.com> <593b9ae805052507481def447a@mail.gmail.com> <5.1.0.14.2.20050525102541.03127828@127.0.0.1> Message-ID: <593b9ae8050525084136ae4342@mail.gmail.com> I think that's a great idea! :) I kinda like the exists? because it's very self explanatory for when some other tester comes along and needs to edit the tests :) Shao On 5/25/05, Bret Pettichord wrote: > I'm thinking we should provide a module method exists? that would be used > like this: > > exists?{ie.button(:id, /some_button/)} > > it would work the exact same way as ie.button(:id, /some_button/).exists?, > but would allow us to greatly simplify the Watir code. > > Note that the new exists? method would be somewhat analogous to Ruby's > defined? method. It would be defined like this: > > def exists? > begin > yield > true > rescue ObjectNotFoundException > false > end > end > > > At 09:48 AM 5/25/2005, Shao Kang Tat wrote: > >on that note, also if I do > > > >assert_false(ie.button(:id, /someButton/).exists?) > >it works fine...I can't seem to not use the exists? > > > >Thanks > > > >Shao > > > > > > > >On 5/25/05, Shao Kang Tat wrote: > > > Hi guys, > > > > > > This is related to the previous posts about doing > > > > > > if ie.someObject.exists? > > > do option 1 > > > else > > > do option 2 > > > end > > > > > > Right now I"m stuck using exists? in certain spots where I want to > > > ensure that a certain button does not exist under certain scenarios. > > > > > > if I do: > > > > > > assert_nil(ie.button(:id, /someButton/)) > > > > > > I get the error: > > > undefined method `delete_if' for nil:NilClass > > > > > > whereas if I do > > > > > > if ie.button(:id, /someButton/).exists? > > > > > > it runs fine... > > > > > > Shao > > > > > > >_______________________________________________ > >Wtr-general mailing list > >Wtr-general at rubyforge.org > >http://rubyforge.org/mailman/listinfo/wtr-general > > _____________________ > Bret Pettichord > www.pettichord.com > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From christopher.mcmahon at gmail.com Wed May 25 11:45:06 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 25 May 2005 09:45:06 -0600 Subject: [Wtr-general] watir & databases In-Reply-To: <593b9ae80505250839202aab5f@mail.gmail.com> References: <593b9ae80505250839202aab5f@mail.gmail.com> Message-ID: <72799cd7050525084523a48b@mail.gmail.com> On 5/25/05, Shao Kang Tat wrote: > I'm back with more questions :) > > I want to connect to a database after a test runs, to delete something > that was added to the database. Right now, the code is as follows: > > ********************************************************************** > require 'dbi' > # connects to database > ConnectionString = > "PROVIDER=SQLOLEDB;DATABASE=SOME_DB;Server=xx.x.x.xx;UID=yy;PWD=zz;Address=nn.n.n.nn,nnnn;network > library=something" > > dbh = DBI.connect(ConnectionString, login, password) > *********************************************************************** I assume this is a MS DB? You're missing the ODBC interface, i.e: require 'odbc' include ODBC @connection = connect('db-instance', 'username', 'password') assert @connection q = @connection.prepare("INSERT INTO table_name "12345678901, abcd") q.execute From andy__s at hotmail.com Wed May 25 11:54:46 2005 From: andy__s at hotmail.com (Andy Sipe) Date: Wed, 25 May 2005 11:54:46 -0400 Subject: [Wtr-general] watir & databases Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050525/695a2414/attachment.html From shaorobics at gmail.com Wed May 25 11:56:54 2005 From: shaorobics at gmail.com (Shao Kang Tat) Date: Wed, 25 May 2005 11:56:54 -0400 Subject: [Wtr-general] watir & databases In-Reply-To: <72799cd7050525084523a48b@mail.gmail.com> References: <593b9ae80505250839202aab5f@mail.gmail.com> <72799cd7050525084523a48b@mail.gmail.com> Message-ID: <593b9ae805052508563ba1335a@mail.gmail.com> Hi Chris, I've tried what was suggested which brings a new problem: C:/Documents and Settings/stat/Desktop/Watir/Eatmr/DeleteGlobalBudget.rb:27:in ` initialize': S1090 (0) [Microsoft][ODBC Driver Manager] Invalid string or buffer length (ODBC::Error) from C:/Documents and Settings/stat/Desktop/Watir/Eatmr/DeleteGlobalBudg et.rb:27:in `connect' from C:/Documents and Settings/stat/Desktop/Watir/Eatmr/DeleteGlobalBudg et.rb:27 Thanks Shao On 5/25/05, Chris McMahon wrote: > On 5/25/05, Shao Kang Tat wrote: > > I'm back with more questions :) > > > > I want to connect to a database after a test runs, to delete something > > that was added to the database. Right now, the code is as follows: > > > > ********************************************************************** > > require 'dbi' > > # connects to database > > ConnectionString = > > "PROVIDER=SQLOLEDB;DATABASE=SOME_DB;Server=xx.x.x.xx;UID=yy;PWD=zz;Address=nn.n.n.nn,nnnn;network > > library=something" > > > > dbh = DBI.connect(ConnectionString, login, password) > > *********************************************************************** > > I assume this is a MS DB? You're missing the ODBC interface, i.e: > > require 'odbc' > include ODBC > @connection = connect('db-instance', 'username', 'password') > assert @connection > q = @connection.prepare("INSERT INTO table_name "12345678901, abcd") > q.execute > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From softwarespack at yahoo.com Wed May 25 12:28:06 2005 From: softwarespack at yahoo.com (Scott Pack) Date: Wed, 25 May 2005 09:28:06 -0700 (PDT) Subject: [Wtr-general] Another way of specifying attributes Message-ID: <20050525162806.65358.qmail@web32204.mail.mud.yahoo.com> While Watir is extremely flexible with the types of attributes it supports for controls, sometimes that might not be unique enough of a match. I think it would be a very valuable feature to be able to supply multiple attributes to ensure a match. Either syntactic approach is fine, although AND/OR is more flexible. Presumably one could also NOT an attribute although I'm not sure this is likely to occur. Scott __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new Resources site http://smallbusiness.yahoo.com/resources/ From softwarespack at yahoo.com Wed May 25 12:30:29 2005 From: softwarespack at yahoo.com (Scott Pack) Date: Wed, 25 May 2005 09:30:29 -0700 (PDT) Subject: [Wtr-general] two API's Message-ID: <20050525163029.91326.qmail@web32210.mail.mud.yahoo.com> More tools in the box is better as far as I am concerned. RDoc the intent, and that should suffice. My intent with Watir is strict functional testing, so I'll make the determination to use those API that support that. But I will use any API that solves a roadblock to the greater goal. Scott __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From softwarespack at yahoo.com Wed May 25 12:39:36 2005 From: softwarespack at yahoo.com (Scott Pack) Date: Wed, 25 May 2005 09:39:36 -0700 (PDT) Subject: [Wtr-general] Selenium integration Message-ID: <20050525163936.34204.qmail@web32212.mail.mud.yahoo.com> Brett, Can you please speak to what this is about? If you can offer browser neutral implementation of Watir that would be very beneficial. Having been doing test automation for too many years, the power of Watir is it's simplicity and having a full language behind it to support data and state dynamic testing. Static, linear scripting of the sort of capture/playback and Selenium's HTML table scripting model is not all that useful. Scott __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new Resources site http://smallbusiness.yahoo.com/resources/ From paul.rogers at shaw.ca Wed May 25 13:03:45 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 25 May 2005 11:03:45 -0600 Subject: [Wtr-general] Selenium integration In-Reply-To: <20050525163936.34204.qmail@web32212.mail.mud.yahoo.com> Message-ID: <001501c5614b$b5f2d900$72d39044@NewDell> I think there are 2 stages to selenium integration. The overall goal is to get cross browser support. The first stage, kind of a simple, but not very elegant approach, is to use watir to generate the html that selenium would then use. This does have the advantage that the selenium html may become more manageable. The second stage is as I understand it ( Bret understands this better than I do ) is to access the selenium api ( which already has ruby bindings) from watir Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Scott Pack Sent: 25 May 2005 10:40 To: wtr-general at rubyforge.org Subject: [Wtr-general] Selenium integration Brett, Can you please speak to what this is about? If you can offer browser neutral implementation of Watir that would be very beneficial. Having been doing test automation for too many years, the power of Watir is it's simplicity and having a full language behind it to support data and state dynamic testing. Static, linear scripting of the sort of capture/playback and Selenium's HTML table scripting model is not all that useful. Scott __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new Resources site http://smallbusiness.yahoo.com/resources/ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Wed May 25 13:06:36 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 25 May 2005 11:06:36 -0600 Subject: [Wtr-general] Another way of specifying attributes In-Reply-To: <20050525162806.65358.qmail@web32204.mail.mud.yahoo.com> Message-ID: <001601c5614c$1c544260$72d39044@NewDell> Possibly not as nice a solution than having something like ie.button( { :name=>'foo' , :value=>'bar' , :id=>'x'} ) is to use the iterator ie.buttons.each do |b| b.click if b.name=='foo' and b.value=='bar' and b.id=='x' end This allows you to acces anything, and saves me the trouble of writing unittests ;-) -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Scott Pack Sent: 25 May 2005 10:28 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Another way of specifying attributes While Watir is extremely flexible with the types of attributes it supports for controls, sometimes that might not be unique enough of a match. I think it would be a very valuable feature to be able to supply multiple attributes to ensure a match. Either syntactic approach is fine, although AND/OR is more flexible. Presumably one could also NOT an attribute although I'm not sure this is likely to occur. Scott __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new Resources site http://smallbusiness.yahoo.com/resources/ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From tuyet.ctn at mscibarra.com Wed May 25 13:08:26 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Wed, 25 May 2005 10:08:26 -0700 Subject: [Wtr-general] FW: Access is denied and Exception Errors Message-ID: Hello, In your last response you mentioned: "The access denied means that we cant access parts of the page as its hosted on a different domain." Is this a permission issue on the machine that's hosting the page? Should I ask for Read/Write permission for WATIR? Not sure how to go about this? I still can't get to any fields on my Login page. Per my email below, I am not sure what to try next? -----Original Message----- From: Tuyet Cong-Ton-Nu Sent: Tuesday, May 24, 2005 5:27 PM To: 'wtr-general at rubyforge.org' Subject: RE: Access is denied and Exception Errors Hi Paul, I tried your suggestion and it still has the Access Denied issue. I am not sure what to do about the page being hosted on a different domain! Thanks again for your help. I don't want to give up!: irb(main):028:0> puts ie.frame(:index,1).text WIN32OLERuntimeError: document OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1844:in `method_missing' from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1844:in `getDocument' from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1534:in `text' from (irb):28 from :0 irb(main):029:0> puts ie.frame(:index,2).text WIN32OLERuntimeError: document OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1844:in `method_missing' from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1844:in `getDocument' from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1534:in `text' from (irb):29 from :0 -----Original Message----- From: wtr-general-request at rubyforge.org [mailto:wtr-general-request at rubyforge.org] Sent: Tuesday, May 24, 2005 4:47 PM To: wtr-general at rubyforge.org Subject: Wtr-general Digest, Vol 18, Issue 34 Send Wtr-general mailing list submissions to wtr-general at rubyforge.org To subscribe or unsubscribe via the World Wide Web, visit http://rubyforge.org/mailman/listinfo/wtr-general or, via email, send a message with subject or body 'help' to wtr-general-request at rubyforge.org You can reach the person managing the list at wtr-general-owner at rubyforge.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Wtr-general digest..." Today's Topics: 1. RE: Unable to click the "Ok" button in a Javascriptalert box (Paul Rogers) 2. Access is denied and Exception Errors (Tuyet Cong-Ton-Nu) 3. RE: Access is denied and Exception Errors (Paul Rogers) 4. RE: Unable to click the "Ok" button in a Javascriptalert box (Paul Rogers) 5. RE: problem with page refresh & variables (Paul Rogers) 6. Re: Unable to click the "Ok" button in a Javascriptalert box (Jared Luxenberg) 7. Re: IE.attach (Alexey Verkhovsky) 8. Re: Unable to click the "Ok" button in a Javascript alert box (still not working) (Jared Luxenberg) ---------------------------------------------------------------------- Message: 1 Date: Tue, 24 May 2005 15:50:17 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box To: wtr-general at rubyforge.org Message-ID: <005f01c560aa$93368de0$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii The installer should install the autoit activex control for you. Did you use the gui installer? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg Sent: 24 May 2005 15:43 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box Ah, yes that was the problem. I found AutoIt and installed it. The AutoIt install step should be added to the user guide, and the tests should probably raise an exception Thanks for the quick response, Jared Paul Rogers wrote: >It looks to me like you don't have autoit installed. > >We need to fix the code to raise an excepton if the autoit activex >control isnt found > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 14:12 >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >alert box > > >On my computer, when I run the unittests/jscript_test.rb unit test, a >Javascript alert() box comes up that says "Press OK". The box does not >go away automatically. If I press OK, the box goes away but nothing >else happens and it looks like the unit test is waiting for something to > >happen. This happens with the latest release (1.3.1) and the CVS as of >5/24/05 at 4pm. > >Isn't WATIR supposed to click the button automatically? I ask because >I'm trying to use WATIR to test my applicaiton, and I need to be able to > >click the OK button in javascript alerts. > >Any help would be appreciated, >Jared > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > ------------------------------ Message: 2 Date: Tue, 24 May 2005 15:11:11 -0700 From: Tuyet Cong-Ton-Nu Subject: [Wtr-general] Access is denied and Exception Errors To: "'wtr-general at rubyforge.org'" Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi, I am not sure why I am getting this "Access is denied" error. How do I find out what the HRESILT code means or what the Exceptions mean? I also tried to follow your suggestions Chris and Jonathan, but can't seem to get to the "main" frame or the "relay" frame due to the Access Denied problem. Sorry, I am a newbie, and it's hard to tell whether the problem is caused by the real application, or maybe my settings/file locations are not correct. Any help is very much appreciated! I just want to prove to my manager that we can use Watir and I have to at least get my 1 test case working (which is to Login to the application). Thanks! irb(main):004:0> ie.goto("https://qa-common-b4.dev.com") W, [24-May-2005 14:48:58#2132] WARN -- : frame error in waitdocument OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `method_missing' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `upto' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1332:in `goto' (irb):4:in `irb_binding' C:/ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' :0 W, [24-May-2005 14:48:58#2132] WARN -- : runtime error in wait => 0.281 irb(main):005:0> ie.show_all_objects -----------Objects in page ------------- id= src=/include/top.js HTML Document name=relay id= src=/include/blank.htm l HTML Document name=main id= src=/araneae/login => nil irb(main):006:0> ie.show_frames there are 2 frames frame index: 0 --Access Denied-- frame index: 1 --Access Denied-- => 0..1 ------------------------------ Message: 3 Date: Tue, 24 May 2005 16:24:43 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Access is denied and Exception Errors To: wtr-general at rubyforge.org Message-ID: <006201c560af$6277f860$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii Don't worry about the OLE exception you see. The access denied means that we cant access parts of the page as its hosted on a different domain. Im curious why the 2 show_ methods do different things though, I'll try and look into it You can probably access the frames using this puts ie.frame(:index,1).text puts ie.frame(:index,2).text You should see the text from each frame displayed in the console Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Tuyet Cong-Ton-Nu Sent: 24 May 2005 16:11 To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] Access is denied and Exception Errors Hi, I am not sure why I am getting this "Access is denied" error. How do I find out what the HRESILT code means or what the Exceptions mean? I also tried to follow your suggestions Chris and Jonathan, but can't seem to get to the "main" frame or the "relay" frame due to the Access Denied problem. Sorry, I am a newbie, and it's hard to tell whether the problem is caused by the real application, or maybe my settings/file locations are not correct. Any help is very much appreciated! I just want to prove to my manager that we can use Watir and I have to at least get my 1 test case working (which is to Login to the application). Thanks! irb(main):004:0> ie.goto("https://qa-common-b4.dev.com") W, [24-May-2005 14:48:58#2132] WARN -- : frame error in waitdocument OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `method_missing' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `upto' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1332:in `goto' (irb):4:in `irb_binding' C:/ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' :0 W, [24-May-2005 14:48:58#2132] WARN -- : runtime error in wait => 0.281 irb(main):005:0> ie.show_all_objects -----------Objects in page ------------- id= src=/include/top.js HTML Document name=relay id= src=/include/blank.htm l HTML Document name=main id= src=/araneae/login => nil irb(main):006:0> ie.show_frames there are 2 frames frame index: 0 --Access Denied-- frame index: 1 --Access Denied-- => 0..1 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------ Message: 4 Date: Tue, 24 May 2005 16:28:15 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box To: wtr-general at rubyforge.org Message-ID: <006301c560af$e0ae74c0$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii Ive checked in a version of this test that raises an exception if autoit isnt found Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg Sent: 24 May 2005 15:43 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box Ah, yes that was the problem. I found AutoIt and installed it. The AutoIt install step should be added to the user guide, and the tests should probably raise an exception Thanks for the quick response, Jared Paul Rogers wrote: >It looks to me like you don't have autoit installed. > >We need to fix the code to raise an excepton if the autoit activex >control isnt found > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 14:12 >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >alert box > > >On my computer, when I run the unittests/jscript_test.rb unit test, a >Javascript alert() box comes up that says "Press OK". The box does not >go away automatically. If I press OK, the box goes away but nothing >else happens and it looks like the unit test is waiting for something to > >happen. This happens with the latest release (1.3.1) and the CVS as of >5/24/05 at 4pm. > >Isn't WATIR supposed to click the button automatically? I ask because >I'm trying to use WATIR to test my applicaiton, and I need to be able to > >click the OK button in javascript alerts. > >Any help would be appreciated, >Jared > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > ------------------------------ Message: 5 Date: Tue, 24 May 2005 16:47:42 -0600 From: Paul Rogers Subject: RE: [Wtr-general] problem with page refresh & variables To: wtr-general at rubyforge.org Message-ID: <006401c560b2$9827d680$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii Ive added it for spans, divs and p tags, and there is a unit test too. I'll add it for other objects now Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 24 May 2005 15:10 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] problem with page refresh & variables Hi Paul, that would be helpful if Ruby would have such a method :) I think it is important because 1. if you have a lot of data to sort through, (going row by row) and once you find it, you want to store it's information conveniently for quick retrieval during later use. 2. right now, to find all objects associated with a certain row, I have to search from the top of the table to the bottom (which is fine if I only do that once) but since those objects lose its values after a refresh, I have to perform that search all over again and reassign those variables which takes up time Regardless, I'm still extremely happy with Watir! :) Shao On 5/24/05, Paul Rogers wrote: > The objects that use assign to a and b no longer exist once the page > has reloaded, so you would need to do > > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > > a.set --> which works fine > > > #hit the update button, which then refreshes the page. If I now try > to access the checkbox and do > > # a and b no longer exist, so need to redifene them > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > > > a.clear > > > Perhaps we need a refresh method, so that ou could do > > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > > a.set --> which works fine > > > #hit the update button, which then refreshes the page. If I now try > to access the checkbox and do > > # a and b no longer exist, so need to redifene them > > a.refresh > b.refresh > a.clear > > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 24 May 2005 11:14 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] problem with page refresh & variables > > > I'm testing a webpage that has a table with rows of products and a few > columns for each product that contains check boxes that can be checked > off > > > Right when I get to this page, I locate the row (product) I'm > interested in and I SAVE all of the objects in each column for that > product into variables. > > for example > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > ... > > I check off some checkboxes, by doing > > a.set --> which works fine > > hit the update button, which then refreshes the page. If I now try to > access the checkbox and do > > a.clear > > I get the error: > > ERROR: Error!! Aborting Test Case --> > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2 > 112:in `invoke': Unknown property or method `disabled' > HRESULT error code:0x80070005 > Access is denied. > > > Any idea why a saved object b4 a page refresh can't be accessed after > a page refresh? > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------ Message: 6 Date: Tue, 24 May 2005 19:32:14 -0400 From: Jared Luxenberg Subject: Re: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box To: wtr-general at rubyforge.org Message-ID: <4293B97E.9010900 at comcast.net> Content-Type: text/plain; charset="us-ascii" Yes, I ran the install.rb file and had the "Install AutoIt" checkbox checked. - Jared Paul Rogers wrote: >The installer should install the autoit activex control for you. Did you >use the gui installer? > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 15:43 >To: wtr-general at rubyforge.org >Subject: Re: [Wtr-general] Unable to click the "Ok" button in a >Javascriptalert box > > >Ah, yes that was the problem. I found AutoIt and installed it. The >AutoIt install step should be added to the user guide, and the tests >should probably raise an exception > >Thanks for the quick response, >Jared > >Paul Rogers wrote: > > > >>It looks to me like you don't have autoit installed. >> >>We need to fix the code to raise an excepton if the autoit activex >>control isnt found >> >>Paul >> >>-----Original Message----- >>From: wtr-general-bounces at rubyforge.org >>[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >>Sent: 24 May 2005 14:12 >>To: wtr-general at rubyforge.org >>Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >>alert box >> >> >>On my computer, when I run the unittests/jscript_test.rb unit test, a >>Javascript alert() box comes up that says "Press OK". The box does not >> >> > > > >>go away automatically. If I press OK, the box goes away but nothing >>else happens and it looks like the unit test is waiting for something >> >> >to > > >>happen. This happens with the latest release (1.3.1) and the CVS as of >>5/24/05 at 4pm. >> >>Isn't WATIR supposed to click the button automatically? I ask because >>I'm trying to use WATIR to test my applicaiton, and I need to be able >> >> >to > > >>click the OK button in javascript alerts. >> >>Any help would be appreciated, >>Jared >> >>_______________________________________________ >>Wtr-general mailing list >>Wtr-general at rubyforge.org >>http://rubyforge.org/mailman/listinfo/wtr-general >> >> >> >> >> > > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 254 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050524/3ab9ef97/sig nature-0001.bin ------------------------------ Message: 7 Date: Tue, 24 May 2005 19:52:41 -0400 From: Alexey Verkhovsky Subject: Re: [Wtr-general] IE.attach To: wtr-general at rubyforge.org Message-ID: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Andy Sipe wrote: > On another note, are you the Alexey who is the maintainer of the > Test/Unit Report project? > Email me. I'm surprised to hear that this project has any real users - except that I used it myself while I needed it :) -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) ------------------------------ Message: 8 Date: Tue, 24 May 2005 19:53:42 -0400 From: Jared Luxenberg Subject: Re: [Wtr-general] Unable to click the "Ok" button in a Javascript alert box (still not working) To: wtr-general at rubyforge.org Message-ID: <4293BE86.3030309 at comcast.net> Content-Type: text/plain; charset="iso-8859-1" This is odd. It turns out I did have AutoIt installed before I ran the AutoIt installer. After running the AutoIt installer, I re-ran the jscript_test.rb test and it worked. But I just ran the test again, and now it's not working anymore. I have the latest version of Ruby, and I just grabbed the most recent CVS copy of Watir a minute ago. If I un-register the AutoIt DLL, the test produces an error, but if I re-register the DLL the test does the same thing as before (doesn't give me an error, but doesn't work either). - Jared Paul Rogers wrote: >It looks to me like you don't have autoit installed. > >We need to fix the code to raise an excepton if the autoit activex >control isnt found > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 14:12 >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >alert box > > >On my computer, when I run the unittests/jscript_test.rb unit test, a >Javascript alert() box comes up that says "Press OK". The box does not >go away automatically. If I press OK, the box goes away but nothing >else happens and it looks like the unit test is waiting for something to > >happen. This happens with the latest release (1.3.1) and the CVS as of >5/24/05 at 4pm. > >Isn't WATIR supposed to click the button automatically? I ask because >I'm trying to use WATIR to test my applicaiton, and I need to be able to > >click the OK button in javascript alerts. > >Any help would be appreciated, >Jared > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 254 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050524/78ed43ab/sig nature.bin ------------------------------ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general End of Wtr-general Digest, Vol 18, Issue 34 ******************************************* From paul.rogers at shaw.ca Wed May 25 13:18:32 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 25 May 2005 11:18:32 -0600 Subject: [Wtr-general] FW: Access is denied and Exception Errors In-Reply-To: Message-ID: <001f01c5614d$c6ab7a70$72d39044@NewDell> No the permission denied is from the web browser. Its to stop cross domain scripting attacks. This article descibes it: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/om/xf rame_scripting_security.asp If you right click on each of the frames and do a view properties you should be able to view the url If your pc is not in the same domain ( If I remember correctly) you wont be able to acccess the content. I think this only applies to pages that use frames. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Tuyet Cong-Ton-Nu Sent: 25 May 2005 11:08 To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] FW: Access is denied and Exception Errors Hello, In your last response you mentioned: "The access denied means that we cant access parts of the page as its hosted on a different domain." Is this a permission issue on the machine that's hosting the page? Should I ask for Read/Write permission for WATIR? Not sure how to go about this? I still can't get to any fields on my Login page. Per my email below, I am not sure what to try next? -----Original Message----- From: Tuyet Cong-Ton-Nu Sent: Tuesday, May 24, 2005 5:27 PM To: 'wtr-general at rubyforge.org' Subject: RE: Access is denied and Exception Errors Hi Paul, I tried your suggestion and it still has the Access Denied issue. I am not sure what to do about the page being hosted on a different domain! Thanks again for your help. I don't want to give up!: irb(main):028:0> puts ie.frame(:index,1).text WIN32OLERuntimeError: document OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1844:in `method_missing' from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1844:in `getDocument' from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1534:in `text' from (irb):28 from :0 irb(main):029:0> puts ie.frame(:index,2).text WIN32OLERuntimeError: document OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1844:in `method_missing' from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1844:in `getDocument' from C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1534:in `text' from (irb):29 from :0 -----Original Message----- From: wtr-general-request at rubyforge.org [mailto:wtr-general-request at rubyforge.org] Sent: Tuesday, May 24, 2005 4:47 PM To: wtr-general at rubyforge.org Subject: Wtr-general Digest, Vol 18, Issue 34 Send Wtr-general mailing list submissions to wtr-general at rubyforge.org To subscribe or unsubscribe via the World Wide Web, visit http://rubyforge.org/mailman/listinfo/wtr-general or, via email, send a message with subject or body 'help' to wtr-general-request at rubyforge.org You can reach the person managing the list at wtr-general-owner at rubyforge.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Wtr-general digest..." Today's Topics: 1. RE: Unable to click the "Ok" button in a Javascriptalert box (Paul Rogers) 2. Access is denied and Exception Errors (Tuyet Cong-Ton-Nu) 3. RE: Access is denied and Exception Errors (Paul Rogers) 4. RE: Unable to click the "Ok" button in a Javascriptalert box (Paul Rogers) 5. RE: problem with page refresh & variables (Paul Rogers) 6. Re: Unable to click the "Ok" button in a Javascriptalert box (Jared Luxenberg) 7. Re: IE.attach (Alexey Verkhovsky) 8. Re: Unable to click the "Ok" button in a Javascript alert box (still not working) (Jared Luxenberg) ---------------------------------------------------------------------- Message: 1 Date: Tue, 24 May 2005 15:50:17 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box To: wtr-general at rubyforge.org Message-ID: <005f01c560aa$93368de0$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii The installer should install the autoit activex control for you. Did you use the gui installer? Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg Sent: 24 May 2005 15:43 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box Ah, yes that was the problem. I found AutoIt and installed it. The AutoIt install step should be added to the user guide, and the tests should probably raise an exception Thanks for the quick response, Jared Paul Rogers wrote: >It looks to me like you don't have autoit installed. > >We need to fix the code to raise an excepton if the autoit activex >control isnt found > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 14:12 >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >alert box > > >On my computer, when I run the unittests/jscript_test.rb unit test, a >Javascript alert() box comes up that says "Press OK". The box does not >go away automatically. If I press OK, the box goes away but nothing >else happens and it looks like the unit test is waiting for something to > >happen. This happens with the latest release (1.3.1) and the CVS as of >5/24/05 at 4pm. > >Isn't WATIR supposed to click the button automatically? I ask because >I'm trying to use WATIR to test my applicaiton, and I need to be able to > >click the OK button in javascript alerts. > >Any help would be appreciated, >Jared > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > ------------------------------ Message: 2 Date: Tue, 24 May 2005 15:11:11 -0700 From: Tuyet Cong-Ton-Nu Subject: [Wtr-general] Access is denied and Exception Errors To: "'wtr-general at rubyforge.org'" Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi, I am not sure why I am getting this "Access is denied" error. How do I find out what the HRESILT code means or what the Exceptions mean? I also tried to follow your suggestions Chris and Jonathan, but can't seem to get to the "main" frame or the "relay" frame due to the Access Denied problem. Sorry, I am a newbie, and it's hard to tell whether the problem is caused by the real application, or maybe my settings/file locations are not correct. Any help is very much appreciated! I just want to prove to my manager that we can use Watir and I have to at least get my 1 test case working (which is to Login to the application). Thanks! irb(main):004:0> ie.goto("https://qa-common-b4.dev.com") W, [24-May-2005 14:48:58#2132] WARN -- : frame error in waitdocument OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `method_missing' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `upto' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1332:in `goto' (irb):4:in `irb_binding' C:/ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' :0 W, [24-May-2005 14:48:58#2132] WARN -- : runtime error in wait => 0.281 irb(main):005:0> ie.show_all_objects -----------Objects in page ------------- id= src=/include/top.js HTML Document name=relay id= src=/include/blank.htm l HTML Document name=main id= src=/araneae/login => nil irb(main):006:0> ie.show_frames there are 2 frames frame index: 0 --Access Denied-- frame index: 1 --Access Denied-- => 0..1 ------------------------------ Message: 3 Date: Tue, 24 May 2005 16:24:43 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Access is denied and Exception Errors To: wtr-general at rubyforge.org Message-ID: <006201c560af$6277f860$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii Don't worry about the OLE exception you see. The access denied means that we cant access parts of the page as its hosted on a different domain. Im curious why the 2 show_ methods do different things though, I'll try and look into it You can probably access the frames using this puts ie.frame(:index,1).text puts ie.frame(:index,2).text You should see the text from each frame displayed in the console Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Tuyet Cong-Ton-Nu Sent: 24 May 2005 16:11 To: 'wtr-general at rubyforge.org' Subject: [Wtr-general] Access is denied and Exception Errors Hi, I am not sure why I am getting this "Access is denied" error. How do I find out what the HRESILT code means or what the Exceptions mean? I also tried to follow your suggestions Chris and Jonathan, but can't seem to get to the "main" frame or the "relay" frame due to the Access Denied problem. Sorry, I am a newbie, and it's hard to tell whether the problem is caused by the real application, or maybe my settings/file locations are not correct. Any help is very much appreciated! I just want to prove to my manager that we can use Watir and I have to at least get my 1 test case working (which is to Login to the application). Thanks! irb(main):004:0> ie.goto("https://qa-common-b4.dev.com") W, [24-May-2005 14:48:58#2132] WARN -- : frame error in waitdocument OLE error code:80070005 in Access is denied. HRESULT error code:0x80020009 Exception occurred. C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `method_missing' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1470:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `upto' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1469:in `waitForIE' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1332:in `goto' (irb):4:in `irb_binding' C:/ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' :0 W, [24-May-2005 14:48:58#2132] WARN -- : runtime error in wait => 0.281 irb(main):005:0> ie.show_all_objects -----------Objects in page ------------- id= src=/include/top.js HTML Document name=relay id= src=/include/blank.htm l HTML Document name=main id= src=/araneae/login => nil irb(main):006:0> ie.show_frames there are 2 frames frame index: 0 --Access Denied-- frame index: 1 --Access Denied-- => 0..1 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------ Message: 4 Date: Tue, 24 May 2005 16:28:15 -0600 From: Paul Rogers Subject: RE: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box To: wtr-general at rubyforge.org Message-ID: <006301c560af$e0ae74c0$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii Ive checked in a version of this test that raises an exception if autoit isnt found Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg Sent: 24 May 2005 15:43 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box Ah, yes that was the problem. I found AutoIt and installed it. The AutoIt install step should be added to the user guide, and the tests should probably raise an exception Thanks for the quick response, Jared Paul Rogers wrote: >It looks to me like you don't have autoit installed. > >We need to fix the code to raise an excepton if the autoit activex >control isnt found > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 14:12 >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >alert box > > >On my computer, when I run the unittests/jscript_test.rb unit test, a >Javascript alert() box comes up that says "Press OK". The box does not >go away automatically. If I press OK, the box goes away but nothing >else happens and it looks like the unit test is waiting for something to > >happen. This happens with the latest release (1.3.1) and the CVS as of >5/24/05 at 4pm. > >Isn't WATIR supposed to click the button automatically? I ask because >I'm trying to use WATIR to test my applicaiton, and I need to be able to > >click the OK button in javascript alerts. > >Any help would be appreciated, >Jared > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > ------------------------------ Message: 5 Date: Tue, 24 May 2005 16:47:42 -0600 From: Paul Rogers Subject: RE: [Wtr-general] problem with page refresh & variables To: wtr-general at rubyforge.org Message-ID: <006401c560b2$9827d680$72d39044 at NewDell> Content-Type: text/plain; charset=us-ascii Ive added it for spans, divs and p tags, and there is a unit test too. I'll add it for other objects now Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat Sent: 24 May 2005 15:10 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] problem with page refresh & variables Hi Paul, that would be helpful if Ruby would have such a method :) I think it is important because 1. if you have a lot of data to sort through, (going row by row) and once you find it, you want to store it's information conveniently for quick retrieval during later use. 2. right now, to find all objects associated with a certain row, I have to search from the top of the table to the bottom (which is fine if I only do that once) but since those objects lose its values after a refresh, I have to perform that search all over again and reassign those variables which takes up time Regardless, I'm still extremely happy with Watir! :) Shao On 5/24/05, Paul Rogers wrote: > The objects that use assign to a and b no longer exist once the page > has reloaded, so you would need to do > > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > > a.set --> which works fine > > > #hit the update button, which then refreshes the page. If I now try > to access the checkbox and do > > # a and b no longer exist, so need to redifene them > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > > > a.clear > > > Perhaps we need a refresh method, so that ou could do > > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > > a.set --> which works fine > > > #hit the update button, which then refreshes the page. If I now try > to access the checkbox and do > > # a and b no longer exist, so need to redifene them > > a.refresh > b.refresh > a.clear > > > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Shao Kang Tat > Sent: 24 May 2005 11:14 > To: wtr-general at rubyforge.org > Subject: [Wtr-general] problem with page refresh & variables > > > I'm testing a webpage that has a table with rows of products and a few > columns for each product that contains check boxes that can be checked > off > > > Right when I get to this page, I locate the row (product) I'm > interested in and I SAVE all of the objects in each column for that > product into variables. > > for example > > a = $ie.checkbox(:id, /BF/) > b = $ie.checkbox(:id, /TF/) > ... > > I check off some checkboxes, by doing > > a.set --> which works fine > > hit the update button, which then refreshes the page. If I now try to > access the checkbox and do > > a.clear > > I get the error: > > ERROR: Error!! Aborting Test Case --> > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2 > 112:in `invoke': Unknown property or method `disabled' > HRESULT error code:0x80070005 > Access is denied. > > > Any idea why a saved object b4 a page refresh can't be accessed after > a page refresh? > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------ Message: 6 Date: Tue, 24 May 2005 19:32:14 -0400 From: Jared Luxenberg Subject: Re: [Wtr-general] Unable to click the "Ok" button in a Javascriptalert box To: wtr-general at rubyforge.org Message-ID: <4293B97E.9010900 at comcast.net> Content-Type: text/plain; charset="us-ascii" Yes, I ran the install.rb file and had the "Install AutoIt" checkbox checked. - Jared Paul Rogers wrote: >The installer should install the autoit activex control for you. Did you >use the gui installer? > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 15:43 >To: wtr-general at rubyforge.org >Subject: Re: [Wtr-general] Unable to click the "Ok" button in a >Javascriptalert box > > >Ah, yes that was the problem. I found AutoIt and installed it. The >AutoIt install step should be added to the user guide, and the tests >should probably raise an exception > >Thanks for the quick response, >Jared > >Paul Rogers wrote: > > > >>It looks to me like you don't have autoit installed. >> >>We need to fix the code to raise an excepton if the autoit activex >>control isnt found >> >>Paul >> >>-----Original Message----- >>From: wtr-general-bounces at rubyforge.org >>[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >>Sent: 24 May 2005 14:12 >>To: wtr-general at rubyforge.org >>Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >>alert box >> >> >>On my computer, when I run the unittests/jscript_test.rb unit test, a >>Javascript alert() box comes up that says "Press OK". The box does not >> >> > > > >>go away automatically. If I press OK, the box goes away but nothing >>else happens and it looks like the unit test is waiting for something >> >> >to > > >>happen. This happens with the latest release (1.3.1) and the CVS as of >>5/24/05 at 4pm. >> >>Isn't WATIR supposed to click the button automatically? I ask because >>I'm trying to use WATIR to test my applicaiton, and I need to be able >> >> >to > > >>click the OK button in javascript alerts. >> >>Any help would be appreciated, >>Jared >> >>_______________________________________________ >>Wtr-general mailing list >>Wtr-general at rubyforge.org >>http://rubyforge.org/mailman/listinfo/wtr-general >> >> >> >> >> > > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 254 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050524/3ab9ef97 /sig nature-0001.bin ------------------------------ Message: 7 Date: Tue, 24 May 2005 19:52:41 -0400 From: Alexey Verkhovsky Subject: Re: [Wtr-general] IE.attach To: wtr-general at rubyforge.org Message-ID: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Andy Sipe wrote: > On another note, are you the Alexey who is the maintainer of the > Test/Unit Report project? > Email me. I'm surprised to hear that this project has any real users - except that I used it myself while I needed it :) -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) ------------------------------ Message: 8 Date: Tue, 24 May 2005 19:53:42 -0400 From: Jared Luxenberg Subject: Re: [Wtr-general] Unable to click the "Ok" button in a Javascript alert box (still not working) To: wtr-general at rubyforge.org Message-ID: <4293BE86.3030309 at comcast.net> Content-Type: text/plain; charset="iso-8859-1" This is odd. It turns out I did have AutoIt installed before I ran the AutoIt installer. After running the AutoIt installer, I re-ran the jscript_test.rb test and it worked. But I just ran the test again, and now it's not working anymore. I have the latest version of Ruby, and I just grabbed the most recent CVS copy of Watir a minute ago. If I un-register the AutoIt DLL, the test produces an error, but if I re-register the DLL the test does the same thing as before (doesn't give me an error, but doesn't work either). - Jared Paul Rogers wrote: >It looks to me like you don't have autoit installed. > >We need to fix the code to raise an excepton if the autoit activex >control isnt found > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jared Luxenberg >Sent: 24 May 2005 14:12 >To: wtr-general at rubyforge.org >Subject: [Wtr-general] Unable to click the "Ok" button in a Javascript >alert box > > >On my computer, when I run the unittests/jscript_test.rb unit test, a >Javascript alert() box comes up that says "Press OK". The box does not >go away automatically. If I press OK, the box goes away but nothing >else happens and it looks like the unit test is waiting for something to > >happen. This happens with the latest release (1.3.1) and the CVS as of >5/24/05 at 4pm. > >Isn't WATIR supposed to click the button automatically? I ask because >I'm trying to use WATIR to test my applicaiton, and I need to be able to > >click the OK button in javascript alerts. > >Any help would be appreciated, >Jared > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 254 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/wtr-general/attachments/20050524/78ed43ab /sig nature.bin ------------------------------ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general End of Wtr-general Digest, Vol 18, Issue 34 ******************************************* _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From kevin.christen at valtech.com Wed May 25 14:34:07 2005 From: kevin.christen at valtech.com (Kevin Christen) Date: Wed, 25 May 2005 13:34:07 -0500 Subject: [Wtr-general] watir & databases In-Reply-To: <593b9ae80505250839202aab5f@mail.gmail.com> References: <593b9ae80505250839202aab5f@mail.gmail.com> Message-ID: <4294C51F.2030809@valtech.com> To use DBI against SQL Server, try a connection string like this: DBI:ADO:Provider=SQLOLEDB;Data Source=(local);Initial Catalog=Northwind;User Id=abc;Password=xyz; -- Kevin Shao Kang Tat wrote: >I'm back with more questions :) > >I want to connect to a database after a test runs, to delete something >that was added to the database. Right now, the code is as follows: > >********************************************************************** >require 'dbi' ># connects to database >ConnectionString = >"PROVIDER=SQLOLEDB;DATABASE=SOME_DB;Server=xx.x.x.xx;UID=yy;PWD=zz;Address=nn.n.n.nn,nnnn;network >library=something" > >dbh = DBI.connect(ConnectionString, login, password) >*********************************************************************** >errors out to be: > >c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:519:in `parse_url': Invalid Data Sourc >e Name (DBI::InterfaceError) > from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:400:in `_get_full_driver' > > from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:381:in `connect' > from C:/Documents and Settings/stat/Desktop/Watir/blah/DeleteGlobalBudg >et.rb > >Any advice? I got this sample code off the internet. I'm sure the >connection string is correct as it is part of a vb script that is >currently being used to do the same thing... (I'm not too experienced >with DB's other than knowing how to SQL). Is watir/ruby able to get >into databases to manipulate tables that would otherwise be accessed >through SQL Server Enterprise Manager? > >Thanks! > >Shao > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > > From bret at pettichord.com Wed May 25 16:27:10 2005 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 25 May 2005 15:27:10 -0500 Subject: [Wtr-general] Another way of specifying attributes In-Reply-To: <001601c5614c$1c544260$72d39044@NewDell> References: <20050525162806.65358.qmail@web32204.mail.mud.yahoo.com> Message-ID: <5.1.0.14.2.20050525152457.030f1db8@127.0.0.1> Not as nice is right. I believe that once you click the 'b', the next b (and the collection containing it) will no longer reference valid OLE objects. This will cause a WIN32OLE Runtime error. Bret At 12:06 PM 5/25/2005, Paul Rogers wrote: >Possibly not as nice a solution than having something like ie.button( { >:name=>'foo' , :value=>'bar' , :id=>'x'} ) >is to use the iterator > ie.buttons.each do |b| > b.click if b.name=='foo' and b.value=='bar' and b.id=='x' > end > >This allows you to acces anything, and saves me the trouble of writing >unittests ;-) _____________________ Bret Pettichord www.pettichord.com From paul.rogers at shaw.ca Wed May 25 17:12:22 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 25 May 2005 15:12:22 -0600 Subject: [Wtr-general] Another way of specifying attributes In-Reply-To: <5.1.0.14.2.20050525152457.030f1db8@127.0.0.1> Message-ID: <002d01c5616e$71b1ed30$72d39044@NewDell> Well, only if the button causes a page transition. You can add a break after the click to prevent the win32ole error. Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: 25 May 2005 14:27 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] Another way of specifying attributes Not as nice is right. I believe that once you click the 'b', the next b (and the collection containing it) will no longer reference valid OLE objects. This will cause a WIN32OLE Runtime error. Bret At 12:06 PM 5/25/2005, Paul Rogers wrote: >Possibly not as nice a solution than having something like ie.button( { >:name=>'foo' , :value=>'bar' , :id=>'x'} ) is to use the iterator > ie.buttons.each do |b| > b.click if b.name=='foo' and b.value=='bar' and b.id=='x' > end > >This allows you to acces anything, and saves me the trouble of writing >unittests ;-) _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From tuyet.ctn at mscibarra.com Wed May 25 18:13:16 2005 From: tuyet.ctn at mscibarra.com (Tuyet Cong-Ton-Nu) Date: Wed, 25 May 2005 15:13:16 -0700 Subject: [Wtr-general] Access is denied and Exception Errors Message-ID: OK, I may have something here. When I right-click on the Login page of my application, I can actually see some HTML tags such as:
______________________________________________________________________ So how can I use the above tags to write my test case if WATIR doesn't seem them? irb(main):063:0> ie.show_all_objects -----------Objects in page ------------- id= src=/include/top.js HTML Document name=relay id= src=/include/blank.htm l HTML Document name=main id= src=/araneae/login => nil irb(main):064:0> ie.url => "https://qa-common-b1.dev.com/araneae/app" irb(main):065:0> ie.show_frames there are 2 frames frame index: 0 --Access Denied-- frame index: 1 --Access Denied-- => 0..1 irb(main):066:0> ie.show_forms There are 0 forms => 0..-1 From christopher.mcmahon at gmail.com Wed May 25 18:25:21 2005 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 25 May 2005 16:25:21 -0600 Subject: [Wtr-general] Access is denied and Exception Errors In-Reply-To: References: Message-ID: <72799cd705052515253b387c92@mail.gmail.com> > > ______________________________________________________________________ > So how can I use the above tags to write my test case if WATIR doesn't seem > them? Take a look at the frames and iframes scripts in the watir unittests folder. Also see the google_maps example in the examples folder. -Chris From alex at verk.info Wed May 25 18:48:08 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Wed, 25 May 2005 18:48:08 -0400 Subject: [Wtr-general] Another way of specifying attributes In-Reply-To: <001601c5614c$1c544260$72d39044@NewDell> References: <001601c5614c$1c544260$72d39044@NewDell> Message-ID: Paul Rogers wrote: >Possibly not as nice a solution than having something like ie.button( { >:name=>'foo' , :value=>'bar' , :id=>'x'} ) > > By the way, ie.button( {:name=>'foo' , :value=>'bar' , :id=>'x'} ) and ie.button :name => 'foo' , :value => 'bar' , :id => 'x' are both valid Ruby and mean exactly the same thing :) -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) From paul.rogers at shaw.ca Wed May 25 21:34:07 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 25 May 2005 19:34:07 -0600 Subject: [Wtr-general] Another way of specifying attributes In-Reply-To: Message-ID: <003601c56193$0212f210$72d39044@NewDell> Interesting - how does ruby know how to distinguish a hash from multiple parameters? -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alexey Verkhovsky Sent: 25 May 2005 16:48 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Another way of specifying attributes Paul Rogers wrote: >Possibly not as nice a solution than having something like ie.button( { >:name=>'foo' , :value=>'bar' , :id=>'x'} ) > > By the way, ie.button( {:name=>'foo' , :value=>'bar' , :id=>'x'} ) and ie.button :name => 'foo' , :value => 'bar' , :id => 'x' are both valid Ruby and mean exactly the same thing :) -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From alex at verk.info Wed May 25 21:51:22 2005 From: alex at verk.info (Alexey Verkhovsky) Date: Wed, 25 May 2005 21:51:22 -0400 Subject: [Wtr-general] Another way of specifying attributes In-Reply-To: <003601c56193$0212f210$72d39044@NewDell> References: <003601c56193$0212f210$72d39044@NewDell> Message-ID: Paul Rogers wrote: >Interesting - how does ruby know how to distinguish a hash from multiple >parameters? > > => tells that it's a hash -- Best regards, Alexey Verkhovsky Ruby Forum: http://ruby-forum.org (moderator) RForum: http://rforum.andreas-s.net (co-author) Instiki: http://instiki.org (maintainer) From bret at pettichord.com Thu May 26 01:56:19 2005 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 26 May 2005 00:56:19 -0500 Subject: [Wtr-general] Another way of specifying attributes In-Reply-To: <002d01c5616e$71b1ed30$72d39044@NewDell> References: <5.1.0.14.2.20050525152457.030f1db8@127.0.0.1> Message-ID: <5.1.0.14.2.20050526005323.03135f28@127.0.0.1> But that now takes us beyond 'possibly not as nice' to 'really quite evil'. Bret At 04:12 PM 5/25/2005, Paul Rogers wrote: >Well, only if the button causes a page transition. You can add a break >after the click to prevent the win32ole error. > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord >Sent: 25 May 2005 14:27 >To: wtr-general at rubyforge.org >Subject: RE: [Wtr-general] Another way of specifying attributes > > >Not as nice is right. I believe that once you click the 'b', the next b >(and the collection containing it) will no longer reference valid OLE >objects. This will cause a WIN32OLE Runtime error. > >Bret > >At 12:06 PM 5/25/2005, Paul Rogers wrote: > >Possibly not as nice a solution than having something like ie.button( { > > >:name=>'foo' , :value=>'bar' , :id=>'x'} ) is to use the iterator > > ie.buttons.each do |b| > > b.click if b.name=='foo' and b.value=='bar' and b.id=='x' > > end > > > >This allows you to acces anything, and saves me the trouble of writing > >unittests ;-) > >_____________________ > Bret Pettichord > www.pettichord.com > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com From bret at pettichord.com Thu May 26 02:04:53 2005 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 26 May 2005 01:04:53 -0500 Subject: [Wtr-general] Access is denied and Exception Errors In-Reply-To: Message-ID: <5.1.0.14.2.20050526010335.01bad9a0@127.0.0.1> At 05:13 PM 5/25/2005, Tuyet Cong-Ton-Nu wrote: >So how can I use the above tags to write my test case if WATIR doesn't seem >them? The cross-site scripting limits prevent Watir from navigating from a frame hosted by one server to another frame hosted by another server. You can work around this limit, but giving Watir the URL for the new frame directly (ie.goto). _____________________ Bret Pettichord www.pettichord.com From Jan.Montano at thomson.com Thu May 26 05:33:50 2005 From: Jan.Montano at thomson.com (Jan.Montano at thomson.com) Date: Thu, 26 May 2005 17:33:50 +0800 Subject: [Wtr-general] alertboxes on silent mode Message-ID: <71EA7CA4B789864F9B3AC722A7F016B68DBE10@tfphmanilmul01.ERF.THOMSON.COM> Hi! I'm trying to run my script using the -b option for silent mode or invisible mode. However, whenever there are alertboxes, somehow, the script is not able to close the alertboxes. but in ordinary mode or visible mode, it runs smoothly. Do I need to install an additional component when running in silent mode? please advise. Thanks. From ksraghavan2000 at yahoo.com Thu May 26 07:43:27 2005 From: ksraghavan2000 at yahoo.com (SRK) Date: Thu, 26 May 2005 12:43:27 +0100 (BST) Subject: [Wtr-general] Accessing menu Message-ID: <20050526114327.99792.qmail@web50806.mail.yahoo.com> Hi, I am new to WATIR. I am using the WATIR User Guide to start developing one test case for our Web application page. I want to access a menu that is created inside mm_menu.js. In View/Source Code, there are no objects shown. Is there anyway to access that menu? irb(main):003:0> ie.show_all_objects -----------Objects in page ------------- id= id= src=mm_menu.js text/javascript id= src=scripts/test .js id= src= name=link1 id=link1 name= id= name= id= id= src= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= hidden name=hidPageReload id= value= alt= s c= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= => nil Regards, Raghavan. --------------------------------- Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050526/ccf94281/attachment.html From ksraghavan2000 at yahoo.com Thu May 26 07:43:30 2005 From: ksraghavan2000 at yahoo.com (SRK) Date: Thu, 26 May 2005 12:43:30 +0100 (BST) Subject: [Wtr-general] Accessing menu Message-ID: <20050526114330.97266.qmail@web50801.mail.yahoo.com> Hi, I am new to WATIR. I am using the WATIR User Guide to start developing one test case for our Web application page. I want to access a menu that is created inside mm_menu.js. In View/Source Code, there are no objects shown. Is there anyway to access that menu? irb(main):003:0> ie.show_all_objects -----------Objects in page ------------- id= id= src=mm_menu.js text/javascript id= src=scripts/test .js id= src= name=link1 id=link1 name= id= name= id= id= src= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= hidden name=hidPageReload id= value= alt= s c= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= => nil Regards, Raghavan. --------------------------------- Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050526/33732fb8/attachment.html From ksraghavan2000 at yahoo.com Thu May 26 08:25:57 2005 From: ksraghavan2000 at yahoo.com (SRK) Date: Thu, 26 May 2005 13:25:57 +0100 (BST) Subject: [Wtr-general] How to find the default value in the selection box Message-ID: <20050526122557.6548.qmail@web50801.mail.yahoo.com> Hi, Is there any way to find the default value displayed in the selection box after the page got loaded? Regards, Raghavan. --------------------------------- Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050526/ec62e377/attachment.html From lorenzo_jorquera at yahoo.com Thu May 26 09:43:45 2005 From: lorenzo_jorquera at yahoo.com (Lorenzo Jorquera) Date: Thu, 26 May 2005 08:43:45 -0500 (CDT) Subject: [Wtr-general] Another way of specifying attributes In-Reply-To: 6667 Message-ID: <20050526134345.19636.qmail@web32212.mail.mud.yahoo.com> Or you could use other Enumerable method button = ie.buttons.detect do |b| b.name=='foo' and b.value=='bar' and b.id=='x' end button.click if button Bret Pettichord escribi?: But that now takes us beyond 'possibly not as nice' to 'really quite evil'. Bret At 04:12 PM 5/25/2005, Paul Rogers wrote: >Well, only if the button causes a page transition. You can add a break >after the click to prevent the win32ole error. > >Paul > >-----Original Message----- >From: wtr-general-bounces at rubyforge.org >[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord >Sent: 25 May 2005 14:27 >To: wtr-general at rubyforge.org >Subject: RE: [Wtr-general] Another way of specifying attributes > > >Not as nice is right. I believe that once you click the 'b', the next b >(and the collection containing it) will no longer reference valid OLE >objects. This will cause a WIN32OLE Runtime error. > >Bret > >At 12:06 PM 5/25/2005, Paul Rogers wrote: > >Possibly not as nice a solution than having something like ie.button( { > > >:name=>'foo' , :value=>'bar' , :id=>'x'} ) is to use the iterator > > ie.buttons.each do |b| > > b.click if b.name=='foo' and b.value=='bar' and b.id=='x' > > end > > > >This allows you to acces anything, and saves me the trouble of writing > >unittests ;-) > >_____________________ > Bret Pettichord > www.pettichord.com > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general --------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, Am?rica Latina y el resto del Mundo. Vis?ta Yahoo! Noticias. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050526/5fa77fbe/attachment.html From DBoyt at anteon.com Thu May 26 10:39:10 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Thu, 26 May 2005 10:39:10 -0400 Subject: [Wtr-general] How can I access other HTML tags? Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC86260D1@HQ-EXVS02.anteon.com> How do I access HTML tags for horizontal rules, lists (ordered and unordered), list items, etc.? Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama From paul.rogers at shaw.ca Thu May 26 12:30:40 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 26 May 2005 10:30:40 -0600 Subject: [Wtr-general] How can I access other HTML tags? In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC86260D1@HQ-EXVS02.anteon.com> Message-ID: <002401c56210$41e877c0$72d39044@NewDell> Can I ask what you would want to do with these? Are you just checking if the layout is ok? We havent added these items so far, Id assumed there would be fairly low demand for them Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 26 May 2005 08:39 To: wtr-general at rubyforge.org Subject: [Wtr-general] How can I access other HTML tags? How do I access HTML tags for horizontal rules, lists (ordered and unordered), list items, etc.? Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Thu May 26 12:30:40 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 26 May 2005 10:30:40 -0600 Subject: [Wtr-general] How to find the default value in the selection box In-Reply-To: <20050526122557.6548.qmail@web50801.mail.yahoo.com> Message-ID: <001f01c56210$41525240$72d39044@NewDell> $ie.selectBox(:name, "MyName").getSelectedItems See the select_box test for examples -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of SRK Sent: 26 May 2005 06:26 To: wtr-general at rubyforge.org Subject: [Wtr-general] How to find the default value in the selection box Hi, Is there any way to find the default value displayed in the selection box after the page got loaded? Regards, Raghavan. _____ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050526/2e1cd1a5/attachment.html From paul.rogers at shaw.ca Thu May 26 12:33:28 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 26 May 2005 10:33:28 -0600 Subject: [Wtr-general] Accessing menu In-Reply-To: <20050526114330.97266.qmail@web50801.mail.yahoo.com> Message-ID: <002501c56210$a5836e20$72d39044@NewDell> it depends how the menu is made up. There are many different ways of creating menus. I suspect that the lines in your print_out where there is no type just id= name= etc are the menu items, and they are list items. Is the page publicly accessable? I can try taking a look for you if it is Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of SRK Sent: 26 May 2005 05:44 To: wtr-general at rubyforge.org Subject: [Wtr-general] Accessing menu Hi, I am new to WATIR. I am using the WATIR User Guide to start developing one test case for our Web application page. I want to access a menu that is created inside mm_menu.js. In View/Source Code, there are no objects shown. Is there anyway to access that menu? irb(main):003:0> ie.show_all_objects -----------Objects in page ------------- id= id= src=mm_menu.js text/javascript id= src=scripts/test .js id= src= name=link1 id=link1 name= id= name= id= id= src= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= hidden name=hidPageReload id= value= alt= s c= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= name= id= => nil Regards, Raghavan. _____ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20050526/1a4886ba/attachment.html From paul.rogers at shaw.ca Thu May 26 12:34:32 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 26 May 2005 10:34:32 -0600 Subject: [Wtr-general] alertboxes on silent mode In-Reply-To: <71EA7CA4B789864F9B3AC722A7F016B68DBE10@tfphmanilmul01.ERF.THOMSON.COM> Message-ID: <002a01c56210$cb68a9c0$72d39044@NewDell> Im not sure! This is done using Autoit, so maybe check the documentation for that Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Jan.Montano at thomson.com Sent: 26 May 2005 03:34 To: wtr-general at rubyforge.org Subject: [Wtr-general] alertboxes on silent mode Hi! I'm trying to run my script using the -b option for silent mode or invisible mode. However, whenever there are alertboxes, somehow, the script is not able to close the alertboxes. but in ordinary mode or visible mode, it runs smoothly. Do I need to install an additional component when running in silent mode? please advise. Thanks. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From DBoyt at anteon.com Thu May 26 14:32:39 2005 From: DBoyt at anteon.com (Boyt, Darrel) Date: Thu, 26 May 2005 14:32:39 -0400 Subject: [Wtr-general] How can I access other HTML tags? Message-ID: <258593F548C79D4AB7CBA2AE72DEBEC862618A@HQ-EXVS02.anteon.com> Hi Paul, Let me start by saying that I'm not asking for any tags to be added to Watir...y'all have enough on your plates already! What I want to do is to write a script to give me a description of what's on a web page. I'd actually like to get to the point where it also tells me what attributes certain tags have so I can verify Section 508 compliance. I've been looking at the Microsoft documentation on various and sundry IE methods, objects, properties, etc., and I'm getting ready to piece together some Ruby code to see if I can make this work for me somehow. I was just wondering if there was something already in Watir that would help me get to where I'd like to go and avoid reinventing the wheel... Thanks! Darrel -----Original Message----- From: Paul Rogers Sent: Thu, 26 May 2005 10:30:40 -0600 To: wtr-general at rubyforge.org Subject: RE: [Wtr-general] How can I access other HTML tags? Can I ask what you would want to do with these? Are you just checking if the layout is ok? We havent added these items so far, Id assumed there would be fairly low demand for them Paul -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Boyt, Darrel Sent: 26 May 2005 08:39 To: wtr-general at rubyforge.org Subject: [Wtr-general] How can I access other HTML tags? How do I access HTML tags for horizontal rules, lists (ordered and unordered), list items, etc.? Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama Darrel Boyt Systems Analyst Anteon Corporation Montgomery, Alabama (334) 260-3331 From hitesh.jain at investmet.com Thu May 26 14:38:13 2005 From: hitesh.jain at investmet.com (hitesh.jain at investmet.com) Date: Thu, 26 May 2005 11:38:13 -0700 Subject: [Wtr-general] How can I access links within IFRAME tag? In-Reply-To: <258593F548C79D4AB7CBA2AE72DEBEC862618A@HQ-EXVS02.anteon.com> Message-ID: Hi All, I'm having a problem to access links within an IFRAME tag. Here is the sample code....
Login ID
Password
Client ID
Destination