2

I am new to UI Automation with Instruments, and I haven't found a way to reset the app state. How should I prevent tests from affecting each other? I also haven't found a way to use setUp or tearDown methods? It would be awesome if someone has a advice for me - thanks a lot!

I read in quit old blog post that it is not possible? On the other hand Appium is able to do it and it is actually using Instruments - so there must be a way?

Best regards, Daniel

Laurent Bristiel
  • 6,819
  • 34
  • 52
daniel.lozynski
  • 14,907
  • 6
  • 18
  • 21

1 Answers1

0

I think only way is by restarting application. You can check this question How to continue testing an iOS app, using UIAutomation instrument, even after the app exits?

Community
  • 1
  • 1
KamilPyc
  • 376
  • 1
  • 5
  • Hi, thanks for the answer, but the documentation says: UIATarget.localTarget().deactivateAppForDuration(n); "When a user exits your app by tapping the Home button or causing some other app to come to the foreground, your app is suspended." So basically it's not restarting the app but puts in suspended state. – daniel.lozynski Nov 06 '13 at 09:59
  • Restarting doesn't solve it. For one, restarting doesn't remove files. – James Moore Nov 19 '14 at 17:29