Android - system dialog interaction

Mobile Testing, Android App Testing.
Posts: 13
Joined: Wed Oct 31, 2018 11:10 am

Android - system dialog interaction

Post by Uzivatel » Tue Nov 06, 2018 6:24 pm

Hello community,

I testing the trial version of Ranorex to see what everything Ranorex is able to automate in mobile area. I am using Ranorex ver. 8.3.0

Currently I am blocked with automation of system dialogs. I am testing Android native app. I have 2 types of system dialogs in the application:
A) Run-time permission dialog
B) Open file dialog

The scenario for both is simple: Main application screen > Open action bar menu > Click on option 1 in case to invoke run-time permission dialog or Click on option 2 in case to invoke Open file dialog

Actual result: I am able to invoke both types of dialogs but once the dialog is opened I am not able to click on any element on it

I am able to detect the elements from both activities (Tested app and AndoidOS) via RanorexSpy and drag-drop them to repository of items. Then I can add the touch action step on them. However when executing the test the test fails on: Failed to find item.

Note: The settings "Android OS Automation = True", Screenshots on AndoidOS = False

My question is: Is Ranorex able to interact with system dialogs? Is Ranorex able to switch between steps interacting with AndroidOS elements and steps interacting with tested app elements?
According the closed topic here in forum viewtopic.php?f=23&t=9926&p=40022&hilit ... pup#p40022 seems that I can only test System app or tested app. Do I understand it correctly?

You do not have the required permissions to view the files attached to this post.

User avatar
Posts: 284
Joined: Wed Jan 25, 2017 11:08 am

Re: Android - system dialog interaction

Post by qwertzu » Wed Nov 07, 2018 3:38 pm


it seems like the link you mentioned in your post already provided the answer:
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.
Seems like this is the reason why you are facing this issue.

regards, qwertzu

Posts: 13
Joined: Wed Oct 31, 2018 11:10 am

Re: Android - system dialog interaction

Post by Uzivatel » Thu Nov 08, 2018 10:43 am

Hello qwertzu,

question is that in case the system dialog is invoked (popped up) I would expect that in this moment the Andoid OS is on foreground so Ranorex will continue with clicking on it. According my quick testing seems that Ranorex cannot switch between tested app and Android OS in one test-case.

I wanted to have confirmation that it is the known limitation of Ranorex and the issue is not in me (that I missed some settings, or I use some wrong approach) :)

I have raised the issue also on Support, waiting for more info.

User avatar
Ranorex Guru
Ranorex Guru
Posts: 7464
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Android - system dialog interaction

Post by odklizec » Thu Nov 08, 2018 11:05 am


I already suggested below link via PM, but I think it may be interesting also for other people, fighting this Android security issue:
As it seems, ADB commands are the only workaround for Android security popups? But it would be interesting to hear more regarding this problem from Ranorex support ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Posts: 13
Joined: Wed Oct 31, 2018 11:10 am

Re: Android - system dialog interaction

Post by Uzivatel » Thu Nov 08, 2018 4:57 pm

Hello guys,

Thanks for cooperation.

I got the response directly from Ranorex support (Thomas Gruber) to this issue:
Automating these is not possible using Ranorex for security reasons. Android blocks us of doing so. Otherwise it would be possible that Ranorex could interact with the internal system settings of the device from the outside. You always have to manually use these dialogs.

I have already raised the question to confirm it is possible via ADB. I will keep you updated once I get the answer.

Posts: 13
Joined: Wed Oct 31, 2018 11:10 am

Re: Android - system dialog interaction

Post by Uzivatel » Wed Nov 14, 2018 3:26 pm

Hello participants,

FYI - posting the latest response from support. However no concrete answer about supporting system dialogs interaction via ADB:
In general, it is a security feature of Android that it is not possible to simply automate the Android UI in order to gain additional permissions. (That’s similar to Captchas, some of our customers also want to automate those, while their sole purpose is to not be automatable…) That said, I am not a professional for adb, and as far as I know, adb allows you to do a lot of things, even clicking Android system dialogs. Of course, you can use adb within Ranorex code modules.