Deprecated: Function set_magic_quotes_runtime() is deprecated in /home2/www/gerhardtconsulting/gide/wikka.php on line 120 Deprecated: Function ereg() is deprecated in /home2/www/gerhardtconsulting/gide/libs/Wakka.class.php on line 648 Gerhardt Informatics: RCP Robot
spacer.png, 0 kB
spacer.png, 0 kB
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/www/gerhardtconsulting/gide/3rdparty/plugins/geshi/geshi.php on line 2067 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/www/gerhardtconsulting/gide/3rdparty/plugins/geshi/geshi.php on line 2057 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/www/gerhardtconsulting/gide/3rdparty/plugins/geshi/geshi.php on line 2067 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/www/gerhardtconsulting/gide/3rdparty/plugins/geshi/geshi.php on line 2057 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/www/gerhardtconsulting/gide/3rdparty/plugins/geshi/geshi.php on line 2067 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/www/gerhardtconsulting/gide/3rdparty/plugins/geshi/geshi.php on line 2057 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/www/gerhardtconsulting/gide/3rdparty/plugins/geshi/geshi.php on line 2067 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/www/gerhardtconsulting/gide/3rdparty/plugins/geshi/geshi.php on line 2057 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/www/gerhardtconsulting/gide/3rdparty/plugins/geshi/geshi.php on line 2067 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/www/gerhardtconsulting/gide/3rdparty/plugins/geshi/geshi.php on line 2057

RCP Robot

What is RCP Robot?

RCP Robot is a library to simplify the development of GUI tests for RCP applications.

RCP Robot is an API on top of Abbot. We started GUI testing with Abbot and found the Abbot API hard to work with. Here is an example of a GUI test using Abbot. Lot's of SWT classes, testers, matchers and finders involved. Compare this with the test code you find in our RCP Robot examples below.

We wrote convenience methods to make the GUI test code easier to write and easier to read. Our clients wanted casual Java programmers to write GUI tests. No deep SWT skills required/available. After some time we refactored the convenience methods into our own API. That was the birth of RCP Robot.

RCP Robot is aimed at RCP applications, not just SWT or JFace applications. The robot has a notion of RCP workbench concepts like perspectives and views.

API Design

The design of the RCP Robot API is based on two main ideas.
  1. the Robot is the single entry point to the API
  2. all method parameters are Stings or basic Java types - no SWT

This leads to GUI test code that looks like this.

    public void testPluginInAboutDialog() {
        robot.clickOnMainMenuItem("Help/About ");
        robot.waitForShellShowing("About ");
        robot.clickOnButton("&Plug-in Details");
        robot.waitForShellShowing("About  Plug-ins");
        robot.assertAboutTreeItemByColumnText("Plug-in Name" , "RCPMail Plug-in");
        robot.assertSignedStateInAboutDialog("RCPMail Plug-in", "false");
        robot.clickOnButton("OK");
    }


We choose method names that are close to a English sentences. The method clickOnMainMenuItem causes the robot to click on an item in the main menu. The parameter defines the menu path. Easy?

There are two kinds of methods: 1.) methods that do something, like typing on the keyboard or clicking with the mouse, and 2.) methods that assert something.

We found it useful to make application-specific changes when the robot needs to do special things. Following the two design principles above we created e.g. a XyzRobot and a GEFRobot. We would like to keep generic GUI test logic in the RCP Robot and suggest at the same time to make custom non-generic extensions.

Downloads

Three plug-ins are needed.

Installation

The plug-ins are distributed as archive files. The plug-ins need to be imported into your workspace. Do not put them into the plugins folder of your Eclipse installation (this will do no harm but will have zero effect).

Here are the instrcutions how to import an archive file into the workspace.

Usage

RCP Robot and Abbot are libraries for GUI testing. They are used to write GUI tests in Java using some kind of testing framework. The examples below show tests using JUnit. We prefer to use RCP Robot together with FIT. Other testing frameworks, e.g. TestNG, should be compatible but we did not try this.

GUI tests are created as separate plug-ins. The test plug-ins need to define a dependency on com.gerhardtinformatics.rcprobot.

To run the GUI tests you need to include your test plug-ins (with dependencies) in the runtime environment of your RCP application. That is usually done by the test runner that comes with your testing framework. However, the OSGi runtime can be tricky to set up. A test framework that supports plug-in tests is preferable. A JUnit runner for plug-in tests is included in Eclipse already. For FIT we provide a runner called RCP FIT.

Examples

We provide two examples for RCP Robot. The examples need to be imported into your workspace as above.

Both examples have a non-GUI and a GUI part. On this page we show only the GUI part. The non-GUI part uses RCP FIT (you can ignore this if you are not interested in FIT).

The examples below use JUnit as testing framework because it is nicely integrated into Eclipse already. However, we recommend to use the RCP Robot together with RCP FIT.

Each example can be found on a separate page.

There are no comments on this page. [Add comment]

spacer.png, 0 kB
spacer.png, 0 kB
spacer.png, 0 kB
spacer.png, 0 kB