A Step-by-Step Guide to Jubula – The Open Source Automated Functional Testing Tool

By Vijay

By Vijay

I'm Vijay, and I've been working on this blog for the past 20+ years! I’ve been in the IT industry for more than 20 years now. I completed my graduation in B.E. Computer Science from a reputed Pune university and then started my career in…

Learn about our editorial policies.
Updated March 6, 2024

This detailed tutorial was created with the aim of sharing the knowledge I have gained in Jubula and helping you create a customized, robust and flexible automation testing framework.

[Detailed tutorial with lots of images, so allow it to load]

Today, we are going to learn about a popular open source functional testing tool – Jubula.

Jubula is an Eclipse Project for automated functional GUI testing for many applications. It helps to write automated tests from a user perspective with little or no coding skills, saving time and improving readability and test maintenance.

A wide range of open source automation tools are available in the market with a good amount of online help. 

When it comes to Jubula, the online help provides a lot of information on its built-in framework. This information is of great use to those non-technical testers who are not involved in coding and want to create automation scripts through Jubula’s GUI.

But technical automation testers wanting to create a customized framework using Jubula find it difficult to reach out for help.

Guide to Jubula Tool

jubula-tutorial

Let us first look into its built-in framework (this section of the tutorial will help you to understand the basics) and then proceed with Building framework in Jubula using Java code.

Basics – built-in framework:

Installation and Launch:

(Note: click on any image for an enlarged view)

  1. Go to the download page here.
  2. Note – You can check this download page for various options based on the features you are interested in.
    Register and Login.
  3. Click on Download Installers.
  4. Click on the download page under the Jubula downloads section.
  5. Download the appropriate installer (as per the OS).
  6. Install it using the downloaded exe file and save the folder in a preferred location ( I have saved it in C:\Program Files).
  7. Once the installation is completed, you should be able to launch the tool from ‘All programs’.
  • 42

8. While launching, create a workspace in your preferred location.

45

9. The home screen will look like the one below:

2

Sample AUTs:

One impressive thing about this tool is that it comes with sample AUTs (Applications Under Test). The AUTs will be present in <Installation Folder>\examples\AUTs.

In this case, it can be found in C:\Program Files\jubula_8.2.0.021\examples\AUTs

3

Demo Project

Now with Jubula installed and sample AUTs available, let us try to automate a simple addition functionality using a ‘swing’ application called ‘SimpleAdder’.

The application can be invoked using this file:

‘C: \ProgramFiles\jubula_8.2.0.021\examples\AUTs\SimpleAdder\swing\SimpleAdder.cmd’ and looks like below:

The task is to enter ‘value1’, enter ‘value2’, click ‘=’ button and verify the ‘result’.

44

How to Test:

Below are the steps to be followed to automate the task:

Step 1 – Create project.
Step 2 – Create AUT.
Step 3 – Create test case, include test steps & map data.
Step 4 – Create test suite.
Step 5 – Assign AUT to the test suite.
Step 6 – Map the test case to the test suite.
Step 7 – Map logical test objects with technical object identifiers.
Step 8 – Run the test suite.

Let us see how to perform each step in detail:

Step #1 – Create project

A project in Jubula can be considered a logical workspace where all required components are gathered to complete a testing task.

Creation of the project goes as below:

1. Go to Test > New.

4

