1) Firebug –
Once firebug is installed, you will see a bug icon on the right top corner of the browser, click as per the below screen order to identify the webelements.
2) firepath –
will get this with the firebug addon: which displays the relative or absolute xpath of a web element as shown below:
Above xpath is known as Relative xpath, it takes the recent (parent element id) and then move downwards to identify the required webelement, if anything changes on the browser elements above to this required web element doesn’t affect our xpath.
But if we use Absolute xpath which starts from the root node of the html and moves downwards to the required web element which depends on the inter relation among all the web elements on the browser, so if anything gets change, we need to change our xpath as well, let’s see one example:
Another way to get the firepath directly is to, right click on any web element and then click on the options as shown below instead of clicking on the bug icon on right top corner of browser:
3) xpath checker –
Another addon to mozilla to identify the xpath as shown below,
Just right click on any browser element and click on the xpath… option.