简体   繁体   中英

how i can fix Failed to connect and Connection refused in laradock selenium

Configured the server with Lara Dock

You can access localhost: 4444 / wd / hub in your browser.

But when I run the test code, I get the following error

[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)

I tried 127.0.0.1, localhost, selenium, laradock_selenium_1 mydomain, etc. but didn't succeed

Docker IP Trying to http://10.0.75.1:4444/wd/hub gives me the following error

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

Why do I get this error?

I think the host is wrong but I don't know what's weird

I tried changing the host with laradock_selenium_1 and still got an error

Is there a setting I didn't do??

below picture is my docker container state 在此处输入图像描述

在此处输入图像描述

在此处输入图像描述 在此处输入图像描述

Update ChromeDriver and Selenium to latest version: https://www.seleniumhq.org/download/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM