tl;dr: safaridriver
very often not able to connect to mobileSafari on real iOS 13 device. mobileSafari seems to be in kind of suspended mode after webdriver connection has been closed. Only solution, to make further connects, is manually killing mobileSafari via iOS app switcher.
edit: The issue can be reproduced only on iPads. The problem does not seem to exist on iPhones.
I am trying to run selenium tests, directly on an iOS device, using the the new iOS 13 webdriver possibilities. It seems to work as described in https://webkit.org/blog/9395/webdriver-is-coming-to-safari-in-ios-13/ but when trying to run a 2nd test session, safaridriver doesnt seem to be able to connect do mobileSafari on the device. This seems to happen, if the 2nd session is not immediately started after the 1st one - mobileSafari seems to be suspended and safaridriver can not handle this situation.
Use Postman, connecting to a running safaridriver -p 5500
server.
Make a localhost:5500/session
request with raw body:
{
"capabilities": {
"alwaysMatch": {
"browserName": "Safari",
"platformName": "iOS"
}
}
}
After several retries this will result in:
{
"value": {
"error": "session not created",
"message": "Could not create a session: The session timed out while connecting to a Safari instance.",
"stacktrace": ""
}
}
It is not possible to get around this issue. Only solution is to manually kill mobileSafari via App Switcher.
Perhaps anyone has an idea, how this could be fixed. Would be thankful, since this is a real showstopper for running continuous automatic running tests.