Locators
Mechanism to find elements in a web page
There are 7 ways which we can use to find an element or group of elements in a web page. And they are
Id
Name
Tag name
Link text
Partial link text
CSS Selector
XPath
Id:
If an element has id
attribute then we can use it find the element.
Name:
If an element has name
attribute then we can use it find the element.
Tag name:
We can find an element using it'stagname
.
Link text:
If an element is having tag a
, then we can identify it using the link text of it.
Partial link text:
If an element is having tag a
, then we can identify it using a portion of it's text.
Last updated
Was this helpful?