Selenium webdriver Selenium Webdriver+Java-如何为firefox配置自动代理配置URL?

Selenium webdriver Selenium Webdriver+Java-如何为firefox配置自动代理配置URL?,selenium-webdriver,selenium-firefoxdriver,Selenium Webdriver,Selenium Firefoxdriver,我正在尝试将FirefoxDriver配置为使用自动代理配置URL。我没有这样做 我的代码如下所示: FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("network.proxy.type", 2); profile.setPreference("network.proxy.autoconfig_url", "http://10.203.193.52/Proxy-cmv.pac"); WebDriver d

我正在尝试将FirefoxDriver配置为使用自动代理配置URL。我没有这样做

我的代码如下所示:

FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("network.proxy.type", 2);
profile.setPreference("network.proxy.autoconfig_url", "http://10.203.193.52/Proxy-cmv.pac");
WebDriver driver = new FirefoxDriver();

我没有收到任何类型的错误,但此浏览器的连接不起作用。在Firefox菜单中选中选项>高级>网络>连接设置时,proxy设置为使用系统代理。

您需要使用该配置文件,因为现在您只需创建它

因此,改变:

WebDriver driver = new FirefoxDriver();


您需要使用该配置文件,因为现在您只需创建它

因此,改变:

WebDriver driver = new FirefoxDriver();