This shows you the differences between two versions of the page.
es:objects_identification [2018/01/16 15:45] tast created |
es:objects_identification [2019/09/10 06:55] (current) tast [Encontrar selectores:] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Objects Identification ====== | + | ====== Identificación de Objetos ====== |
- | {{:TAST-icon.png?nolink&70|}} 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. | + | Cuando se trabaja con una herramienta de automatización, es muy importante poder identificar objetos y trabajar con ellos. De lo contrario, la herramienta de automatización no sabrá dónde hacer click o escribir. |
- | 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. | + | Para resolver este problema, normalmente, se utilizan las propiedades del objeto. Esos son algunos de los atributos, identificaciones, nombres, etc... que cada objeto utiliza para ser reconocido y modificado. |
- | 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. | + | Como usuario de TAST, es posible trabajar con ellos. Después de crear los mensajes (usemos el mensaje CLICK como ejemplo) y los parámetros necesarios para ello (por ejemplo, haciendo click en el botón LOGIN), podemos seleccionar cómo identificar el botón. |
- | As it is shown in the image beside, the dropdown "Search by" gives us the option of choosing between: | + | Como se muestra en la imagen de al lado, el menú desplegable "Buscar por" nos da la opción de elegir entre: |
* Class Name | * Class Name | ||
Line 20: | Line 20: | ||
{{:Search_by_eng.png?nolink&2500|}} | {{: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. | + | Con cada uno de ellos, el usuario de TAST deberá completar el campo "Elemento" a la derecha, que contendrá el valor de la opción seleccionada en "Buscar por". Por ejemplo, si queremos utiliar el atributo "Id" para el botón de Inicio de sesión, tendremos que escribir en el campo elemento, la ID del propio botón. |
- | 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]]). | + | Sin embargo, para evitar complicaciones y problemas al ejecutar la prueba, debemos asegurarnos de que el atributo que elijamos define UNIcamente el botón (u otro elemento) con el que queremos trabajar. Por ejemplo, si la página web tiene dos botones diferentes con el mismo nombre de etiqueta, el usuario debe evitar el uso de la propiedad Nombre de etiqueta para su definición (de lo contrario, la prueba automática no sabrá cuál de ellos es la correcta y, por lo tanto, fallará). Dado que se necesitan estos parámetros para que sean __únicos__, hay dos opciones en TAST para ayudarnos a que esto suceda ([[XPath]] y [[CSS Selector]]). |
- | ===== Tools for finding selectors: ===== | + | ===== Herramientas para encontrar selectores: ===== |
- | ==== Checking Selectors: ==== | + | ==== Comprobando Selectores: ==== |
- | 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: | + | El explorador de Google Chrome nos da la oportunidad de verificar si un Selector CSS o un Xpath está definido de manera única. Para hacer esto, el procedimiento es el siguiente: |
- | * Open Google Chrome, and navigate to the webpage that will be tested | + | * Abra Google Chrome y acceda a la página web que se va a probar. |
- | * Press F12, and after that press CTRL + F (Strg+F in German keyboards) | + | * Pulse F12, y después pulse CTRL + F (Strg+F en los teclados alemanes). |
- | * 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. | + | * Una barra de búsqueda aparece hacia abajo. Úselo para introducir el selector Xpath o CSS, y en el lado derecho aparecerá un número "n/n" si este número es 1/1, el elemento se define de forma única. |
- | * | + | |
- | ==== 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. | + | ==== Encontrar selectores: ==== |
- | The working of this tool is as follows: | + | Además, para facilitar la forma de trabajar con estos atributos, en caso de necesidad, el usuario puede descargar aquí {{Fire-IEBrowser1.4.xls}} un __excel sheet__ que le ayudará a elegir el identificador adecuado. |
- | * first of all, the excel book needs some permissions (for granting them, click on "Enable Content", | + | El funcionamiento de esta herramienta es el siguiente: |
+ | |||
+ | * En primer lugar, el libro de Excel necesita algunos permisos (para concederlos, haga click en "Enable Content", | ||
{{: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.." | + | * Entonces, aparece una ventana emergente que dice "FIRE - IE BROWSER - WEB ELEMENT DETAILS". Haga click en "Continuar..." |
- | * 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). | + | * Después de eso, se abre un explorador, solo introduciendo la URL y haciendo click en Cargar, el usuario puede hacer click (con el botón derecho del ratón) en el elemento deseado. Una ventana emergente solicita un nombre para clasificar el elemento (el usuario puede elegir el más fácil de recordar). |
- | * 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. | + | * Cuando todos los elementos necesarios son pulsados y nombrados, después de cerrar el explorador, el usuario puede ver una lista completa con todos los elementos elegidos anteriormente, y los principales atributos e identificadores utilizados (XPath, CSS, ID y nombre), y el tipo de elemento. |
- | **Please take care to ensure that the CSS or the Name are Unique before using them, to avoid errors in the test launch.** | + | **Por favor asegúrese que el CSS o el Nombre sean únicos antes de usarlos, para evitar errores en el lanzamiento de la prueba.**\\ |
{{:google_eng.png?nolink&1500|}} | {{:google_eng.png?nolink&1500|}} | ||