Locators

The locator is an address that identifies a web element uniquely within the webpage. Locators are the HTML properties of a web element which tells the Selenium about the web element it needs to perform some action on. Every Selenium command requires locators to find the web elements.
For identify these web elements accurately Selenium have different types of locators.

Locators:
1)   ID
2)   Name
3)   Class Name
4)   Tag Name
5)   Link Text/Partial Link Text
6)   CSS
7)   XPath


Locating web elements in Webdriver is performed with the help of findElement() and findElements() method.

How to locate WebElement using ID Locator
How to locate WebElement using Name Locator
How to locate WebElement using ClassName Locator
How to locate WebElement using TagName Locator
How to locate WebElement using Link Text Locator
How to locate WebElement using Partial Link Text Locator
How to locate WebElement using CSS Selector - Part -1
How to locate WebElement using CSS Selector - Part -2
How to locate WebElement using CSS Selector - Part -3
How to locate WebElement using Xpath - Part - 1
How to locate WebElement using Xpath - Part - 2
How to locate WebElement using Xpath - Part - 3

Comments