I have the following code:
public class LoadBrowserAndSurf {
@Test
public void loadAndSurf() {
System.setProperty("webdriver.chrome.driver", "D:\\Desktop\\Automation Requirements\\chromedriver\\chromedriver.exe");
String proxyString= "13.228.117.219";
Proxy proxy = new Proxy();
proxy.setHttpProxy(proxyString);
DesiredCapabilities browserProxy =new DesiredCapabilities();
browserProxy.setCapability(CapabilityType.PROXY,proxy);
WebDriver wd = new ChromeDriver(browserProxy);
wd.get("http://www.globe.com.ph/");
}
}
In eclipse oxygen this code is able to initiate the driver version, however it is not accessing the proxy.
When try I the same code in the IntelliJ editor, it strikes out the ChromeDriver in the driver object initiation line i.e:
WebDriver wd = new ChromeDriver(browserProxy);
And states message as:
ChromeDriver(org.openqa.selenium.Capabilities) is depricated
Is there a way I can add this proxy in the driver instance when it launches in runtime?