How to modify Create test case from External data option in test manager programmatically?
조회 수: 27 (최근 30일)
이전 댓글 표시
I am trying to generate a script to automate the testing in test manager. I want the handle to 'Create Test case from External Data' option that is visible on openeing a test file in MATLAB R2019a.
댓글 수: 0
답변 (1개)
Altaïr
2025년 3월 26일
The "Create test case from External file" checkbox mainly functions to show or hide the "File" edit field, shown below.
To programmatically import test case criteria from a MAT-file or Excel file for Baseline or Equivalence tests, the captureBaselineCriteria and captureEquivalenceCriteria methods of the sltest.testmanager.TestCase object are useful. Below 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);
For additional information 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'))
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Results, Reporting, and Test File Management에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!