Execute JavaScript WebElement

Last modified: June 18, 2025

Description

Executes the provided JavaScript snippet. Runs asynchronous when Timeout is set. Returns a string.

Usage

Pass the script you want to execute as parameter for the action. You have to set a WebElement as return value, otherwise the action will fail. The optional arguments are stored in an array and can be used in your script. For example type "arguments[0]" to get the value of the Argument 0 parameter.

Input Parameters

NameDatatypeRequiredDescription
ScriptStringyesThe JavaScript source code you want to Execute
Timeout(ms)IntegernoThe time in milliseconds for the script to finish
Argument 0anynoArgument to use in the JavaScript code
Argument 1anynoArgument to use in the JavaScript code
Argument 2anynoArgument to use in the JavaScript code
Argument 3anynoArgument to use in the JavaScript code

Return Value

NameDatatypeDescription
Script ResultWebElementThe return value set in the script.