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!!!