docker pull elgalu/selenium
docker pull dosel/zalenium
docker run --rm --name zalenium -p 4444:4444
-v /var/run/docker.sock:/var/run/docker.sock
-e "zalenium_http_proxy=http://example.com:80"
-e "zalenium_https_proxy=http://example.com:80"
-e zalenium_no_proxy="localhost,127.0.0.1,http://example.com"
--privileged dosel/zalenium start --desiredContainers 2 --maxDockerSeleniumContainers 2 --maxTestSessions 5
在运行 zalenium 容器时使用代理时,节点容器会突然关闭,并在每 2 分钟后创建一个新的容器。因此,如果测试时间超过 2 分钟,则会因以下错误而失败
WebDriverError: cannot forward the request Failed to connect to /192.168.64.4:40000
每 2 分钟看到节点重新启动后
zalenium | 20:16:50.110 [Thread-10] INFO d.z.e.z.registry.ZaleniumRegistry - Registered a node http://172.18.0.5:40000
zalenium | 20:16:50.899 [Thread-11] INFO d.z.e.z.registry.ZaleniumRegistry - Registered a node http://172.18.0.6:40001
zalenium | 20:18:52.592 [http://172.18.0.5:40000] INFO d.z.e.z.p.DockerSeleniumRemoteProxy - Marking node down.
zalenium | 20:18:52.637 [http://172.18.0.6:40001] INFO d.z.e.z.p.DockerSeleniumRemoteProxy - Marking node down.
zalenium | 20:19:08.529 [Thread-12] INFO d.z.e.z.registry.ZaleniumRegistry - Registered a node http://172.18.0.5:40002
zalenium | 20:19:09.735 [Thread-13] INFO d.z.e.z.registry.ZaleniumRegistry - Registered a node http://172.18.0.6:40003
请让我知道这个问题的解决方案。