Known Issues - Java Add-in
This topic contains troubleshooting and limitation information about working with the Java Add-in.
Opening Java applications
The following limitations apply when opening Java applications:
Loading a Child Add-in of the Java Add-in
When you select a child add-in under Java in the Add-in Manager, you load Java Add-in extensibility support for the selected environment.
If you load support that was developed using a Java Add-in Extensibility SDK version earlier than version 10.00, UFT One dialog boxes such as the Object Identification dialog box display the extensibility test object classes in the wrong list.
This occurs for any UFT One dialog boxes that display test object classes for a selected environment.
Errors include:
-
If you select the child add-in in the Environment list, the list of test object classes is empty. Instead, the extensibility test object classes are displayed directly under the Java environment instead of being displayed under the child add-in in the Environment list.
-
Additionally, in some cases, the Generate Script button in the Object Identification Dialog Box does not function properly.
In such cases, do the following:
-
Locate the test object configuration file associated with the child add-in. This file is located in the following locations:
UFT One Installation Folder \dat\Extensibility\Java\<add-in name>TestObjects.xml. When working with ALM <UFT One Add-in for ALM Installation Folder>\dat\Extensibility\Java\<add-in name>TestObjects.xml -
In the XML file, locate the PackageName attribute in the TypeInformation element, and change its value from JavaPackage to the name of the child add-in.
-
Save the file and reopen UFT One.
-
If this extensibility support (child add-in) was developed by a third party, you may want to contact them for assistance.
Java 8 applications
Launching Java 8 applications may cause a VerifyError to appear, especially Oracle Forms and Java Applets with jre8u91, or JavaFX applications with jre8u45.
In such cases, add a or -UseSplitVerifiier runtime parameter in the Java Runtime Environment settings. You can access these on the system level via the Java Control Panel.
Application type | Runtime parameter setting |
---|---|
jre7u65+ | java -XX:-UseSplitVerifier -jar <application.jar> |
Cross-environment testing
Running a test on a Java 8 application in a Java 9 environment may cause UFT One to behave unexpectedly.
Recording settings
-Xincgc flags |
Adding a -Xincgc flag to the java.exe command line prevents the Java support from working properly. You might do this in the Record and Run Settings dialog box, or in a batch file. Workaround: When testing with UFT One Java support, do not use -Xincgc in your command line, or, alternatively, do not use the dynamic transformation support mechanism. |
JAR files |
When selecting a JAR file from the command line in the Record and Run Settings dialog box, you should manually add -jar to the Command line box before you invoke the Java application. |
Launching Java applications |
If you intend to launch your Java application using the Record and Run Settings dialog box without using a batch file (or another executable file), and without the -jar command line option (after selecting a JAR file), you should include the fully qualified name of the Java class in the Command line box. |
Recording
JFC single-line edit boxes |
If, while recording keyboard operations in a JFC single-line edit box in an IME composition window, you press the ENTER key to select the composition string, the key press may be recorded as the Activate method, thereby generating an extra step. For example:
This extra step generally does not affect the run session adversely. Workaround: Before running your test or business component, remove the extra step that was recorded. |
ALT+F4 keyboard shortcut |
The ALT+F4 keyboard shortcut is not supported for recording or running. This shortcut is used used for closing a Java applet or Java application Workarounds:
|
Moving and resizing Java windows |
By default, moving and resizing of Java windows are not recorded. This is because it may cause redundant recordings in some cases. Workaround: To instruct the Java Add-in to record these actions, use the Setting.Java method to set the record_win_ops variable to 1. For example:
|
AWT popup menus |
AWT popup menus are recorded by the Standard Window control support WinMenu test object, instead of the usual JavaMenu test object. You cannot perform checkpoints or Active Screen operations on such menus. Workaround: Use other verification methods (such as using GetTOProperty). |
Sub-menus of JavaMenu objects | The Active Screen cannot highlight recorded sub-menus of JavaMenu objects on Java applications. |
Hovering over identifiers |
The Java Add-in does not record or run steps for hovering over identifiers in an Eclipse window. |
Closing a Java dialog box |
When you record a step that closes a Java dialog box, UFT One records an additional Close statement. Workaround: Manually delete the extra Close statement. |
Java applets or ActiveX controls within a Web page |
When the Active Screen displays a Java applet or ActiveX control within a Web page, the applet or control is for viewing purposes only and you cannot perform operations on the object. For example, creating checkpoints or adding methods. Workaround: Record an operation on the Java applet/ActiveX control to create a step on the object with the ActiveX Add-in and/or Java Add-in loaded. Then you can create a checkpoint, parameterize a step, or add a method from the individual Java applet/ActiveX control in the Active Screen. |
Adding checkpoints or output values from the Active Screen | After recording steps on JavaTree, JavaTable, or JavaSlider objects, you cannot add checkpoints or output values from the Active Screen for these objects. |
Object identification
Native properties |
If you want to use a control's native property for object identification, you can add the property to a Java test object as an in the Add/Remove Properties Dialog Box dialog box. If you do this, consider the following:
|
Case-sensitivity |
In early releases of QuickTest, Java description properties were not case-sensitive. If you learned a test object in a QuickTest version earlier than 11.00, you need to re-learn the object with properties that are case-sensitive by performing an Update Run. Do this using the Update test object descriptions option. |
JavaWindow object | In the Object Identification Center, Validate is not supported on a JavaWindow object if it is the parent object in an object tree hierarchy. |
Test objects and test object methods
SWT-based JavaMenu objects |
You cannot add SWT-based JavaMenu objects directly to an object repository using the Add Objects to Local button in the Object Repository window, or the Add Objects button in the Object Repository Manager. If you want to add an SWT-based JavaMenu objects to the object repository, you can:
|
Scroll bar controls |
Scroll bar controls in AWT and Swing applications are represented by JavaSlider test objects. Scroll bar controls in SWT applications are not supported. Scroll bar controls in JavaFX applications are supported, represented by JavaSlider test objects. |
Calls to .Object.startModal |
A call to .Object.startModal of a JavaInternalFrame or JavaDialog object may cause UFT One to behave unexpectedly until the dialog box is closed. |
Multi-byte characters |
The use of multi-byte characters in a multiline edit field object is not supported. |
Button objects |
For button objects whose label is determined by the name of the image file they display, the process of naming the test object when running in JDK 1.6 and later is different than the one used when running in JDK 1.5. This applies to both JavaButtons or buttons in a JavaToolbar. Therefore, if you have a test or business component containing button objects that were learned on JDK 1.5 and labeled according to their image file, when you run it on JDK 1.6, the test or business component may fail. Workaround:
|
PropertyValue arguments |
The PropertyValue argument (second argument) of the WaitProperty method for any Java test object can be only of type string. Workaround: Use a string instead of the original type. For example, instead of 1, use "1".
|
JavaStaticText objects | To learn JavaStaticText objects using Navigate and Learn toolbar, you must select All object types as the object filter. |
Checkpoints and Output Values
Text checkpoints and text output values |
You can create text checkpoints and text output values only for Java objects that meet specific criteria. For details, see Text checkpoint/output value steps for Java objects. |
New table checkpoints |
To create a new table checkpoint on a Java table while editing a test or business component, you must first open the application containing the table you want to check and display the table in the application. |
JavaList /JavaTree objects |
If you add a checkpoints on a JavaList or JavaTree object while editing a test or business component, the list_content or tree_content property is not available in the checkpoint. Workaround: Create checkpoints on Java lists and Java trees while recording. |
Objects that are not always visible |
Performing a checkpoint on an object that is not always visible (such as a list opening from a combo box selection or a menu item) is not fully supported. Workaround: If a checkpoint on a transient object is required, make sure the object is visible prior to executing the checkpoint. For example, in the case of combo box list, you should insert a statement that clicks the combo box button before executing the checkpoint. |
SWT-based Java trees |
When working with tests, if you create a checkpoint on an SWT-based Java tree with columns, a table checkpoint is created. |
Applets Running on Internet Explorer
UFT One versions 2021 R1 and earlier:
In some cases, when running Java applets using Oracle Java JRE 5 or 6 on Microsoft Internet Explorer, the Java Add-in does not recognize the applet as belonging to the Java environment.
It does not recognize objects in the applet as Java objects, and cannot record or run steps on them.
This happens when the JVM does not use the Java Add-in's settings from the environment variables.
In this case, you need to set -agentlib:jvmhook -Xbootclasspath/ a:"<UFT One installation folder>\bin\java_shared\classes";"<UFT One installation folder>\bin\java_shared\classes\jasmine.jar" in the JVM Runtime Parameters.
JavaFX applications
General
CloseTab method |
To record the CloseTab method on a tab item in a JavaFX application, you must first select the tab item. The UFT One test can close only the selected tab. It cannot close all tabs in one step. |
Display scaling |
The display scaling must be set to 100% for UFT One to identify objects in JavaFX applications. Setting the scaling to 125% or 150% may cause UFT One to recognize objects as Standard Windows objects instead of Java. |
Unsupported methods |
The following methods are not supported for JavaFX objects:
|
Web testing only
Web applications running inside a JavaFX window have the following known issues:
Unsupported controls |
|
Unsupported functionalities |
|
Unsupported test objects and methods |
|
Checkpoints | Only standard, bitmap, and text/text area checkpoints are supported. |
64bit applications | 64-bit versions of JavaFX are not supported |
Highlighting in the application | JavaFX menu and menu item objects cannot be highlighted in an application. |
Java Runtime Environment (JRE)
In some cases, after installing the Java Add-in, Java applications running on the Java JVM cannot be started. The error message displayed may indicate that Mercury Interactive support could not be loaded and the Java Virtual Machine could not be created.
Workaround:
-
Add -agentlib:jvmhook at the beginning of the _JAVA_OPTIONS and IBM_JAVA_OPTIONS environment variables.
-
Delete the JAVA_TOOL_OPTIONS environment variable.
Installing Java on a UFT One computer
When re-installing or upgrading the JRE on a machine with UFT One installed, you might encounter error 1603 preventing the JRE installation to complete.
This can be caused by an interference between the UFT One Java environment variables and the Java installer.
To successfully complete the installation, rename the UFT One Java environment variables, perform the JRE installation and restore the variable names.
To temporarily rename the UFT One Java environment variables:
-
On your Windows Desktop, right-click My Computer or This PC and select Properties.
-
Select the Advanced tab.
-
Click the Environment Variables... button.
-
Look for the following environment variables both under the user variable list and the system variables list and edit their names:
-
_JAVA_OPTIONS
-
Java_Tool_Options
-
IBM_Java_Options
-
-
Install the JRE.
-
Once the installation is completed, change the environment variables names back to their original names.
Working with IntelliJ IDEA 2020.2 or later
IntelliJ IDEA 2020.2 or later suggests that you delete certain environment variables to ensure performance. Make sure not to delete the following variables as they are required for testing Java applications:
- _JAVA_OPTIONS
- JDK_JAVA_OPTIONS
- JAVA_TOOL_OPTIONS