leonid-shevtsov/headless — Issue #15: Click() undefined when executing JS through Webdriver running Firefox via Headless
Author: wokkaflokka
Created: 2011-11-18 00:36:41+00:00
State: open

This may honestly not be an issue with Headless or XVFB at all. However, there is an utter dearth of information, and I figured you might know better than others since you were kind enough (and wise enough) to grace us with this awesome gem that let's us use XVFB.

To summarize, I'm trying to execute the click() function on an element through webdriver. Roughly, this looks like:

@driver.execute_script("document.findElementsByName('Foo')[0].click();")

I haven't had any issues executing arbitrary amounts of JS through Webdriver while running XVFB before (although I never was using the click() function).

Further, the scripts execute fine when running on plain, vanilla Firefox.

I know, I know - why not just click the element using the methods provided by WebDriver? Truthfully, I've been commenting on the webdriver backlog regarding my specific case. I finally decided today to stop attempting to mess around using webdriver to do a man's business, and put in this very hacky JS to click() the element. It was working fine, but right when I batched off a system-test, I noticed that XVFB was not having it. Which brings me here....

Any insight you have would be greatly appreciated. I'll admit - I'm no JS guru, and I'm certainly new to XVFB.

Thanks,
wokkaflokka
(waka flokka flame)