Closed GRme-zz closed 4 years ago
When I replace all the WDIO v4 packages in package.json with WDIO v5 packages then the simple test is running. So, it is really because of the WDIO version. Is there any chance to make it runnable with WDIO v4?
Hi @GRme , unfortunately this project has never been tested with wdio@v4; the first version already used wdio@v5.
However the bug might simply be due to the config not properly setting the address of the selenium server. The following line from your error output shows that wdio tries to connect to localhost, but the chromedriver is running on a different host (chromedriver):
ERROR: connect ECONNREFUSED 127.0.0.1:4444
So if you can find out what the difference is between setting the selenium server address in wdio v4/v5, you might be able to fix this problem.
Hey @blueimp,
thanks for your answer. Normally the hostname
is relevant to set the driver server. and the driver server is chromedriver
in that case, doesn't matter if WDIO v4 or v5 is used. But maybe I have to migrate to WDIO v5, even though it will be a great effort ;)
Sorry, I think I didn't explain properly what I meant with the difference between the wdio versions.
From your error log of wdio
, we can see the following line:
ERROR: connect ECONNREFUSED 127.0.0.1:4444
wdio
tries to connect to the selenium server (chromedriver in our case) on the address 127.0.0.1:4444
, which would be in the same container.
However the selenium server is running in a separate container and only available at the address chromedriver:4444
.
This leads to my assumption that there might be a difference in how the different wdio versions configure the selenium server address.
Looking at the v4 WebdriverIO documentation, the config for the selenium host is indeed different from the one for version 5 (see current (v5) WebdriverIO documentation).
The config property for the selenium server address in WebdriverIO:
host
hostname
So to fix the connection issue, you'll have to set the following:
host: 'chromedriver'
hey @blueimp, thanks a lot. now I'm a step further.
I want to use your blueimp/wdio solution to execute WDIO tests in an own project, because I like this solution and it is really easy to use, also in combination with Jenkins. So, I’ve tried to make it useful for my project, but I have an issue with it and hope you can help me or can give me some recommendations :)))
So, what did I do:
Now the problem is that it is not running with my own docker image based on the updated Dockerfile. The difference between your project https://github.com/blueimp/wdio and my project is the WDIO version. You are using WDIO v5 and we are still using WDIO v4. Maybe that could be the reason.
When I try to start a simple test (via
docker-compose run --rm wdio chrome.js --spec=test/google.js
), that only opens the google page, then it’s really fine while using your docker image (with WDIO v5) indocker-compose.yml
. But when I’m using my docker image (with WDIO v4) then I get this error:The big problem is that we are not able to switch to WDIO v5 in a fast way because therefore we have to do a refactoring that will take a lot of time and I’m the only testautomation guy at the moment ;) So, I try to make it runnable also with WDIO v4.
This is my
Dockerfile
:This is my
package.json
(with WDIO v4):This is my
chrome.js
(WDIO config file):And finally this is my
docker-compose.yml
:Maybe you have some recommendations or tips for me what I can do to make it runnable for me.
It would be very, very cool and you would make me really happy :))) I hope I will get an answer from you.