Web
Browser - Select list item(s)
Declaration
<AMWEBBROWSER ACTIVITY="select_list_item" PATH="text" HTMLID="text" HTMLNAME="text" HTMLTAG="text" HTMLCONTENTS="text" USEMATCH="text" SESSION="text" BROWSER="text (options)" URL="text" EXTENSIONS="text" IEMODE="YES/NO" ACTION="text (options)" ITEMTEXT="text" ADDTOSELECTION="YES/NO" WAITFOR="YES/NO" MEASURE="text (options)" UNIT="text"><HTMLATTRIBUTE NAME="text" VALUE="text" /></AMWEBBROWSER>
Description
Selects items from a list view or list control on the currently active web browser web page.
- The Web Browser action is not backwards compatible with the Web Browser (Legacy) action.
- This activity is compatible with Chrome, Edge, and Firefox browsers only – Internet Explorer is not supported.
- The browser you specify must be updated to the latest version and installed on the target system to ensure the Web Browser action functions correctly.
- Unlike other session-based actions where sessions are optional, the use of a session in the Web Browser action is required as each created session explicitly links to a specific web browser instance. A session is created using the Web Browser - Create session or Web Browser - Open activity. Numerous sessions are supported within a single task, however, since Web Browser 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
See Description.
Parameters
Location
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Session name | Text | Yes | BrowserSession1 | SESSION="mySession" | Specifies
the name of an existing session to associate with this activity.
Numerous sessions can exist within a single task which allows activities
to be performed on several web browsers simultaneously. NOTE: Sessions are 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 |
Select browser | --- | --- | --- | --- | You can use Automate's Window
Dissection technology to facilitate
the discovery of existing windows and their controls. To select the target browser Automate's Window Dissection technology window:
To manually select the target browser window:
NOTE: This parameter does not contain markup and is only displayed in visual mode for task construction and configuration purposes. |
Browser | Text(options) | Yes | Chrome |
|
Specifies the
web browser to use with this activity. The following browsers are supported:
NOTE: Firefox does not require a separate extension to be installed with this version of the Web Browser action. |
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). |
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 ![]() NOTE:
|
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: Known limitations and required updates and configurations section. |
Locate HTML elements | --- | --- | --- | --- | The
following parameters relate to the specification of HTML elements
required to identify the object to use with this activity. To pinpoint an HTML element (in this case, the button to click):
To interact with a web page before selecting the desired element, (for example, open a menu to select a menu item):
Additional parameters become available, based on the element and its properties. You can further fine tune your selection by editing these parameters. NOTE:
|
Path within the document hierarchy | Text | No | (Empty) | PATH="/outer/inner/" | If the desired control is located within a floating frame, you can specify a frame hierarchy in this field. The specifier is a list of slash delimited frame identifiers (for example, "/outer_frame/inner_framer/"). |
Locate by identifier (best method) | Text | No | (Empty) | HTMLID="unique_ID" | If enabled, searches the specified unique ID of the target element. Specifying an element's unique identifier (where supported) is the fastest and most accurate method of locating an HTML element due to the fact that an ID must be unique within the HTML document. This parameter is disabled by default. |
Locate by name (certain elements) | Text | No | (Empty) | HTMLNAME="element_name" | If enabled, specifies the unique name identifying the target object to search. Specifying an element's unique name (where supported) is a fast and accurate method of locating an HTML element as an element name must be unique within the HTML document. This parameter is disabled by default. |
Locate by HTML tag | Text | Yes | (Empty) | HTMLTAG="tagName" | Specifies the start tag (or opening tag) identifying the target object to search. |
Locate by attributes (case-sensitive, all must match) | --- | --- | --- | --- | If enabled, uses attribute name/value pairs as search criteria. Attributes provide additional information about HTML elements. If this option is enabled, the parameters specified below become active. This parameter is disabled by default. |
Attribute name | Text | No | (Empty) | HTMLATTRIBUTE NAME="foo" VALUE="bar" | The name of the attribute to search for. Click Add to enter a new attribute name/value pair. To remove an existing name/value pair, highlight the proper row of data and then click Remove. |
Attribute value | Text | No | (Empty) | HTMLATTRIBUTE NAME="foo" VALUE="bar" | The value of the attribute to search for. Click Add to enter a new attribute name/value pair. To remove an existing name/value pair, highlight the proper row of data and then click Remove. |
Locate by content (not recommended, slow) | Text | No | (Empty) | HTMLCONTENTS="contents" | If
enabled, uses the specified textual and graphical content
between the start and end tags as search criteria.
This parameter is disabled by default. NOTE: This search method is exceedingly
slow. It is recommended to only use this method if all other methods are not applicable. |
Restrict to specific match | Number | No | (Empty) | USEMATCH="44" | If enabled, specifies which occurrence to use if there are multiple matches. For example, if five text boxes match and this parameter is set to "4", the activity is applied to the fourth text box. This parameter is disabled by default. |
Interaction
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Selection mode | Text (options) | Yes | Select first item with text |
|
Specifies how to identify the item(s) to select from a list view or list control. The available options are:
|
Text of item to select | Text | Yes, if Selection mode is set to Select first item with text, Select last item with text, or Select all items with text | (Empty) | ITEMTEXT="Menu" | Specifies the text of the item(s) to select from a list view or list control. This parameter is not case sensitive. |
Index of item to select | Text | Yes, if Selection mode is set to Select item at index | (Empty) | ITEMTEXT="5" | Specifies the index number of the item to select from a list view or list control. |
Add to existing selection | Yes/No | No | No | ADDTOSELECTION="YES" | If selected (YES), causes the item to be added to the current selection rather than replace it, similar to the effect of holding down the control key when selecting items in a list control. If disabled (NO, default), causes the item to replace the current selection. |
Wait for | Yes/No | No | No | WAITFOR="YES" | If selected (YES), the measurement and unit of time specified must expire before an item is selected from a list view or list control. |
Measurement of time (unlabeled) | Text (options) | Yes, if Wait for is selected | Milliseconds | MEASURE"=Seconds" | The measurement of time to use to wait before selecting an item from a list view or list control. This parameter is only available if the Wait for parameter is selected. |
Unit of time (unlabeled) | Text | Yes, if Wait for is selected | (Empty) | UNIT="10" | The unit of time to use to wait before selecting an item from a list view or list control. This parameter is only available if the Wait for parameter is selected. |
Additional notes
Using the Edge Browser with IE Mode enabled (Enable IE mode) in Automate: Known limitations and required updates and configurations
Known limitations
Required updates and configurations
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 page and then selects "Florida" from a list view.
<AMWEBBROWSER URL="https://www.seleniumeasy.com/test/basic-select-dropdown-demo.html" SESSION="BrowserSession1" BROWSER="chrome" />
<AMWEBBROWSER ACTIVITY="select_list_item" HTMLID="multi-select" SESSION="BrowserSession1" ACTION="first_selection" ITEMTEXT="Florida" ADDTOSELECTION="YES" WAITFOR="YES" MEASURE="seconds" UNIT="1" />