Skip to main content

Advanced GUI Automation

Note: The Advanced GUI Automation is a step in Desktop plugin. However, it appears under the Scripting category in the Process Studio.

Description

Advance GUI Automation step is used to write a script for Desktop GUI automation workflow. Sometimes desktop control with access or locators doesn't react well as is unable to perform the action. At such times this step can be very useful to perform desktop element actions.

Advance GUI Automation automatically gets the desktop handle once it is placed after Desktop Start step in a workflow.

Configurations

No.Field NameDescription
Left Pane:
1Get Input FieldsBy clicking on this it will give a list of all input fields that can be used as a part of GUI Automation Script.
Code Snippets: Common Use
2Sample CodeDouble click Sample Code to populate quick start sample code in the GUI Automation Script right hand pane. Here you will find an example to make fields available to next step.

Partial pseudo code for making multiple fields available to next step,

var FieldName = "FieldName"; var FieldValue = "FieldValue";var FieldName2 = "FieldName2"; var FieldValue2 = "FieldValue2";java.lang.System.out.println( "<<>>"+FieldName+"::"+FieldValue+"<<>>;<<>>"+FieldName2+"::"+FieldValue2+"<<>>");
Implement Try-CatchQuick start sample for try-catch code.
Code Snippets:

Action APIs

Mouse Events: _xySample code to perform position based actions.
Mouse Events: _clickSample code to perform click action.
Write to Console:
Write Value to ConsoleThis option allows you to create output fields from a Script which can be used in subsequent steps.
Right Pane:
3GUI Automation ScriptWrite the Script in the space provided.

Following, is a sample Script showing how to set value and click a button. In this case the code sets values of username and password and clicks a login button.

Windows Automation

\_setMode(\"WINDOWS\"); \_selectWindow(\"Sample Application\"); \_setValue \_textbox(\"username\"),"AutomationEdge"; \_setValue(\_passwprd(\"password\"),"AutomationEdge"); \_click(\_button(\"/Login/\"))

Browser Automation

\_setMode("BROWSER"); var $id=_launchNewBrowser("https://www.google.com/"); _wait(5000); _selectBrowser($id)_highlight(_div(0));_closeBrowser();

4Validate ScriptClick to validate the script. You will see an error message if there is any error in the script.
Configurations: Execution Mode
1Execution ModeSelect the mode of execution. Available options: Default Mode and Parallel Mode

Note: The fields in Browser and Applet section are available only if you select the Default Mode for execution. And the Parallel Mode Runtime Port (Default is 9999)* field is available if you select the Parallel Mode.

2Parallel Mode Runtime Port (Default is 9999)*Select or specify the runtime port number for the execution.
3Test ConnectionClick to verify if the connection to the port is happening or not.
Browse
4Enable Browser ModeSelect the checkbox if you want to enable the browser mode.
5Default Browser*Select the browser which you want as your default browser.

If you written a script a script without specifying the browser, then this selected browser will be used as the default browser.

Example:

\_setMode("BROWSER"); **var** \$id=\_launchNewBrowser(\"https://[www.google.com/](http://www.google.com/)\"); \_wait(5000); \_selectBrowser(\$id) \_highlight(\_div(0)); \_closeBrowser();

6Base URL*Select or specify the base URL which you want to get loaded upon browser start.Example: \_setMode("BROWSER"); **var** \$id=\_launchNewBrowser(null,"chrome"); \_wait(5000); \_selectBrowser(\$id) \_highlight(\_div(0)); \_closeBrowser();
Applet ConfigurationThe setting must be same as those set in the AutomationEdge Desktop Spy dialog.
Use the Enable Applet Mode option if you want to perform applet automation using GUI-Automation and Desktop automation.
1Enable Applet ModeSelect the checkbox if you want to enable the applet mode.
2Use Environment Variable For Java PathSelect the checkbox if you want to utilize the environment variable as the Java path.
3Environment Variable Name* or Java Path*Select or specify the environment variable name or the path where Java is stored.

Note: The Environment Variable Name * field is available if you select Use Environment Variable For Java Path checkbox. Else, it is available as Java Path*.

If you introduced a new Environment variable, then restart the PS or agent.

4BrowseClick to select the path of the Java folder to use in the Java Path field.
Use the Launch browser for Applet option if you want to perform applet automation using Desktop automation.
5Launch browser for AppletSelect the checkbox to launch the browser for the applet.

Note: Use the field to perform browser automation using WINDOWS mode.

6Browser Executable PathSpecify the path of the browser executable.

Note: To ensure that applet automation happens after browser automation, specify the path of Microsoft Edge or Internet Explorer executable.

7BrowseClick to select the path of the browser executable.
8URLSpecify the path of the site you want to capture through the workflow.
9Do Not Download URLsSpecify the URLs that you want to restrict from opening or downloading.