Xpath Function Using Parent
Xpaths Parent :-
This method is used to select the parent node of the current node. In the below example, the parent element is located through its child element. From the email field we are traversing to its parent node. Please note in case of child XPath, only the immediate children of the current node are considered and not the grandchildren. In case if the current node is the root node, then its parent will be empty and hence it will have no parent.
Example 1: Xpath= //input[@name='email']//parent::div