Import and Export Graphical Tests
A graphical test is a test case that you create in the Polyspace® Platform user interface or programmatically by using classes in the
Polyspace
Python® API. To archive, reuse, or share graphical tests between projects, you can
export them to .pstestd files and import them from these files. When
you import a graphical test from a file, you can choose whether to import it as a local
copy that is saved in the .psprjx project file or by adding a
reference from the project to the .pstestd file.
Export Copy of Graphical Test to File
To export a copy of a graphical test case from a project to a .pstestd file in the Polyspace Platform user interface:
Open the graphical test.
On the Test Case toolstrip tab, click Export.
Specify a filename and location for the new
.pstestdfile.
To export a copy of a graphical test case using the Polyspace
Python API, use the export() method of the polyspace.project.OwnedTestCase object or the saveCopy() method of the polyspace.project.TestCase object.
Import Copy of Graphical Test from File
To import a local copy of a graphical test into your project in the Polyspace Platform user interface:
Open your project. On the Project tab of the toolstrip, select Import Tests > Import Copy of Graphical Test Case.
Browse to the
.pstestdfiles you want to import local copies of and click Open. Polyspace Test™ imports the copies of the tests into the default test suite,pst_default_suite. To move the tests to a different test suite, see Organize Graphical Tests in Polyspace Platform Project Using Test Suites.
To import a local copy of a graphical test using the Polyspace
Python API, see polyspace.project.OwnedTestCase.
Add Reference to Graphical Test File
Instead of importing a local copy of a graphical test case into a project, you can add a reference from the project to the .pstestd file where the graphical test is saved. This is called a test reference. Importing a graphical test by reference creates a modular project structure and enables you to share single-sourced tests with related projects. For more information about test references and creating modular Polyspace Platform projects, see Modularize Project by Using External Configurations, Test References, and External Stub Files.
To import graphical tests by reference in the Polyspace Platform user interface:
Open your Polyspace Platform project. On the Project tab of the toolstrip, select Import Tests > Import Graphical Test Case by Reference.
Browse to the
.pstestdfiles you want to reference from the project and click Open. If necessary, move the imported test references to a different test suite in your project.
To import graphical tests by reference using the Polyspace
Python API, see polyspace.project.TestCaseRef.
See Also
polyspace.project.Project | polyspace.project.OwnedTestCase | polyspace.project.TestCaseRef | polyspace.project.TestCase