Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium Webdriver Support for Javafx 2.0 Webkit or QT5 Webkit (Goal: headless webkit)

I was wondering:

  • Has anybody already thought about implementing the webdriver-interface for an embedded Javafx 2.0 Webkit Browser or for the new QT5 - Webkit.
  • Has anybody some pointers on some Github/Bitbucket/GoogleCode projects heading in this direction?

Why? This would add another cross-platform browser and hopefully could be headless with a new webkit rendering engine. Right now I am using SafariDriver on MacOSX or ChromeDriver. This kinda works, but chromedriver often bites me, when Chrome does it's autoupdate and breaks the chromedriver.

The project, which comes closest for a headless Webkit implementation (including taking screenshots) is, I think, phantomjs (QT-4.8 webkit) + ghostdriver (webdriver addon for phantomjs as a javascript implementation). Right now phantomjs has it's quirks with fonts and hyphenation (­) rendering.

Testing the QT5 browser examples, the font/shy rendering seems to have been fixed. Now I could either wait for phantomjs to catch up with qt5.

The other idea would be to have Java 7 installed, which includes Javafx 2.0 and implement a WebView which can be controlled by the webdriver-protcol as well. Newer JavaFx 2.0 version contain the possibility to take screenshots of JavaFX scenes, which would be helpful.

References:

  • http://ariya.ofilabs.com/2012/03/the-evolution-of-phantomjs-build-workflow.html (Phantomjs/QT integration)
  • How to fix/work around QtWebKit's incorrect font fallback behavior? (qt4.x font rendering)

Merry Christmas,

Jan

like image 679
Jan Weitz Avatar asked Dec 21 '12 20:12

Jan Weitz


1 Answers

Yes, I built this: https://github.com/MachinePublishers/jBrowserDriver

It runs headless by default. Snapshots, xpath, and everything else work. No browser is required, just Java 8.

like image 114
Dan Avatar answered Oct 12 '22 10:10

Dan