Step execution scripts
-
- UpdatedJan 30, 2025
- 2 minutes to read
- Yokohama
- Automated Test Framework
In a step configuration record, the step execution script field determines what a step with this configuration does when it runs.
Step inputs
The input variables to a step are determined by the inputs related list in the step
configuration record. The inputs parameter to
executeScript()
gives the script access to these variables. For example, if
the inputs related list contains two records, var1 and
var2, the script can reference var1 with the expression
inputs.var1
and can reference var2 with
inputs.var2
.
Step outputs
The output variables to a step are determined by the outputs related list in the step
configuration record. The outputs parameter to
executeScript()
gives the script access to these variables. For example, if
the outputs related list contains two records, out1 and
out2, the script can reference out1 with the expression
outputs.out1
and can reference out2 with
outputs.out2
.
Step result
The stepResult parameter provides access to an API that controls whether the step passes or fails. It also determines the message the step writes to the log.
The method stepResult.setSuccess()
causes the step to succeed. The method
stepResult.setFailed()
causes the step to fail.
The method stepResult.setOutputMessage()
sets the message to write to the log
when the step succeeds or fails. It takes one parameter: the string to write to the log. If the
script calls stepResult.setOutputMessage()
more than once, the most recent
value set overwrites any previous value.
Example: Record Query step execution script
Example: Custom scripted step configs
stepResult.setSuccess()
” and stepResult.setFailed()
with
return true
and return false
.