2016-07-06 71 views
2

我想将Firefox配置文件设置为以下驱动程序:如何设置Firefox配置文件一硒的webdriver遥控器上使用Ruby

driver = Selenium::WebDriver.for :remote, :url => "http://localhost:4444/wd/hub", :desired_capabilities => :firefox 

我试着加入:

profile = Selenium::WebDriver::Firefox::Profile.new 
profile['browser.download.downloadDir'] = '/home/seluser' 
driver = Selenium::WebDriver.for :remote, :url => "http://localhost:4444/wd/hub", :desired_capabilities => :firefox, :profile => profile 

但配置文件选项不存在

感谢

回答

2

你应该尝试如下: -

profile = Selenium::WebDriver::Firefox::Profile.new 
profile['browser.download.downloadDir'] = '/home/seluser' 

capabilities = Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile => profile) 

driver = Selenium::WebDriver.for :remote, :url => "http://localhost:4444/wd/hub", :desired_capabilities => capabilities 

注意: - 您应该按照this更多地了解Ruby结合。

希望它能帮助你...... :)

+0

你知道如何启用Chrome插件的Chrome插件吗? – Richlewis

相关问题