Web Browser (Legacy) - Create session

Declaration

<AMBROWSER ACTIVITY="attach" SESSION="text" BROWSER="text (options)" MATCHWINDOWURL="text" MATCHWINDOWTITLE="text" MATCHWINDOWHANDLE="text" />

Related Topics        

Description

Attaches a session to an open web browser instance and creates a unique session which can be used to combine various other browser-based activities. To end a session, use the Web Browser (Legacy) Close activity.

NOTE: Automation can be performed on Internet Explorer and Firefox browsers only. Firefox automation requires a separate extension which can be downloaded from here. The browser you specify must be installed on the target system to ensure that these activities function properly. Unlike other session-based actions in which sessions are optional, the use of a session in the Web Browser (Legacy) action is required due to the fact that each created session explicitly links to a specific web browser instance. A session can be created using the Web Browser (Legacy) Create session or Open activity. Numerous sessions are supported within a single task, however, since Web Browser (Legacy) actions are performed interactively (and not in the background), each session must run concurrently to avoid sending interactions to the wrong browser window.

Practical usage

Mainly used to attach a session to an already open browser window matching the specific criteria. To open a web browser as well as create a session, use the Web Browser (Legacy) Open activity.

Parameters

Browser

This activity comprises Automate Desktop's Window Dissection technology to facilitate the discovery of existing windows and their controls. To select certain elements that should match an open browser window in which to attach a session to:

  1. Make certain the window is open and in the foreground (in front of all other open windows).
  2. Drag and release the magnifier icon over the window. If the window is supported by this activity, a green border will appear around it.
  3. Upon releasing the icon, identified window properties are populated onto the editor.

Property Type Required Default Markup Description
Browser Text(options) Yes Internet Explorer BROWSER="Firefox" The web browser in which to attach a session to. The following browsers are supported with this activity:
  • Internet Explorer
  • Firefox
Session name Text Yes BrowserLegacySession1 SESSION="mySession" The name of the session that should be created. A session explicitly links to a specific web browser instance. In order to automate a series of web browser steps,  subsequent activities must be linked to this session. The default session name is BrowserLegacySession1.
Match by window title Text Yes (Empty) WINDOWTITLE="*Explorer" If enabled, indicates that the session will be attached to an open browser window matching the specified window handle. If disabled, the window handle will be ignored. This parameter supports wildcard characters (that is, * or ?). For example, entering *Automate* would include any browser with the word Automate in its handle.
Match by window handle Number No (Empty) WINDOWHANDLE="555735" If enabled, indicates that the session will be attached to an open browser window matching the handle specified. If disabled, the window handle will be ignored. A window handle is numeric code that uniquely identifies an open window. This parameter supports wildcard characters (that is, * or ?).
Match by URL Text No (Empty) URL="555735" If enabled, indicates that the session will be attached to an open browser window matching the URL specified. This parameter supports wildcard characters (that is, * or ?). For example, entering *Automate* would include any browser displaying the word Automateas part of its URL.

Description

Error Causes

On Error

Example

NOTE:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Description

This sample task attaches to a window called "Google - Internet Explorer" and then clicks the "I'm feeling lucky" button.

Copy
<AMBROWSER ACTIVITY="attach" SESSION="mySession" MATCHWINDOWTITLE="Google - Internet Explorer" />
<AMBROWSER ACTIVITY="click" HTMLNAME="btnI" USEMATCH="2" SESSION="mySession" />