In a prior post, we showed how to use Mobile Labs’ deviceConnect and UFT 11.5 to create a script that answers a phone call (to be sure the app resumes as expected when the call ends) and to create a script that makes an outgoing phone call.
The small script below shows how UFT 11.5 and deviceConnect can be used to detect and respond to one of the infamous iOS “location services” prompts.
Here is the script:
The app we are testing wants to use location services, and iOS prompts the user with a system-side pop up, shown below:
The script launches the app and waits for three seconds to see if the prompt appears (it only appears the first time the app is run). If the prompt is detected, the script prints a message on the UFT log and then waits a few seconds (we did this for the benefit of our video recording, below). It then finds and clicks the “OK” button on the pop-up and issues a message box stating that it performed the task. If the popup does not appear, the script just presses on with its business.
To enable testing, we used the manual testing console app to reset location and privacy settings:
This allowed testing the script as many times as we wanted.
Here is a video captured by UFT 11.5 of the script in action:
By: Michael Ryan