Web Browser - 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 Close browser 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 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 Create session or Open Web Browser activity. Numerous sessions are supported within a single task, however, since Web Browser actions are performed interactively (and not in the background), each session must run concurrently and not simultaneously in order 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 Open Web Browser activity.

Parameters

Browser

This activity comprises AutoMate'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)

No

Internet Explorer

BROWSER="Firefox"

The web browser in which to attach a session to. The available options are:

  • Internet Explorer - Attach a session to an existing Internet Explorer browser window.

  • Firefox - Attach a session to an existing Firefox browser window.

Session

Text

No

BrowserSession1

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 BrowserSession1.

Match by window title

Text

No

(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 (i.e. * 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 (i.e. * 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 (Uniform Resource Locator) specified. This parameter supports wildcard characters (i.e. * or ?). For example, entering *AutoMate* would include any browser displaying the word AutoMate as part of its URL.

 

Description

Error Causes

On Error

example

NOTE: The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description

This sample task attaches a session to an existing IE browser with the URL https://www.google.com/ and clicks the Google logo.

<AMBROWSER ACTIVITY="attach" SESSION="mySession" MATCHWINDOWURL="https://www.google.com/" />

<AMBROWSER ACTIVITY="click" HTMLID="hplogo" SESSION="mySession" />