0

I am trying to send contents to an external application and monitor/make assertions/test against the results of the external app.

Opening the external app is trivial, but how do you get a reference to the new activity (from the new application)?

Android: How can I get the current foreground activity (from a service)?

The above link was the closest in terms of content, but it deals with interactions within the same application (or something code that you can access the source and build together).

Are there any robotium/junit/android ways to do this?

Community
  • 1
  • 1
  • I don't think Robotium or any of the standard testing frameworks are designed to test external applications, but I could be mistaken. – Karakuri Jun 10 '13 at 17:29

1 Answers1

0

how do you get a reference to the new activity (from the new application)?

You don't. That's in another process.

You are welcome to validate the other app through whatever API it exposes, or by examining whatever it stores on external storage.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Isn't there any way to the Android process manager, get the top of the stack and do some visual confirmations with some library that I don't know about? – prgrmr1618 Jun 10 '13 at 17:46
  • @prgrmr1618: If the context of all of this is some sort of test suite, use `uiautomator`. If, instead, the thing that is "trying to send contents to an external application and monitor/make assertions/test against the results of the external app" is a regular Android app, then no, you cannot examine the UI of another app, for obvious privacy and security reasons. – CommonsWare Jun 10 '13 at 17:59
  • yeah I think you're right. there is no way to verify data in an external program if they don't expose anything – prgrmr1618 Jun 10 '13 at 19:41