Тёмный

What are the locators? 

CYDEO
Подписаться 4,5 тыс.
Просмотров 335
50% 1

Locators are methods coming from the Selenium library that help us to locate web elements, and there are eight locators: ID, name, link text, partial link text, CSS selector, XPath, tag name, and class name. If an interviewer asks you to give an explanation for each of them, you can go through each of them to explain. For example, the ID is unique; it has to be unique, and if there is an ID, you always use it. The name locator is used only if there is a name attribute, and you go through this name attribute's value. Link text and partial link text relate only to anchor text, which is a text, and you use the text of this 'a' tag, using link text and partial link text. CSS selectors and XPath can work with all attributes and their values; then, you can locate elements using them. The tag name locator uses only the tag name. For instance, you can just specify the tag name, like div or a, or whichever tag name you want to locate. It's not good for locating only one web element; it's mostly used for groups of elements. For example, if you want to locate all links in a web application, you know that links have 'a' tags, so you can use the tag name 'a', and it will locate a group of all texts, all links in it. The class name allows you to find the attribute's value of the class in the web element, and you can locate the class name using this class attribute's value.
#selenium #locators #cydeo
Website: cydeo.com/
Instagram: / cydeo
Linkedin: / cydeo-official
Twitter: / cydeo_official
Facebook: / cydeo.official

Опубликовано:

 

6 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 2   
@julieistyak6124
@julieistyak6124 7 месяцев назад
thank you Aysun🌹
@yorumcuday6968
@yorumcuday6968 9 месяцев назад
Selenium locators❤