tags:

views:

110

answers:

1

I'm trying to get HTMLUnit to perform a click action on a span, which doesn't work for some reason. Please take a peek at the code below.

HtmlElement clickable = (HtmlElement) page.getByXPath("//div[10]/div/div/span").get(0);
clickable.click();

By doing this I get a really long error message. The interesting bit seems to be the following:

TypeError: Cannot find function setCapture in object [object].(script in [some long url here])

The same thing happens when i try to call on mouseDown() or dblClick() or any other mousey method. This is really frustrating since the code snippet is something that worked fine some time ago. I simply uncommented it today and now it won't co-operate.

A: 

HtmlUnit doesn't currently support .setCapture()/.releaseCapture(), please open a bug report in its tracker

Ahmed Ashour
I got it working by specifying BrowserVersion.FIREFOX_3 in the constructor of my WebClient instance.
nici