Information in this topic applies only to web tests that implement the default approach. This method is not supported in cross-platform web tests. |
Description
Use the MultiSelect
action to select several items in the specified list box control.
Declaration
TestObj.MultiSelect(Items)
TestObj | A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section | |||
Items | [in] | Required | Variant | |
Result | None |
Applies To
The method is applied to the following objects:
Developer Express ASPxListBox, Developer Express CheckedListBox, Developer Express CheckListBox and 15 more objects, Developer Express ListBox, Ext JS Time Picker, Flash List, Flash TileList, Flex List, Java Swing List, Oracle Forms List, Qt ListWidget, Silverlight ListBox, Telerik RadListBox for WinForms, Telerik RadListControl for WinForms, Web List Box, Win32 ListBox, WPF ListBox, XUL Listbox « Collapse the list
View Mode
To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.
Parameters
The method has the following parameter:
Items
This parameter can be either of the following:
- An array containing captions or indexes of items to select. You can use “native” JavaScript, JScript, Python, VBScript and DelphiScript arrays as well as arrays created using the
CreateVariantArray
function. - A string holding the captions of items to select, separated by the
wListSeparator
characters. The default list separator is the pipe character.
Item captions can contain wildcard characters - * and ?. The asterisk (*) corresponds to a string of any length, the question mark (?) - to any single character. Captions can be case-sensitive or case-insensitive depending on the value of the Use case-sensitive parameters project setting.
Result Value
None.
Remarks
In order for this action to execute successfully, the control must support multiselection. If an item is not found or the control does not support multiselection, MultiSelect
fails and posts an error message to the test log.
-
Java Swing List: When you call the
MultiSelect
method, the previous selection is preserved. To deselect an item you should callSelectItem
with the SelOption parameter set to False. To deselect all list box items, callSelectItem(-1, False)
. -
Win32 ListBox: The list box must have the
LBS_MULTIPLESEL
orLBS_EXTENDEDSEL
style.Items
is a string containing the item names to be selected.If the list box style does not include
LBS_MULTIPLESEL
orLBS_EXTENDEDSEL
,MultiSelect
fails and posts an error message to the test log. -
Chrome browser: TestComplete may fail to record the
MultiSelect
method for web controls in Chrome. It will record ordinary coordinate clicks instead. You can replace those clicks with theMultiSelect
method in your tests manually.
Example
To view an example that demonstrates how to use the MultiSelect
action, see Selecting Multiple List Box Items.
See Also
Selecting a Single List Box Item
ClickItem Action (ListBox Controls)
DblClickItem Action (ListBox Controls)
SelectItem Action (ListBox Controls)