Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用Ruby在Selenium WebDriver remote上设置firefox配置文件_Ruby_Selenium_Firefox_Selenium Webdriver - Fatal编程技术网

如何使用Ruby在Selenium WebDriver remote上设置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'] = '

我想将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
但是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插件吗?