Sha256: 0f22a5fb29e2ef1e7381a733a03d58a27e483cbc9432d09da6378acf2cc882e7

Contents?: true

Size: 980 Bytes

Versions: 14

Compression:

Stored size: 980 Bytes

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'lib'))
require 'watirgrid'
require 'extensions/remote'

# Here's some basic examples in plain Ruby with Watirgrid and WebDriver Remote / HtmlUnit

# Start a Controller using defaults
controller = Controller.new
controller.start

# Start 50 Providers with WebDriver Remote
1.upto(50) do
  provider = Provider.new(:browser_type => 'webdriver_remote')
  provider.start
end

# Start another Grid
@grid = Watir::Grid.new
@grid.start(:take_all => true)
threads = []
  @grid.browsers.each_with_index do |browser, index|
    sleep 0.5 # let's sleep a little to give a more natural rampup
    threads << Thread.new do
      require 'selenium/server'
      include Selenium

      b = browser[:object].new_browser(:htmlunit)
      t = Time.now
      b.goto("http://90kts.local/")
      puts "#{Thread.current.object_id} : #{b.title} : Elapsed #{Time.now - t}"
      b.close
    end
  end
threads.each {|thread| thread.join}

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
watirgrid-1.1.3 examples/basic/example_webdriver_remote.rb
watirgrid-1.1.3.pre examples/basic/example_webdriver_remote.rb
watirgrid-1.1.2 examples/basic/example_webdriver_remote.rb
watirgrid-1.1.1 examples/basic/example_webdriver_remote.rb
watirgrid-1.1.0 examples/basic/example_webdriver_remote.rb
watirgrid-1.0.6 examples/basic/example_webdriver_remote.rb
watirgrid-1.0.5 examples/basic/example_webdriver_remote.rb
watirgrid-1.0.4 examples/basic/example_webdriver_remote.rb
watirgrid-1.0.4.pre examples/basic/example_webdriver_remote.rb
watirgrid-1.0.3 examples/basic/example_webdriver_remote.rb
watirgrid-1.0.3.pre examples/basic/example_webdriver_remote.rb
watirgrid-1.0.1 examples/basic/example_webdriver_remote.rb
watirgrid-1.0.0 examples/basic/example_webdriver_remote.rb
watirgrid-0.0.9 examples/basic/example_webdriver_remote.rb