问题
I am trying to test an Google Map based Android app using RoboScript on Firebase TestLab. By default location is disabled on TestLab devices. To enable them we need to simulate a click on OK button on the system prompt. But this click never happens. You can see the screenshot below. The OK button never gets pressed and flow stops here.
I checked the RoboScript json file. Android studio never recorded the OK button click. I tried to create another element like below. But couldn't identify what should be the resourceId for the system dialog.
{
"eventType": "VIEW_CLICKED",
"timestamp": 1512127956674,
"replacementText": "",
"actionCode": -1,
"delayTime": 0,
"canScrollTo": false,
"elementDescriptors": [
{
"className": "android.widget.LinearLayout",
"recyclerViewChildPosition": -1,
"adapterViewChildPosition": -1,
"groupViewChildPosition": 0,
"resourceId": "com.entransys.parkeze:id/confirm_linear",
"contentDescription": "",
"text": ""
},
{
"className": "android.support.v7.widget.ContentFrameLayout",
"recyclerViewChildPosition": -1,
"adapterViewChildPosition": -1,
"groupViewChildPosition": 1,
"resourceId": "android:id/content",
"contentDescription": "",
"text": ""
},
{
"className": "android.support.v7.widget.FitWindowsLinearLayout",
"recyclerViewChildPosition": -1,
"adapterViewChildPosition": -1,
"groupViewChildPosition": 0,
"resourceId": "com.entransys.parkeze:id/action_bar_root",
"contentDescription": "",
"text": ""
}
]
}
So my question is a) Is there an option to make location enabled before the test starts on the device in Firebase TestLab ?
b) Is there an option to generate clicks on the system level dialog using Robo Script
Edit 1: Added screenshot
Edit 2: Yes, there is confusion between if the ok button is getting pressed or Ok button got pressed [location icon is appearing in appbar] and map is not visible. There is no error and flow stops here.
回答1:
I am recording the robo script for my app. It never recorded the actions performed on runtime permissions.
来源:https://stackoverflow.com/questions/47673019/roboscript-not-able-click-enable-location-ok-button-in-firebase-testlab