Our app has a 'google' account choosing functionality (not authenticating; just linking)
Here is the google acount chooser intent looks like
Intent intent = AccountPicker.newChooseAccountIntent(null,
null,
new String[]{"com.google"},
true,
null,
null,
null,
null);
startActivityForResult(intent, REQUEST_CODE_PICK_ACCOUNT)
When I test the app in my emulator, I choose a dummy google account. I do the same when capturing Robo test recording also.
And my Robo json looks like this before showing the account choosing prompt
{
"eventType": "VIEW_CLICKED",
"timestamp": 1567317991869,
"replacementText": "Choose a Google Account",
"actionCode": -1,
"delayTime": 0,
"canScrollTo": false,
"elementDescriptors": [
{
"className": "android.support.v7.widget.AppCompatButton",
"recyclerViewChildPosition": -1,
"adapterViewChildPosition": -1,
"groupViewChildPosition": 2,
"resourceId": "com.app.xyz:id/btn_main_propic",
"contentDescription": "",
"text": "Choose a Google Account"
},
{
"className": "android.widget.RelativeLayout",
"recyclerViewChildPosition": -1,
"adapterViewChildPosition": -1,
"groupViewChildPosition": 0,
"resourceId": "com.app.xyz:id/id_main_rlyt",
"contentDescription": "",
"text": ""
},
{
"className": "android.support.v7.widget.ContentFrameLayout",
"recyclerViewChildPosition": -1,
"adapterViewChildPosition": -1,
"groupViewChildPosition": 0,
"resourceId": "android:id/content",
"contentDescription": "",
"text": ""
}
]
}
And after choosing the account, my robo script has this.
{
"eventType": "VIEW_CLICKED",
"timestamp": 1567318000894,
"replacementText": "I Agree, Proceed",
"actionCode": -1,
"delayTime": 0,
"canScrollTo": false,
"elementDescriptors": [
{
"className": "android.support.v7.widget.AppCompatButton",
"recyclerViewChildPosition": -1,
"adapterViewChildPosition": -1,
"groupViewChildPosition": 5,
"resourceId": "com.app.xyz:id/btn_first_proceed",
"contentDescription": "",
"text": "I Agree, Proceed"
},
{
"className": "android.widget.RelativeLayout",
"recyclerViewChildPosition": -1,
"adapterViewChildPosition": -1,
"groupViewChildPosition": 0,
"resourceId": "com.app.xyz:id/id_main_rlyt",
"contentDescription": "",
"text": ""
},
{
"className": "android.support.v7.widget.ContentFrameLayout",
"recyclerViewChildPosition": -1,
"adapterViewChildPosition": -1,
"groupViewChildPosition": 0,
"resourceId": "android:id/content",
"contentDescription": "",
"text": ""
}
]
}
As you can notice above, there is no entry for choosing the account. i.e. clicking on the account name.
Now this is where the problem arises when i test it in the cloud. Instead of using the existing google account, the Robo goes to create new account and fails.
The prompt in the cloud test looks like this.
The test should choose the first option. Instead it selects 'Add Account' option and starts creating an account and fails.
The questions are.
- Why robo json is not capturing the account choosing step?
- What needs to be done to use the existing google account in cloud device?
Pls note that, its not authentication as explained in this page. It is only linking of an existing account (just any account would do).