Eclipse Jubula is a new addition to the Eclipse universe. It’s a functional UI testing tool that allows you to specify and run tests.Jubula consists of plug-ins for an IDE and a standalone RCP application.
In this tutorial we will create a simple RCP java product and then we’ll use Jubula testing tool to execute some automated tests. First we will create a minimal RCP application, using the Plug-in Project creation Eclipse Wizard. The next step will consist into setup the Jubula environment and the AUT Agent to link the application with jubula
The final step will be create some recorded tests and play them with Jubula. The result is a simple suite of tests that allow us to automatically run our tests saving our time. The main goal of this tutorial is show how to use Jubula testing tool with a RCP application.
Step 1: Setup Environment
First we have to setup the environment, downloading the Eclipse for Tester version:
Eclipse for Testers (Indigo Packages) The Eclipse Jubula Download
And Jubula Standalone application from: The Jubula StandAlone Download
Step 2: Create the Plugin Project
The next step is create a new Plug-in Project. To do this, follow the steps showed in the figures below. From menu File select New then Plug-in Project
(File/New/Project…/Plug-in Development/Plug-in Project):
As Plug-in name enter “com.rcpvision.rcpmailsample”.
Next, tell Eclipse that it’s a rich client application:
And finally, choose the “RCP Mail” template:
Select “Yes” if you want to switch to the Plug-in development perspective.
You should now see the project MANIFEST.MF editor. It contains mainly the information about the dependencies from other projects and the exporting options. From here you can manage the project and launch it. Just click “Launch” as showed below.
Step 3: Create the Product
In order to use Jubula application you need to create a product configuration for the application just created. Starting from:
Name it “SimpleMail.product”
To finish click on Finish button and in the com.rcpvision.rcpmailsample plugin will appear the SimpleMail.product file
Then export the Plugin Project:
The result should be a product like this one:
Step 4: Set and launch AUT Agent
The AUT Agent is the Jubula daemon providing the bridge between the test executor and the Application Under Test.
Once the AUT Agent has started the AUT, object mapping can take place, and tests can be observed and executed.
Step 4.1: Set AUT Agent
Launch “setup.exe” to install the AUT AGENT (Application Under Test Agent)
Accept the agreement then click on “Next”
click again “Next” and finally…..
Step 4.2: Launch AUT Agent
To execute AUT Agent under Windows you need administrator rights:
And you’ll see a little green icon on your toolbar.
Step 4.3: Configuring the Product to work with Jubula
In order to work with Jubula under RCP mail product you need to extract the rcp-support.zip in your Jubula (AUT Agent) installation directory and copy it into your product directory (plugins folder) .
This will add a Jubula instrumentation plugin to your product. 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:
And finally, after all these steps, you’re ready to work with Jubula!!!
Step 5: Working with Jubula
You are finally ready to open Jubula and create your first tests
Step 5.1: Start Jubula
Step 5.2: Create new Test Project
However, it doesn’t tell you how to create a new project. You will find it in the Test menu:
Give your project a good name, choose “rcp” as toolkit and click the “Next” button.
Pitfall: Make sure your test specifies either English (United States) or German (Germany)as the keyboard layout. These are the only two keyboard layouts provided out-of-the-box by Jubula at the moment.
Now you’ve got to tell Jubula about your test object (Jubula calls it “AUT”):
Give your AUT Agent a name and choose “rcp” as toolkit.
Click on “Proceed” to close the dialog and to continue working on New Project Wizard dialog.
Now you can choose to specify an AUT Configuration, by clicking on “Next” or click “Finish” and finish creating the project and configure the AUT later via “Project -> Properties”
Choosing to close the wizard menu, click on “Finish”.
You can notice that in the Test Browser view there is a new project “SimpleMailTest”
Step 5.3: Configuring AUT for Test Project
Focus on “Simple Test Mail” and click on
Click on “Add”
Enter a suitable name for the AUT Agent Host and select the executable file of your product in the “Executable File Name”
Clicking on “Ok” we create the test project. Then click on the little arrow next to , choose the option “localhost: 600000″ to connect the AUT agent.
Step 6: Testing With Jubula
At the end of this section you’ll be able to create and run a set of test cases. Let’s test the opening of a new messages view.
There are three methods to open a new Message view and for all of these we’ll show you how to do.
Case 1: Using Menu Bar: File-> Open Another Message View Command
Case 2: Using toolbar button
Case 3: Using shortcut: CTRL+2
Test Case 1
Goal of this test case is to replay the
File → Open Another Message View
operation recording jubula commands.
Preconditions: Application under test (RCP Product) running.
Name the test Case with a suitable name, i.e. “OpenNewMessageView”
and confirm your choice by clicking on “Ok” button.
Jubula will move into the “TestCase” perspective with the “OpenNewMessageView” tab open in the editor and a new item “OpenNewMessageView” listed under the “Test Case Browser” view.
After few seconds the “Observation Console” window will be opened in the bottom corner of your screen. In this windows will be listed all the steps done during registration. Now give the focus on the application under test (RCPMAIL) and Select “File-> Another Message View” option. You’ll create a new Message View in the RCPMail
and in the “Observation Console” will be added two new steps:
Stop the recording by clicking on “CameraStop Recording Icon”
Save the test case and in the Test Case perspective you’ll notice two steps under the your first test.
Now you have to create a new Test Suite: Within the “Test Suite Browser” view, right click on “Test Suites” folder and click on
New-> New Test Suite
Name it as “First Test Suite” and confirm (Click on “OK”)
Double click on First Test Suite just created and it will be opened in an editor. Now drag your use case “OpenNewMessageView” into the test suite and save the test project:
To play the test click on the little green icon in the “Test Suite Browser” then choose the “First Test Suite’
Test Case 2
Test Case 3
You have to create this test case by choosing a couple of template from the Test Case folder in the Test Case Browser. To do it follow these simple steps: From the folder “Test Cases” in “Test Case Browser” open “unbound_modules_concrete-> Actions (basic) → Input via Keyboard → Application → Key Combination” and select the test case named
the result should be:
Now you have to complete the settings for the test case just choosen.
Parameter Name = BASE_KEY
Parameter Value = 2
Parameter Name = MODIFIER_KEYS
Parameter Value = control
Parameter Name = BASE_KEY
Parameter Value = BASE_KEY
Run the test suite and … Enjoy your automated test with Jubula!!!