Continuing with the Automation project, WebDriver allows to interact with the DOM (Document Object Model) through XPath . Xpath provides a quite interesting approach to query the DOM, but sometimes it requires dedication and practice to fully understand how it works and how the queries can be performed.
Since I need to interact with the DOM elements very often and WebDriver also provides a way to use XPath, then it is time to getting started using it.
FirePath gives you the XPath expression to locate the element, look for example how easy is to find an element in google :
Let’s suppose I would like to find the dive where the country is displayed, then the XPath expression would be
This is another approach to interact with XPath.