Main Content


Class: sltest.testmanager.Assessment
Namespace: sltest.testmanager

Get parent test case of assessment

Since R2022a


tc = sltest.testmanager.Assessment.getTestCase(assessObj)


tc = sltest.testmanager.Assessment.getTestCase(assessObj) returns the test case object that is the parent of the specified assessment object.

Input Arguments

expand all

Assessment for which to get its parent, specified as an sltest.testmanager.Assessment object.

Output Arguments

expand all

Parent test case of assessment, returned as an sltest.testmanager.TestCase object.


expand all

This example shows how to obtain the parent test case of a test assessment. Load a test file and obtain its test suites and test cases, then display the test case that contains the first assessment.

tf = sltest.testmanager.load('test_traffic.mldatx');

ts = tf.getTestSuites;
tc = tf.getTestSuites.getTestCases;
assessObjs = tc.getAssessments;

tcParent = assessObjs(1).getTestCase
tcParent = 
  TestCase with properties:

             Name: 'New Test Case 1'
         TestFile: [1x1 sltest.testmanager.TestFile]
         TestPath: 'test_traffic > New Test Suite 1 > New Test Case 1'
         TestType: 'simulation'
      RunOnTarget: {[0]}
    RunOnPlatform: {[Desktop]}
           Parent: [1x1 sltest.testmanager.TestSuite]
     Requirements: [0x1 struct]
      Description: ''
          Enabled: [1]
             Tags: [0x0 string]

Version History

Introduced in R2022a