Execute JS

Updated at:

1. Overview

Note

Prerequisites: Open New Web Page or Get Opened Web Page

This component executes a JavaScript script on a specified web page. It supports Chrome, Edge, and Internet Explorer (IE) browsers.

2. Inputs

Note

For details on each input, refer to the component panel in the visual editor.

3. Outputs

Note

For details on each output, refer to the component panel in the visual editor.

4. Usage example

4.1. Configuration example

  1. In the opened browser object field, select v_web_obj_1, which is the output from a prerequisite component (Open New Web Page or Get Opened Web Page).

  2. In the JavaScript script field, enter alert("Alibaba Cloud RPA test").

  3. Keep the default values for the advanced options.

4.2. Result

The component pops up an alert box in the Chrome browser.执行JS_1

5. Example flow

Build the flow

  1. In the Get Project Panel Information component, enter the name of the specified parameter from the parameter panel.

  2. Use the Open New Web Page component to open a Chrome browser and navigate to Baidu.

  3. In the Execute JS component, in the JavaScript script field, use the expression editor to enter alert("'''+v_project_param_value_1+'''").

image

Result

The flow opens the Baidu page in a Chrome browser and pops up an alert box on the page. The text for the alert box is retrieved from the parameter panel.