2. Enter the name of the project, E.g. ‘DemoProject’ and Click ‘Finish’ (On clicking ‘Next’ you should be able to create AUT. But let us finish here and look at creating an AUT in Step #2).

5

3. The Test Suite browser shows the created project.
6

Step #2 – Create AUT

An instance of the application under test (SimpleAdder) has to be created in Jubula for object mapping and to run the test suite.

1. Go to Test > Properties.

7

2. Choose ‘AUTs’.

8

3. Enter the AUT name (this can be any user defined value. E.g. DemoAUTSimpleAdder).
4. Choose the technology the AUT is developed on. (In this case, it is ‘swing’).
5. Click on “Add” under the AUT configuration.
6. Enter the AUT ID (this can again be any user defined value. E.g. DemoAUTSimpleAdderID).
7. Enter the executable file name i.e. file invoking which AUT will be opened. As I mentioned earlier, I have used ‘C: \ProgramFiles\jubula_8.2.0.021\examples\AUTs\SimpleAdder\swing\SimpleAdder.cmd’ .

9

Please note that in order to invoke the AUT through Jubula, it must be connected to the AUT agents. There are two AUT agents Jubula can connect with:

  • Embedded AUT agent installed at ‘localhost:60001’
  • External AUT agent installed at ‘localhost:60000’

Once Jubula is connected to either of the AUT agents, you should be able to invoke the application through it. The below screenshot shows how to connect to AUT agents. Here I am connecting you to the embedded AUT agent.

The below screenshot shows how to connect to AUT agents. Here I am connecting you to the embedded AUT agent.

10

Once the AUT agent is connected to Jubula, the AUT (DemoAUTSimpleAdder) can be invoked as below:

11

The AUT will be invoked below. The application can be kept running in the background. However, at this stage, I would prefer to close the application to be comfortable performing the rest of the steps.

44

Step #3 – Create test case, include test steps and map data

This is a crucial step where the actual development of automation scripts happens (without coding).

There is a Test case browser at the bottom left part of the tool where user test cases can be developed.

1. Right click and move to New to create a new test case.

12

2. Enter the test case name and click on “OK” (e.g. DemoTestCase).

13

3. The test case browser should now have the user create a test case along with Jubula’s built-in test cases.
4. Double click on the created test case. An empty test case will be opened in the middle panel.

14

5. Drag and drop the appropriate test actions from ‘Jubula’s base actions’ into the test case.

As shown in the below screenshots:

  • To enter value1 and value2 use ‘Component with Text input – replace text’.
  • To click the equals button use .Click “left single”.
  • To check the value, use “Components with Text input – check text’.

15

16

17

6. Now for each test step included, enter the following as applicable (e.g. Clicking the button does not require any data):

  • Test case reference name (Test step description).
  • Component name (Logical name to which the technical identifier will be mapped).
  • Data – Data can be entered as direct value e.g. 10, 20 or parameterized using variables e.g. =Value1, =Value2 or fed through an excel sheet. In this case, I am parameterizing the data).

a)

18

b)

19

c)

20

d)

21

7. As mentioned in the previous step, when data values are parameterized, highlight the test case below. You should be able to see a grid where the values for variables can be defined. Use the “Add” button to insert a row of data. You can have n number of rows of data for n number of execution iterations.

a)

22

b)

23

Step #4 – Create test suite

Jubula’s test suite is a runnable component under the project where user defined test cases are sequenced for execution.

1. Right click on the project and move to New to create a new test suite.

24

2. Enter the name of the test suite and click OK (e.g. DemoTestSuite).

25

3. You should be able to see the created test suite under the project.

26

Step #5 – Assign AUT to the Test Suite

When there is just a single AUT defined in Jubula, the AUT will be automatically selected for the test suite. But when there are multiple AUTs, it is very important to make sure that the test suite runs on the correct AUT.

1. Double click on the test suite and highlight the same in the middle panel.
2. Select AUT from the drop down.

27

Step #6 – Map the test case to the test Suite

Drag and drop the test case to the test suite. Multiple test cases can be sequenced under the test suite likewise.

28

Upon saving, you should be able to see the test case under the test suite below:

29

Step #7 – Map logical test objects with technical object identifiers

1. Right click on the test suite and open with the object mapping editor.

30

2. All the logical components within the test suite for which technical names are to be mapped will be displayed.

31

3. Invoke the AUT.

32

33

4. Click on the object mapping icon for the particular AUT.

34

5. Move the cursor over the field for which you have to identify the technical name. The fields will be highlighted in green.

35

6. Press control + shift + Q to have the corresponding field’s technical name under the unassigned technical names section. Repeat for all the fields in the test suite.

36

7. Now map unassigned component names with an unassigned technical name by simple drag and drop.

37

8. Save the workspace and quit from the object mapping mode.

38

Step #8 – Run the test suite

The test suite is ready to be run. Make sure the AUT is invoked using Jubula.

Click on the run button in the test suite browser.

(You can also activate the application as the first step. If not, ensure that you activate the application after running the test suite).

39

Results can be viewed below:

40

Points to be noted

While feeding the test suite with data through Excel, provide the location of the excel file in the example format:

C://Data//Data.xls

41

In the above demonstration, the data is parameterized using the variables ‘=Value1’, =’Value2’ and =’Result’.

In such cases, when the values need to be passed through an excel file, make sure that the file has the corresponding columns with names exactly matching the variables and sheet name set to the language chosen at the time of project creation.

46

External AUT agent (localhost: 60000) can be connected after starting the agent from ‘All programs’ where you can find options for starting and stopping the agent.

42

Multiple test suites can be created under a test job. This would be of help if the testing involves more than one application (Different AUTs can be assigned to different test suites).

This explains the basics of playing around with the tool. It is very important to get familiarized with Jubula’s basic actions to automate complex functionalities and deal with various test objects.

Jubula can also automate applications developed with different technologies, not just swing applications.

43

Building a framework in Jubula using Java code:

With the basic knowledge given in this article, let us now see how to build a customized framework in Jubula using Java code.

