We have started adopting a new version of Xcode 14, and we see many tests failure. Many test failures are mainly those with a web view inside the app. After trying all the different alternatives, we cannot tap on the done button; that’s the default button when we open the web view in the app.
Please list the steps you took to reproduce the issue:
Our tests are trying tap on done button that’s inside the web view and seeing error (default done button of browsers). We can check the existence of the button that’s return true but can’t tap on it . see attachment
that’s Xcode 14 bug for sure. I also tested previous version of Xcode 13.4.1 and did not see any error
Any alternative way to handle the webview done button
3
Answers
with help from How to tap on a specific point using Xcode UITests
@Nish answer works fine, so I added a little variation to get the coordinate of the button and tap on it.
(Note: this will work on any screen/simulator size, because it is not dependent on the CGPoint being explicitly passed)
Something that helped me was: