I am working on a project where I need to use a proxy. I am using the Chrome browser and when I run my script it forces me to enter the username and password of the proxy.
I have tried passing the username and password with the URL itself, but it is not working.
Here is the code:
Proxy p = new Proxy(); p.setHttpProxy("in-pr.oxylabs.io:20000"); p.setSslProxy("in-pr.oxylabs.io:20000"); System.setProperty("webdriver.chrome.driver","D:\\Love_Testing\\Senium_Naveen\\chrome Driver\\chromedriver_win32\\chromedriver.exe"); ChromeOptions options = new ChromeOptions(); // options.addArguments("--incognito"); DesiredCapabilities dc = DesiredCapabilities.chrome(); dc.setCapability(ChromeOptions.CAPABILITY,options); dc.setCapability("proxy",p); WebDriver driver = new ChromeDriver(dc); driver.get("https://www.google.com");