I’m encountering an issue with Appium when trying to run Safari tests on multiple devices and iOS versions (16.0, 17.x, 18.0). The tests often fail with the error message “No Webview has been detected…”
Activating a recent webview
Retrieving contexts and views
No web frames found.
Could not find any webviews yet, retrying
Encountered internal error running command: Error: No webview has been detected after 31511ms. You may try to change the 'webviewConnectTimeout' capability value to modify the timeout.
at XCUITestDriver.activateRecentWebview (/xcuitest/xcuitest-7.15.3/lib/commands/context.js:95:15)
at XCUITestDriver.start (/xcuitest/xcuitest-7.15.3/lib/driver.js:646:7)
AppiumDriver.createSession (/appium/appium-2.6.0/lib/appium.js:717:35)
This error seems to originate from the activateRecentWebview
function in the Appium XCUITestDriver:
No webview has been detected after ${elapsedMs.toFixed(0)}ms.
You may try to change the 'webviewConnectTimeout' capability value to modify the timeout.
Setup Details:
- Appium Version: 2.6.0
- XCUITestDriver Version: 7.15.3
- Devices: Multiple iOS versions (16.0, 17.x, 18.0)
Related Capabilities:
{
"appium:safariInitialUrl": "about:blank",
"autoWebview": true,
"webviewConnectTimeout": "30000"
}
This issue seems to be more prevalent on Intel Macs compared to ARM-based Macs. I have tried increasing the webviewConnectTimeout
, but I’d prefer not to rely on this approach.
Current Considerations:
I’m considering experimenting with the following capabilities to see if they resolve the issue:
{
"includeSafariInWebviews": true,
"ignoreAboutBlankUrl": false,
"webviewConnectRetries": <value>
}
Question:
Has anyone else experienced similar issues with Safari tests on these iOS versions? Are there any additional capabilities or configurations that might help resolve this problem? This is an intermittent issue on my end, and I’d like to understand its root cause.