WDA is not listening at 'http://localhost:8100/'

I’m working through the Appium Pro Intro Workshop. I’m working on Mac Catalina 10.15.4, XCode version 11.4.
In the Appium Session Video/Module, The AndroidCapabilitiesTest runs fine.
The IOSCapabilitiesTest does not.
I can see on the iPhone 11(running 13.3) simulator the installation and removal of TheApp and the WebDriverAgent. It appears that Xcode automation can’t communicate with WebDriverAgent.

Here is some of the log: [DevCon Factory] Successfully requested the connection for FC279262-79F5-4A9B-9054-791D2504BEB6:8100

[debug] [XCUITest] Starting WebDriverAgent initialization with the synchronization key ‘XCUITestDriver’

[debug] [WD Proxy] Matched ‘/status’ to command name ‘getStatus’

[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body

[WD Proxy] Got an unexpected response with status undefined: {“errno”:-61,“code”:“ECONNREFUSED”,“syscall”:“connect”,“address”:“127.0.0.1”,“port”:8100}

[debug] [XCUITest] WDA is not listening at ‘http://localhost:8100/

[debug] [XCUITest] WDA is currently not running. There is nothing to cache

[debug] [XCUITest] Trying to start WebDriverAgent 2 times with 10000ms interval

[debug] [XCUITest] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities

[debug] [BaseDriver] Event ‘wdaStartAttempted’ logged at 1586642218288 (17:56:58 GMT-0400 (Eastern Daylight Time))

[XCUITest] Launching WebDriverAgent on the device

[WebDriverAgent] Fetching dependencies

[WebDriverAgent] Dependencies up-to-date

[debug] [XCUITest] Killing running processes ‘xcodebuild.*FC279262-79F5-4A9B-9054-791D2504BEB6, FC279262-79F5-4A9B-9054-791D2504BEB6.*XCTRunner, xctest.*FC279262-79F5-4A9B-9054-791D2504BEB6’ for the device FC279262-79F5-4A9B-9054-791D2504BEB6…

[debug] [XCUITest] ‘pgrep -ifn xcodebuild.*FC279262-79F5-4A9B-9054-791D2504BEB6’ didn’t detect any matching processes. Return code: 1

[debug] [XCUITest] ‘pgrep -ifn FC279262-79F5-4A9B-9054-791D2504BEB6.*XCTRunner’ didn’t detect any matching processes. Return code: 1

[debug] [XCUITest] ‘pgrep -ifn xctest.*FC279262-79F5-4A9B-9054-791D2504BEB6’ didn’t detect any matching processes. Return code: 1

[debug] [XCUITest] Beginning test with command ‘xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=FC279262-79F5-4A9B-9054-791D2504BEB6 IPHONEOS_DEPLOYMENT_TARGET=13.3 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO’ in directory ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent’

[debug] [XCUITest] Output from xcodebuild will only be logged if any errors are present there. To change this, use ‘showXcodeLog’ desired capability

[debug] [XCUITest] Waiting up to 60000ms for WebDriverAgent to start

[debug] [WD Proxy] Matched ‘/status’ to command name ‘getStatus’

[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body

[WD Proxy] Got an unexpected response with status undefined: {“errno”:-61,“code”:“ECONNREFUSED”,“syscall”:“connect”,“address”:“127.0.0.1”,“port”:8100}

[debug] [WD Proxy] Matched ‘/status’ to command name ‘getStatus’

[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body

It keeps trying and eventually fails.

Interestingly, the test appears to rerun or at least I see TheApp and the WebDriverAgent uninstalled and reinstalled twice before the test fails.

I’m thinking I have an XCUITest/XCode and WebDriverAgent version incompatibility issue.

Any feedback on this would be great as I’ve been stuck on this too long.

Thank you.

Jack

Make sure the WebDriverAgent sources are signed properly and can be installed on the device. Consider enabling xcodebuild logs in caps to track WDA build progress and make sure you follow https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md

Hi Mykola-Mokhnach. Thank you for replying

The WDA does get installed on the device.

I’ll look into determining if the WDA is signed properly and will trying enabling xcode build logs in caps.

I’m using a simulator and working through Appium Pro Intro Workshop, but will check out that document to see if there is something relevant.

Thank you.

If this is a simulator then no signing is required. Check xcodebuild logs and make sure you use the most recent Appium server version

Thank you. Sorry for the long delay.

I’m running v1.16.0 of the Appium Server from the command line.
I have v1.15.1 desktop version as well but it crashes if I try to use it so I don’t.
There is not problem building the WDA as it gets deployed.
Build log looks good:
SLF010#22%IDECommandLineBuildLog1@0#39"Xcode.IDEActivityLogDomainType.BuildLog63"Testing project WebDriverAgent with scheme WebDriverAgentRunner63"Testing project WebDriverAgent with scheme WebDriverAgentRunnera9dd97fc3427c241^2e7679fd3427c241^-125"note: Using new build system
note: Building targets in parallel
note: Planning build
note: Using build description from disk
4(21%IDEActivityLogMessage2@22"Using new build system-609118713#18446744073709551615#0#-0#–6"Notice–2@28"Building targets in parallel-609118713#18446744073709551615#0#-0#–6"Notice–2@14"Planning build-609118713#18446744073709551615#0#-0#–6"Notice–2@33"Using build description from disk-609118714#18446744073709551615#0#-0#–6"Notice–0#0#0#—36"723E3BBF-3703-47A9-8302-72B8C3228C0915"Build succeeded-

My V1.6.0 Appium Server output clearly shows that it can’t connect to the WDA:
Proxying [GET /status] to [GET http://localhost:8100/status] with no body

[WD Proxy] Got an unexpected response with status undefined: {“errno”:-61,“code”:“ECONNREFUSED”,“syscall”:“connect”,“address”:“127.0.0.1”,“port”:8100}

I tried checking for ports listening while running the IOSCapabilitiesTest via:
lsof -nP +c 15 | grep LISTEN (less the stars)
But nothing is running on 8100 before during or after the test.

Might I need to do something with IOS security or even my router to to allow 8100?

Any help is much appreciated as I’m dead in the water.

Jack

1 Like

Hey @Jack_Mason I am facing the exact situation since last two days. What did you do to eliminate the error? Please help, any help will be greatly appreciated.
Appium: 1.16.0
Xcode: 11.5
IOS: 13.2

2 Likes

@Jack_Mason @Snigdha_Majee any solution to overcome this? any help will be greatly appreciated.

1 Like

I’ve had the exact same issue the past 2 days. The fix for me was to completely remove appium off machine, reinstall appium via npm, then install latest desktop version. When you run the test for the first time via terminal, it will still give the wda error, but wait a minute and it will get past it successfully. It believe differences in xcode update broke previous versions of appium.

Hi @ankit_gupta1,
For me what worked is to follow Raghav Pal tutorial to do iOS automation using Appium: https://www.youtube.com/watch?v=-6C-CMqSk&t=1355s
But more specifically with this issue, I would suggest you to the following setup and run the automation script once you have xcode and everything set up:
Build the WDA project:

Go to this folder again:

    /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WedDriverAgent

And run the following command:
    
    xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=udid' test 

 udid = device UDID

How to get the udid: instruments -s devices (You will get the list of simulator and real devices in booted and shut mode)
Hopefully this will solve your problem.

1 Like