Web Browser - Open

Declaration

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

See Also

Web Browser - Browser State, Web Browser - Close, Web Browser - Extract Table, Web Browser - Get Value, Web Browser - Set Value

Description

Opens a web browser at the specified URL and establishes a session for use with subsequent web browser related activities. This allows several web browser operations to be performed simultaneously within a single task (IE only).

NOTE: Only one Firefox window can be open at any time. This indirectly affects the number of simultaneous sessions supported by Firefox. Internet Explorer has no such limitation.

 

IMPORTANT: AutoMate supports Internet Explorer automation out-of-the-box; Firefox automation requires a separate extension, which can be downloaded from here. Additionally, the browser you specify must be installed on the target system to ensure that these activities function properly.

Practical Usage

Commonly used to start an automated task that will interact with a web browser.

Parameters

Browser Properties

Property

Type

Required

Default

Markup

Description

Browser

Text (options)

No

Internet Explorer

BROWSER="firefox"

The browser that will be used to perform this activity. The available options are:

  • Default Browser - Use the default browser specified by your system. Note that selecting this option disables automation, even if the default browser is Firefox or IE. To enable automation, you must select Internet Explorer or Firefox explicitly.  

  • Internet Explorer (Default) - Use Internet Explorer browser.

  • Firefox - Use Firefox browser. Note that Firefox automation requires the AutoMate Firefox Automation Extension which can be downloaded here.

  • Chome - Use Chrome browser. This browser does not support automation.

  • Safari -  Use Safari browser. This browser does not support automation.

Page URL

Text

Yes

(Empty)

URL="www.google.com"

The URL (Uniform Resource Locator) of the web page to open.

Create a new session (automation-supporting browsers only)

Text

No

BrowserSession1

SESSION="MySession"

The session name that should be created. Subsequent browser activities can be linked to this session during runtime. Numerous sessions can exist within a single task allowing several browser operations to be performed simultaneously.

NOTE: Sessions are supported in Internet Explorer and Firefox browsers only.

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 browse rwindow  to open. This parameter is disabled by default.

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 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 datasets that this activity creates are entered below under Additional Notes.

NOTE: Only supported in Internet Explorer and Firefox browsers.

 

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties allows you to instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

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

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.

Expressions, Variables and Functions

All text fields allow the use of expressions such as variables, functions or AutoMate extended functions, which can be entered by surrounding the expression in percentage signs (example: %FileDateTime(myVar)% or %myVar%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on function

More on extended functions
More on the expression builder

Example

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

 

Description: This sample task opens a Network Automation product order site, clicks the AutoMate 7 order form button and extracts an HTML table displaying the differences between Professional and Premium Editions. Thereafter, it closes the web browser, ending the session.

 

<AMBROWSER URL="https://www.networkautomation.com/order/add_items.php?orderid=14CFED224985D678" />

<AMBROWSER ACTIVITY="click" HTMLID="startAM7" />

<AMBROWSER ACTIVITY="state" WAITTIME="3" />

<AMBROWSER ACTIVITY="extable" RESULTDATASET="theTable" HTMLTAG="TABLE"><HTMLATTRIBUTE NAME="className" VALUE="prdCmpr" /></AMBROWSER>

<AMBROWSER ACTIVITY="close" />

 

↑ Top of Page