Running tests for a running Java application
You can run a functional test for a Java application that is already running locally. You can configure the environment variable JAVA_TOOL_OPTIONS that enables Test UI to detect an already running application instance and run the test on it.
Before you begin
You must have completed the following tasks:
- Ensured that the required Java application (JAR file) is available on the local machine to run the test.
- Commented out the Start App step in the test that you want to run.
About this task
Procedure
-
Add the following environment variable to the system:
JAVA_TOOL_OPTIONS=-Dsun.java2d.uiScale.enabled=false -Djavax.accessibility.assistive_technologies=com.rational.test.ft.bootstrap.Bootstrap -javaagent:"C:\Program Files\IBM\DevOpsTest\FunctionalTester\bin\javaagent\FtAgent.jar" --add-opens=java.desktop/java.awt=ALL-UNNAMED
-
Open the command line interface and check the Java version to confirm that the
environment variable is active by running the following command:
java -version
The output displays the path of the added environment variable with the Java version information.
- Start the Java application if it is not running.
-
Start the test run either from the GUI of Test UI or the command
line.
The system detects the open application instance, and the playback starts successfully without closing or restarting the application.