What would be the syntax to use XPath to locate element in Selenium Ruby and click on it?

What would be the syntax to use XPath to locate element in Selenium Ruby and click on it?

Hello NoahSmith,

You can use the below code as example to locate element by XPath and click on it.

e1 = @driver.find_element(:xpath, "//*[contains(text(), 'widgets.pdf')]")
e1.click;