필터 지우기
필터 지우기

How to divide Test Cases programmatically from already loaded TEST Suite?

조회 수: 3 (최근 30일)
Montina
Montina 2023년 3월 10일
댓글: Montina 2023년 3월 22일
I have loaded Test Suite programmatically. Test Suite contains categories and subcategories. Subcategories contains Test Cases. And now I want to divide the Test Cases in two parts programmatically.
Example:
>TestSpecification
> PowerTrain
> ABC
> XYZ
> Chasis
> LMN
> SDF
> Engine
> POQ
>GHJ

답변 (1개)

Sugandhi
Sugandhi 2023년 3월 20일
Hi Montina,
I understand that you want to divide test Cases programmatically from already loaded TEST Suite.
>> suite = testsuite
The above command creates a suite of tests from your current folder and returns the suite as a TestSuite array. This contains Test array with properties:
  • Name
  • BaseFolder
  • ProcedureName
  • SharedTestFixtures
  • Parameterization
  • Tags
You can access these properties using dot operator (suite.<propertyName> ).
>> suite = testsuite(tests)
The above command creates a suite from a set of specified tests. For example, in place of tests in above syntax you can specify a test file, a test class, a folder that contains test files, a package that contains test classes, or a project folder that contains test files.
>> suite = testsuite(tests,Name="productA_*")
The above command creates a test suite from tests that have names starting with "productA_".
One of the possible workarounds could be, using test cases name from properties of test suite and directory containing these test cases as parameters to above methods, you can divide test cases programmatically from already loaded TESTSuite.
For more understanding kindly go through the following link –
  댓글 수: 1
Montina
Montina 2023년 3월 22일
Thanks for the response Sugandhi.. This will not work in my case. I have explored this option.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Run Unit Tests에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by