Telerik Test Studio utilizes DOM structure of the web page for Identifying Objects. The recording function in the Telerik Test Studio acquire the properties of the objects on which the operations are performed. It identifies the elements and presents the tester with the suggestions based on the DOM structure of a property. A tester can then identify and choose the unique object attribute from all the relevant properties it has.
- When a Test Project is loaded all the elements from created test scripts are combined to form Element Repository and are displayed in the Element Explorer tab.
- The repository contains the definition for individual elements that are referenced to test cases. Some of the element that has been recognized by the same property are displayed together.
Element Explorer
In the previous chapter of Record and Play Back in Telerik Test Studio, we recorded a small test of Contact form and the below tutorial is a followed tutorial of the same.
How to view elements in Telerik Element Explorer?
In the Test Studio home, click on the Elements tab in the bottom left-hand side. This will open the element explorer pane.
- ContactLink, YourNameText, etc in the element explorer are the elements.
- DemoqaJustAnother and ContactDemoqa are the Frames Nodes.
Element Explorer displays the list of elements that are used in your tests. Also, the elements are organized in a tree view with attributes that are specific to the test they belong to. If an element is used by several different test steps or tests then also it will be displayed only once in the Elements Explorer.
The hierarchy is maintained for the elements based on their location on a particular page. You can do a right-click on the element to view its properties and to perform other actions.
If you right-click on an element, it will show the context menu. Let’s see what each of these menus does.
- Edit Element : It opens find element pop-up where you can edit the properties through which an element can be recognized or found.
- Edit in Live : It allows you to locate an element in the current active page while recording.
- Used By : It opens up test selector and displays all the tests that uses this particular element.
- Validate : It is used to validate elements present in the page node. It requires you to load page in the recording window.
- Rename : You can give a unique name to the element for easy recognition.
- Delete : Delete the element
- View Error : Shows error logic for an element that cannot be found.
- Locate in DOM : Opens recording window and navigates to this element’s position in the DOM
- Load Page : Allows test to load URL of the page to where this element belongs
- Properties : Open up the Properties pane.
Test Studio automatically detects Frames, whenever you record an action or verify an element which is present in that frame. It then adds the Frame node to the element explorer and stores all the element found inside that frame in the node.
Below is the example of the Frame Node
Frame node also has its attributes based on which it is identified. Frame node is identified and recorded first before any of the element present in the frame are recorded. Just right click on the Frame node and select property to view its properties.
Properties of the frame are:
- FriendlyName: Any name you want to provide to the Frame Node or element. Telerik automatically provides a unique name to the elements/Frames but user can change it as per their own choice.
- Path: Path is the URL of the webpage on which this frame was found.
- Title: It’s the title of the Webpage.