WebElements can be located with selenium webdriver using XPaths. These are expressions that identify elements on a page based on certain details, such as, if the element contains a specific attribute or has a specific child node.
IWebElement Query = driver.FindElement(By.XPath("//*[@class='central-textlogo-wrapper']"));
To explain what the different parts of the xpath in the above statement do:
- // means to select an element descending from the root element
- * means the element can be of any type
- @class means to select an element matching the class attribute of the WebElement.