![how to copy the code when you inspect element chrome how to copy the code when you inspect element chrome](https://i.ytimg.com/vi/KAxKLvNwfn0/maxresdefault.jpg)
Similarly, we can write also XPath of any element just by following all the above steps. XPath(First name): = 'firstname'] (1 of 1 matched) On the basis of the above screenshot of element “First name”, we can easily find XPath of element. Look at the below screenshot where we have written XPath for element “First name”. If XPath is matched with any elements, they will be highlighted in DOM in yellow color. Now you can write XPath in the panel to evaluate for that element.Ħ. Press ctrl+F to enable DOM searching in the panel.ĥ. This frame will highlight the HTML code of element in blue color.Ĥ.
![how to copy the code when you inspect element chrome how to copy the code when you inspect element chrome](https://i.stack.imgur.com/EXqoG.png)
Now, the elements panel will be opened right-hand side on the screen. Move the mouse over the desired element (object) on the web page, right-click on that element on which you are trying to find XPath, and then go to option “Inspect Element”.ģ. Open URL or web page in the Chrome browser.Ģ. There are following steps to inspect an element and find XPath of element on a webpage in Chrome browser for Selenium WebDriver script. They are much more powerful than Firebug. Google Chrome provides an inbuilt feature for inspecting pages and elements. Let’s know what are a few steps to find XPath in Chrome browser? Steps to Find XPath in Chrome Browser I will recommend that you practice more and more to find XPath in chrome browser because when you would go for any company technical test, you will have to find XPath in Chrome browser only. It is a query language for searching and selecting nodes from the XML document. XPath is the most powerful way to determine the location of elements on a web page.