I am currently trying to run tests using Appium on a real iOS device, with the pytest and selenium framework. Before running tests, I successfully built the WebDriverAgent onto the device and started the Appium server. After entering the pytest command to start the test the Safari browser in the iOS device opens but the test does not start. I get this error in the Appium logs:
[debug] [iProxy@67f2ea78:8100] Closing the connection
[debug] [DevCon Factory] Cached connections count: 0
[debug] [XCUITest] Not clearing log files. Use `clearSystemFiles` capability to turn on.
[debug] [XCUITest] Found a remote debugger session. Removing...
[debug] [RemoteDebugger] Cleaning up listeners
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1639089800521 (14:43:20 GMT-0800 (Pacific Standard Time))
[debug] [W3C] Encountered internal error running command: Error: Could not navigate to webview! Err: Failed to receive any data within the timeout: 5000
[debug] [W3C] at spinHandles (/Users/user/.nvm/versions/node/v17.0.1/lib/node_modules/appium/node_modules/appium-ios-driver/lib/commands/context.js:522:23)
[debug] [W3C] at XCUITestDriver.navToViewWithTitle (/Users/user/.nvm/versions/node/v17.0.1/lib/node_modules/appium/node_modules/appium-ios-driver/lib/commands/context.js:564:3)
[debug] [W3C] at XCUITestDriver.navToInitialWebview (/Users/user/.nvm/versions/node/v17.0.1/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/context.js:29:5)
[debug] [W3C] at XCUITestDriver.start (/Users/user/.nvm/versions/node/v17.0.1/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:479:7)
[debug] [W3C] at XCUITestDriver.createSession (/Users/user/.nvm/versions/node/v17.0.1/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:215:7)
[debug] [W3C] at AppiumDriver.createSession (/Users/user/.nvm/versions/node/v17.0.1/lib/node_modules/appium/lib/appium.js:371:35)
[debug] [W3C] Caused by: Error: Failed to receive any data within the timeout: 5000
[debug] [W3C] at Timeout._onTimeout (/Users/user/.nvm/versions/node/v17.0.1/lib/node_modules/appium/node_modules/appium-ios-device/lib/plist-service/index.js:67:16)
[debug] [W3C] at listOnTimeout (node:internal/timers:557:17)
[debug] [W3C] at processTimers (node:internal/timers:500:7)
[HTTP] <-- POST /wd/hub/session 500 14924 ms - 741
[HTTP]
[iProxy@67f2ea78:8100] The connection has been closed
Has anyone come across this issue and found a resolution?
capabilities = {
"platformName": settings.MOBILE_DEVICE_PLATFORM,
"platformVersion": _platform_version,
"newCommandTimeout": 3000,
"udid": _device_id,
"automationName" = "XCUITest",
"browserName" = "Safari",
"usePrebuiltWDA": True,
"deviceName": "iPhone
}
Appium version: 1.22.1
XCode version: 13.1 (13A1030d)
iOS version on device: 15.1
Node version: 17.0.1
NVM version: 0.39.0
4
Answers
Not sure why or how but my issue was fixed by using Appium Desktop instead.
It’s causing because of IOSDriver when we access programatically. Android works fine.
Failed exactly here.
No issue with WDA if directly run Appium desktop server works fine.
I faced same problem with Appium 1.22.3.
Node version is root cause of this error. I was using node v18 when I changed it to v16 it worked as expected.
Like @positivecrux I faced same problem with Appium 1.22.3. I was using node v18 when I updated to v16.9.1 it worked as expected.
or for 2nd line if you get issue you can use specific version