How do I find element by text in Selenium Webdriver?

Can anyone tell me how do I find element by text in Selenium Webdriver.

You can find the element using xpath function text().

XPath using text() function :

Syntax:.//*[text()=’VisibleText’]

usage : driver.FindElement(By.XPath(“.//*[text()=‘Our People’] ”))

This XPath will select an element which contains the text “Our People”.