Run Browser Script
Run JavaScript in the browser during a Test Case.
Last updated
Run JavaScript in the browser during a Test Case.
Run browser script executes custom JavaScript in the page. Use it when you need logic the built-in steps do not cover, such as a calculation, a DOM read, or a small helper.
Read Values with VALUES.yourKey inside the script. The $ picker works in other Test Step fields. The script field is JavaScript, so use the VALUES object instead.

Store mode saves the script return value under Response Storage Name for later steps.
Check mode asserts the script result as part of the step outcome.
Prefer built-in Action and Check steps when they already cover the job.
Label
Optional label shown in results
JavaScript
The script to run. Use VALUES.key for stored Values
Mode
Store (default) or Check
Response Storage Name
Where to save the return value in Store mode (output by default)
When should screenshots be taken?
Always or On Failures (default)
Status on fail
Pro tip: If a Value looks empty in the script, confirm an earlier step wrote that storage name and that you used VALUES.yourKey, not $yourKey.
Tags: browser, script, javascript, VALUES
Last updated