On Fri, Oct 28, 2011 at 4:01 PM, Dan <[email protected]> wrote:
> Yes, I want to be able to open several browsers
Do you understand what I am doing here?
browsers = (1..3).collect {|b| b = Watir::Browser.new}
=> [#<Watir::Browser:0x..f23916a93f0b1b04 url="about:blank" title="">,
#<Watir::Browser:0x..f97f513754190883c url="about:blank" title="">,
#<Watir::Browser:0x..fe644be4abcf6b4c url="about:blank" title="">]
browsers.each {|browser| browser.goto "google.com"}
=> [#<Watir::Browser:0x..f23916a93f0b1b04 url="http://www.google.hr/"
title="Google">, #<Watir::Browser:0x..f97f513754190883c url="
http://www.google.hr/" title="Google">,
#<Watir::Browser:0x..fe644be4abcf6b4c url="http://www.google.hr/"
title="Google">]
browsers[0].goto "yahoo.com"
=> "http://www.yahoo.com/"
browsers
=> [#<Watir::Browser:0x7634bc0a9bd10db4 url="http://www.yahoo.com/"
title="Yahoo!">, #<Watir::Browser:0x4493d1aaf9e29d54 url="
http://www.google.hr/" title="Google">, #<Watir::Browser:0x379320cacad2a554
url="http://www.google.hr/" title="Google">]
In short, I have opened 3 browsers and put them in array "browsers". You can
control each browser by it's index. For example browser[0] is the first
browser.
Željko
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]