Web Browser (Legacy) - Open

Declaration

<AMBROWSER URL="text" SESSION="text" WINDOWCLASSVARIABLE="text" WINDOWTITLEVARIABLE="text" WINDOWHANDLEVARIABLE="text" RESULTDATASET="text" />

Related Topics        

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.

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

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
  • BROWSER="default"
  • BROWSER="firefox
  • BROWSER="chrome"
  • BROWSER="safari"
The browser to open. The following options are available:
  • Default Browser - Uses the default browser specified by your system. Note that selecting this option disables automation, even if default browser is Firefox or Internet Explorer. To enable automation, you must select Internet Explorer or Firefox explicitly from the Browser drop-down.  
  • Internet Explorer
  • Firefox - Requires the Automate Firefox Automation Extension.
  • Chrome - Automation is not supported.
  • Safari - Automation is not supported.
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.

Description

Error Causes

On Error

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

NOTE:
  • 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.

Copy
<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" />