I am using Xamarin.UITest to execute automation on iOS app.
The problem is that: while accessing gallery to upload a photo, there is a permission dialog and i need to tap "OK" button to dismiss it.
The following ways that i tried, but they didn't work:
Using tree command does not show hierarchy of that dialog, so that i can not locate UI element to automate
Using
iOSApp.InvokeUia("UIATarget.localTarget().frontMostApp().alert().buttons()[\"OK\"].tap()");
This shown error:
UIATarget.localTarget().frontMostApp().alert().buttons()["OK"] could
not be tapped because the element is not visible tap@[native code]
app.TapCoordinate
, it seems that it is able to work, but have to know the correct coordinate depends on different screens and when dialog appears.Are there any solution to work on this problem? Thanks.
System dialogs for permissions are outside the scope of the app and won't show up in tree
or any other query that you can do through UITest. Instead, these are typically handled automatically by calabash. The "automatic" behavior is to accept any permission dialog that appears.
Is your dialog in a different language where "OK" might be displayed in a non-english language? If so, we may need to file an issue for that specific locale so it can be implemented.
Also, make sure you have the latest UITest version. Take a look at the changes for iOS 10 and InvokeUia here.
try this: target.frontMostApp().mainWindow().elements()[0].elements()[2].elements()[1].tap()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With