TestOptimal Wiki

Model-Based Testing (MBT)

User Tools

Site Tools


Writing User Defined Function

User Defined Functions are useful to help organize and re-use scripts. The user functions are defined in “Function” MBT Triggers. There is no limit on the number of user functions you may define.

Below is an example of a user function:


You can call the user function with $callFunc('funcName','params') where 'params' is a string in the format of http url params like p1=value1,p2=value2.

Inside the user function, you can access the input parameters with $getFuncParam('paramName'). For example $getFuncParam('p2') to retrieve parameter 'p2' which should return 'value2' in the above example.

If you have comma in the parameter value, you will need to encode “,” with “[comma]”.

User function may return a value by calling $setFuncReturn('returnValue').

User function may call another user function with $callFunc(…).

define_user_defined_function.txt · Last modified: 2016/09/22 02:35 (external edit)