SelectRange - web automation method
IE automation method that selects a range of options in HTML multiple selection list-box web controls.
start_range is the text or the ordinal position of the first option in the range to be selected.
end_range is the text or the ordinal position of the last option in the range to be selected.
Any previous selection in the HTML web control is removed and the options between start_range and
end_range are selected.
Each of the two input parameters can be:
If the speciffied range is empty (no option matches the input parameters), 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 the limit of the range.
a string that represents the text pattern of the option to be the limit of the range..
* and ? wildcards are accepted in the text pattern.
If the IE automation 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 selecting the options is specified by the searchTimeout property. If loadTimeout is not zero, then the method waits the browser objects 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);
- AddSelection | AddSelectionRange | ClearSelection | Element | GetAllSelectedOptions | Select | selectedOption
2017 CodeCentrix Software. All rights reserved.