GetVariableValue method

Relevant for: API testing only

Description

Retrieves the value of a selected test or environment variable.

Back to top

Class

TestProfile

Back to top

Syntax

this.<activity>.Context.TestProfile.GetVariableValue("<variable name>");
this.<activity>.Context.EnvironmentProfile.GetVariableValue("<variable name>");

Back to top

Parameters

Parameter Description
Variable name A string for the name of the variable. You can find this value in the Test Variables tab in the Properties pane.

Back to top

Return Type

No explicit return - the variable value is set for the test run.

Back to top

Examples

this.ConcatenateStringsActivity4.Context.TestProfile.GetVariableValue("Prefix");
this.ConcatenateStringsActivity4.Report("Prefix Variable Value", this.ConcatenateStringsActivity4.Context.TestProfile.GetVariableValue("Prefix"));
this.ConcatenateStringsActivity4.Context.EnvironmentProfile.GetVariableValue("Prefix");
this.ConcatenateStringsActivity4.Report("Prefix Variable Value 2", this.ConcatenateStringsActivity4.Context.EnvironmentProfile.GetVariableValue("Prefix"));

Back to top