Main Content

setRoadRunnerCustomVariable

Class: sltest.testmanager.TestIteration
Namespace: sltest.testmanager

Set RoadRunner custom variable value for test iteration

Since R2024a

Syntax

setRoadRunnerCustomVariable(iterObj,varName,varValue)

Description

setRoadRunnerCustomVariable(iterObj,varName,varValue) creates or overrides the RoadRunner custom variable varName in the test iteration iterObj with the value varValue.

Input Arguments

expand all

Test iteration to which to apply the RoadRunner custom variable, specified as a sltest.testmanager.TestIteration object.

Name of the RoadRunner custom variable, specified as a string or character vector.

Data Types: char | string

Value of the RoadRunner custom variable, specified in the format determined by the RoadRunner variable type.

Examples

expand all

This example shows how to create and set the value of a RoadRunner custom variable. First, create a test file, test suite, and RoadRunner test case. Then, create an iteration, ti and set the RoadRunner scenario to myExampleScenario. Then, set the RoadRunner custom variable myCustVariable to 15 and add the iteration myIteration to the test case.

tf = sltest.testmanager.TestFile("myTestFile");
ts = sltest.testmanager.TestSuite(tf,"myTestSuite");
tc = sltest.testmanager.TestCase(ts,"simulation",...
   "myTestCase",runOnPlatform="RoadRunner");

Then, create an iteration called ti and set the RoadRunner scenario to myExampleScenario. Then, set the RoadRunner custom variable myCustVariable to 15 and add the iteration myIteration to the test case.

ti = sltest.testmanager.TestIteration;
setRoadRunnerScenario(ti,"myExampleScenario")
setRoadRunnerCustomVariable(ti,"myCustVariable",15);
addIteration(tc,ti1,"myIteration");

Version History

Introduced in R2024a