Project Properties - Java Options

Applies to TestComplete 15.70, last modified on December 17, 2024
Information in this topic applies to desktop applications only.

The Open Applications > Java group contains settings that specify how TestComplete works with Java application objects.

This group is available only if:

  • You have an active license for the TestComplete Desktop module.

  • The Java Application Support plugin is enabled in TestComplete.

    This plugin is installed and enabled by default during the TestComplete installation. You can check the plugin status in the File > Install Extensions dialog in TestComplete.

To view or modify the Java settings:

  • Open the Properties page of the project editor and then choose Open Applications > Java in the list on the left of the page.
TestComplete Project Properties - Java

Click the image to enlarge it.

You can change the following option:

  • Do not recognize child windows of an SWT control as the same SWT control - Specifies how TestComplete recognizes Java controls that contain several windows. For instance, a Spinner control of the SWT library contains one edit and one up-down control. When TestComplete retrieves information about the control’s class, SWT reports that the control’s class is Spinner. However, when TestComplete retrieves information about child windows, edit box and the up-down control, SWT says that their class name is also Spinner. So, the Object Browser displays the following hierarchy of controls:

    ...

    SWTObject("Spinner", "") // <-- spinner

    SWTObject("Spinner", "") // <-- edit box

    SWTObject("Spinner", "") // <-- up-down control

    ...

    This causes ambiguous recognition of controls and causes errors during the execution of the recorded scripts.

    Enabling this option lets you avoid the problem. If the option is on, TestComplete does not recognize child SWT objects as objects of the class of the parent SWT control. The Object Browser displays the following hierarchy of controls:

    ...

    SWTObject("Spinner", "") // <-- spinner

    Window("Edit", "", 1) // <-- edit box

    Window("msctls_updown32", "", 1) // <-- up-down control

    ...

    By default, the option is disabled. This is done to provide support for test projects that were created in TestComplete 5 and earlier, since these versions of TestComplete used the algorithm that might cause ambiguous recognition. If you do not run legacy projects, you can enable the option to activate the new recognition algorithm.

    You can also control the option’s state from scripts by using the Options.JavaOpenApps.DoNotRecognizeChildSWTAsParent property.

The default values of the Java settings that are used in new TestComplete projects can be specified in the Default Project Properties - Java Options dialog.

See Also

Default Project Properties - MSAA Options
Testing Java Applications - Overview

Highlight search results