[FIXED] Android Firebase: Robo script failing on Location Permissions Dialog

Issue

My recorded Firebase Robo scripts fail due to system dialogs such as the “For a better experience, turn on device location” dialog.

turn on device location dialog

When recording the script, it shows:

Requested permissions

android.permissions.ACCESS_FINE_LOCATION
android.permissions.ACCESS_COARSE_LOCATION

but it does not record me clicking “OK” in the related permissions dialog or in the “Turn on device location” dialog.

The scripts work if I remove code that requires permissions, but as that functionality is integral to my app, removing the code which relies on location greatly reduces the usefulness of the scripts.

I would expect that the Robo script would either capture the option which I selected from the permissions dialog OR that the test runner would automatically handle accepting the permission. There must be some way to get past this or many apps could not be thoroughly tested

Similar question from 2017 with no answer: RoboScript not able click Enable Location OK button in Firebase Testlab

How do I make the scripts not break when these sorts of dialogs are triggered?

Solution

Clicking “OK” in permission request dialogs is not intended to be recorded as part of a Roboscript. Instead, Roboscript records that these permissions were requested, which it did as expected in your recording session. At replay time, Robo is supposed to grant all these permissions at the beginning of the crawl such that these dialogs do not pop up during the crawl. Apparently, these permissions were not granted as expected and these dialogs popped up breaking the execution of the recorded Roboscript. For further diagnosis, please follow Tony’s suggestions. Thanks!

Answered By – Stanislav Negara

Answer Checked By – Marie Seifert (Easybugfix Admin)

Leave a Reply

(*) Required, Your email will not be published