1

Scenario : "My application may escape control during UI automation to another application like the browser etc"

Solution : "I want to get back to my application which I am automating after it loses control and moves to another app so that I can proceed with my automation"

Tried : I can figure out if an application escapes control by checking the bundle id's after each action so that if the actual and current bundle id's differ I get to know that my application lost control.

I am blocked on how to proceed further in getting back to my application in case it moves out of control

Thank you for your time and effort in going through till the end :)

Prabhu Konchada
  • 548
  • 8
  • 26

1 Answers1

0

This is a limitation of the "sandbox" in iOS -- once your app loses focus, UIAutomation must terminate as well. You will need to launch another instruments session to automate the browser (or whatever application you're switching to).

See this question for some information on launching an automation session against those apps.

Community
  • 1
  • 1
Ian
  • 11,280
  • 3
  • 36
  • 58
  • Sorry but this doesn't help. I believe there is some problem with me in explaining the question right ?? – Prabhu Konchada Jun 18 '15 at 08:21
  • There is not really a solution to what you are asking, only a workaround. If I understand correctly, your application may open a browser -- at which point UIAutomation loses control of it. There is no way for a UIAutomation session attached to your app to "switch" to controlling the browser and/or to bring your app to the foreground again. – Ian Jun 18 '15 at 12:52
  • My answer is the workaround; you must launch a new UIAutomation session against the new foreground app. You may also be able to relaunch instruments against your app to bring it into the foreground again. – Ian Jun 18 '15 at 18:20