Recently I started working at a headless client for RAP 2.0 with the following aims:

  • Allow functional testing of RAP/RWT applications.
  • Allow stress testing of RAP/RWT applications, working together with a performance test library.

A secondary requirement is to:

  • Be similar enough to the SWTBot API so that the effort for testing single-sourced applications is minimal

which gives this project the name RWTBot.

The following example test connects to the RWT Controls Demo and tests the toggle button functionality:

public void selectToggleButton() throws Exception {
  String rwtAppUrl = "";
  RWTBot bot = new RWTBot(new RWTBotClientParameters(rwtAppUrl));
  RWTBotDisplay session = bot.startSession(); // 1. handshake
  RWTBotShell shell =; // 2. identify the main window
  RWTBotButton observed = shell.button("Toggle"); // 3. Find a button named "Toggle"
  assertFalse(observed.getSelection()); // 4. check precondition

  shell.button("Toggle Button").click(); // 5. trigger UI change

  assertTrue(observed.getSelection()); // 6. check post condition

During the test, this happens inside RWTBot:

  1. The initial handshake is executed with the RWT Demo. This opens a RAP session and a display is created. All widgets on the main screen are received. RWTBot control handlers for roughly 100 controls are created and configured.
  2. Initially there is just the main window. This is identified and the RWTBot handle is received.
  3. The main window has a button named “Toggle”. A handle for the button is received and remembered as a local variable. It will reflect the state change in the UI.
  4. Assert that the precondition is as expected, ie. that the toggle button is deselected.
  5. The “Toggle Button” is clicked. This is sent to the server which responds with changes for the UI. These changes include the activation of the observed button.
  6. Assert that the postcondition is as expected, ie. that the toggle button is activated.

Did I miss any design criteria for RWTBot? Are you interested in a working RWTBot? Leave a comment or email me to let us know.




  • hangum
    Posted at 2:11 am, November 16, 2012

    woooooooooooow, very good. very surprising.

  • Markus
    Posted at 1:48 pm, November 18, 2012

    nice work.
    Is there a download available somewhere?

    Regards, Markus

  • Ingo Meyer
    Posted at 11:26 am, November 21, 2012

    This would be a great wanna-have, especially for Performance Testing.
    Very good idea!