How can I export the test results from simulink test manager to an excel sheet programmatically ?

6 ビュー (過去 30 日間)
Geethika
Geethika 2022 年 1 月 17 日
回答済み: atharva 2023 年 11 月 14 日
Hi, I am trying to export the test results after execution of five testcases in simulink test manager to an excel sheet programmatically. Please let me know how can I perform the same ? I am using Matlab 2017b.
Any feedback is appreciated.

回答 (1 件)

atharva
atharva 2023 年 11 月 14 日
Hey Geethika,
I understand that you want to export the test sequence test steps to Excel.
Currently there isn't an automated way to export the Test Sequence information to TXT/XML files.
As a workaround, you can use some of the Test Sequence APIs to get the step and transition information. Here are some resources you can utilize to accomplish this:
1. To get names/paths of all the steps in a Test Sequence block: sltest.testsequence.findStep(blockPath)
2. Then you can loop over all the step paths to read step information for each step.
3. To get the information for each step as a struct: sltest.testsequence.readStep(blockPath, stepPath)
(The number of transitions is in the return struct)
4. For Each step, you can loop over all the transitions to read transition information for each step.
5. To get the information for each transition as a struct: sltest.testsequence.readTransition(blockPath, stepPath, transitionIndex)
After getting all the information, the you can write them into TXT or XML files.
6. Please take a look at the example in the attachment. The script "programaticallySaveTestSequenceToXML.m" works to export test sequences as an "xml" file. This script is modified from the shipped example below.
- Programmatically Create a Test Sequence
I hope this helps!

カテゴリ

Help Center および File ExchangeTest Scripts についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by