0

I'm executing script test using monkeyrunner on AVD (Android Emulator) sequentially with the code below, and I want to know if it is possible to execute Script Tests in a parallel on all emulators.

*listADVtotest is a text file with the names of emulators online and for each emulator I call to monkeyrunner to execute the test.

for index, line in enumerate(listAVDtotest):
     emulatorid = listdevtotest[index][0]
     deviceid = listdevtotest[index][1]
     print "Identified device %s" % deviceid
#Execute test with monkeyrunner for each AVD
     subprocess.call('monkeyrunner -v ALL Test1.py ' + emulatorid + ' ' + deviceid + ' ' + str(index), shell=True)
CodeIK
  • 177
  • 1
  • 14

1 Answers1

1

It's possible with AndroidViewClient/culebra but no with monkeyrunner.

culebra supports the command line option

  -m, --multi-device               enables multi-device test generation

that enables the generation of tests to run concurrently on multiple devices. For example, when you are generating a tests and let's say click on the Photos icon the following line will be generated

[_vc.findViewWithContentDescriptionOrRaise(u'''Photos''').touch() for _vc in allVcs()]

that will perform the touch on all the devices.

This post (http://dtmilano.blogspot.ca/2015/05/android-culebra-multi-device.html) has a more detailed explanation and also features a video of a Calculator test running concurrently on 3 devices. What's remarkable of this capability is that the same test is run on 3 different devices with different screen resolution and also different orientation.

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134