What’s hot for SWTBot ?

Here are some news from SWTBot, the famous SWT UI Bot API that’s widely used in order to write some functional tests!

A Test Recorder and Generator

Together with Rastislav Wagner (who’s a Red Hat colleague working on testing JBoss Tools and JBoss Developer Studio), we had the opportunity to meet in person with the whole JBoss Tools team in Brno. We started to work on a draft of a test recorder and generator that could work for both SWTBot, and an Eclipse bot API used by Brno folks called RedDeer.
We made so much progress that we did not simply sketch a way to get it to work; but in the end, we wrote a first simple version of the generator. It’s quite simple, but it’s already powerful enough to be useful, so we decided to contribute it to SWTBot.
For more details about the contribution process, you can follow those links: Gerrit contribution (thanks to Matthias Sohn for reviewing it), disucssion on the developer mailing-list, discussion on user forum, and finally the Git commit in the source repository.

All this stuff leads us to the ability to install this recorder from the SNAPSHOT p2 repository: http://download.eclipse.org/technology/swtbot/snapshots/

SWTBot Snapshot p2 Reposioty

SWTBot Snapshot p2 Reposioty

Once installed on any RCP application, it’s pretty easy to use: just set the -Dorg.eclipse.swtbot.generator.enable=true system property. The following video shows a basic use-case

It’s currently limited to a few concepts, but it’s easy to add support for new widgets, and it can already be used to save a lot of time when writing tests. If you feel interested in contibuting, see http://wiki.eclipse.org/SWTBot/Contributing and come to the swtbot-dev mailing-list to have a chat.

Rastislav already has plans to implement support for more complex UI operations that match several events, that will be a very interesting to implement and powerful to use improvement!

Support for Eclipse 4

SWT has not changed much between Eclipse 3.x and Eclipse 4, so SWTBot still supports most SWT concepts There are very few bugs that are known, but there is no blocker. The most critical one is probably related to the visibility of some menus. Any help to fix one of these bugs is highly welcome.

However, there is an important bug that prevents UI tests (may them use SWTBot or not) from being run with PDE for an Eclipse 4 application. So it’s difficult to test SWTBot for Eclipse 4 from IDE. Fortunately, Tycho, which is more “regular”, is able to run tests that use SWTBot on an e4 application. You can give it a try by configuring the product in tycho-surefire-plugin to use an e4 product (such as the contact demo) and use SWTBot in your tests. Make sure e4 bundles are present during tests (they must either be a transitive dependency of the test –recommanded-, or you can add them as dependencies of test execution).

I think once all the SWTBot for e4 are fixed, we’ll try to make an official release of SWTBot.

SWTBot is an open project!

SWTBot is a community-engaging project: there is activity on the user forum, on the developer mailing-list, the wiki makes it easy to learn how to use SWTBot, but also how to contribute. SWTBot excels in the use of Git, Gerrit, Hudson, Sonar… All those tools are there to make it easier for users to turn into contributors, and contributors into committers, and to keep productivity and quality at a high level; and they’ve proven there efficiency on these topics in the last few months. They provide so much feedback on contributions that the process of accepting a patch is made faster.
So if you’re interested in contributing, please give it a try and feel free to ask for help on the developer mailing-list. The tools and processes are open as well, so please come and suggest better ways of doing things, it will be very appreciated!

All those proofs of openness made that I nominated SWTBot for the Most Open Project of Eclipse Community Awards.

  1. #1 by Lars Vogel on January 8, 2013 - 6:00 pm

    Thanks Mickael for this work and for writing it up for other to see it. I’m very much impressed with the work Redhat is putting into Eclipse. It is notable that RedHat knows what is important for an OS project.

  2. #2 by Sebastien Gandon on January 10, 2013 - 11:36 am

    Excellent work Mickael, so many people have dreamt about this but could not put too much effort into it.
    I think just by getting this started will easy the process of contributing.

    Thanks again.

    SeB.

  3. #3 by Mickael Istria on January 13, 2013 - 1:29 pm

    A documentation page is available there: http://wiki.eclipse.org/SWTBot/Generator

  4. #4 by Harald Kirschner on March 15, 2013 - 1:35 pm

    I try to use the generator but the generator window does not open up when I start my RCP. Any idea why?

    • #5 by Mickael Istria on March 15, 2013 - 2:02 pm

      Hi Harald,

      Can you please ask this question on SWTBot user forum?

  5. #6 by Ramkumar Shanmugam on March 22, 2016 - 10:36 am

    Hi Mickael

    Does SWTBot supports JavaFX ?
    Please let me know

    Thanks
    Ram

    • #7 by Mickael Istria on February 8, 2017 - 3:25 pm

      No. SWTBot support SWT-based applications only.

Leave a comment