SynchPoints Object

Applies to TestComplete 15.63, last modified on April 23, 2024
The Network Suite functionality is deprecated. We don’t recommend using it for distributed testing. Consider using a CI/CD system for managing distributed tests. See Migrating Distributed Tests to CI/CD Systems for details. In case you need to run web tests on multiple environments in parallel, you can also try using your project’s Execution Plan.

Description

The SynchPoints object allows you to manage synchronization points defined in the current project. To obtain the SynchPoints object from tests, use the NetworkSuite.SynchPoints property.

Members

Example

The following example demonstrates how you can access the synchpoint collection from script and synchronize tests execution by using the desired synchpoint from this collection. The example uses the SynchPoint.WaitFor method to simultaneously start creating new files on different computers. Remember that this code must be added to all the projects that will create files.

JavaScript, JScript

...
// Obtain the collection of synchronization points defined in the current project
MySynchPointCollection = NetworkSuite.SynchPoints;

// Obtain the synchpoint named Synchpoint1 from the collection
MySynchPoint = MySynchPointCollection.Synchpoint1;

// Synchronize the script execution flow of the current project with script execution flows of other projects
MySynchPoint.WaitFor();

// Call the routine that creates files
CreateFiles(0);
...

Python

# ...
# Obtain the collection of synchronization points defined in the current project 
MySynchPointCollection = NetworkSuite.SynchPoints
# Obtain the synchpoint named Synchpoint1 from the collection 
MySynchPoint = MySynchPointCollection.Synchpoint1
# Synchronize the script execution flow of the current project with script execution flows of other projects 
MySynchPoint.WaitFor()
# Call the routine that creates files 
CreateFiles(0)

VBScript

...
' Obtain the collection of synchronization points defined in the current project
Set MySynchPointCollection = NetworkSuite.SynchPoints

' Obtain the synchpoint named Synchpoint1 from the collection
Set MySynchPoint = MySynchPointCollection.Synchpoint1

' Synchronize the script execution flow of the current project with script execution flows of other projects
Call MySynchPoint.WaitFor

' Call the routine that creates files
Call CreateFiles(0)
...

DelphiScript

...
// Obtain the collection of synchronization points defined in the current project
MySynchPointCollection := NetworkSuite.SynchPoints;

// Obtain the synchpoint named Synchpoint1 from the collection
MySynchPoint := MySynchPointCollection.Synchpoint1;

// Synchronize the script execution flow of the current project with script execution flows of other projects
MySynchPoint.WaitFor;

// Call the routine that creates files
CreateFiles(0);
...

C++Script, C#Script

...
// Obtain the collection of synchronization points defined in the current project
MySynchPointCollection = NetworkSuite["SynchPoints"];

// Obtain the synchpoint named Synchpoint1 from the collection
MySynchPoint = MySynchPointCollection["Synchpoint1"];

// Synchronize the script execution flow of the current project with script execution flows of other projects
MySynchPoint["WaitFor"]();

// Call the routine that creates files
CreateFiles(0);
...

See Also

SynchPoints Property
Distributed Testing
Synchronization Points

Highlight search results