Main Content

getRoadRunnerCustomVariableValueByName

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

Get RoadRunner custom variable value

Since R2023b

Syntax

varValue = getRoadRunnerCustomVariableValueByName(varName)

Description

varValue = getRoadRunnerCustomVariableValueByName(varName) gets the value varValue of the specified RoadRunner custom variable varName. Use setRoadRunnerVariable to specify a custom variable to use in RoadRunner test cases or test iterations.

Input Arguments

expand all

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

Output Arguments

expand all

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

Examples

expand all

This example shows how to get the value of a custom RoadRunner variable. First, create a test file, test suite, and RoadRunner test case. Then, create an iteration named speed50, add the iteration to the test case, and set the speed variable to 50. Finally, create another iteration named speed70, add the iteration to the test case, and set the speed variable to 70.

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

ti = sltest.testmanager.TestIteration;
addIteration(tc,ti,"speed50");
setRoadRunnerVariable(ti,"custom","myCustVariable",12);
getRoadRunnerCustomVariableValueByName(ti,"myCustVariable")
ans =
    12

Version History

Introduced in R2023b