Luke Cupak
Luke Cupak

Reputation: 46

Watir - clicking on element works diffrent than manualy

I wrote test in watir, and one of line doesn't work correctly:

$browser.element(:css => '#sub-15079 > div.ardbnServerInformation').click

When I click manualy on this element, browser opens new tab and everything is fine. But when watir clicks on this element, browser opens new window (instead tab) and data in window doesn't load. How to fix this difference in behaviour?

Upvotes: 0

Views: 67

Answers (1)

boulder_ruby
boulder_ruby

Reputation: 39763

Sounds like maybe some countermeasures are being used to block the scraping efforts...some kind of javascript thing...

A surefire way to overcome these types of things is to a visual-based automation tool something like Sikuli (sikuli.org) to visually identify a link and click it. It actually uses optical recognition rather than the DOM to identify links and click them.

A more haphazard way to go about this would be to use something like cliclick to click based on screen coordinates, but this is not a very good solution in my opinion.

Upvotes: 1

Related Questions