Select an element using Object Spy
The Object Spy feature in Scriptless Web supports the creation process of your test automation during test execution. Using Object Spy, you can accurately select objects or elements in your web application.
Object Spy provides a quick snapshot of your web application and lets you view the detected elements in the OBJECT TREE pane.
The object tree presents a hierarchical view of all objects retrieved from the web page. You can either select an object on the device screen or in the tree hierarchy to view related information in the adjacent PROPERTIES pane, which displays a wide range of object attributes. The attributes differ from object to object. Some of the attributes displayed include:
-
class
-
name
-
jsname
-
type
-
style
-
value, etc.
In addition, the PROPERTIES pane displays bindings. Bindings help with identifying and selecting an object on which you want to perform further actions.
You can also use the Search field in the OBJECT TREE pane to search the tree by any object property. If the search brings up results, the number of objects found is displayed below the search field, and you can use the < Prev and Next > buttons to browse through the results and see them highlighted.
Watch this short video to see how you can work with Object Spy. Detailed steps follow.
Step-by-step instructions
Expand a section to view the steps.
- On the detailed execution page, pause the test where you want to add a new step. For more information, see Set a breakpoint to halt an execution.
- On the toolbar above the browser, click the scouting icon . Object Spy opens in the right pane. You can expand nodes as needed.
-
To find all objects that contain a specific string, in the OBJECT TREE pane, in the Search object field, enter the word or string you want to find. You can also search an object by entering a value for the object attribute.
The search is dynamic. The results are refined as you type, and the number of found objects appears below the search field.
-
To navigate the results, use the < Prev and Next > buttons. For the selected object, search results are highlighted.
-
In the tree or in the browser, click a detected object. In the browser, a rectangle displays around the selected element.
-
On the detailed execution page, pause the test where you want to add a new step. For more information, see Set a breakpoint to halt an execution.
-
On the toolbar above the browser, click the scouting icon . Object Spy opens in the right pane.
-
In the OBJECT TREE pane, in the Search object field, search for the specific object.
-
In the tree or in the browser, click the desired detected object.
-
In the browser, from the quick action bar that displays above the selected object, select the action to use, such as keyboard input, checking element text, or checking if an element is present.
-
If the Add Flow Element dialog box opens, you may need to provide more information. For example, if your step involves keyboard input, enter information into the Keys to send field, and then click ADD.
-
Verify that the element was added as a step in the left pane. The test should immediately proceed and display a checkmark next to the new step.