In this Selenium XPath tutorial we will learn about XPath axes method ancestor and ancestor-or-self with examples.
XPath axes ancestor method helps in selecting all the ancestor nodes of the current node.
XPath axes ancestor-or-self method helps in selecting current node as well as all the ancestor nodes of current node. Watch the full tutorial to understand XPath axes ancestor methods with examples.