In Firefox 50.1, Firebug is no longer available so I have to use the inspector but I cannot find copy ---> xpath option that was available in Firebug. How can I find the xpath of an element using the inspector?
Go to the First name tab and right click >> Inspect. On inspecting the web element, it will show an input tag and attributes like class and id. Use the id and these attributes to construct XPath which, in turn, will locate the first name field.
Firefox browser (v72): Right-click webpage -> Inspect Element -> Right-click on web element -> Copy -> XPath (If the web element has any unique id then it will give you the relative XPath otherwise it will give absolute XPath).
Press F12, this opens the developer tools. Then click anywhere in the HTML structure and press Ctrl + F or Cmd + F if you're on a Mac. In the search bar that appears you can search by XPath, Css selectors or strings. So if you type //div/div/form for example, you can immediately check if the XPath works.
You can use the console to check if the xpath you want return the correct element or not. $x("//div/xpath")
https://developer.mozilla.org/en-US/docs/Tools/Settings
Follow Bellow Steps:
Step 1 : Right click on page -> Select (Inspect Element)
Step 2 : Pick an element from the page
Step 3 : Right Click on highlighted html -> Copy -> Xpath
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With