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:

Memory issues If you are not able to open your Java application after you've opened UFT One, you may have a memory space fragmentation issue, caused by loading a Windows .dll file.
Could not create the Java Virtual Machine error message

If the Could not create the Java Virtual Machine error message is displayed, activate UFT One's memory defragmenting by adding a line to the mercury.ini file.

Locate the mercury.ini file in your Windows folder (%windir%) and add a line to the Memory_Defrag section, as follows:

[Memory_Defrag] <process_name>.exe=1

where <process_name> is the name of the Java engine or application that you are using.

To turn off defragmenting, change the 1 value to 0.

No error message, higher memory settings do not help

If no error message appears, and Eclipse fails to start with higher memory settings, do one of the following:

  • Use a 64-bit Windows operating system and 64-bit JVM, with 64-bit Eclipse.

    Having a 64-bit virtual memory space can prevent you from encountering memory fragmentation issues.

  • Force Eclipse to start using the java.exe or javaw.exe file instead of the default startup file.

    To do this edit the eclipse.ini file by adding the following text, on two separate lines:

    -vm

    <full path to the java.exe or javaw.exe file>

  • Modify the Eclipse memory setting in the eclipse.ini file.

    For example, if the application fails to start with a parameter setting of -Xmx512m, use a parameter setting of -Xmx256m or -Xmx384m instead.

Verify Error message

When launching an application on a computer using Java version 8, if you:

  • Launch an Oracle Forms application or Java applets over Java jre8u91
  • JavaFX applications over Java jre8u45

UFT One returns a "VerifyError" error.

Workaround: Add -UsesplitVerifier to the runtime parameters in the Runtime environment settings.

Back to top

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:

  1. 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
  2. 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.

  3. Save the file and reopen UFT One.

  4. If this extensibility support (child add-in) was developed by a third party, you may want to contact them for assistance.

Back to top

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.

Settings per application type

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.

Back to top

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.

Back to top

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:

JavaWindow("Application").JavaEdit("User Name").Activate

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:

  • Use a Close menu command or button to close a Java applet or Java application during a recording session.

  • Manually add a JavaWindow(...).Close step.

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:

Setting.Java("RECORD_WIN_OPS") = 1

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.

Back to top

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:

  • You can add only native properties for which the control has a public get or is method that returns the property value.

  • If the native property name includes upper-case letters, then in the corresponding name that you create, you must replace each of the upper-case letters except the first one with _<lower-case letter>.

    For example, to use the native property OneSmallProp, add an named One_small_prop.

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.

Back to top

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:

  • Add the parent object and select to also add the descendants.

    Use the Add Objects or Add Objects to Local button.

  • Add a JavaMenu object using the Navigate and Learn option in the Object Repository Manager.
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:

  • For a JavaButton object—relearn the object on JDK 1.6 or later.

    Then modify the test to use the new test object, or delete the old object from the object repository and rename the new test object to match the object name used in the step.

    Make sure the Automatically update test and business components steps when you rename test objects option is selected in the General pane of the GUI Testing tab in the Options dialog box (Tools > Options > GUI Testing tab > General node).

  • For a button in a JavaToolbar object, modify the Item argument in the JavaToolbar statement to refer to the relevant button.

    Specify the button's index, or use the Object Spy to spy on the toolbar button, and then provide the label as the Item argument.

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".

y = JavaCheckBox("Active").WaitProperty ("enabled", "1", 1000)

JavaStaticText objects To learn JavaStaticText objects using Navigate and Learn toolbar, you must select All object types as the object filter.

Back to top

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.

Back to top

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.

Back to top

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:

  • Object.getText
  • JavaCalendar.GetTime
  • UFT One version 2021 R1 and earlier: JavaWindow.Move, JavaWindow.Resize, and JavaWindow.PressKey methods

Web testing only

Web applications running inside a JavaFX window have the following known issues:

Unsupported controls
  • Browser dialog boxes (like Alert, Confirm, and Prompt dialogs)

  • Modal or modeless dialog boxes

  • Cross-domain frame/iFrame objects

Unsupported functionalities
  • Web applications design with Web 2.0 toolkits (ASP .NET AJAX. Dojo, Google Web Toolkit, jQueryUI, EXT-JS, Siebel Open UI, and Yahoo UI)

  • Browser operations

  • Navigate and Learn

  • Drag and Drop

  • Active Screen

  • Recording on Frame or iFrame objects

  • Recording on role-based controls (that use the role= property)

  • Options in the Web > Advanced pane of the Options dialog

Unsupported test objects and methods
  • All Browser test object methods

  • WebFile objects

  • ViewLink objects

  • WebXML objects

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.

Back to top

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:

  1. Add -agentlib:jvmhook at the beginning of the _JAVA_OPTIONS and IBM_JAVA_OPTIONS environment variables.

  2. Delete the JAVA_TOOL_OPTIONS environment variable.

Back to top

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: 

  1. On your Windows Desktop, right-click My Computer or This PC and select Properties.

  2. Select the Advanced tab.

  3. Click the Environment Variables... button.

  4. 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

  5. Install the JRE.

  6. Once the installation is completed, change the environment variables names back to their original names.

Back to top

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

Back to top