WaitJavaFXObject Method

Applies to TestComplete 15.63, last modified on April 23, 2024

Description

Use this method to pause the test execution until the specified object of a JavaFX application becomes available to TestComplete. The method returns a program object that provides access to the specified window or control. The resulting object contains both methods and properties defined in application code as well as methods, properties and actions provided by TestComplete.

Declaration

TestObj.WaitJavaFXObject(Name, Timeout)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
Name [in]    Required    String    
Timeout [in]    Required    Integer    
Result Object

TestObj.WaitJavaFXObject(ClassName, Text, Timeout)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
ClassName [in]    Required    String    
Text [in]    Required    String    
Timeout [in]    Required    Integer    
Result Object

TestObj.WaitJavaFXObject(ClassName, Text, Index, Timeout)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
ClassName [in]    Required    String    
Text [in]    Required    String    
Index [in]    Required    Integer    
Timeout [in]    Required    Integer    
Result Object

Applies To

The method is applied to the following objects:

View Mode

To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.

Parameters

The method has the following parameters:

Name

The name of the desired object as it is specified in the tested application’s source code (the string that is returned by the JavaFXObjectName property).

ClassName

The window’s class name as it is specified by the JavaClassName property. You can use wildcards (* and ?) in this parameter.

Text

The window’s caption as it is specified by the JavaFXObjectText property. You can use wildcards (* and ?) in this parameter.

Index

The window’s index as it is specified by the JavaFXObjectIndex property.

The Index parameter is used only if an object contains two or more child objects that have the same class name and caption. It is used to distinguish these objects from each other. The first found object has an index of 0, the second -  1 and so on.

If there is only one child object with the specified class name and caption, index should not be specified. To decide whether the index should be used, explore your application in the Object Browser panel and use the naming format that is used by the panel.

Timeout

The number of milliseconds to wait until the specified object becomes available. If Timeout is 0, the method returns immediately. If Timeout is -1, the wait time is infinite.

Note that Timeout value is not strict and if the tested application is busy, TestComplete could wait for the object for a longer period of time than it is specified by the parameter. The following can cause this:

A call to any WaitXXXObject method causes the object tree to refresh. To update object data, TestComplete may call some of object’s native methods that are accessible only from the application’s thread. When the thread is busy, TestComplete tries to call those methods during some pre-defined time (one second) thus delaying the refresh. There could be several attempts to get the object’s data which could result in a noticeable difference from the Timeout value.

Result Value

The WaitJavaFXObject method returns an object that provides access to an object located in a JavaFX application. If TestComplete cannot access the specified object (for example, this object does not exist), the method will return an empty stub object. To determine whether WaitJavaFXObject returns a valid object, use the Exists property of the resultant object. If this property returns False, then the returned object is a stub object and the call to WaitJavaFXObject was not successful.

Remarks

The returned object contains both methods and properties defined in the application code as well as methods, properties and actions provided by TestComplete. The returned object may hold two or more methods or properties having the same name. When you call such a method or property, a naming conflict will occur. To avoid it and to specify which method or property is to be called, use the NativeJavaFXObject namespace.

The WaitJavaFXObject method is available only if the Java Application Support and JavaFX Application Support plugins are installed. Otherwise, the method is absent in the method list of the TestObj object.
If the plugins are installed, you cannot use the WaitWindow method to address windows of your JavaFX application, you should use the WaitJavaFXObject instead.

To obtain the class name, text and index used by the second or third implementation of the WaitJavaFXObject method, use the JavaClassName, JavaFXObjectText and JavaFXObjectIndex properties.

See Also

Addressing Objects in JavaFX Applications
Object Browser Naming Notation
Using Namespaces
About Open Applications
JavaClassName Property
JavaFXObjectName Property
JavaFXObjectText Property
JavaFXObjectIndex Property
JavaFXObject Method

Highlight search results