Different locators in Selenium.


To automate the web application, such as automatically clicking on the buttons and links ,
writing data to a text-box etc we need to first identify the web elements of those buttons
or text-boxes and then perform the operation.

We can identify those web elements using locators. Selenium web-driver can use the following
locators to identify any HTML element on the web pages or web applications.

There are mainly eight locators.Those are given below.

  • ID
  • XPath
  • CSS Selector
  • Tag Name
  • Name
  • Class Name
  • Link Text
  • Partial link Text