I'm trying to change a proxy every time I reload a page in GhostDriver(PhantomJS).
Everything what i found was set the proxy at the launch time:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "FULL_PATH_TO_PHANTOMJS");
capabilities.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, new String[]{
"--proxy-auth=login:password",
"--proxy=proxy:port",
"--proxy-type=proxy_type"
});
WebDriver driver = new PhantomJSDriver(capabilities);
But is it possible to change the proxy at the fly?