Some may not find automation in the Jubula workspace flexible and reusable. Extensive automation may not be possible. But for each action we have done using Jubula GUI, there is a corresponding java method.

Here in this section, we will see the basics of such java methods with which any complicated framework can be built.

Jars

The jars required for the methods are available in Jubula’s installation folder:

C:\Program Files\jubula_8.2.0.021\development\api

47

AUT

Let us first see how to connect with the AUT agent and how to invoke the AUT by creating an AUT identifier using the AUT configuration

We need the following variables:

AUTAgent autagent = null;
AUTConfiguration autconfiguration = null;
AUTIdentifier autidentifier = null;
AUT aut = null;

Connecting with AUT agents:

autagent = MakeR.createAUTAgent(&amp;quot;localhost&amp;quot;,60000);
autagent.connect();

Launching AUT:

autconfiguration = new
SwingAUTConfiguration(&amp;quot;Autidentifier&amp;quot;, &amp;quot;Autidentifier&amp;quot;,&amp;quot;runlocal.bat&amp;quot;, &amp;quot;C:\\Application&amp;quot;,null,Locale.getDefault());
autidentifier = autagent.startAUT(autconfiguration);
aut = autagent.getAUT(autidentifier, SwingComponents.getToolkitInformation());
aut.connect();

Where runlocal.bat is the executable and C:\\Application is the location where an executable file is present.

We can create a configuration for other tool kits too.

For e.g. JavaFXAUTConfiguration, RCPAUTConfiguration, HTMLAUTConfiguration.

Test actions can now be performed using the instance “aut.” However, we need to have the object identifiers to perform test actions.

Creating an Object Mapping Class

Right click on the object mapping editor, choose “Export Object Mapping to File” from the option “Use in API” and export the object mapping details to a Java class.

48

Include this class in the project. I have saved it as OM.java where the technical identification of each object in the object mapping editor is present.

49

Performing Test Actions

Test actions can be performed in two steps:

Step 1: Define the component on which test action has to be performed.

TextInputComponent input1 = SwingComponents.createJTextComponent(OM.txtValue1);
TextInputComponent input2 = SwingComponents.createJTextComponent(OM.txtValue2);
ButtonComponent equals = SwingComponents.createAbstractButton(OM.btnEquals);
TextComponent result = SwingComponents.createJLabel(OM.txtResult);

Step 2: Perform the action.

aut.execute(input1.replaceText(“10”), &amp;quot;jubula&amp;quot;);
aut.execute(input2.replaceText(“15”), &amp;quot;jubula&amp;quot;);
aut.execute(equals.click(1,InteractionMode.primary), &amp;quot;jubula&amp;quot;);
aut.execute(result.checkText(“25&amp;quot;,Operator.equals), &amp;quot;jubula&amp;quot;);

Where “Jubula” is just a dummy text which preferably should carry the description of the action.

The “execute” statement carries CAP (C – Component, A-Action, P-Parameter (Data)).

Action and Parameter correspond to the same of Test cases in Jubula workspace.

Working with multiple AUTs

Working with multiple applications and swapping between them is a bit tricky when you develop your own framework using Jubula java methods.

While dealing with multiple applications, make sure the AUT is activated before performing actions and the same is deactivated once you are done.

While activating:

  • Connect autagent.
  • Connect aut.

While deactivating:

  • Disconnect aut.
  • Disconnect the autagent.

eg.

Activate(autidentifier1);
//perform actions on aut1
Currentaut.execute(…)
Currentaut.execute(…)
Deactivate(autidentifier1);
Activate(autidentifier2);
//perform actions on aut2
Currentaut.execute(…)
Currentaut.execute(…)
Deactivate(autidentifier2);
Activate(autidentifier1);
//perform actions on aut1
Currentaut.execute(…)
Currentaut.execute(…)
Deactivate(autidentifier1);

Activate and deactivate functions should be something like this:

public static void Activate(AUTIdentifier autidentifier){

if(autagent.isConnected())	{
	autagent.disconnect();
	autagent.connect();
}
else
	autagent.connect();	

if(Currentaut==null){
	Currentaut = autagent.getAUT(autidentifier, SwingComponents.getToolkitInformation());
    Currentaut.connect();
}

else{

	if(Currentaut.isConnected()){
		Currentaut.disconnect();
		Currentaut = autagent.getAUT(autidentifier, SwingComponents.getToolkitInformation());
		Currentaut.connect();
	}
	else{
		Currentaut = autagent.getAUT(autidentifier, SwingComponents.getToolkitInformation());
		Currentaut.connect();
	}
}

}

