Function usage and syntax guidelines – MTS Multipurpose Elite User Manual
Page 281
![background image](/manuals/568053/281/background.png)
Edit Function Window Properties
Description
Item
Shows the function name. A name that is unique
within the test is prefilled in the Function Name field.
Function name
When you enter a function name in the work area,
the new name shows in this field. The name is
case-sensitive, and must not contain spaces.
Shows the function category. If you create the
function from the Test Definition, the category is Test
Definition.
Category
Shows how to use your function and the arguments
required. As you enter the function name and the
Usage
variables in the work area, you see the name and
variables replace the generic text in the Usage field.
Enter your function in this area. You can add, edit
and delete functions and arguments by changing the
def line.
Python Code
Validates your code as you are entering it. A
message displays indicating whether your code is
valid.
Validation
For More Information
Concept
Task
(p. 282)
Create Variables Used in Python Function Example
(p. 283)
Function Usage and Syntax Guidelines
SetValue
To set a test variable in a function, you must enter the code as in the following example:
TestVariableX.SetValue(10)
Note:
The example above is not entered as TestVariableX=10. You must enter SetValue in the Function
Editor.
Arrays
To read a test variable array in a function, enter the code as in the following example:
functionVariableX=TestVariableX.Value.ValueArray
MTS TestSuite | 281
Working with Variables