4

Automated testing of web site in JavaFX WebView

I have a Web Site, for which I have to write automated tests. The WebSite is built with the following technologies: HTML, CSS, Js, AngularJS. The major issue is that my target browsers are: • Chrome (latest versions) • Mozilla (latest versions) • IE 11+ • JavaFX WebView. Therefore, I am quite stuck, because it is easy to find tools for automated testing for normal browsers but I have no clue, whether there is a tool that support both browsers and JavaFX WebView.

Currently, I have found two tools:

  1. Eclipse Jubula. I am not sure, that there is a possibility to conduct tests for JavaFX WebView here.
  2. QFS. Seems that it fits all my needs, but unfortunately, the license is too expensive. Will be happy to receive any information: link to tools, tutorials, suggestions and so on.
  • Jubula currently doesn't support JavaFX web view. – Alex Jul 20 '16 at 6:18
2

When you say an expensive tool is not an alternative, have you thought about testing both things separately?

To the test the JavaFX application, you can use frameworks such as TestFX. For the WebView, you could come up with a browser that uses the same engine as your JavaFX application—which is WebKit—and test it there. You can determine the WebKit version programmatically:

new WebView().getEngine().getUserAgent();

The output will be a string similar to this:

Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/538.19 (KHTML, like Gecko) JavaFX/8.0 Safari/538.19

If you deploy your own runtime, it should be sufficient to use the corresponding WebKit version for testing. If not, you probably have to figure out what JRE versions (and, therefore, WebKit versions) your customers are using in order to set up an appropriate test environment.

This may not be super satisfying, but still better than no automated tests at all.

0

WATT is a JavaFX based automation tool I develop in my free time. It is similar to Selenium IDE and runs Selenese tests using the JavaFX WebView.

0

You can use Sikuli for the JavaFX WebView test.

Sikuli provides screenshot-based testing just like Kantu but it runs on the desktop (Kantu only works with Chromium). It automates anything you see on the screen and uses image recognition to identify and control GUI components.

So by design, it can automate any application. And if you know a bit of Python, it is easy to use and powerful.

Sikuli is available for Mac, Linux and Windows. It is free/open-source.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.