Accessing Project and Project Suite Variables from Connected Applications

Applies to TestComplete 15.47, last modified on January 20, 2023
Connected and Self-Testing applications are deprecated. These technologies will be removed in one of the future releases of TestComplete.
To create test code that runs from within your tested apps, use TestLeft, a SmartBear functional testing tool for developers.

Connected applications can access TestComplete variables. You can then use the values assigned to these variables in your TestComplete tests.

To access project or project suite variables from a Connected Application, use the following code:

Visual Basic

Sub Test
 ...
 Project.Variables.MyVariable = "C:\MyFolder\MyProject.mds"
 ...
End Sub

Delphi

procedure Test;
begin
 ...
 Project.Variables.MyVariable := 'C:\MyFolder\MyProject.mds';
 ...
end;

C++

void Test()
{
 ...
 Project["Variables"]["MyVariable"] = "C:\\MyFolder\\MyProject.mds";
 ...
}

C#

void Test()
{
 ...
 Project["Variables"]["MyVariable"] = "C:\\MyFolder\\MyProject.mds"; 
 ...
}

Before you read or assign a value to a project or project suite variable in a Connected Application, make sure you have loaded the project that holds this variable in TestComplete. Otherwise, an error will occur.

See Also

Connected Applications - Overview
About Project And Project Suite Variables

Highlight search results