How to continue testing an iOS application using the UIAutomation tool, even after the application is released?

I have an application. The application has a button that, when pressed, exits the application. I am testing the application using the UIAutomation tools. I want to check this button. But after the application exits, the tool stops throwing an exception. What I want to do is that after the application exists, I want to open the application again and continue the rest of the test. Has anyone else been in the same scenario? If so, can you please share the solution if you find it?

+7
source share
3 answers

This is not possible because the tool loses connection with the application after it is completed.

If you create a UI Automation script from the command line, you can run the second script automation after the first closes the application, which then checks that everything is reset.

instruments \ -D [trace document] \ -t [instruments template] \ /path/to/Bundle.app \ -e UIARESULTSPATH [directory to store test output] \ -e UIASCRIPT reset_the_app.js instruments \ -D [trace document] \ -t [instruments template] \ /path/to/Bundle.app \ -e UIARESULTSPATH [directory to store test output] \ -e UIASCRIPT check_that_the_app_is_reset.js 

So, instead of trying to get the same instance of tools to restart and reconnect to the application, just run two separate scripts, one of which executes your reset -and-abort, and the other, which checks the received status of the application.

+3
source

You can use:

 UIATarget.localTarget().deactivateAppForDuration(n); 

where n is the number of seconds you want this application to restart. Hope this helps.

0
source

thanks for the answers, but the documentation says:

"When a user exits your application by clicking the Home button or causing another application to appear in the foreground, your application is paused."

So, it does not restart, but pauses?

0
source

All Articles