Java | Test Automation Technologies | Rapise


Rapise supports the testing of Java applications using a variety of different GUI toolkits including the Abstract Window Toolkit (AWT), Swing (Java Foundation Classes), and the Eclipse Standard Widget Toolkit (SWT). For maximum flexibility, Rapise can connect to your choice of JVM.

Java AWT Applications

Rapise supports the testing of Java applications using the Abstract Window Toolkit (AWT). The AWT was the first generation Java GUI library and was designed to allow Java applications to mimic the underlying operating system and map their controls into the native GUI environment (e.g. Win32).

Rapise supports the following Java AWT Controls:

Image Control Type Matcher Rule Record Learn Comment
Label JavaLabel No Yes
Button JavaButton Yes Yes
Text Field JavaTextField Yes Yes
Text Area JavaTextArea Yes Yes
Checkbox JavaTextBox Yes Yes
Choice JavaChoice No Yes
List JavaList Yes Yes
Scrollbar JavaObject No No
Scroll Pane JavaObject No No
Panel JavaObject No No
Canvas JavaObject No No
Menu Bar JavaObject No No
Popup Menu JavaObject No No
Empty Border, Line Border, Matte Border, Titled Border, Etched Border, Bevel Border, Soft Bevel Border, Compound Border JavaObject No No

Java Swing Applications

Rapise supports the testing of Java applications using the Swing graphic library (formerly known as Java Foundation Classes). The Swing library was designed as a replacement for AWT that attempts to provide a consistent user interface for all Java applications regardless of the underlying Operating System GUI framework. As a result, Swing applications look the same on different platforms but do not generally match the design of native applications.

Rapise supports the following Java Swing Controls:

Image Control Type Matcher Rule Record Learn Comment
Label JavaSwingLabel No Yes
Button JavaSwingButton Yes Yes
Toggle Button JavaSwingToggleButton Yes Yes
Check Box JavaSwingCheckBox Yes Yes
Radio Button JavaSwingRadioButton Yes Yes
Button Group JavaObject No No
Combo Box JavaSwingComboBox No Yes
List JavaSwingList Yes Yes
Text Field JavaSwingTextField Yes Yes
Text Area JavaSwingTextArea Yes Yes
Scroll Bar JavaObject No No
Slider JavaSwingSlider No Yes
Progress Bar JavaSwingProgressBar No Yes
Formatted Field JavaObject No No
Password Field JavaSwingPasswordField Yes Yes
Spinner JavaObject No No
Separator JavaObject No No
Text Pane JavaObject No No
Editor Pane JavaObject No No
Tree JavaSwingTree Yes Yes
Table JavaSwingTable Yes Yes
Menu Bar JavaSwingMenuBar Yes Yes
Menu JavaSwingMenu Yes Yes
Menu Item JavaSwingMenuItem Yes Yes
Menu Item / Check Box JavaSwingMenuItemCheckBox Yes Yes
Menu Item / Radio Button JavaSwingMenuItemRadioButton Yes Yes
Popup Menu JavaObject No No
Panel JavaObject No No
Tabbed Pane JavaObject No No
Split Pane JavaObject No No
Pane JavaObject No No
Tool Bar JavaObject No No
Desktop Pane JavaObject No No
Internal Frame JavaObject No No
Layered Pane JavaObject No No
Dialog JavaObject No No
Frame JavaObject No No
Color Chooser JavaObject No No
File Chooser JavaObject No No
Option Pane JavaObject No No

Java SWT Applications

The Java SWT GUI library is an alternative to Swing developed by the Eclipse foundation and it provides Java applications the ability to access the native GUI libraries of the operating system using JNI (Java Native Interface) in a manner that is similar to those programs written using operating system-specific APIs. Programs that call SWT are portable, but the implementation of the toolkit, despite part of it being written in Java, is unique for each platform.

Rapise supports the testing of applications written using Java Standard Widget Toolkit (SWT) using its UIAutomation library. Since SWT displays applications using native Windows controls it doesn’t need the Java Access Bridge to be installed (unlike Java AWT/Swing applications). The following SWT controls are recognized by Rapise:

Image Control Type Matcher Rule Record Learn Comment
button UIAButton Yes Yes
CheckBox UIACheckBox Yes Yes
ComboBox (simple) SWTComboBox Yes Yes
Editable ComboBox SWTComboBoxEdit Yes Yes
Button UIAHyperlink Yes Yes
Label UIALabel Yes Yes
List SWTList Yes Yes
Progress Bar UIAProgressBar No Yes
Radio Button UIARadioButton Yes Yes
Slider UIASlider Yes Yes
Tab Control UIATabControl Yes Yes
Edit Box UIATextBox Yes Yes
Tree SWTTree Yes Yes

Testing Java Applications with Rapise

Java Bridge Installation

In order to use a particular Java Virtual Machine (JVM) with Rapise you need to first install the Java Bridge into it. The installation process consists of several simple steps:

1. Click 'Java Support' link in the Rapise program group

2. Choose the target JVM in the list of available Java machines and press the [Install] button:

3. Verify that the installation is successful

Running the Java Sample

Rapise includes a Java sample. You can open it from the Start Page. Just choose the Java link in Browse Samples section located on the right side of the page.

The Java sample uses the JAVA_HOME environment variable to launch a simple Java application named AUTJAVA. Please make sure that the JAVA_HOME environment variable points to a JVM that has the Java Bridge installed (see previous section: Java Bridge Installation). If this is the first time you have set the JAVA_HOME environment variable then please reboot after adding it, otherwise the sample may not work.

How to Set JAVA_HOME in Windows

Please follow these instructions to set up the JAVA_HOME environment variable in your computer. First find out the installation folder of the Java development kit (JDK) or Java run-time environment (JRE) in your machine. Let's assume it is installed in the folder "C:\Program Files (x86)\Java\jre6".

  • Right click on the My Computer icon on your desktop and select properties
  • Click the Advanced Tab
  • Click the Environment Variables button
  • Under System Variable, click New
  • Enter the variable name as JAVA_HOME
  • Enter the variable value as the install path for the JDK or JRE
  • Click OK
  • Click Apply Changes


Windows Security

If you are testing Java on Windows Vista or Windows 7 and User Access Control (UAC) is turned ON then you should launch your Java application or Internet Explorer (if you start your Java application from a browser page) as Administrator.


If Rapise does not work with your Java application then the first thing to check is that JVM you use to launch the application is the same JVM where you installed the Java Bridge, if not either change the JVM or install the JavaBridge into the additional JVM.

Verify the JVM - Rapise Connection using Spy

You can use the Rapise Spy tool to verify the connection between the JVM and Rapise:

  • Launch your Java application
  • Launch Rapise, create new test, press Record button
  • In Application Chooser dialog choose your Java application
  • In Recording Activity dialog press Spy button
  • Verify that Spy window contains 'Java Object' label

Analyze Application

With Spy you can walk along the tree of Java objects in your application.

Save to File

You can save the Spy data for a particular node and all its descendants to a text file.

Reflection Information

You can save reflection information for a java class used to implement a GUI control.

Questions? email or call us at +1 (202) 558-6885