public static void DeActivate(AUTIdentifier autidentifier){

if(Currentaut.isConnected())
	Currentaut.disconnect();

if(autagent.isConnected())
	autagent.disconnect();

}

Conclusion

At the end of this article, you must have acquired proper knowledge in using the existing framework of Jubula and developing a custom framework using Jubula’s java methods.

Here, we have learned about automating Java swing components. However, Jubula can work on multiple technologies.

Automating multiple applications (of the same and of the different technologies) at the same time is the most challenging area. The steps detailed in Working with multiple AUTs should really help.

While thinking of building a custom framework using Jubula, you must be wondering how to define different test components (e.g button, textinput, text, tree, table, etc.), what are all the different actions that can be performed on these components and what data is required for each action.

To learn how to define different components and how to perform various test actions using the execute command, please refer to the “Jubula Reference Manual” here.

Make sure to give it a try!

Feel free to post your feedback/queries about the Jubula tool in the comments section. We would love to hear from you.

About the author: This is a guest tutorial by Geethalakshmi. She is working as a principal technical engineer in a leading software testing organization with a great interest in exploring functional automation tools.

Was this helpful?

Thanks for your feedback!

Recommended Reading

27 thoughts on “A Step-by-Step Guide to Jubula – The Open Source Automated Functional Testing Tool”

  1. Hello I am looking for work from home job opportunity related to software testing. I am working as Software Testing Intern . Where can i get software testing work related information? Pls share any details about this.

    Thanks In Advance

    Reply
  2. Hi
    I’m getting the below error upon Invoke “3) Invoke the AUT” step, so please help in solve it.

    5009: AUT start failed
    No valid Java binary found. Check given JRE binary.

    Reply
    • Apologies for late reply. Can you pls elaborate what you actually do to face the error, may be in a word doc and send to my mail geethalucky15@gmail

      Reply
  3. I am working on jubula automation.Your step by step here is helpful.
    Can you please help me to address a blocking issue.

    Jubula automation on one of my machine(on linux)is working fine.
    I have exported the testcases and imported it on another machine.Importing worked successfully and aut started.But testcases are not running on the second machine.AUT is a RCP application and required plugins are added in ‘config.ini’

    What can be the blocking issue.

    Regards
    Bincy

    Reply
  4. Where can I find detailed description of every Actions (basic) and Actions (complex) that is available in Test Case Browser pane? If I wanted to click on next Tab which Action I need to use?

    Reply
  5. Hello All,

    Getting the below error:

    5009: AUT start failed
    Establishing connection to AUT failed.
    Please check the AUT configuration.
    AUTServer could not start: Security violation;

    If anybody have a solution, please share.
    Thanks & Best Regards

    Reply
  6. Hi Geetha,

    Thank you for detailed description. I am new to Jubula and I need to create framework in Jubula using test cases written in Java. Can you please guide me in more detail.
    You have created some variables for AUT and you are also writing code for connecting to AUT agent and luanching the AUT agent, you are also creating Activate function, where exactly are you writing these codes ?

    It will be great if you could help me in more detail.

    Reply
  7. Hi
    I’m getting the below error upon Invoke “3) Invoke the AUT” step

    5009: AUT start failed
    No valid Java binary found. Check given JRE binary.

    Reply
  8. Hello, I have done engineering in Computer Science, i am looking for work from home job opportunity related to software testing. I have work experience in soft development. Where can i get software testing work related information? Pls share any details about this.

    Thanks In Advance
    Sanmati

    Reply
  9. I’m working on a RCP application. I need to automate a scenario where we select a file and right click on it. Then it pop up a context menu and we have to go down in the context menu until we find a specific name. I have already implemented until selecting the file and right click on it. Context menu pop up happening as well. Since the context menu cannot be track using object mapping i don’t have any idea to proceed. Appreciate your help.

    Reply
  10. i really thank yo you.. it was so nice to learn..can you please send a pdf file of tutorial.. it will help me in future.

    Reply
  11. Hi,

    I’m getting
    5009: AUT start failed
    In the details mention : AUTServer could not start:Invalid arguments,;

    Appreciate your help. ALready double check with all the stop but still same.

    Reply
  12. Hi
    I’m getting the below error upon Invoke “ Invoke the AUT” step, so please help in solve it.

    5009: AUT start failed
    No valid Java binary found. Check given JRE binary.

    Reply
  13. Khaulah and Kiran,

    Did you manage to solve the error?
    Please check if you had chosen appropriate tool kit while adding the AUT.

    Try using cmd instead of jar file. BTW what version of java you guys use?

    Reply
  14. That’s a really good tutorial, thank you! Is it possible to write my AUT using JUBULA API and somehow export it again to use with Jubula/Eclipse?

    Reply

Leave a Comment