已使用Lara Dock配置服务器
您可以在浏览器中访问localhost: 4444 / wd / hub。
但是,当我运行测试代码时,我得到以下错误
[2019-11-13 18:53:22] local.ERROR: Curl error thrown for http POST to /session with params:
{"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":
{"w3c":false,"binary":"","args":["--user-agent=Mozilla\/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/75.0.3770.80 Safari\/537.36","disable-
gpu","lang=ko_KR","disable-infobars","start-maximized"]}}}
Failed to connect to localhost:port 4444: Connection refused {"exception":"[object]
(Facebook\\WebDriver\\Exception\\WebDriverCurlException(code: 0): Curl error thrown for http POST to
/session with params: {\"desiredCapabilities\":
{\"browserName\":\"chrome\",\"platform\":\"ANY\",\"chromeOptions\":
{\"w3c\":false,\"binary\":\"\",\"args\":[\"--user-agent=Mozilla\\/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/75.0.3770.80 Safari\\/537.36\",\"disable-
gpu\",\"lang=ko_KR\",\"disable-infobars\",\"start-maximized\"]}}}
Failed to connect to ohmanager.kr port 4444: Connection refused at
/var/www/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:297)
我尝试了127.0.0.1、localhost、selenium、laradock_selenium_1 mydomain等,但没有成功
Docker IP尝试http://10.0.75.1:4444/wd/hub时出现以下错误
Curl error thrown for http POST to /session with params:
{"desiredCapabilities":
{"browserName":"chrome","platform":"ANY","chromeOptions":
{"w3c":false,"binary":"","args":["disable-gpu","lang=ko-KR","disable-
infobars=true","start-maximized"]}}} Connection timed out after 7001
milliseconds
为什么会出现这个错误?
我认为主人错了,但我不知道哪里奇怪
我尝试使用laradock_selenium_1更改主机,但仍收到错误
有没有我没做的设置??
下图是我的docker容器状态
发布于 2019-11-13 23:27:29
将ChromeDriver和Selenium更新到最新版本:https://www.seleniumhq.org/download/
https://stackoverflow.com/questions/58839573
复制相似问题