How can we locate an element by only partially matching the value of its attributes in Xpath?
Hi Joe,
Using contains() method we can locate an element by partially matching its attribute’s value. This is particularly helpful in scenarios where the attributes have dynamic values with a certain constant part.
xPath expression = //*[contains(@name,'user')]
Basically, the above statement will match all the values of the name attribute containing the word ‘user’ in them.