How do find XPath when only value is given in the source code?
What will be the XPath of a 'Search' button from the expression mentioned above?
inna last edited by
It's hard to come up with the correct XPath locator without seeing the source code of the page you're trying to automate.
Here are few hints:
If the element is a
which looks like:
<button class="favorite styled" type="button"> Search </button>
the relevant XPath locator would be
<input type="button" value="Search">
the relevant XPath locator would be:
It's also possible to use XPath Functions or Operators for example for partial match: