Execute script Version 11 (Java)
Action group: Browsers Subgroup: Windows, tabs, frames
Description
The action is performed by a script in the browser (JavaScript scripts are used)
Action icon
Parameters and their settings
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Context | Action context for working with the browser | Robin.Selenium | Browser context | Yes |
Script | Script to execute in browser | Robin.String | Yes | |
Script parameters | Parameters passed to the script | Robin.Object | No | |
Results | ||||
Result | Script execution result | Robin.Object |
Special conditions of use
None.
Example of use
Task
Open a browser and display the "This page says" window using a script. Then get the text from the "This page says" window and display it as a message on the screen.
Implementation
- Assemble the following robot scheme:
- Set the parameters for the "Open Browser" action:
- Set the parameters of the "Execute script" action:
In the script field set the parameters asThis is necessary because the script parameters are taken from the arguments variable.arguments[0]
In the script parameters, select a variable of the "String" type and write the value "Hello World!". - Set the parameters of the "Get the alert text" action:
- Set the parameters of the "Show Message" action:
- Start the robot.
Result
The robot completed successfully:
A message from the browser window is displayed on the screen:
Обзор
Инструменты контента