This shows you the differences between two versions of the page.
objects_identification [2017/12/29 12:47] tast |
objects_identification [2024/01/16 08:44] (current) montse [Checking Selectors:] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Objects Identification ====== | ====== Objects Identification ====== | ||
- | |||
- | [[doku>wiki:dokuwiki|{{wiki:TAST-128_small.png }}]] | ||
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. | 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. | ||
Line 20: | Line 18: | ||
* XPath | * XPath | ||
- | {{:Search_by_eng.png?nolink&900|}} | + | {{:Search_by_eng.png?nolink&2500|}} |
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. | 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). | + | 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: ===== | ===== Tools for finding selectors: ===== | ||
Line 35: | Line 33: | ||
* Press F12, and after that press CTRL + F (Strg+F in German keyboards) | * 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. | * 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: ==== | ==== Finding Selectors: ==== | ||
- | Also, for ease the way of work with this attributes, in case of need, user can download here an excel sheet that helps to choose the proper identifier. | + | 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: | The working of this tool is as follows: | ||
Line 45: | Line 43: | ||
{{:excel permissions_eng.png?nolink&400|}} | {{:excel permissions_eng.png?nolink&400|}} | ||
+ | |||
* Then, a popup comes out saying "FIRE - IE BROWSER - WEB ELEMENT DETAILS". Click on "Proceed.." | * Then, a popup comes out saying "FIRE - IE BROWSER - WEB ELEMENT DETAILS". Click on "Proceed.." | ||
Line 51: | Line 50: | ||
* 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. | * 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.** | + | **Please take care to ensure that the CSS or the Name are Unique before using them, to avoid errors in the test launch.** |
+ | {{:google_eng.png?nolink&1500|}} |