2011-02-05 27 views
0

我已经在黄瓜中设置了一个功能,并使用@javascript标签让它在硒中运行 在我的开发机器上硒运行良好,但因为webdriver不支持本地事件在OSX但我需要把它挂到虚拟机运行Ubuntu远程Selenium WebDriver没有响应黄瓜测试

我有webdriver的服务器上运行我的Ubuntu机器

上攻击我的水豚司机像这样把它连接到像这样的远程服务器:

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 

当我跑我的测试我的虚拟机上的控制台显示出头的事情和输出:

webdriver的远程服务器:INFO执行....

但那是一段时间后,由于超时

测试失败

有没有想法?

回答

0

我不确定是什么原因导致您的具体问题。

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 

,然后你可以使用正常的机制切换到它:

Capybara.current_dirver :firefox_ubuntu 
+0

啊辉煌我也一直在寻找更好的方式来做到这一点,但你应该使用内置的机构注册您的驱动器 probs虽然,如何设置配置文件?我从另一个帖子中猜出一半我发现: profile = Selenium :: WebDriver :: Firefox :: Profile.new 但我得到: 未初始化的常量Selenium – msaspence 2011-02-16 08:27:50