Selenium webdriver 如何设置';自动代理配置url';通过使用SeleniumWebDriver调整Firefox首选项?

Selenium webdriver 如何设置';自动代理配置url';通过使用SeleniumWebDriver调整Firefox首选项?,selenium-webdriver,Selenium Webdriver,为了测试应用程序,我必须将“自动代理配置url”设置为类似“自动代理配置url” 为此,我做了以下工作: profile = Selenium::WebDriver::Firefox::Profile.new proxy = Selenium::WebDriver::Proxy.new(:http => "abc.xyz.com/tester/proxy") profile.proxy = proxy driver = Selenium::WebDriver.for :firefox,

为了测试应用程序,我必须将“自动代理配置url”设置为类似“自动代理配置url”

为此,我做了以下工作:

profile = Selenium::WebDriver::Firefox::Profile.new
proxy = Selenium::WebDriver::Proxy.new(:http => "abc.xyz.com/tester/proxy")

profile.proxy = proxy
driver = Selenium::WebDriver.for :firefox, :profile => profile

但是这设置了“手动代理配置”,您能帮我设置“自动代理配置url”吗?

以下代码设置了自动代理配置url:

require 'selenium-webdriver'

profile = Selenium::WebDriver::Firefox::Profile.new
profile['network.proxy.type'] = 2
profile['network.proxy.autoconfig_url'] = "http://abc.xyz.com/tester/proxy"

driver = Selenium::WebDriver.for :firefox, :profile => profile