0

Most of us rely on extracting the XPaths from browser plugins or tools. These tools have got limitations. One of the limitations is that they frequently produce absolute XPaths (meaning all the way from the HTML tag!) which are long and extremely flaky. Other smarter tools seem to have trouble producing unique XPaths in anything but the simplest conditions. Generally, we locate the elements using their unique attributes but some elements do not have unique attributes. Locating such elements is difficult because the XPath generated will have multiple matching elements.

Can we do auto generation xpaths for input and button elements in webpage using Java by parsing into DOM elements using Jsoup and please provide sample code if any.

2
  • Possible duplicate of Find Xpath of an element in a html page content using java Commented Sep 30, 2019 at 11:00
  • Thanks. I think its more of finding an xpath of a webpage element. But, my requirement is to auto generate of independent xpath for selenium tecinical issue like "NOSuchElementExcception" Commented Sep 30, 2019 at 11:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.