1

I'm trying to setup webdrivermanager java with a chrome browser in a docker container. I have a docker daemon running on my local Windows 10 machine on WSL2. The docker daemon url should be tcp://127.0.0.1:2375.

I have version 5.1.0 of webdrivermanager.

Some sample code

WebDriverManager
        .chromedriver()
        .browserInDocker()
        .dockerDaemonUrl("tcp://127.0.0.1:2375")
        .create();

I always get the following warning: WARN io.github.bonigarcia.wdm.docker.DockerService - Docker is not available in your machine... local browsers are used instead

What is the correct setup for webdrivermanager in this case?

Boni García
  • 4,618
  • 5
  • 28
  • 44
Curb
  • 11
  • 2

2 Answers2

0

For a local Docker engine, the method dockerDaemonUrl() should not be necessary.

Boni García
  • 4,618
  • 5
  • 28
  • 44
  • I did another attempt without dockerDaemonUrl however I got the same warning Docker is not available in your machine – Curb Mar 28 '22 at 13:58
0

The following attempt was successful. Adding avoidDockerLocalFallback did the trick. The DockerService of WebdriverManager always tries to resolve the docker daemon locally by default but is unsuccessful in case of a docker daemon running on WSL2.

WebDriverManager
    .chromedriver()
    .browserInDocker()
    .avoidDockerLocalFallback()
    .dockerDaemonUrl("tcp://127.0.0.1:2375")
    .create();
Curb
  • 11
  • 2