Not able to connect to selenium chrome standalone container.
See original GitHub issueWhat are you trying to achieve?
I am trying to follow the documentation regarding docker composer.
I use the following docker-compose.yml
version: '3'
services:
codeceptjs:
image: codeception/codeceptjs
depends_on:
- chrome
volumes:
- .:/tests
chrome:
image: selenium/standalone-chrome:3.8.1-bohrium
ports:
- '4444'
- '5900'
and I run docker-compose up.
What do you get instead?
Recreating chrome_1 ...
Recreating chrome_1 ... done
Recreating codeceptjs_1 ...
Recreating codeceptjs_1 ... done
Attaching to chrome_1, codeceptjs_1
codeceptjs_1 | CodeceptJS directory has been found.
chrome_1 | 19:59:13.809 INFO - Selenium build info: version: '3.8.1', revision: '6e95a6684b'
chrome_1 | 19:59:13.814 INFO - Launching a standalone Selenium Server
chrome_1 | 2017-12-23 19:59:14.163:INFO::main: Logging initialized @1356ms to org.seleniumhq.jetty9.util.log.StdErrLog
chrome_1 | 19:59:14.327 INFO - Using `new FirefoxOptions()` is preferred to `DesiredCapabilities.firefox()`
chrome_1 | 19:59:14.372 INFO - Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
chrome_1 | 19:59:14.383 INFO - Using `new EdgeOptions()` is preferred to `DesiredCapabilities.edge()`
chrome_1 | 19:59:14.386 INFO - Driver class not found: com.opera.core.systems.OperaDriver
chrome_1 | 19:59:14.386 INFO - Using `new OperaOptions()` is preferred to `DesiredCapabilities.operaBlink()`
chrome_1 | 19:59:14.392 INFO - Using `new SafariOptions()` is preferred to `DesiredCapabilities.safari()`
chrome_1 | 19:59:14.395 INFO - Driver class not found: org.openqa.selenium.phantomjs.PhantomJSDriver
chrome_1 | 19:59:14.514 INFO - Driver provider class org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
chrome_1 | registration capabilities Capabilities {browserName: internet explorer, ensureCleanSession: true, platform: WINDOWS, version: } does not match the current platform LINUX
chrome_1 | 19:59:14.515 INFO - Driver provider class org.openqa.selenium.edge.EdgeDriver registration is skipped:
chrome_1 | registration capabilities Capabilities {browserName: MicrosoftEdge, platform: WINDOWS, version: } does not match the current platform LINUX
chrome_1 | 19:59:14.516 INFO - Driver provider class org.openqa.selenium.safari.SafariDriver registration is skipped:
chrome_1 | registration capabilities Capabilities {browserName: safari, platform: MAC, version: } does not match the current platform LINUX
chrome_1 | 19:59:14.681 INFO - Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
chrome_1 | 19:59:14.683 INFO - Using `new EdgeOptions()` is preferred to `DesiredCapabilities.edge()`
chrome_1 | 19:59:14.683 INFO - Using `new FirefoxOptions()` is preferred to `DesiredCapabilities.firefox()`
chrome_1 | 19:59:14.686 INFO - Using `new OperaOptions()` is preferred to `DesiredCapabilities.operaBlink()`
chrome_1 | 19:59:14.686 INFO - Using `new SafariOptions()` is preferred to `DesiredCapabilities.safari()`
chrome_1 | 19:59:14.711 INFO - Using the passthrough mode handler
chrome_1 | 2017-12-23 19:59:14.880:INFO:osjs.Server:main: jetty-9.4.7.v20170914
chrome_1 | 2017-12-23 19:59:14.983:WARN:osjs.SecurityHandler:main: ServletContext@o.s.j.s.ServletContextHandler@7cbd213e{/,null,STARTING} has uncovered http methods for path: /
chrome_1 | 2017-12-23 19:59:14.998:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@7cbd213e{/,null,AVAILABLE}
chrome_1 | 2017-12-23 19:59:15.087:INFO:osjs.AbstractConnector:main: Started ServerConnector@509f3a27{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
chrome_1 | 2017-12-23 19:59:15.089:INFO:osjs.Server:main: Started @2282ms
chrome_1 | 19:59:15.089 INFO - Selenium Server is up and running
codeceptjs_1 | CodeceptJS v1.1.1
codeceptjs_1 | Using test root "/tests"
codeceptjs_1 |
codeceptjs_1 | Creation of investor's account. Some Validations --
✖ "before all" hook: codeceptjs.beforeSuite in 37ms
codeceptjs_1 | Error: connect ECONNREFUSED 127.0.0.1:4444
codeceptjs_1 | Creation of investor's account --
✖ "before all" hook: codeceptjs.beforeSuite in 10ms
codeceptjs_1 | Error: connect ECONNREFUSED 127.0.0.1:4444
codeceptjs_1 |
codeceptjs_1 | -- FAILURES:
codeceptjs_1 |
codeceptjs_1 | 1) Creation of investor's account. Some Validations
codeceptjs_1 | "before all" hook: codeceptjs.beforeSuite:
codeceptjs_1 | connect ECONNREFUSED 127.0.0.1:4444
codeceptjs_1 |
codeceptjs_1 | Run with --verbose flag to see NodeJS stacktrace
codeceptjs_1 |
codeceptjs_1 | 2) Creation of investor's account
codeceptjs_1 | "before all" hook: codeceptjs.beforeSuite:
codeceptjs_1 | connect ECONNREFUSED 127.0.0.1:4444
codeceptjs_1 |
codeceptjs_1 | Run with --verbose flag to see NodeJS stacktrace
codeceptjs_1 |
codeceptjs_1 |
codeceptjs_1 | FAIL | 0 passed, 2 failed // 77ms
codeceptjs_1 exited with code 1
Details
- Operating System: MAC OSX
- WebDriverIO
- Configuration file:
"tests": "./*_test.js",
"timeout": 50000,
"output": "./output",
"helpers": {
"WebDriverIO" : {
"smartWait": 5000,
"browser": "chrome",
"desiredCapabilities": {
"chromeOptions": {
"args": [ "--incognito"]
}
},
"url":"https://www.as.com",
"restart": false,
"windowSize": "maximize",
"timeouts": {
"script": 60000,
"page load": 10000
}
}
},
"include": {
"I": "./steps_file.js",
"SignupPage":"./pages/signup.page.js",
"Onboarding":"./pages/onboarding.page.js",
"Dashboard":"./pages/dashboard.page.js",
"Financials":"./pages/financials.page.js"
},
"bootstrap": false,
"mocha": {
"reporterOptions": {
"mochaFile": "output/result.xml"
}
},
"name": "exercise"
}
My first thought was that it tries to connect to the selenium server before it is ready, I added a command to the compose with wget with retries and after 4 mins it is still not able to connect.
I am not sure if it is a bug, but I haven’t been able to execute the tests and I ran out of ideas.
Thanks.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
can't connect to selenium/standalone-chrome docker ...
Using hostname setting in the docker compose file, I can proper connect and run the automated tests with success.
Read more >Docker Container stuck at Started Selenium Standalone 4.4.0 ...
I'm trying to use Selenium inside a Docker container but after running the docker container the console stays stuck at.
Read more >Selenium with Chrome in Docker - Reddit
I try to connect to the Chrome container from my code (outside of a container, using http://127.0.0.1:4444) and get this error: (The process ......
Read more >Testing a website with Selenium and Docker - LogRocket Blog
Use Selenium and Docker to test a website, and start a Selenium Grid that allows you to test a website on Chrome and...
Read more >selenium/standalone-chrome-debug - Docker Image
Wasm is a fast, light alternative to Linux containers – try it out today with the Docker+Wasm Beta. ✕.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
nevermind : the host that i had to use was:
and everything worked as expected. Thanks @DavertMik for the hints.
I meet this issue, too! See my terminal log:
😢 But when i restart my computer, the issue just disappear and everything is ok again! I think maybe my computer’s cpu or memory or something is not enough. See my
top
log:🙊 And this is my command to build the webdriver container: