Web Browser (Legacy) - Create session |
Declaration
<AMBROWSER ACTIVITY="attach" SESSION="text" BROWSER="text (options)" MATCHWINDOWURL="text" MATCHWINDOWTITLE="text" MATCHWINDOWHANDLE="text" />
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.
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'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:
- Make certain the window is open and in the foreground (in front of all other open windows).
- Drag and release the magnifier icon over the window. If the window is supported by this activity, a green border will appear around it.
-
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:
|
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 Automate as part of its URL. |
Example
- The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
- Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.
Description
This sample task attaches to a window called "Google - Internet Explorer" and then clicks the "I'm feeling lucky" button.
<AMBROWSER ACTIVITY="attach" SESSION="mySession" MATCHWINDOWTITLE="Google - Internet Explorer" />
<AMBROWSER ACTIVITY="click" HTMLNAME="btnI" USEMATCH="2" SESSION="mySession" />