为了测试应用程序,我设置了自动代理配置网址'类似于' http://abc.xyz.com/tester/proxy'
为了做到这一点,我做了以下事情:
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
但这设置了“手动代理配置”。您能否帮我解决如何设置自动代理配置网址?
的问题答案 0 :(得分:1)
以下代码设置自动代理配置网址:
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