Skip to content

Test#

Measmatic test

This class enables access to properties of a test


property Category#

Gets the test type's category

Returns#

Type Description
string The test type's category

property DataTable#

Gets a reference to the data table with all measurement data collected by this test.

Refer to DataTable for all properties of this class.

Returns#

Type Description
DataTable The test's data table

property Description#

Gets the description for this type of test

Returns#

Type Description
string The description for this type of test

property FilePath#

Gets the test's file path.

Returns#

Type Description
string The test's file path.

property Guid#

Gets the unique identifier for the test.

Every test inside a project has a unique ID which can be used to identify it.

Returns#

Type Description
string The unique identifier for the test as GUID.

property IsActive#

Gets a value indicating whether the test is selected for execution in the test sequence.

Returns#

Type Description
bool True if the test is selected for execution, otherwise False .

property Name#

Gets the name of the test.

Returns#

Type Description
string The name of the test.

property Result#

Gets the test result as integer (0 = undefined, 1 = test passed, 2 = test failed)

Returns#

Type Description
int 0 for undefined, 1 for test passed or 3 for test failed.

property Type#

Gets the test's type.

Returns#

Type Description
string The test's type.

property TypeGuid#

Gets the unique identifier of the test's type.

Returns#

Type Description
string The unique identifier of the test's type as UUID.

property WasExecuted#

Gets a value indicating whether the test was executed during the last run.

Available since Measmatic 2.3.27

Returns#

Type Description
bool true if the test was executed during the last run; otherwise, false .

method ExportData(exportFilterIndex: int)#

Exports the data available at this time using the specified export filter.

Available since Measmatic 2.3.16

Parameters#

Name Description
exportFilterIndex The zero-based index of the export filter setting defined for this test.

Returns#

Type Description
string The returned value of the export filter.

Example#

Exports the test data using the first export filter setting defined in test UI

returned_string = measmatic.Test.ExportData(0)


method ExportData(exportSettingName: string)#

Exports the data available at this time using the specified export filter.

Available since Measmatic 2.3.16

Parameters#

Name Description
exportSettingName The export setting name of the export filter defined for this test.

Returns#

Type Description
string The returned value of the export filter.

Example#

Exports the test data using the filter setting with name 'Data export 1' defined in test UI

returned_string = measmatic.Test.ExportData("Data export 1")


method GetInputBool(controlId: string)#

Gets a boolean value that was defined in test user interface

Available since Measmatic 2.3.24

Parameters#

Name Description
controlId The identifier of the control in the test user interface

Returns#

Type Description
bool The value

Example#

Gets the value set in a checkbox in the test user interface

is_checked = test.GetInputBool('checkbox-control-id')


method GetInputFloat(controlId: string)#

Gets a float value that was defined in test user interface

Available since Measmatic 2.3.24

Parameters#

Name Description
controlId The identifier of the control in the test user interface

Returns#

Type Description
float The value as float

Example#

Gets the value set in an input in the test user interface

voltage = test.GetInputFloat('input-control-id')


method GetInputInt(controlId: string)#

Gets an integer value that was defined in test user interface

Available since Measmatic 2.3.24

Parameters#

Name Description
controlId The identifier of the control in the test user interface

Returns#

Type Description
int The value as integer

Example#

Gets the value set in an input in the test user interface

points = test.GetInputInt('input-control-id')


method GetInputString(controlId: string)#

Gets an integer value that was defined in test user interface

Available since Measmatic 2.3.24

Parameters#

Name Description
controlId The identifier of the control in the test user interface

Returns#

Type Description
int The value as integer

Example#

Gets the value set in an input in the test user interface

iterations = test.GetInputInt('input-control-id')
for n in range(0, iterations):
    print(n)


property Caption#

Gets the caption of the parameter

Returns#

Type Description
string The parameter's caption

property Name#

Gets the name of the parameter

Returns#

Type Description
string The parameter's name

property Unit#

Gets the unit of the parameter

Returns#

Type Description
string The parameter's unit