Learn how to integrate custom Node.js scripts into your TestDriver workflows for dynamic testing.
exec
command. This feature, introduced in version 5.1.0
, enables you to integrate custom logic, such as generating one-time passwords (OTPs), hitting APIs, or performing other dynamic operations, directly into your tests.
totp-generator
NPM package and use it in a test.
exec
command now takes a lang
argument with supported values js
or pwsh
.js
code is executed in a Node.js VM module internally.pwsh
code is executed in the PowerShell on the runner.result
variable is already available in your script, overwrite it to store the output as shown in the example.The output
argument is assigned automatically by setting result = somestringvalue
in the script you run.result
variable.prerun
script when using GitHub Actions.