We are having two Android devices connected to PC at the same time. I want to use wake
and drag
commands. Till now I was using AndroidViewclient
version 3.2, which use to work with monkeyrunner
. So these function were easily automated.
Since there is new version of AndroidViewClient
(Which is much faster then one latter version), we would like to migrate our scripts.
We have a function which is able to unlock one device. But not working for more than one device. Can you plz help us with same.
Please find the code:
for i in range(len(connected_devices)-1):
serialno2=connected_devices[i]
serialno1=connected_devices[i+1]
device_ref, serialno = ViewClient.connectToDeviceOrExit(serialno1,1)
device_dut, serialno = ViewClient.connectToDeviceOrExit(serialno2,1)
myBluetooth.Device_Unlock(device_dut,serialno1)
def Device_Unlock(device,serialno):
#To make device Wake up
device.wake()
device.drag((157,662), (642,1163), 1.0, 120)
We are not sure how to pass serialno
to the Device_Unlock
function