Recently, Bredex created an interesting product at the Eclipse Foundation: namely, Jubula, a tool for UI testing Eclipse RCP, SWT, Swing and web applications. Basically, I guess this will become the “community edition” of GUIDancer, which is good enough for me, considering the dire need for any free UI testing tool for RCP, SWT or Swing at all.
I won’t go into comparisons with other tools in this post, but in short, imho, though there may be better tools for web testing, though there may be alternatives for Swing testing, though there may be better commercial tools for testing RCP and SWT, when you’re looking for free tools for testing RCP/SWT, I think you should start with Jubula.
Unfortunately, working with Jubula turns out to be a bit unwieldy at first. – So I’ll try to give a detailed step-by-step guide to your first GUI test automation with Jubula here, using a simple Eclipse RCP sample project as the test object.
Looking good. This should be simple enough for our first steps, yet complex enough to play around a bit. – However, for exporting the application, we’re missing a product configuration (File/New/Product Configuration):
Finally, we’re done with preparing our test object. Or are we?
Actually, we’re not, unfortunately. The reason for this is that sadly, the Eclipse JFace/SWT libraries haven’t got any easy way to access/instrument them for automation on the fly (unlike Swing).
So, Jubula has to somehow hook itself into our RCP application, and we have to help with that: Look for the archive
rcp-support.zip in your Jubula installation directory and extract it into your product directory. This will add a Jubula instrumentation plugin to your product.
However, that’s not all. You’ve still got to activate that plugin, and you can do that by editing the
configuration/config.ini file in your product directory. There’s a long line in that file listing the
osgi.bundles, and you have to add the Jubula plugin at the end:
Phew. Now we’re really really done with preparing the test object. Of course, for real projects, you’ll probably want to automate all these preparations in your build.
Let’s start up Jubula and do some testing! – Or wait, actually, let’s do that in my next blog post.