Validating xpaths

To validate whether the xpath we created is valid or not we can go to chrome developer tools and go to elements tabs Then click anywhere in elements and press ctl+f and then paste the xpath we created there it will show if it is valid then it will say something like 1 out of 1 etc.

Then we can click the down arrow and it will highlight the actual element on the webpage for which the xpath Is created.

For firefox we can add an addon extension called try xpath

Then we go to the webpage of rediffmail and open try xpath and in expression field paste our created xpath and if it is valid it will highlight the webelement in red dots.