我想将Firefox配置文件设置为以下驱动程序:
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
但配置文件选项不存在
由于
答案 0 :(得分: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
绑定的更多信息。
希望它会帮助你...... :)