开发者

Remote Selenium WebDriver not responding to Cucumber tests

I've set up a feature in cucumber and am using the @javascript tag to have it run in selenium On my dev machine selenium runs fine but because webdriver doesn't support n开发者_C百科ative events on osx yet I need to hook it up to a virtual machine running ubuntu

I've got webdriver server running on my ubuntu machine

and hacked my capybara driver like so it connect to the remote server like so:

def browser
  unless @browser

    @browser = Selenium::WebDriver.for(:remote, :url => "http://192.168.1.69:4444/wd/hub", 
      :desired_capabilities => Selenium::WebDriver::Remote::Capabilities.firefox)
    #@browser = Selenium::WebDriver.for(options.delete(:browser) || :firefox, options)
    at_exit do
      @browser.quit
    end
  end
  @browser
end

When I running my test the console on my virtual machine shows somethings going on and outputs:

WebDriver remote server: INFO executing ....

But thats it the test fails after some time due to timeout

Any ideas?


I am not sure what is causing your specific problem. But you should register your driver using the built in mechanism:

profile = Selenium::WebDriver::Firefox::Profile.new
profile["network.http.use-cache"] = false

Capybara.register_driver :firefox_ubuntu do |app|
  Capybara::Driver::Selenium.new(app,
    :browser => :remote,
    :url => 'http://192.168.1.69:4444/wd/hub',
    :desired_capabilities =>     Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile => profile)
  )
end

and then you can switch to it using the normal mechanism:

Capybara.current_dirver :firefox_ubuntu
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