How to create a duplicate test case programmatically, just like copy/paste in the test manager under the same test suite.

16 views (last 30 days)
Hello,
I am currently working with the Simulink Test Manager and need assistance with programmatically duplicating test cases within the same test suite, similar to the "copy/paste" functionality available in the Test Manager interface.
I have a test suite loaded, and I want to create new test cases by duplicating existing ones. The goal is to maintain all properties (including the scripts and variable definitions in the callback sections) and settings of the original test case in the new duplicates.
So far, I have tried to retrieve the existing test case I wish to duplicate into the workspace and used dot operations like copy and duplicate, but these methods did not work as expected. For example:
newTestCase = existingTestCase.copy;
newTestCase = existingTestCase.duplicate;
A follow-up question, is it possible to programmatically edit or modify the scripts written in the callback sections of test cases? I am looking to automate the process of creating multiple test cases based on an existing one that was manually created in the Test Manager.
If anyone has experience with this or can provide guidance on how to achieve this programmatically, I would greatly appreciate your help!
Thank you

Accepted Answer

Fangjun Jiang
Fangjun Jiang about 13 hours ago
  4 Comments

Sign in to comment.

More Answers (0)

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!