Ranorex Help Center How can we help you?

Automation of System Apps

When automating an Android App it might sometimes be necessary to leave the application under test. For example you want to:
  • check if an issued notification has been received
  • share something on a social network
  • change the system settings
As only the application under test is instrumented for Ranorex Automation you can only record within this application. To automate outside of the application you have to manually create the needed steps using the Ranorex Spy.

Note To automate system apps the setting 'Android OS Automation' has to be enabled. The setting can be found in the mobile section of the plugin specific settings in settings dialog.


Note To speed up the test execution of system app automation you can disable the generation of screenshots for android. The setting can be found in the mobile section of the plugin specific settings in settings dialog.

Enable Android OS automation

Enable Android OS automation

Restrictions

  • To automate system apps a USB connection has to be established.
  • Highlighting on the device does not work for system apps
  • Recording is not possible for system apps

Validate an Issued Notification

The following example will show how to validate a text in a received notification.

Create a new recording and open the Ranorex Spy. You will notice a node labeled 'MobileApp AndroidOS' at the application level in the object tree.

System app in Spy

System app in Spy

To navigate through the element tree you can either use the tree view. Another way to navigate is to use the image navigator which can be found at the bottom of the Overview/Advanced tab. Clicking a UI element selects it, double-clicking outside the selected element selects the parent.

To open the notification bar, a swipe action from the top of the screen has to be performed. Navigate to a tree element including the navigation bar in the representing screenshot and add this element to the repository using the context menu.

Add a system app container to the repository

Add a system app container to the repository

Add a swipe action by dragging/dropping the newly created repository item to the actions table and choosing 'Swipe Action' as action type from the context menu.
Add a swipe gesture action

Add a swipe gesture action

In the properties pane set the swipe direction to '90°' and the start location to '0.5;0.0' which is the top center of the element.
Set properties of the swipe action

Set properties of the swipe action

Manually open the notification bar on your device and switch back to Ranorex Spy. Navigate through the element tree until you'll find the element you want to validate.
Identify the element to validate

Identify the element to validate

Add the specific element to the repository and add a validation action on the repository item as described before.

Additionally add a key press on the back button to return to the initial situation.

Added validation action

Added validation action

After adding these three actions, the recording is ready to be executed.