appium-boilerplate
appium-boilerplate copied to clipboard
Appium Service and Wdio Capabilities mismatch for address and hostname
Using the main branch of this repo as of eb3ad62 and I kept getting this error while running ios.app script.
2022-03-10T17:26:10.542Z ERROR webdriver: RequestError: connect ECONNREFUSED ::1:4723 at ClientRequest.
(./appium-boilerplate/node_modules/got/dist/source/core/index.js:956:111) at Object.onceWrapper (node:events:640:26) at ClientRequest.emit (node:events:532:35) at ClientRequest.emit (node:domain:475:12) at ClientRequest.origin.emit (./appium-boilerplate/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20) at Socket.socketErrorListener (node:_http_client:442:9) at Socket.emit (node:events:520:28) at Socket.emit (node:domain:475:12) at emitErrorNT (node:internal/streams/destroy:164:8) at emitErrorCloseNT (node:internal/streams/destroy:129:3) at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) 2022-03-10T17:26:10.542Z ERROR @wdio/runner: Error: Failed to create session. Unable to connect to "http://localhost:4723/", make sure browser driver is running on that address. If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
It looks like the appium service and wdio capabilities default the hostname to 0.0.0.0 and localhost. The fix was to update either the wdio.shared.local.appium.conf.ts with address: "localhost"
as an arg, OR wdio.ios.app.conf.ts with capabilities.hostname = '0.0.0.0
.
Then and only then was I able to get it to work on my mac.
Links to the docs: https://webdriver.io/docs/options/#capabilities https://appium.io/docs/en/writing-running-appium/server-args/
Hi @hborham
Thanks for this issue, was this based on the current project? Can you also provide some info about how your environment looks like and what you altered to the configs?
I'm running on Monterrey (macOS).
index c4ab3ad..3eb1c31 100644
--- a/config/wdio.shared.local.appium.conf.ts
+++ b/config/wdio.shared.local.appium.conf.ts
@@ -15,6 +15,9 @@ config.services = (config.services ? config.services : []).concat([
// This is needed to tell Appium that we can execute local ADB commands
// and to automatically download the latest version of ChromeDriver
relaxedSecurity: true,
+ // the default is 0.0.0.0
+ // see https://appium.io/docs/en/writing-running-appium/server-args/
+ address: "localhost"
},
},
or setting hostname here to 0.0.0.0
index c948b59..e5d8249 100644
--- a/config/wdio.ios.app.conf.ts
+++ b/config/wdio.ios.app.conf.ts
@@ -17,6 +17,7 @@ config.capabilities = [
{
// The defaults you need to have in your config
platformName: 'iOS',
+ // hostname: '0.0.0.0',
maxInstances: 1,
// For W3C the appium capabilities need to have an extension prefix
// This is `appium:` for all Appium Capabilities which can be found here```
hmm, this is really strange, I can run the tests on my local machine without any changes. Just trying to understand the differences between your and my setup.
- Which version of Appium are you using?
- How did you install it (globally/local)
- 1.22.2
- globally - followed these instructions APPIUM.md
hmm, this is really strange, I can run the tests on my local machine without any changes. Just trying to understand the differences between your and my setup.
- Which version of Appium are you using?
- How did you install it (globally/local)
Hey guys, I encourage you to push this change to master, otherwise, the mobile tests will keep failing.
@arctouch-thiagowerner please raise a PR with a fix, we would be happy to merge it
@christian-bromann can you give me permission to the repository?
@arctouch-thiagowerner just fork the repository and create an upstream pull request. See also: https://gist.github.com/MarcDiethelm/7303312#contributing
PR was merged, closing.
i faced the same problem. so what is the correct configuration?
@firmansyahrosid
Are you facing the same problem with the updated boilerplate?