Project.Variables Property

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

Description

This property returns the collection of local variables that were defined in the current TestComplete project. See Project Variables.

Declaration

Project.Variables

Read-Only Property A Variables object

Applies To

The property is applied to the following object:

Property Value

A Variables object that represents the collection of local variables defined in the current TestComplete project.

Example

The following example demonstrates how to obtain the collection of variables specified in the current project and how to modify one of the project variables.

JavaScript, JScript

function ProjectSample()
{
  …

  if (Project.Variables.VariableExists("TVar1"))
    Project.Variables.TVar1 = "New Value";
  …

}

Python

def ProjectSample():
  # ...
  if Project.Variables.VariableExists("TVar1"):
    Project.Variables.TVar1 = "New Value"
  # ...

VBScript

Sub ProjectSample

  …

  If Project.Variables.VariableExists("TVar1") Then
    Project.Variables.TVar1 = "New Value"
  End If

  …

End Sub

DelphiScript

procedure ProjectSample();
begin
  …

  if Project.Variables.VariableExists('TVar1') then
    Project.Variables.TVar1 := 'New Value';
  …

end;

C++Script, C#Script

function ProjectSample()
{
  …

  if (Project["Variables"]["VariableExists"]("TVar1"))
    Project["Variables"]["TVar1"] = "New Value";
  …

}

See Also

Project Variables
Variables Object
ProjectSuite.Variables

Highlight search results