AddSelection - web automation method
Adds options to the current selection in HTML multiple selection list-box web controls.
item_to_select is the text or the ordinal position of the option to be added to list-box selection.
The input parameter can be:
If no option matches the input parameter, then a script exception is thrown and the lastError property is set to NOT_FOUND_ERROR
- a number that represents the zero-based ordinal position of the option to be added to selection.
a string that represents the text pattern of the option to be added to selection.
If the pattern contains * and/or ? wildcards then all the options matching the pattern are added to selection.
If the method is applied to an Element that is not a multiple selection list-box web control, then a script exception is
thrown and the lastError property is set to INVALID_OPERATION_ERROR.
The time allocated for automating the options selection is specified by searchTimeout property. If loadTimeout is not zero, then the method waits the browser object to be completely loaded in the amount of time specified by the property.
If the timeout has expired the lastError property is set to LOAD_TIMEOUT_ERROR. In this case, if loadTimeoutIsError property is true, then a script exception is thrown.
// Assume nativeList is a <select multiple> HTML element.
// Select the first two items in the multiple selection list-box control.
var coreObj = new ActiveXObject("OpenTwebst.Core");
var list = coreObj.AttachToNativeElement(nativeList);
- AddSelectionRange | ClearSelection | Element | GetAllSelectedOptions | Select | selectedOption | SelectRange
2017 CodeCentrix Software. All rights reserved.