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
如何在SeleniumWebDriverJava中设置多个代理_Java_Selenium_Automation_Webdriver_Automated Tests - Fatal编程技术网

如何在SeleniumWebDriverJava中设置多个代理

如何在SeleniumWebDriverJava中设置多个代理,java,selenium,automation,webdriver,automated-tests,Java,Selenium,Automation,Webdriver,Automated Tests,我的要求是打开我的项目网站,它需要两个不同的代理。 如何使用SeleniumWebDriver处理它 请帮助我。您没有提到您正在使用的驱动程序(Firefox、Chrome等),但以下是您在Firefox上的操作方式: FirefoxProfile profile = new FirefoxProfile(); profile.setEnableNativeEvents(true); profile.setPreference("network.

我的要求是打开我的项目网站,它需要两个不同的代理。 如何使用SeleniumWebDriver处理它


请帮助我。

您没有提到您正在使用的驱动程序(Firefox、Chrome等),但以下是您在Firefox上的操作方式:

        FirefoxProfile profile = new FirefoxProfile();
        profile.setEnableNativeEvents(true);

        profile.setPreference("network.proxy.http_port", proxyPort);
        profile.setPreference("network.proxy.ssl", proxyHost);
        profile.setPreference("network.proxy.ssl_port", proxyPort);

        FirefoxDriver driver = new FirefoxDriver(profile);

您没有提到您正在使用的驱动程序(Firefox、Chrome等),但以下是您在Firefox上的操作方式:

        FirefoxProfile profile = new FirefoxProfile();
        profile.setEnableNativeEvents(true);

        profile.setPreference("network.proxy.http_port", proxyPort);
        profile.setPreference("network.proxy.ssl", proxyHost);
        profile.setPreference("network.proxy.ssl_port", proxyPort);

        FirefoxDriver driver = new FirefoxDriver(profile);

什么样的代理?ssl?http?ftp?socks?我要设置的http代理。。根据我的要求,我的两个代理都是http代理,我必须设置。什么样的代理?ssl?http?ftp?socks?我要设置的http代理。。根据我的要求,我的两个代理都是我必须设置的http代理。我使用firefox驱动程序,要求使用http代理,代理是两个IP。它将如何工作?我认为没有一种方法可以在FF本身中定义多个代理。可能有一些附加组件允许这样做,但不支持普通FF,因此不支持Webdriver。这里最好的解决方案可能是FF外部解决方案。例如代理链接…是的,你是对的,我们不能在FF中手动设置多个代理,因为我们正在使用proxifier。但无法使用webdriver完成此操作。u plz可以帮助我如何通过WebDriver在自动化中使用代理链接吗?我使用firefox驱动程序,要求使用http代理和代理是两个IP。它将如何工作?我认为没有一种方法可以在FF本身中定义多个代理。可能有一些附加组件允许这样做,但不支持普通FF,因此不支持Webdriver。这里最好的解决方案可能是FF外部解决方案。例如代理链接…是的,你是对的,我们不能在FF中手动设置多个代理,因为我们正在使用proxifier。但无法使用webdriver完成此操作。u plz能帮助我如何通过webdriver在自动化中使用代理链接吗