SelectList Method (ListBox ListView)

Class

ListBox and ListView.

Action

Selects one or more items in the extend-selection or multi-selection list, list box, or listview.

Availability

This functionality is supported only if you are using the Classic Agent.

Syntax

object.SelectList (lItems)
Variable Description
lItems The items to select. LIST OF LISTITEM.

Notes

  • You use SelectList to select a series of items in an extend-selection or multi-selection list. SelectList selects or unselects an item by scrolling the item into view and clicking it with the mouse.
  • For additional information on specifying lItems, see LISTITEM Data Type.
  • SelectList does not depend on the state of the list when it is called. When the function finishes executing, only the specified items are selected, regardless of what might have been selected before the call.
  • After selecting the list of items, Silk Test Classic verifies that the items were actually selected and generates the exception E_CONTROL_NOT_RESPONDING if they were not.
  • You cannot use this method with single-selection lists.
  • The SelectList method is not available in the ListViewEx class, which is the equivalent of the ListView class on the Open Agent. To achieve the same functionality for a listview on the Open Agent, use the Select method of the ListViewEx class.

Example

LIST OF STRING lsItems
lsItems = ({"fire", "water", "window"})
DialogBox1.Elements.SelectList (lsItems)