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

1

6

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.

Toscanini answered 12/5, 2012 at 10:33 Comment(2)
This isn't automated like you describe, but Android lint will eliminate subtle/easy bugs in your app... I'd use that before you try anything else.Pissed
U must check in service which activity is on the screen after call is disconnectedPresa
S
3

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
Sanctimony answered 15/5, 2012 at 3:53 Comment(1)
ad 1. sounds interesting: I'll give a try :-) ad 2. seems like a nasty workaround :/ Really isn't there any better way of achieving this?Toscanini

© 2022 - 2024 — McMap. All rights reserved.