Run Script Activity
The Run Script activity enables the execution of JavaScript code within a targeted web interface. This activity facilitates complex browser interactions and data retrieval by running custom scripts directly in the application context.
| Field | Description | Requirement |
|---|---|---|
| Application name | Specifies the reference name of the application instance that is currently open or attached. | Required |
| Script | Defines the JavaScript code to be executed within the browser context. | Required |
| Result variable name | Designates the variable used to store the output data returned by the executed script. | Required |
Action Types & Examples
Script Execution
- Format: string
- Example Result: "return document.title;"
Variable Assignment
- Format: string
- Example Result: "countResult"
Implementation Examples
Field Setup - Application name: ${robustaWebpage} - Script: return document.querySelectorAll("button").length; - Result variable name: countResult
Execution Parameters - Application name: ${robustaWebpage} - Script: return document.readyState === "complete"; - Result variable name: existResult
Technical Notes
The script provided must follow valid JavaScript syntax. Ensure the Application name matches a previously initialized application reference to ensure the script executes within the correct browser session. All returned values are stored in the variable specified in the Result variable name field for use in subsequent workflow steps.