Reputation: 41
Run npx wdio and not run ı more try but ı did not PLease help me this issue always
My caps
capabilities: [{
platformName: "Android",
"appium:deviceName": "emulator-5554",
"appium:automationName": "UIAutomator2",
"appium:app": join(process.cwd(), "./app/android/Berqnet Connect 3.1.0-1.apk"),
}],
My Bugs
ERROR webdriver: RequestError: connect ECONNREFUSED ::1:4723
ERROR @wdio/runner: Error: Failed to create session.
FAILED in Android - C:(MyFiles)\Desktop\wdioDers\test\specs\sample.js
My sample.js File
describe('Sample', () => {
it('Sample Test', () =>{
});
});
Upvotes: 4
Views: 9329
Reputation: 16182
Note that the error "ECONNREFUSED ::1:4723" complains about "::1" address which is a loopback address for IPv6.
I've got a similar problem after upgrading to Node 18 (from Node 16) on CircleCI.
In my case, the error looked like this:
Unable to connect to “http://localhost:4723/”, make sure browser driver is running on that address.
..
ERROR webdriver: RequestError: connect ECONNREFUSED ::1:4723
The localhost
resolves to IPv6 address ::1
and the connection fails as the server (Appium) only runs on IPv4 address (127.0.0.1
).
The problem is caused by the change in Node’s DNS lookup procedure and starting with Node 17, it does not resolve localhost to 127.0.0.1 (IPv4 address) by default (instead it got resolved to IPv6 ::1 address which caused connection error):
Node.js no longer re-sorts results of IP address lookups and returns them as-is (i.e. it no longer ignores how your OS has been configured)
Discussion is here: https://github.com/nodejs/node/issues/40702.
In the case of native webdriver.io tests, it both starts the server (Appium) and acts as a client, trying to connect to it via http://localhost:4723
.
I found a configuration option to change the port, but I didn’t find a way to configure Appium server address (to change
localhost
to 127.0.0.1
). As a simpler solution, I switched to Node 20 before running tests:
nvm install 20
nvm use 20
cd e2e-webdriver
npm run test:ios
This way tests run with Node 20 that has a fall-back to IPv4 and the connection works.
Upvotes: 3
Reputation: 1
Your problem in version node js. For all works, you need to install the latest version recommended for most users(Not the latest Latest Features)
Upvotes: 0
Reputation: 502
For anyone coming to look for answers to this solution, if you're on windows and use WSL. If the code is run on WSL while using the appium GUI on normal port, you can't connect through so you need to either:
Hope this helps anyone who's having the same issue as I did and couldn't find the problem!
Upvotes: 2
Reputation: 21
I think you need show full code of "wdio.config.js" to everyone can help you check around your config. Maybe, You can check the value of "services" in wdio.config.js file. You must set value of services is "services: ['appium']" I hope it will help you resolve your problem.
Upvotes: 2