Description
This property returns the collection of local variables that were defined in the current TestComplete project. See Project Variables.
Declaration
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";
…
}
{
…
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
…
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;
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";
…
}
{
…
if (Project["Variables"]["VariableExists"]("TVar1"))
Project["Variables"]["TVar1"] = "New Value";
…
}