3

I am writing Unit test case to test an Activity. Extending ActivityUnitTestCase class. Launching basic intent first. Then using TouchUtils, Performing intended actions. there is startActivity() call in my action. While debugging code i am able to see, the activity is started. but when in testcase using getStartedActivityIntent it returns null. What i have to do?

Meghana M
  • 535
  • 4
  • 21
  • Intent nextIntent = getStartedActivityIntent(); Here it returns null. even though startActivity() is called in main program – Meghana M Apr 12 '15 at 14:05

2 Answers2

0

I would advise you to use "Functional Tests" with an ActivityMonitor:

http://developer.android.com/training/activity-testing/activity-functional-testing.html

There starting an activity and verifying it works for me. With getStartedActivityIntent() using in an ActivityUnitTestCase also does not work for me.

unlimited101
  • 3,653
  • 4
  • 22
  • 41
0

ActivityUnitTestCase is going to be deprecated. Don't use it anymore. Refer to the following issue

Eugene
  • 17
  • 4