I am trying to start selenium and selenium's browser with proxy but not getting success. I have used two methods:
Properties sysProps = System.getProperties();
sysProps.put("proxySet", "true");
sysProps.put("proxyHost", "190.249.188.220");
sysProps.put("proxyPort", "81");
and
java -jar lib/selenium-server.jar proxyHost=22.52.50.228 proxyPort=80
but both are not supporting.
is anyone able to help me to start selenium's browser with proxy.
You can use this:
String PROXY = "localhost:8080";
org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
proxy.setHttpProxy(PROXY)
.setFtpProxy(PROXY)
.setSslProxy(PROXY);
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(CapabilityType.PROXY, proxy);
WebDriver driver = new InternetExplorerDriver(cap);
For more detail, refer here