In this videos, I have explained the XPath by text() function in Selenium WebDriver.
Refer to the below points:
If the Attribute is matching with more than one element or if the attribute is not present then we can identify the element using its text. It has the following
syntax: //tagname[text()=’textValue’]
syntax: //tagname[.=’textValue’]
Examples: //div[text()=’Login ‘]
//div[text()=’Users’]
//td[text()=’Java’]
//div[@class=’label’][text()=’Users’]
Ещё видео!