objects_identification [TAST DokuWiki ]

User Tools

Site Tools


Sidebar

First steps in TAST

What is UML

Computer setup for TAST use

FAQ

Recognized Issues

TAST tool Menu

TAST Adaptors

Adaptors examples

TAST Integrations

Interesting features

Documentation of technical administration

Modeling recommendations

Training in the TAST tool

objects_identification

Objects Identification

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:

  • Class Name
  • Css Selector
  • Id
  • Link Text
  • NAme
  • Partial Link Text
  • Tag Name
  • XPath

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).

Tools for finding selectors:

Checking Selectors:

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:

  • Open Google Chrome, and navigate to the webpage that will be tested
  • Press F12, and after that press CTRL + F (Strg+F in German keyboards)
  • A search bar appears downwards. Use it to introduce the Xpath or CSS selector, and at the right side will appear a number “n/n” if this number is 1/1, the element is defined uniquely.

Finding Selectors:

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:

  • first of all, the excel book needs some permissions (for granting them, click on “Enable Content”,

  • Then, a popup comes out saying “FIRE - IE BROWSER - WEB ELEMENT DETAILS”. Click on “Proceed..”
  • After that, an explorer opens up, only by introducing the URL and clicking in Load, the user can be able to click (with the right mouse button) in the desired element. A pop up asks for a name to classify the element (the user can choose the one easier to remind).
  • When all the elements needed are clicked and named, after closing the explorer, the user can see a complete list with all the elements chosen before, and the main used attributes and identifiers (XPath, CSS, ID and name), and the type of element.

Please take care to ensure that the CSS or the Name are Unique before using them, to avoid errors in the test launch.

objects_identification.txt · Last modified: 2024/01/16 08:44 by montse