USING FIREBUG IN SELENIUM WEBDRIVER TO FIND XPATH AND CSS SELECTOR

Finding xpath using Firebug in Selenium WebDriver is so easy,So the People who have been dirtying their hand in automation with selenium would be familiar with the pain of failing test due to wrong element locator and because they don’t get the right way to find out the Xpaths, CSS path . Firebug is the solution of all such pain and it also helps you to speed your automation work.
Oh I am taking much time of yours, Ok then let me start with the steps to find out the Xpaths and CSS path through Firebug of any element on a web page. But let me tell you what Xpath is
Xpath is just the combination of HTML tag that helps in identifying specific element on a webpage.

But before this
1- Firefox should be installed
2- Firebug add-on should be installed. To install Firebug follow this, go to Tool–> Add-ons –> Search Firebug –> Install
Assuming you have installed Firebug and Firefox on your Windows or Mac machine.
Steps for finding Xpath through Firebug
1-      Open Firefox browser with its Mozilla home page
2-      Click on Bug tab at the right corner of the Browserfirebug-1

3-      Click on Inspect element button and place your tip of cursor on any element for which you want to find Xpath
firebug-2
4-      Here I have selected the Mozilla logo as soon as we put cursor on Logo and click once on it, HTML tag get highlighted in Firebug
5-      Right Click on highlighted code and Select Copy Xpath like thisfirebug-3
 6-      Now place this Xpath in to your script.