Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically test that applications behaves like expected with regard to other activities?

I have an application that launches an activity right after a call ends. I would like to write an automatic test that makes sure that:

  • it actually launches
  • if some other activity pops up after my activity got activated (e.g. yet another call or sms), as soon as this new activity is finished by user, my activity will be shown again (unless the user clicks "home" button or something.

I had a look on Robotium and Roboelectric frameworks but couldn't really find an answer if it is at all doable.

like image 970
mjaskowski Avatar asked May 12 '12 10:05

mjaskowski


1 Answers

I hope you can achieve this by following methods:

  1. There is a tool called monkey runner and its open source which helps to record the test cases. You can use a actual physical device to automate the test cases.
  2. This is a very simple manner you can give a try. you can put log statements in all the life cycles of your activity, i mean in onCreate, onStart, onStop, onResume, onRestart, onDestroy.... this will help you to know whether your activity is in foreground or background or whether it is launched successfully. You have to check the logcat output for these. I hope this will help you
like image 184
Arun Avatar answered Nov 15 '22 04:11

Arun