Search code examples
androidmonkeyrunnergenymotion

Android MonkeyRunner - app closes when clicking on button


I am trying to use MonkeyRunner to login on my virtual device with my gmail address. The issue is that the app closes when clicking on the New button in the google store app.

I am using Genymotion as an emulator.

Here is my script:

import os
import sys
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice

device = MonkeyRunner.waitForConnection()

device.startActivity(component='com.google.android.gsf.login/com.google.android.gsf.login.AccountIntroUIActivity')
device.touch(426, 1140, MonkeyDevice.DOWN_AND_UP)
MonkeyRunner.sleep(5)

I have also a logcat ouput here, but I didn't see anything really helpful in it.

I don't really know where to look. I have several ideas:

  1. could it be because I am trying to monkey test an app which is not mine? but a google app?
  2. could it be Genymotion handling incorrectly clicks? (typing seems to be ok, it is when it tries to go to the next intent that it fails)

Solution

  • The issue is that you need to go through the Settings/Add account to be able to create an account. You cannot call the com.google.android.gsf.login.AccountIntroUiActivity directly.