Known Issues - 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, 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'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 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 dialog boxes such as the Object Identification dialog box display the extensibility test object classes in the wrong list.

This occurs for any UFT 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 Installation Folder \dat\Extensibility\Java\<add-in name>TestObjects.xml.
    When working with ALM <UFT 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.

  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

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.

For details see Settings per application type.

Settings per application type

Application type Runtime parameter setting
jre7u65+ java -XX:-UseSplitVerifier -jar <application.jar>

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

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 records an additional Close statement.

Workaround:

Manually delete the extraneous 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.

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.

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.
Calls to .Object.startModal

A call to .Object.startModal of a JavaInternalFrame or JavaDialog object may cause UFT 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 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.

    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)

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

IBM Java Runtime Environment (JRE) 1.6

In some cases, after installing the Java Add-in, Java applications running on the IBM Java 6 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

Applets Running on Internet Explorer

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 installation folder>\bin\java_shared\classes";"<UFT installation folder>\bin\java_shared\classes\jasmine.jar" in the JVM Runtime Parameters.

Back to top

JavaFX applications

Web applications running inside a JavaFX window have the following limitations:

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

  • Modal or modaless 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

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
Errors when navigating to a link If your application returns an unspecified error when replying a navigation operation to a link, add a Wait statement before after the step that clicks on the link.

Back to top