Automated Testing of hybrid Java Swing and Jxbrowser Application

113 Views Asked by At

I'm looking to expand our automated testing suite for an application that is primarily java (11) swing, but being slowly upgraded to jxbrowser. Right now its probably 95% java, 5% angular, but with every screen that is touched we are looking to convert that to angular.

The issue that were running into is finding a good tool to automate testing for a hybrid application. What are the tools out there that support a hybrid test environment like this? I'm sure were not the only one with this problem and I'm wondering what other solutions people have used.

Selenium doesn't seem to work given that the angular screen are often buried and would require a custom swing driver to translate the web driver interface into swing components which doesn't seem optimal, but I'm fairly Selenium illiterate so feel free to correct me if I'm wrong.

QF-Test looks promising, but I have yet to take a crack at a proof of concept.

1

There are 1 best solutions below

0
On

What are the tools out there that support a hybrid test environment like this?

While there are tons of tools for testing web applications and tons of tools for testing swing applications the number of tools that can do both are quite limited. To my knowledge only QF-Test and Ranorex support both technologies.

but being slowly upgraded to jxbrowser

From experience: Depending on your application and the migration it can be quite tricky to ensure component rerecognition.

I'm sure were not the only one with this problem and I'm wondering what other solutions people have used.

You're not the only ones with a Java application, yes. And I know it's popular to have a web application nowadays (*). However, most projects I know of are using webswing for this. That way they can keep the old Java code (with the old swing / JavaFX / ... toolkit code) and the webswing toolkits takes care of delivering a functional working website to the browser that looks exactly like the old java application.

(*) This may change again in future. In fact I know of some high security projects where they opted against converting an existing Java application to a web application. Mostly because when the internet connection or the server breaks a webbrowser would only display "Please check your internet connection" while a Java application could still provide some limited (but maybe crutial) functionality.

QF-Test looks promising, but I have yet to take a crack at a proof of concept.

QF-Test should work and I personally would prefer it simply because I do have more experince with QF-Test than with Ranorex.

To give you an outline: Since you do have a hybrid application you do have two "engines" (web and swing - and yes engines is how the QF-Test teams call the sup-programs that interact with the toolkit) connected. You may also have two application processes (and thus two clients). If you have two application processes (you can check that in the QF-Test client menu) you may need to change the client variable every time you change between the web and the swing part of your application.

Because of this, I would not necessarily use the default "Click"-steps but rather a procedure that checks through the different clients (and the different engines) for the wanted component and then pass the corresponding information to the "Click"-step. That way you do not need to update all "Click" / "Checks" etc. whenever a particular screen is updated to Angular.

I would also suggest to use SmartIDs and in case of more advanced component recogniton resolver scripts. These subjects are explained in the QF-Test user manual (https://www.qfs.de/en/support/documentation.html) but since these subjects (except SmartIDs) are not necessarily the easiest once you may want to get in touch with the QF-Test support team ([email protected]).