To access the ‘Spy’ page, click on ‘Spy’ in the top navigation.
The Spy page helps to inspect the user interface of an application. When spying you’ll be able to inspect the individual objects of the application’s UI. You can later use these objects in your automation scripts.
Create a Spy Session
To enable the spy tools you need to launch a session first.
- Select the automation type. You can make use of
- application automation: this starts an application session which is able to interact with the selected application.
- device automation: this starts a device session which is able to interact with the full device (also operating system related screens e.g. setting, notification, …)
- Select the right platform (Android or iOS).
- In case of application automation: select the application you want to automate. Only applications corresponding to the selected platform will be displayed.
- Select the device for which you want to start a session. Only devices corresponding to the selected platform will be displayed.
- Click ‘Start’ to start a session.
A dialog appears showing the progress of starting the session. The dialog disapears once the application is launched and the application is ready to be inspected. Both the screenshotfeed and the spy tools appear.
Hint: you can collapse the settings pane with the arrow in the upper left corner.
Spy on a paricular object in the screen
Once the session is started you are able to spy on each object in the screen.
- Click on an object in the screenshotfeed.
- The object will be highlighted in a red rectangle.
The Spy tab provides more information about the selected object.
- the Selected object suggests a xPath which you can use to identify the object.
- the Object hierarchy dispays a tree view with all user interface objects of your application which are related to the object you’ve just selected.
Hint: there is also an option to show the full object hierarchy by clicking on the full tree button
Review the properties of a paricular object in the screen
Properties of the selected object are listed in the Properties tab.
You can use the text box to filter the properties which are being displayd. e.g. type access in the text box. and only properties related to accessibility are being displayed.
Use the Code Generator to compose a script
The Code Generator assists in automating your test scenarios. A script is suggested based on a sequence of actions and validation steps. The steps can be added manually or can be recorded from the device.
The Code Generator tab shows all actions and validation steps added since the last page load. By default, this list is empty.
Suggested scripts are made available in different languages on the Code tab.
Add an action manually
- Select the action or validation step you want to add. The list of available actions is a subset of the possibilies offered in the different clients. Consult the PowerShell Reference to see all possibilies.
- Press Add
- Fill the arguments if nessesary.
Code generator icons
|Removes the corresponding step|
|Drag this step to another place|
|Collapse the arguments of the corresponding step|
|Edit the arguments of the corresponding step|
|Executes the corresponding step|
|Use the suggested xPath as value of this argument|
|Locate the xPath in the current screen|
- Press the Record button
- Perform actions on the device.
Click, enter text, back actions are autotmatically added to the list. Each step can be edited, removed or reordered.
View the suggested code
Code is suggested for the actions and validation steps in the Code Generator. Multiple languages can be selected. The suggested code can be pasted and edited in the appropriate editor.