如何使用Ruby在Selenium WebDriver remote上设置firefox配置文件
我想将Firefox配置文件设置为以下驱动程序:如何使用Ruby在Selenium WebDriver remote上设置firefox配置文件,ruby,selenium,firefox,selenium-webdriver,Ruby,Selenium,Firefox,Selenium Webdriver,我想将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'] = '
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
但是profile选项不存在
谢谢您应该尝试以下方法:-
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
注意:-您应该按照以下步骤了解有关Ruby
绑定的更多信息
希望它能帮助您……:)您知道如何为chrome配置文件启用flash插件吗?