Naveen
Naveen

Reputation: 41

Watir-Classic not clicking on element

<span class="titleBar-link">
<a href="javascript:void(0)" data-click-handler="openBYOTView,omnitureClickHandler"     data-omniture-rfrr="ROUNDTRIP">
<span data-icon="roundtrip"></span>See Roundtrip Combinations
</a>
</span>

From the above HTML code, I want to click on element <span class="titleBar-link">, for that I used the following code

Browser. span(:class => 'titleBar-link').click

When I am running this code with IE(Watir-Classic), this step was executed but really it didn’t click on that element. It worked well with Watir-Webdriver.

Any help is appreciated.

Upvotes: 3

Views: 307

Answers (2)

amjad
amjad

Reputation: 2916

you can also use

browser.link(:xpath => "//span[@class='titleBar-link']/a[0]").click

Upvotes: -1

Justin Ko
Justin Ko

Reputation: 46836

Try clicking the link instead?

browser.span(:class => 'titleBar-link').link.click

Upvotes: 2

Related Questions