Execute Java Script

It activity allows you to perform automation of controls on a web page where a Java script is present. It can be helpful in scenarios where any of the controls on a web page do not get automated using the web application automation method.

The Execute Java Script activity can be used only inside an Application activity where Application Type is set to WebApps.

Using Execute Java Script

1.    In the Canvas Tools pane, click Process Components to expand the tool and view the associated activities.

2.    Drag the Application activity and drop on to the Flowchart  designer  on the  Canvas.

3.    In the Application Type list, select the type of application you want to perform automation on.  The application type that has at least one application added to it appears in the list. See Admin Capabilities to know how to add application before using an activity.

4.    In the Select An Application list, select the web application you want to perform automation on. You can add a web application that is already configure in Automation Studio or add a new application at this level.

5.    Double click to open the  Application activity, drag the Execute JavaScript activity and drop inside the Application activity.

 

 

6.    In the Window Number field, enter the index of the window where you want to execute the Java script.

7.    In the Select Output list, select the parameter to assign the return value. YYou must define the parameter in the Parameter bar use this option.

8.    Click the (Edit Script) icon to open the Script Editor.

 

 

9.    In the Script Writer dialog box, enter the Java script you want to run on the web page.

10.  Click CONFIRM.

The Execute JavaScript activity gets created with a default name

Execute JavaScript Properties

The properties of Execute JavaScript activity are listed in the following table and can be edited in the Property grid on the right panel.


Property Name

Usage

Control Execution

Ignore Error

When this option is set to Yes, the application ignores any error while executing the activity.

If set to NA, it bypasses the exception (if any) to let the automation flow continue; however, it marks the automation status as failure, in case of an exception.

By default, this option is set to No.

Delay

Wait After

Specify the time delay that must occur after the activity is executed. The value must be in milliseconds.

Wait Before

Specify the time delay that must occur before the activity is executed. The value must be in milliseconds.

Misc

Breakpoint

Select this option to mark this activity as the pause point while debugging the process. At this point, the process freezes during execution allowing you to examine if the process is functioning as expected.

In large or complex processes, breakpoints help in identifying the error, if any.

Commented

Select this option to mark this activity as inactive in the entire process. When an activity is commented, it is ignored during the process execution.

DisplayName

The display name of the activity in the flowchart designer. By default, the name is set as Application. You can change the name as required.

JavaScript

The Java script that you want to run on the web page.

WindowNumber

The index of the window where you want to execute the Java script. The index number starts with 0.

On This Page Hide

   

   Related Topics

Step-By-Step Guide to Use Execute Java Script to Extracting the Default Delivery