In addition to UI automation for mobile apps, Ranorex lets you perform non-UI testing by invoking technology-dependent actions (see Detailed list of actions). This is useful when you want to retrieve information about the device hardware, operating system, and other device-related data, without interacting with visible UI elements.
Non-UI testing on Android
Get device info from Ranorex Spy
You can get the device info of your Android device directly by right-clicking the mobile device in Ranorex Spy.
Use Invoke in the actions table
You can access the non-UI testing methods in the action table by adding an invoke action on the mobile app.
Use non-UI methods in code
You can also access the non-UI testing methods within User Code Actions as well as Code Modules. The code should look something like the following:
C#
var app = repo.AndroidApp.Self.As<AndroidApp>();
// get an AndroidDeviceInfo object holding all available device info
var info = app.GetDeviceInfo();
// get a list of SMS from the device
var sms = app.GetSms();
// get a list of calls from the device
var calls = app.GetCalls();
// report the manufacturer of the device
Report.Info("Manufacturer: " + info.Manufacturer);
// report the manufacturer of the device
Report.Info("SMS: " + sms.ToString());
// report the manufacturer of the device
Report.Info("Calls: " + calls.ToString());
VB.NET
Dim app = repo.AndroidApp.Self.[As](Of AndroidApp)()
' get an AndroidDeviceInfo object holding all available device info
Dim info = app.GetDeviceInfo()
' get a list of SMS from the device
Dim sms = app.GetSms()
' get a list of calls from the device
Dim calls = app.GetCalls()
' report the manufacturer of the device
Report.Info("Manufacturer: " & info.Manufacturer)
' report the manufacturer of the device
Report.Info("SMS: " & sms.ToString())
' report the manufacturer of the device
Report.Info("Calls: " & calls.ToString())