I am trying to run selenium tests on docker with selenium docker chrome node. We are running this on windows 7. Since docker does not support windows 7, we are using vagrant to create linux box and then run selenium hub and selenium node/chrome using docker on the linux box.
When I try to run selenium script using below code, I get "This site can't be reached" error. However chrome session gets created successfully and driver launches the website. But the site displays error as "This site can't be reached"
ChromeOptions options = new ChromeOptions();
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), options);
driver.manage().timeouts().implicitlyWait(90, TimeUnit.SECONDS);
driver.get("http://www.google.com");
My company is using proxy server. I have set the proxy settings in vagrant vm box and docker containers also. So when I use "curl www.google.com" on linux box and docker selenium containers,I get the response back successfully.
When I can launch the website successfully on containers and linux box, I am not sure why website is not rendered when launched through selenium WebDriver.
I have tried launching the WebDriver with proxy settings as below but same error is present
Proxy proxy = new Proxy();
proxy.setProxyType(Proxy.ProxyType.MANUAL)
proxy.setHttpProxy("<username>:<password>:<proxy_url>)
ChromeOptions options = new ChromeOptions();
options.setCapability("proxy", proxy);
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), options);
driver.manage().timeouts().implicitlyWait(90, TimeUnit.SECONDS);
driver.get("http://www.google.com");