Proxy with Authentication in Selenium, JAVA

Viewed 142

We try to use authenticated proxy in Selenium driving headless Chrome, JAVA.

ChromeOptions inherit from ChromeCapabilities (deprecated). We pass instance of Proxy class into a ChromeOptions instance.

The Selenium Proxy class has no methods of HTTP proxy to set up username & password:

        Proxy proxy = new Proxy();
        proxy.setAutodetect(false);
        proxy.setHttpProxy(proxyStr);
        proxy.setFtpProxy(proxyStr);
        proxy.setSslProxy(proxyStr);  
        chromeOptions.setCapability("proxy", proxy);
    

Any way out?

1 Answers
Related