I am using calabash cucumber to test my iphone app. In my app i am using system level alert dialog for enabling current location. I need to identify whether there is any alert dialogs displayed on the screen. But i am not able to identify the system level alert dialog. I tried below script. but not working.
query("view:'UIAlertView'",:message)
element_exists("alertView child label marked:'#{message}'")
please help me. I need to click on "OK" button in the dialog.
I think that by 'system level alert' you mean an alert generated by the OS.
Examples of this kind of alert are 'Some App wants to use your location' and 'Some App wants to send you notifications'.
To interact with these alerts, you must use the uia_* functions and you must allow calabash to launch your app with Instruments.
# check if the alert exists
if uia_query(:alert).count > 0
# dismiss by touching 'OK'
uia_tap_mark 'OK'
end
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