Main Content

getTestCaseByName

Class: sltest.testmanager.TestSuite
Namespace: sltest.testmanager

Get test case object by name

Syntax

tc = getTestCaseByName(ts,name)

Description

tc = getTestCaseByName(ts,name) returns a test case with the specified name.

Input Arguments

expand all

Test suite with the test case you want to get, specified as an sltest.testmanager.TestSuite object.

The name of the test case within a test suite object, specified as a character vector. If the name does not match a test case, then the function returns an empty test case object.

Output Arguments

expand all

Test case, returned as an sltest.testmanager.TestCase object. If the name does not match a test case, then the function returns an empty test case object.

Examples

expand all

% Create a test file with default test suite and case
tf = sltest.testmanager.TestFile('My Test File');

% Get test suite
ts = getTestSuites(tf);

% Get the test case object by test case name
tc = getTestCaseByName(ts,'New Test Case 1');

Version History

Introduced in R2015b