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
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
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
Step 4.2: Launch AUT Agent
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
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.
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”
Step 5.3: Configuring AUT for Test Project
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 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.
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
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
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
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!!!