I am trying to create script for matlab test manager . I am not able to find handle for the checkbox "Create test case from External file" . I searched in setProperty function of test case but not able to find anything. Please help me with the issue

9 views (last 30 days)

Answers (1)

Altaïr
Altaïr on 26 Mar 2025
The "Create test case from External file" checkbox primarily serves to toggle the visibility of the "File" edit field, shown below.
For programmatically importing test case criteria from a MAT-file or an Excel file for Baseline or Equivalence tests, the captureBaselineCriteria and captureEquivalenceCriteria methods of the sltest.testmanager.TestCase object can be utilized. Here are the commands to access their documentation:
For captureBaselineCriteria:
web(fullfile(docroot, 'sltest/ref/sltest.testmanager.testcase.capturebaselinecriteria.html'))
Example usage:
% Create the test file, test suite, and test case structure
tf = sltest.testmanager.TestFile('API Test File');
ts = createTestSuite(tf,'API Test Suite');
tc = createTestCase(ts,'baseline','Baseline API Test Case');
% Capture the baseline criteria
baseline = captureBaselineCriteria(tc,'baseline_API.mat',true);
For captureEquivalenceCriteria:
web(fullfile(docroot, 'sltest/ref/sltest.testmanager.testcase.captureequivalencecriteria.html'))
Example usage:
% Create the test file, test suite, and test case structure
tf = sltest.testmanager.TestFile('API Test File');
ts = createTestSuite(tf,'API Test Suite');
tc = createTestCase(ts,'equivalence','Equivalence Test Case');
% Capture equivalence criteria
eq = captureEquivalenceCriteria(tc);
Additionally, for guidance on formatting test case data in Excel and creating a MAT-file for input data, refer to:
web(fullfile(docroot, 'sltest/ug/create-data-files-to-use-as-test-inputs.html'))

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!