Skip to main content
Runs a JavaScript snippet. The return value can be stored with saveAs. The simplified form takes the code as a single string.

Parameters

ParameterTypeRequiredDescription
codestringYesJavaScript to run.
timeoutnumberNoExecution timeout in milliseconds.
saveAsstringNoVariable to store this step’s return value on env.<name>.
retriesnumberNoTimes to retry the step on failure before failing the test.
skippedbooleanNoSkip this step at execution time.

Shorthand

Code as a single string.
- javascript: "return env.COUNT + 1"

Examples

- javascript:
    code: "return Date.now()"
    saveAs: NOW # return value is available as {{ env.NOW }}