Ok, this is driving me nuts. I've got a little CI-build system running. And I'm doing UI testing of my application with UIAutomation. Since the application uses CoreLocation, the first time the application is launched I get a little alert asking me to confirm that I want my location tracked. This would be great and all, but the alert is not part of my own application and I can't use UIAutomation to interface with it. Is there any solution to confirming this alert without manual taping of the button.
Thanks.
P.S. Getting rid of CoreLocation for a test build is not an option.
The only way I have gotten around this at the previous place I worked was to write a little apple script app that can dismiss the alert for you.
You should be able to do some simple UI scripting to dismiss the alert on the iOS simulator.
Obviously I am assuming your running on the simulator and not device for your tests.
How to dismiss location alert via apple script for iPhone simulator
Apple script to run after you app has launched in the simulator and the alert is displayed so you will need to run this after some delay.
tell application "iPhone Simulator"
activate
end tell
tell application "System Events"
tell process "iPhone Simulator"
click button "OK" of window 1
end tell
end tell
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