After doing your first steps in mobile testing on iOS devices please find the following chapters providing detailed information on more advanced topics and testing scenarios
- Instrumentation and Preparation
- iOS Service App
- Non-UI Testing on iOS
- Run a Test on Any iOS Device
- Testing of Mobile Websites on iOS
- Instrumentation with Source Code on iOS
Before getting started with iOS test automation, it's necessary to choose the connection type that suites your needs. The following overview helps you to find out which connection type will work best for you.
|Record||Replay||Start/Stop App||Install IPA||Deploy (unattended)|
Note To make an iOS app testable with Ranorex, it is necessary to instrument the app. However, for a quick start you can take your first steps with the pre-instrumented KeePass app (see Getting Started) that is provided for download.
iTunes is necessary to establish a USB connection (debug mode and non-debug mode) because iTunes installs the USB driver on the Windows machine to connect to iOS devices.
When choosing "Wi-Fi" as connection type, it is recommended that you have your system under test plugged into a power supply during test recording and execution. Additionally make sure that the system under test (the mobile devices) and the machine running the tests (where Ranorex is installed) are on the same network.
Note In order to automate your own mobile app it needs to be instrumented guided by the instructions in the section Instrumentation and Preparation.
- Connect your iOS device (Wi-Fi or USB). See Infrastructure for pros and cons.
- Go to the mobile download archive on your device using the QR Code above or the url bitly.com/mArchive.
- Download and install the iOS service app and make sure it is started on your device.
- Download and install the sample app and initially start it to let the service app recognize it.
- Add the device in Ranorex using the endpoint list. You'll find more details in the section Adding iOS device.
- Start your mobile recording
Note There is a small sample delivered with Ranorex Studio (can be found on the start page) that shows how the iOS MiniKeePass app can easily be tested with Ranorex.
Record and Run an iOS Test
Mobile recording with chosen target technology...
...device and app
Action table updates during recording process
Select element to validate
Choose attribute to validate
Adding actions manually
Add 'Deploy iOS App' action
Action #1 is a 'Deploy iOS App' action which deploys the given app to the selected device.
Action #2 is a 'Run Mobile App' action which resets the instrumented app on the selected device.
Action #3 is a Touch Event on a button. There are two different kinds of touch events recognized by Ranorex:
- A normal 'Touch' which is equivalent to a mouse click on a desktop machine,
- A 'Long Touch' which can be compared to a right click.
Note The duration for both 'Touch' and 'Long Touch' can be defined in the properties pane. You can open this pane by clicking the context menu item 'Properties' on the 'Touch Event' action item.
Action #4 is a 'Set Value' action, which is typically used for keyboard input.
Action #5 is a 'Mobile Key Press' action. With a 'Mobile Key Press' action you can simulate the 'Enter' button on your devices keyboard.
Action #6 is a 'Wait For Not Exists' action, which is useful for cases where an item indicates a loading process and the automation should continue after the item has disappeared.
Action #7 is a 'Validate' action as was previously described.
Action #8 is a 'Get Value' action, which can be used to write back an attribute value of a control to a variable for further processing.
Action #9 is a 'Report' action, which is used to add information to the test report.
Action #10 is an 'Invoke Action' which performs a scroll action on a table control to its index '0'. Invoke actions directly call the corresponding method of the selected adapter.
You can use the invoke action to call user-defined methods or get and set user-defined members.
To call such a user-defined method
- Type 'CallMethod' into the action name field of the invoke action
- Add the method name to the first argument field
- In the following argument field enter a value or choose a variable you want to pass to the method
- Repeat the previous step for all additional arguments
To get or set a member, use 'GetMember' or 'SetMember' instead of 'CallMethod' as the action name.
For further details about invoke action, have a look at Lesson 5: Ranorex Recorder - Additional Editing Options - Invoking User-Defined Actions.
User-defined methods can also be invoked from code in the same way. Here is a short example:
string text = (string) repo.App.Text.Element.InvokeAction("CallMethod", "myCustomGetTextMethod");
Dim text As String = DirectCast(repo.App.Text.Element.InvokeAction("CallMethod", "myCustomGetTextMethod"), String)
Action #11 is a 'Close Application' action. 'Close Application' actions stop the selected application on the mobile device.
After performing the test on the mobile device, the recording process can be stopped by pressing the 'Stop' button.
After recording and altering the action table, the test can be executed on the mobile device by pressing the 'Run' button.