Introduction To Locators
Introduction To Locators
Introduction to Locators
We can use these locators in our test automation code to locate the UI elements on the Web pages.
Demonstrate the usage of Locators in locating the UI Elements on the Web Pages using Selenium IDE
The below are the different types of locators which can be used for locating the UI elements on the Web Pages:
With the help of Selenium IDE's Target Text box field, demonstrate all the below different types of locators:
Locators Priority
Though there are different types of locators available for locating the UI elements on the Web Pages, we need to use any one of them based
on their priority.
The below is the priority order in which we need to select and use the locators :
'id' locator needs to be given the first priority. i.e. If the same UI element can be located with the help of different locators like id, name
and so on, we need to choose id locator locating it.
Similarly second priority goes for 'name' locator. i.e. If the UI element cannot be located by id locator, then we will prefer to choose
'name' locator as second priority.
Third priority goes for 'class' locator.
Forth priority goes for 'link text' locator.
Fifth priority goes for 'cssSelector' locator.
Sixth priority goes for 'xpath expressions' locator.
Last priority goes for 'dom' locator.