Selenium uses what is called locators to find and match the elements of your page that it needs to interact with. There are 8 locators strategies included in Selenium:
- Identifier : works with the Id and name attributes of your html tags.
- Id : The Id strategy looks for an element in the page having an id attribute corresponding to the specified pattern.
- Name : Like the Id strategy, but on the name attribute. You can also specify a filter to refine your locator
- Link : The text of the link
- XPath : While DOM is the recognized standard for navigation through an HTML element tree, XPath is the standard navigation tool for XML; and an HTML document is also an XML document (xHTML). XPath is used everywhere where there is XML
- CSS : The CSS locator strategy uses CSS selectors to find the elements in the page
- UI-element : new locator