Processor Execute code

The Execute Code processor runs a snippet of JavaScript and assigns the result to a profile variable.

Example script of using Execute code processor

In the script above variable COUNT starts at 1, the Execute code processor increments it and stores the outcome in EXECUTED_RESULT .

Configure the Execute code processor
The processor’s output is stored in EXECUTED_RESULT

This processor offers two execution modes:

  • Without browser: the JavaScript snippet runs inside Node.js’s VMarrow-up-right with no browser involvement, so pick this when your code doesn’t need to interact with browser.

  • Run in browser: the JavaScript executes inside Chrome DevTools, launching the browser so you can interact with page elements, for example document.querySelector(".title").innerHTML

Configuration meanings:

Field name
Required?
Detail

Variable name for storing result

Yes

This processor outputs a random number, so select a variable to capture it.

For example EXECUTED_RESULT

Mode

Yes

Without browser hoặc Run in browser

Javascript code

Yes

The code snippet you want to execute

Last updated