XPath: Using Parent
XPath Parent:
The parent axis is used to select the parent node of the current node. In the example below, the parent element is located by navigating from its child element (the email field) to its parent node.
Note that when using the child axis, only the immediate children of the current node are selected, not any deeper descendants like grandchildren. If the current node is the root node, it will have no parent, so the parent axis would return empty in that case.
This selects the div element that is the parent of the input field with the name "email"
Example 1: XPath= //input[@name='email']//parent::div