Define Method
A method consists of instructions to perform a specific task. Defined methods can be called to use later. For more details regarding how to call a defined method, refer to Method Call Statements.
Note:
Once a test step is added as any of the control statements, it is not allowed to change into another keyword.
In manual view
In script view
The Script view of a test case allows you to programmatically define and handle methods using Groovy or Java language. For details about methods in Groovy, refer to Groovy documentation: Methods .
For example:
-
Method declaration :
Integer myMethod(def param1, def param2) { return param1 + param2 }
-
Method call :
myVar = myMethod1(varA, varB)