SetVariableValue method

Relevant for: API testing only

Description

Sets the value of a selected test or environment variable.

Back to top

Class

TestProfile

Back to top

Syntax

this.<activity>.Context.TestProfile.SetVariableValue("<variable name>" , "<variable value>");
this.<activity>.Context.EnvironmentProfile.SetVariableValue("<variable name>" , "<variable value>");

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.
Variable value The value for the variable. The format differs on the expected use of the variable.

Back to top

Return Type

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

Back to top

Example

var activity = ((HP.ST.Ext.WebServicesActivities.StServiceCallActivity)(args.Activity));
activity.Report( "codeCheckPointEvent" , "code CheckPoint event" );
args.Checkpoint.Report("CheckPoint","CheckPoint","=" , HP.ST.Fwk.RunTimeFWK.CheckpointFWK.StatusEnum.Succeed );
activity.Context.EnvironmentProfile.SetVariableValue( "codeCheckpointEvent","true"); 

Back to top