Web Browser (Legacy) - Open |
Declaration
<AMBROWSER URL="text" SESSION="text" WINDOWCLASSVARIABLE="text" WINDOWTITLEVARIABLE="text" WINDOWHANDLEVARIABLE="text" RESULTDATASET="text" />
Description
Opens a web browser at the specified URL and establishes a session in which to correlate subsequent browser-related steps. This activity can detect when a webpage is finished loading before moving onto the next step. To end a session, use the Web Browser (Legacy) Close activity.
Practical Usage
Commonly used to open a web browser in order to start an automated task that will interact with it.
Parameters
Browser
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Browser | Text (options) | Yes | Internet Explorer |
|
The browser to open. The following options are available:
|
Page URL | Text | Yes | (Empty) | URL="www.google.com" | The URL of the web page to open (for example, www.helpsystems.com or https://www.helpsystems.com). |
Create a new session (automation-supporting browsers only) | 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. NOTE: Sessions are supported in Internet Explorer and Firefox browsers
only. |
Advanced
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Wait until page is completely loaded | Yes/No | No | Yes | FINISHLOADING="NO" | If
selected (default), this activity will wait for the web page
specified in the Page URL
parameter to be completely loaded before continuing to the next
step. If disabled, this activity will continue to the next step
without waiting. Set this parameter to YES if the following step
requires interaction with the web page. NOTE: Only supported in Internet Explorer and Firefox browsers. |
Populate variable with window class | Text | No | Disabled | WINDOWCLASSVARIABLE="theClass" | If
enabled, specifies the name of an existing variable to populate
with the window class of the browser window to open. This parameter
is disabled by default. NOTE: Only supported in Internet Explorer and Firefox browsers. |
Populate variable with window handle | Text | No | Disabled | WINDOWHANDLEVARIABLE="theHandle" | If
enabled, specifies the name of an existing variable to populate
with the window handle of the browser window to open. This parameter
is disabled by default. NOTE:
Only supported in Internet Explorer and Firefox browsers. |
Create and populate dataset with window information. | Text | No | Disabled | RESULTDATASET="theDataset" | The
dataset to be created and populated with information about the
browser window that was opened. The list of dataset fields that
this activity creates are entered below under Datasets.
NOTE:
Only supported in Internet Explorer and Firefox browsers. |
Populate variable with window title | Text | No | Disabled | WINDOWTITLEVARIABLE="theTitle" | If
enabled, specifies the name of an existing variable to populate
with the window title of the browser window to open. This parameter
is disabled by default. NOTE: Only supported in Internet Explorer and Firefox browsers. |
Additional Notes
Datasets
A dataset is a multiple column, multiple row container object. This activity creates and populates a dataset containing a specific set of fields in addition to the standard dataset fields. The table below describes these fields (assuming the name of the created and assigned dataset is theDataset).
Name | Data Type | Return Value |
---|---|---|
theDataset.WindowClass | Text | Returns the class of the window that was opened. |
theDataset.WindowHandle | Number | Returns the unique handle of the window that was opened. |
theDataset.WindowTitle | Text | Returns the title of the window that was opened. |
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 opens a browser with www.google.com as the URL and displays the newly opened browser's window title, window handle and window class in a message dialog. The last step ends the session and closes the web browser.
<AMVARIABLE NAME="theHandle" />
<AMVARIABLE NAME="theClass" />
<AMVARIABLE NAME="theTitle" />
<AMBROWSER URL="www.google.com" SESSION="mySession" WINDOWCLASSVARIABLE="theClass" WINDOWTITLEVARIABLE="theTitle" WINDOWHANDLEVARIABLE="theHandle" />
<AMSHOWDIALOG WINDOWTITLE="Browser Window Properties">Title of browser window - %theTitle%Class of browser window - %theClass%Handle of browser window - %theHandle%</AMSHOWDIALOG>
<AMBROWSER ACTIVITY="close" SESSION="mySession" />