I am a manual tester and we are thinking of automating some tasks for our iPhone application. We have successfully Packaged Monkey Talk library to automate our application. Record and playback gives a good start to see the monkey talk command reference. Just with that basic command reference seen in record and playback, I can write monkey talk commands to perhaps write a suite of test cases - to say Login to our application.

We see many "Low Memory Crashes" and some valid Crashes during our regular manual testing. The chances are same thing might happen when we run Automated tests (on device or simulator). I would like to know how to make the script run again if it failed in one test case.

For example - Lets say my suite will contain 25 test cases for now and while automation is happening, there is a valid crash on Test case#16. How can one automatically handle this situation where we want to automatically run the Test case#16 2 more times failing which it will start from Test case#17 through 25.

I also see one challenge if it is a simulator because when crash occurs, X-Code pops up and it has to Stopped and Started again.

Thanks in advance.