Select - web automation method

Browser automation method that selects options in HTML combo-box (drop-down) or list-box web controls.

Applies to:
Element
  elementObj.Select(item_to_select);
Arguments:
Remarks:
Any previous selection in the HTML drop-down / listbox control is removed.
The input parameter can be: If no option matches the input parameter, then a browser automation exception is thrown and the lastError property is set to NOT_FOUND_ERROR
If the browser automation method is applied to an Element that is not a combo-box (drop-down) or list-box control, then a browser automation 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.
Example:
// Assume nativeCombo is a <select> HTML element.
// Select the first item in the combo-box.
var coreObj = new ActiveXObject("OpenTwebst.Core");
var combo   = coreObj.AttachToNativeElement(nativeCombo);
combo.Select(0);
		
See also:
AddSelection | AddSelectionRange | Click | ClearSelection | Element | GetAllSelectedOptions | InputText | selectedOption | SelectRange

© 2017 CodeCentrix Software. All rights reserved.