I have some HTML that looks like this:
<h1 id="header">Header</h1>
I would like to click it using Watir and XPath.
I have some HTML that looks like this:
<h1 id="header">Header</h1>
I would like to click it using Watir and XPath.
browser.element_by_xpath("//h1[@id='header']").click
Sources:
Not using XPath, but it works:
browser.h1(:id, "header").click
browser.element_by_xpath("//h1[@id='header']").click
browser.h1(:xpath, "//h1[@id='header']").click
both are correct usage of xpath
Check with more abt watir in this forum
http://tszone.co.cc/forum/viewforum.php?f=19&sid=cd08b444d523746a3b2ba036865a0eff