GetVariableValue method
Relevant for: API testing only
Description
Retrieves the value of a selected test or environment variable.
Class
TestProfile
Syntax
this.<activity>.Context.TestProfile.GetVariableValue("<variable name>");
this.<activity>.Context.EnvironmentProfile.GetVariableValue("<variable name>");
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. |
Return Type
No explicit return - the variable value is set for the test run.
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"));