When working with an automation tool, it is very important to be able to identify objects and work with them. Otherwise, the automation tool will not know where to click or type.
For solving this issue, normally, the object properties are used. Those are some of the attributes, identifications, names, etc… that every object uses for being recognized and modified.
As TAST user, it is possible to work with them. After creating the messages (let us use the CLICK message as an example), and the parameters needed for it (for instance, clicking on the LOGIN button), we can select how to identify the button.
As it is shown in the image beside, the dropdown “Search by” gives us the option of choosing between:
With every one of them, TAST user will have to fill out the field “Element” at the right side, that will contain the value of the option selected in “Search by”. For example, if we want to use the attribute “Id” for the Login button, we will have to write in the element field, the ID of the button itself.
Nevertheless, for avoid complications and problems while running the test, we have to make sure that the attribute we choose defines UNIQUELY the button (or other element) we want to work with. For instance, if the webpage has two different buttons with the same Tag Name, the user needs to avoid the usage of Tag Name property for its definition (otherwise, the automatic test will not know which one of them is the correct one and, so, it will fail). Since these parameters are needed to be unique, there are two options in TAST to help us to make it happen (XPath and CSS Selector).
Google Chrome explorer gives us the chance to check if a CSS Selector or a Xpath is uniquely defined. For doing this, the procedure is as follows:
Also, for ease the way of work with this attributes, in case of need, user can download an excel sheet that helps to choose the proper identifier.
The working of this tool is as follows:
Please take care to ensure that the CSS or the Name are Unique before using them, to avoid errors in the test launch.