How TruePath Help You To Find the XPath On The Latest Versions Firefox (56 ): - gsumit1/TruePath GitHub Wiki
How TruePath Help You To Find the XPath On The Latest Versions Firefox (56+):
With the release of Firefox version 56+, Firepath & Firebug becomes legacy add-ons and no longer supported. We can no longer use this addon to construct the XPath.
For the latest of Firefox, all the capabilities of Firebug are now present in current Firefox Developer Tools. With the Developer Tool of Firefox, we can now easily identify the XPath.
Assume we need to find the XPath of the Email or Phone text box of the Facebook login page.
Right click on the field as shown below and click Inspect Element.
Once you clicked, it will open the inspector view as shown below and will highlight the HTML text box which is tag input.
Now right click on the HTML, it will display the context menu with copy options. Click the XPath from the submenu.
It will automatically construct the XPath as //*[@id=”email”]. You can directly copy & use this XPath in automation code.
Firefox constructs the XPath based on id, in case ID is generating dynamically we can’t use the XPath in our automation code.
If ID is not present as the attribute for the HTML element, then it will generate the absolute XPath which can break up in the long run.
How TruePath Help You Construct XPath
It creates the multiple XPath, for the target field email & Phone.
From the multiple options, that the TruePath generates, one can easily select the suitable one. Since it generates the relative XPath, the possibility of broken down of the XPath is low. Once selected, it will provide the format options to select from either in the normal or page object format.
For more details on TruePath click here To check or construct XPath manually, one can click console of the developer tool of the Firefox browser as shown below