0

I am new in testing android app. I select monkeyrunner way for testing android app. I don't know python but i reading this. I have a complicated app, my app have a class that extend application and another activity for splash and then my app go to first activity. I set startActivity(firstActivity) in py file, in cmd shows my app run correctly and monkeyimage take a screenshot from my screen (home screen) but my app not run and not shows firstActivity in my device phone! i run startActivity(splash) but again not shows on my screen. Why? I test this in a simple app with one activity, when i run startActivity(firstActivity) on the screen, i see my simple app. How can solve this problem? and How can i go to another activity with monkeyrunner? I mean from application go to splash and from splash go to firstActivity?!

Thanks for your advices!

user3209380
  • 169
  • 1
  • 2
  • 14

1 Answers1

0

First of all, use

adb logcat

to see the package and the starting Activity name.. if you find these two for example package='pck.package' and activity = '.Main' then what you should write in your code, is:

package = 'pck.package'
activity = '.Main'
runComponent = package+'/'+activity
device.startActivity(component=runComponent)

in other words, you must use the package name as well in your code

Hope it helps