I have a link that can not be identified in my html page shown below:
<a href="/somthing/confirm_delete_somthing?&id=12">Delete this monitor</a>
What is the XPath to identify the link by the label Delete this monitor?
something like //a[@label="Delete this monitor"]?
Replace
@labelwithtext()which represents a text value of a node.//a[text()="Delete this monitor"]For cases where the text is on another line, such as
you can use
normalize-space()function which removes starting and trailing spaces://a[normalize-space(text())="Delete this monitor"]