Page 1 of 1

Interact with the system permission popup

Posted: Wed Sep 07, 2016 10:08 am
by CataTester
Hello,

I am using Windows 7 and Ranorex version 6.0.2
I am automating an Android application on Android 6.

In my app, the user goes to an activity that contains a camera view, and the Android permission system popup is triggered.
Is Ranorex allowed to interact with the permission system popup ?
Such as : file / camera / contacts permission popup :
Android_system_permission_popup.png
With Ranorex Spy, I am currently not able to see the screen that contains the system popup.
The screen is displayed completely greyed, the permission popup is not displayed to be analyzed :
Ranorex_spy_Android_system_permission_popup.png
And during a Ranorex recording, touching the "ALLOW" or "DENY" button of the popup is not registered as a new action.

Please also note, when I "spy" my android application with the uiautomatorviewer of Android SDK, I can see the permission popup and select it to get its ressource id.

Is it the Android system that prevents Ranorex from interacting on a system popup ?
Is this a limitation of Ranorex ?
There is known a workaround ?

Thank you very much.

Re: Interact with the system permission popup

Posted: Wed Sep 07, 2016 12:24 pm
by odklizec
Hi,

I believe you need to enable "Android OS Automation" option in Ranorex 'Settings' >> 'Plugins' tab >> 'Mobile' section, as described here:
http://www.ranorex.com/support/user-gui ... -apps.html

Also, you will have to add the action/element manually, as Recording of system apps is not possible.

Re: Interact with the system permission popup

Posted: Wed Sep 07, 2016 1:25 pm
by CataTester
Hello,

Thank you for your quick feedback on this.

I have already enabled the "Android OS Automation" parameter, I tried with ("True") and without ("False"), the result is the same in Ranorex Spy (the view is greyed and I cannot search manually for an element of the system permission popup).

Re: Interact with the system permission popup

Posted: Wed Sep 07, 2016 1:57 pm
by odklizec
Are you connected via USB? It will not work with wifi connection.

Re: Interact with the system permission popup

Posted: Wed Sep 07, 2016 2:59 pm
by CataTester
Yes, I am connected to my Android device (a Nexus 5) with an USB cable.

Note that I can't access Android settings neither with Ranorex Spy (Even if "Android OS Automation" parameter is set to "True).

What kind of information should I add/share to help ?

Re: Interact with the system permission popup

Posted: Wed Sep 14, 2016 8:21 am
by asdf
Hi CataTester,

Please ensure that you set the "Screenshot on AndroidOS" flag to false and the "Android OS Automation" to true.
I tried it with my Nexus 5x and Android 7 and it works like expected.

I hope this helps.

Sincerely,
asdf

Re: Interact with the system permission popup

Posted: Thu Sep 15, 2016 9:12 am
by CataTester
Hello asdf,

Thank you for your help, I have followed your advice but I am still having the problem in the Ranorex Spy.

Regardless of the settings configuration about Android OS Automation ("Android OS Automation" to TRUE or FALSE / "Screenshot on AndroidOS" to TRUE or FALSE), the result is always the same : the Ranorex Spy view is still grey and I don't see the different elements composing a system screen or a system popup.

Maybe this problem is specific to the Nexus 5 with Android 6.0.1 ? :/

Re: Interact with the system permission popup

Posted: Fri Sep 16, 2016 2:10 pm
by Support Team
Hi CataTester,

In order to analyze your issue in more detail, I would suggest sending an email to [email protected] with a detailed description of your problem.

We could arrange a remote session, in order to discuss your problem, if it's necessary.

I'm looking forward to your email.

Sincerely,
Matthias

Re: Interact with the system permission popup

Posted: Mon Oct 03, 2016 3:46 pm
by CataTester
Hello Matthias,

I've been in contact with someone from the Support Team.
To help the community about the problem I've been into, here is the explanation that have been given to me:
Ranorex is able to connect to a single application through the adb interface. In every case this is the active instrumented application. So if you have an instrumented application in foreground you can only do automation on this application, therefore you are not able to click on an android system popup.

If there is no instrumented application in foreground, Ranorex Studio switches to Android OS automation (if enabled), in this case you are able to click on Android OS popups.

You could test this by yourself with an open Ranorex Spy. If you open your application under test the connection the device should be listed as "MobileApp". If you send your application to the background and refresh the Ranorex Spy it should switch to "Android OS". This switch may take a while (~30 seconds).
TL;DR
Ranorex is able to interact with only one application at a time, so if Ranorex is focused on your app, then it cannot automate the Android OS. To automate the Android OS, your app must be in the background.

Thank you,
Best Regards.