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

15 ビュー (過去 30 日間)
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

採用された回答

Fangjun Jiang
Fangjun Jiang 約4時間 前
  3 件のコメント
Peddi Satish Babu
Peddi Satish Babu 約2時間 前
I have 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.
Specifically, I want to retrieve the PreLoad, PostLoad, and Cleanup callback sections of a test case and store them in variables in the workspace. This will allow me to modify the variable values programmatically and then assign them to other test cases.
Thank you!

サインインしてコメントする。

その他の回答 (0 件)

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by