0

watirgrid を実装したいのですが、それができません。コントローラーとプロバイダーの開始プロセスに関連するエラーが発生するたびに、インターネット上のすべての例でも、どれも機能していません。

誰かがこれを実装するのを手伝ってくれませんか。手順を含む完全な実行例は大きな助けになります。

私はこのコードを試しています:

require 'rubygems'
require 'watirgrid'
require 'watir'
require 'watir-webdriver'

# setup a controller on port 12351 for your new grid
controller = Controller.new(:ring_server_port => 12351, :loglevel => Logger::ERROR)
controller.start

# add a provider to your grid
# :browser_type => 'webdriver' if using webdriver or
# :browser_type => 'ie' if using watir...
provider = Provider.new(:controller_uri => 'druby://127.0.0.1:11235',
                        :ring_server_port => 12351,
                        :loglevel => Logger::ERROR, 
                        :browser_type => 'webdriver')
provider.start

# connect to the grid and take all providers from it (this time only one)
grid = Watir::Grid.new(:ring_server_port => 12351, :ring_server_host => '127.0.0.1')
grid.start(:take_all => true)

# for each provider on the grid, launch a new thread to start multiple browsers
threads = []
grid.browsers.each do |browser|
  threads << Thread.new do
    p browser[:hostname]
    p browser[:architecture]
    p browser[:browser_type]
     # in this case we are starting a new IE browser
    b = browser[:object].new_browser(:ie)
    b.goto("http://www.google.com")
    b.text_field(:name, 'q').set("watirgrid")
    b.button(:name, "btnI").click
  end
end
threads.each {|thread| thread.join}

そして、私が得ているエラーは

DRb::DRbConnError: druby://127.0.0.1:11235 - #<Errno::ECONNREFUSED: No connection could  
be made because the target machine actively refused it. - connect(2)>
  from C:/Ruby192/lib/ruby/1.9.1/drb/drb.rb:736:in `rescue in block in open'
  from C:/Ruby192/lib/ruby/1.9.1/drb/drb.rb:730:in `block in open'
  from C:/Ruby192/lib/ruby/1.9.1/drb/drb.rb:729:in `each'
  from C:/Ruby192/lib/ruby/1.9.1/drb/drb.rb:729:in `open'
  from C:/Ruby192/lib/ruby/1.9.1/drb/drb.rb:1191:in `initialize'
  from C:/Ruby192/lib/ruby/1.9.1/drb/drb.rb:1171:in `new'
  from C:/Ruby192/lib/ruby/1.9.1/drb/drb.rb:1171:in `open'
  from C:/Ruby192/lib/ruby/1.9.1/drb/drb.rb:1087:in `block in method_missing'
  from C:/Ruby192/lib/ruby/1.9.1/drb/drb.rb:1105:in `with_friend'
  from C:/Ruby192/lib/ruby/1.9.1/drb/drb.rb:1086:in `method_missing'
  from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watirgrid-1.1.5/lib/provider.rb:141:in `start'
  from (irb):44
  from C:/Ruby192/bin/irb:12:in `<main>'
irb(main):045:0>
4

1 に答える 1