Web Browser - Open
Declaration
<AMWEBBROWSER URL="text" BROWSER="text (options)" IEMODE="YES/NO" SESSION="text" EXTENSIONS="text" BROWSERCLOSE="YES/NO" WINDOWCLASSVARIABLE="text" WINDOWTITLEVARIABLE="text" WINDOWHANDLEVARIABLE="text" RESULTDATASET="text" USERPROFILE="text" />
Description
Opens a web browser at the specified URL and establishes a session where to correlate subsequent browser-related steps. This activity can detect when a web page is finished loading before moving onto the next step. To end a session, use the Web Browser - Close activity.
- The Web Browser action is not backwards compatible with the Web Browser (Legacy) action.
- Automation with the Web Browser action is only compatible with Internet Explorer, Chrome, Edge, and Firefox browsers.
- You must update the specified browser to the latest version and install it on the target system to ensure the Web Browser action functions correctly.
- Unlike other session-based actions where sessions are optional, the Web Browser action requires the use of a session as each created session explicitly links to a specific web browser instance (you can create a session using the Web Browser - Create session or Web Browser - Open activity). A single task can support numerous sessions; however, since Web Browser activities are performed interactively (and not in the background), each session must run concurrently to avoid sending interactions to the wrong browser window.
- For Chrome and Edge browsers, you must set the RemoteDebuggingAllowed policy to true to allow automation with this activity. For more information, see Known policy issue.
Practical usage
Used to open a web browser in order to start an automated task to interact with it.
Parameters
Browser
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Browser | Text (options) | Yes | Chrome |
|
Specifies the browser to open. The following options are available:
NOTE: Firefox does not require a separate extension to be installed with this version of the Web Browser action. |
Page URL | Text | Yes | (Empty) | URL="www.google.com" | The URL to use with this activity (for example, www.fortra.com or https://www.fortra.com). |
Enable IE mode | Yes/No | No | No | IEMODE="YES" | If selected, enables Internet Explorer (IE) mode which provides legacy support for Internet Explorer-based websites and applications in the Edge browser. This parameter becomes available when the Browser parameter is set to Edge and disabled by default. IMPORTANT: Before using the Enable IE mode parameter with your tasks, review the Using the Edge Browser with IE Mode enabled (Enable IE mode) in Automate Desktop: Known limitations and required updates and configurations section. |
Close after completion | Yes/No | No | No | BROWSERCLOSE="NO" | If selected, the web browser window automatically closes after task execution. If disabled, the window remains open after task execution to allow manual work to be performed in the window, if desired. This parameter is disabled by default. |
Create a new session (automation-supporting browsers only) | Text | Yes | BrowserSession1 | SESSION="mySession" | The
name of the session to create. 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. NOTE: Sessions are only supported in Internet Explorer, Chrome, Edge, and Firefox browsers
only. Firefox does not require a separate extension to be installed with this version of the Web Browser action. |
Advanced
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Wait until the page is completely loaded | Yes/No | No | Yes | FINISHLOADING="NO" | If
selected, this activity waits for the web page
specified in the Page URL
parameter to be completely loaded before continuing to the next
step. If disabled, this activity continues to the next step
without waiting. Set this parameter to YES if the following step
requires interaction with the web page. NOTE: This parameter is only supported in Internet Explorer, Chrome, Edge, 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: This parameter is only supported in Internet Explorer, Chrome, Edge, 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: This parameter is only supported in Internet Explorer, Chrome, Edge, and Firefox browsers. |
Create and populate dataset | Text | No | Disabled | RESULTDATASET="theDataset" | The
dataset to create and populate with information about the
browser window that was opened. For information regarding the individual dataset fields this activity creates, see Datasets.
NOTE: This parameter is only supported in Chrome, Edge, 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: This parameter is only supported in Internet Explorer, Chrome, Edge, and Firefox browsers. |
Load user profile | Text | No | Disabled | USERPROFILE="Person 1" | If enabled, specifies the existing user profile to load for Chrome and Firefox browsers. This parameter is disabled by default. NOTE: This parameter is only supported in Chrome, Edge, and Firefox browsers. |
Load extension(s) | Text | No | (Empty) | EXTENSIONS="C:\Users\User\Documents\AutoMate 2024 Tasks\settings.crx" | Specifies the path and file name of the Chromium-based browser extension file(s) (.crx) to load. This can be a fully
qualified path and file name, or a single file. Multiple files are specified by clicking the folder icon , and then selecting each desired file, or by manually entering and separating each path and file name with
a pipe character (|) (for example, c:\temp\*.crx|c:\backup\*.crx).
This parameter becomes available when the Browser parameter is set to Chrome or Edge. NOTE:
|
Additional notes
Known policy issue
If you experience automation issues with your web browser and this activity, see the following:
Policy name | Browser | Required setting | Description |
---|---|---|---|
RemoteDebuggingAllowed |
|
true | Issue:
If this policy is set to false, Automate Desktop will display the error message "Unable to determine browser version" while attempting to open or create a session with Chrome or Edge. Resolution: Set this policy to true to allow this activity to perform automation with Chrome or Edge. For more information on this policy, see:
|
Using the Edge Browser with IE Mode enabled (Enable IE mode) in Automate Desktop: Known limitations and required updates and configurations
Known limitations
Required updates and configurations
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
- 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 opens a web browser to www.google.com and then 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" VALUE="" />
<AMVARIABLE NAME="theClass" VALUE="" />
<AMVARIABLE NAME="theTitle" VALUE="" />
<AMWEBBROWSER URL="www.google.com" BROWSER="firefox" SESSION="BrowserSession1" 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>
<AMWEBBROWSER ACTIVITY="close" SESSION="BrowserSession1" />