beautypg.com

Array of text, Debugging custom functions within mts testsuite, Mts testsuite custom function debugging template – MTS Multipurpose Elite User Manual

Page 287

background image

Array of Text

Description of Text Arrays

Description

Example (using variable txtArray)

Method

Get the number of values stored in
TXTArray

TXTArray. Length

Length

Add a number to TXTArray

TXTArray. Add(value)

Add

Get the number stored at a specific
index in TXTArray

TXTArray.ArrayValue(index).ValueAsString

ArrayValue

Set the number stored at a specific
index in TXTArray

TXTArray.ArrayValue(index, value)

ArrayValue

Debugging Custom Functions Within MTS TestSuite

You may find it convenient to debug your custom functions within MTS TestSuite. For this reason, all “print”
statements are output to the Test Log. You may use this feature to keep track of values within custom
functions, which allows you to track errors and calculations throughout tests more easily.

MTS TestSuite Custom Function Debugging Template

Initialize the custom function test environment

If you are designing a function which requires access to these variables, MTS recommends that you
simulate the variables by initializing them with valid default values.

For example, the following custom function will load a variable array called tsVarArray (analogous to an
MTS TestSuite variable array) with the values of three other MTS TestSuite variables.

To create this custom function, perform the following:

1. Declare the variables in the test environment.

2. Pass the variables to be included in the array as parameters of the custom function.

3. Return the value of the custom function to the variable array.

tsVar1 = 1
tsVar2 = 2
tsVar3 = 3
tsVarArray = list()

MTS TestSuite | 287

Working with Variables