[Wtr-general] Problem with attach using ":title"

Bret Pettichord bret at pettichord.com
Tue Jul 3 11:00:27 EDT 2007


marekj wrote:
>
> hmmm... I was thinking that if I have 3 scripts running at the same 
> time with -b switch they would get confused at which window to talk to.
Take a look at concurrent_search.rb:

require 'thread'
require 'watir' 

def test_google
  ie = Watir::IE.start('http://www.google.com')
  ie.text_field(:name, "q").set("pickaxe")   
  ie.button(:value, "Google Search").click  
  ie.close
end

# run the same test three times concurrently in separate browsers
threads = []
3.times do
  threads << Thread.new {test_google}
end
threads.each {|x| x.join}


More information about the Wtr-general mailing list