How to access element using Watir and XPath
After watir-webdriver 0.5.1 selecting random element with an xpath was updated to:
browser.element(:xpath => "//h1[@id='header']").click
thanks to: https://groups.google.com/forum/#!topic/watir-general/c6Orvy7Qalw
browser.element_by_xpath("//h1[@id='header']").click
Sources:
- http://wiki.openqa.org/display/WTR/XPath
- http://zeljkofilipin.com/2007/07/03/find-element-by-xpath/
browser.h1(:xpath, "//h1[@id='header']").click