XPath starts-with() is a function used for finding the web element whose attribute value gets changed on refresh or by other dynamic operations on the webpage. In this method, the starting text of the attribute is matched to find the element whose attribute value changes dynamically.
Xpath=//label[starts-with(@id,’message’)]
The XPath text() function is a built-in function of selenium webdriver which is used to locate elements based on text of a web element. It helps to find the exact text elements and it locates the elements within the set of text nodes.
Xpath=//td[text()=’UserID’]
XPath Contains() is a method which is used to find the value of those attribute which changes dynamically. For example, login information.
XPath=//tagname[contains(@attribute, 'value')]
XPath ends-with() method checks the ending text of an attribute and finds elements whose attribute changes dynamically on refresh. It has the following syntax as follows:
XPath= //tagname[ends-with(@attribute, 'value')]