Doing this:
add_url = ie.frame('side').button(:name, "add" ).html.scan(
/main.location='(.*)';top.side/ )
add_url2 = add_url.gsub("&","&")Got me this error: c:/watir/criscripts/test.rb:9: private method `gsub' called for #<Array:0x2ae6990> (NoMethodError) Does scan return an array? If so, how do I convert to string? -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, November 22, 2005 9:00 PM To: [email protected] Subject: Wtr-general Digest, Vol 24, Issue 35 Send Wtr-general mailing list submissions to [email protected] 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 [EMAIL PROTECTED] You can reach the person managing the list at [EMAIL PROTECTED] When replying, please edit your Subject line so it is more specific than "Re: Contents of Wtr-general digest..." Today's Topics: 1. Re: Wtr-general Digest, Vol 24, Issue 29 (Chris McMahon) 2. Stress testing using watir/ruby? (Steve Tang) 3. Hiring a Ruby/Watir coder (Jeff Fry) 4. Removing cookies (Paul Rogers) 5. Please use a real subject, was Re: Wtr-general Digest, Vol 24, Issue 29 (Bret Pettichord) 6. Contrib libraries, was Re: Removing cookies (Bret Pettichord) 7. Re: Contrib libraries, was Re: Removing cookies (Jonathan Kohl) 8. Is there a way to input data into a "Readonly" text field in watir? (chaya shetty) 9. Re: Is there a way to input data into a "Readonly" text field in watir? (Paul Rogers) ---------------------------------------------------------------------- Message: 1 Date: Tue, 22 Nov 2005 18:53:30 -0600 From: Chris McMahon <[EMAIL PROTECTED]> Subject: Re: [Wtr-general] Wtr-general Digest, Vol 24, Issue 29 To: [email protected] Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=ISO-8859-1 On 11/22/05, Torres, Ben (HQP) <[EMAIL PROTECTED]> wrote: > Thanks Jeff! This mailing list rocks! > > I was able to grab the url, but now '&' shows up in the url. How > do I remove 'amp;' and just leave '&' in the string? The right way is to use an HTML parser. The quick'n'dirty way is string.gsub("&",""&") I know, I just used the quick'n'dirty way (for now)... =) -Chris ------------------------------ Message: 2 Date: Tue, 22 Nov 2005 18:22:10 -0800 From: "Steve Tang" <[EMAIL PROTECTED]> Subject: [Wtr-general] Stress testing using watir/ruby? To: <[email protected]> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" Hi everyone I was wondering if anyone has any tips or suggestion about using Ruby/Watir to stress test a web application. I'm trying to run pretty basic load test on one of our servers, it's really simple, just a simple access to a single webpage and then that's it. I'm using the code ie = Watir::IE.new() ie.goto(page) ie.close() I'm wondering what is the best way to create thousands (more than 25K) of these processes and have them all storm the server at once. I've tried the approach of creating a shell script that just calls the ruby script multiple times I found out that though it works, it's does not generate enough traffic for my needs. Is there a more efficient way to be doing this? Thanks for your help Steve Tang -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20051122/10ce1668 /attachment-0001.htm ------------------------------ Message: 3 Date: Tue, 22 Nov 2005 18:22:53 -0800 From: Jeff Fry <[EMAIL PROTECTED]> Subject: [Wtr-general] Hiring a Ruby/Watir coder To: [email protected], [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="us-ascii" An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20051122/6b6fd6a8 /attachment-0001.htm ------------------------------ Message: 4 Date: Tue, 22 Nov 2005 20:17:12 -0700 From: Paul Rogers <[EMAIL PROTECTED]> Subject: [Wtr-general] Removing cookies To: [email protected] Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=US-ASCII Here is the code to get rid of cookies. Sorry it took so long, had to get permission, and then I kept forgetting It was writtern on Win XP - the paths maybe different for win 2000 It may be possible to add a reg exp or string to limit the domain that cookies are deleted Thanks to Jason Scammell and Neteller for this. # file revision: "$Revision: #0 $" # Author:: Jason Scammell [EMAIL PROTECTED] # Purpose: To delete all cookies on the PC # Date: Oct 24, 2005 class Dir require 'find' include Find def Dir.visit(dir = '.', files_first = false, &block) if files_first paths = [] Find.find(dir) { |path| paths << path } paths.reverse_each {|path| yield path} else Find.find(dir, &block) end end # simulates unix rm -rf command def Dir.rm_rf(dir) Dir.visit(dir, true) do |path| if FileTest.directory?(path) begin Dir.unlink(path) rescue # Security Exception for Content.IE end else puts "removing #{ path }" begin File.unlink(path) rescue => e #Security exception index.dat etc. puts "Exception " + e end end end end end class CookieKiller def self.kill() dir =CookieKiller.cookie_dir() Dir.rm_rf( dir) end def self.cookie_dir() return ENV['HOMEDRIVE'] + '\\' + ENV['HOMEPATH'] + "\\Cookies" end end # file revision: "$Revision: #0 $" # Author:: Jason Scammell [EMAIL PROTECTED] # Purpose: To test the CookieKiller class # Date: Oct 24, 2005 require '../neteller.rb' require 'test/unit' class CookieKillerTest < Test::Unit::TestCase def test_cookie_killer_dir() cookie_count = get_file_count() puts cookie_count -3 # files .,..,index.dat are never deleted. CookieKiller.kill() delete_count= get_file_count() puts delete_count assert (get_file_count() ==3) end def get_file_count() dir = CookieKiller.cookie_dir() d = Dir.new(dir) count=0 d.each do |x| count = count +1 end return count end end ------------------------------ Message: 5 Date: Tue, 22 Nov 2005 21:15:25 -0600 From: Bret Pettichord <[EMAIL PROTECTED]> Subject: [Wtr-general] Please use a real subject, was Re: Wtr-general Digest, Vol 24, Issue 29 To: [email protected] Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="us-ascii"; format=flowed Please don't allow Digest Titles to serve as headers for posts to this list. They make threads impossible to follow. _____________________ Bret Pettichord www.pettichord.com ------------------------------ Message: 6 Date: Tue, 22 Nov 2005 21:40:24 -0600 From: Bret Pettichord <[EMAIL PROTECTED]> Subject: [Wtr-general] Contrib libraries, was Re: Removing cookies To: [email protected] Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="us-ascii"; format=flowed This is similar to the code in watir/cookiemanager.rb However, i should note that this code has no tests for it and was only put there as a convenience to users (just like the code below). I suspect that it also has platform limitations. I don't know enough to recommend one implementation over the other. I've been thinking about putting code like this in watir/contrib/* instead. The idea is that any code could be put here with no warrenty from us. There are a couple files in watir/* that should probably go there. Plus we could include more stuff from people on the list. Another idea would be to farm a page on RubyGarden.org with examples. Thoughts? Bret At 09:17 PM 11/22/2005, Paul Rogers wrote: >Here is the code to get rid of cookies. Sorry it took so long, had to >get permission, and then I kept forgetting > >It was writtern on Win XP - the paths maybe different for win 2000 > >It may be possible to add a reg exp or string to limit the domain that >cookies are deleted > >Thanks to Jason Scammell and Neteller for this. > ># file revision: "$Revision: #0 $" ># Author:: Jason Scammell [EMAIL PROTECTED] # Purpose: To >delete all cookies on the PC # Date: Oct 24, 2005 class Dir > require 'find' > include Find > def Dir.visit(dir = '.', files_first = false, &block) > if files_first > paths = [] > Find.find(dir) { |path| paths << path } > paths.reverse_each {|path| yield path} > else > Find.find(dir, &block) > end > end > # simulates unix rm -rf command > def Dir.rm_rf(dir) > > Dir.visit(dir, true) do |path| > if FileTest.directory?(path) > begin > Dir.unlink(path) > rescue # Security Exception for Content.IE > end > else > puts "removing #{ path }" > begin > File.unlink(path) > rescue => e #Security exception index.dat etc. > puts "Exception " + e > end > end > end > end >end > >class CookieKiller > def self.kill() > dir =CookieKiller.cookie_dir() > Dir.rm_rf( dir) > end > def self.cookie_dir() > return ENV['HOMEDRIVE'] + '\\' + ENV['HOMEPATH'] + "\\Cookies" > end > >end > > > ># file revision: "$Revision: #0 $" ># Author:: Jason Scammell [EMAIL PROTECTED] # Purpose: To >test the CookieKiller class # Date: Oct 24, 2005 > >require '../neteller.rb' >require 'test/unit' >class CookieKillerTest < Test::Unit::TestCase > > def test_cookie_killer_dir() > > cookie_count = get_file_count() > puts cookie_count -3 # files .,..,index.dat are never deleted. > CookieKiller.kill() > delete_count= get_file_count() > puts delete_count > assert (get_file_count() ==3) > > end > > def get_file_count() > dir = CookieKiller.cookie_dir() > d = Dir.new(dir) > count=0 > d.each do |x| > count = count +1 > end > return count > end > >end > >_______________________________________________ >Wtr-general mailing list >[email protected] >http://rubyforge.org/mailman/listinfo/wtr-general _____________________ Bret Pettichord www.pettichord.com ------------------------------ Message: 7 Date: Tue, 22 Nov 2005 20:43:57 -0700 From: "Jonathan Kohl" <[EMAIL PROTECTED]> Subject: Re: [Wtr-general] Contrib libraries, was Re: Removing cookies To: <[email protected]> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="us-ascii" > Another idea would be to farm a page on RubyGarden.org with examples. I like this idea. -Jonathan ------------------------------ Message: 8 Date: Wed, 23 Nov 2005 04:33:46 +0000 (GMT) From: chaya shetty <[EMAIL PROTECTED]> Subject: [Wtr-general] Is there a way to input data into a "Readonly" text field in watir? To: wtr <[email protected]> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" Hi, I want to write a test case in which I am required to test a date field. This date field is a "readonly text field". The input to this readonly text field is by means of a calendar( the user is supposed to select a date from the calendar which will be displayed in the text field). I want to input data into the "Readonly text field" without selecting the date from the calendar. Is this possible in watir? Is there a way to input data into the "Readonly text field" in watir? --------------------------------- Enjoy this Diwali with Y! India Click here -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20051123/a209f76e /attachment-0001.htm ------------------------------ Message: 9 Date: Tue, 22 Nov 2005 22:06:53 -0700 From: Paul Rogers <[EMAIL PROTECTED]> Subject: Re: [Wtr-general] Is there a way to input data into a "Readonly" text field in watir? To: [email protected] Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="us-ascii" you should be able to use the value= method using the textfields.html from the watir_bonus\unittests\html dir ie.text_field(:name , 'readOnly').value='test' seems to work Paul Content-Type: multipart/alternative; boundary="0-1983776644-1132720426=:63063" Content-Transfer-Encoding: 8bit --0-1983776644-1132720426=:63063 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi, I want to write a test case in which I am required to test a date field. This date field is a "readonly text field". The input to this readonly text field is by means of a calendar( the user is supposed to select a date from the calendar which will be displayed in the text field). I want to input data into the "Readonly text field" without selecting the date from the calendar. Is this possible in watir? Is there a way to input data into the "Readonly text field" in watir? --------------------------------- Enjoy this Diwali with Y! India Click here --0-1983776644-1132720426=:63063 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit <DIV id=RTEContent>Hi,</DIV> <DIV>I want to write a test case in which I am required to test a date field. This date field is a "readonly text field".</DIV> <DIV> </DIV> <DIV> The input to this readonly text field is by means of a calendar( the user is supposed to select a date from the calendar which will be displayed in the text field).</DIV> <DIV> </DIV> <DIV>I want to input data into the "Readonly text field" without selecting the date from the calendar. Is this possible in watir?</DIV> <DIV>Is there a way to input data into the "Readonly text field" in watir?</DIV><p> <hr size=1> Enjoy this Diwali with Y! India <a href="http://in.promos.yahoo.com/fabmall/index.html">Click here</a> --0-1983776644-1132720426=:63063-- -------------- next part -------------- _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general ------------------------------ _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general End of Wtr-general Digest, Vol 24, Issue 35 ******************************************* _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
