Check - web automation method
Sets the checked state of a radio or checkbox web control to true. All necessary HTML events are fired up to simulate user's behavior
Applies to:
- Element
radioOrCheckboxObj.Check();
Arguments:
-
None.
Remarks:
-
The method selects a checkbox or radio by simulating a click on the HTML web control using hardware or Internet Explorer events,
depending on useHardwareInputEvents property. If the element is already checked, the method returns immediately. The method can only be
applied to <input type=radio> and <input type=checkbox> elements, otherwise a web macro exception is thrown and the lastError
property is set to INVALID_OPERATION_ERROR.
Example:
var coreObj = new ActiveXObject("OpenTwebst.Core");
var newBrowser = coreObj.StartBrowser("http://www.google.ro");
var radio = newBrowser.FindElement("input radio", "");
if (!radio.isChecked)
{
radio.Check();
}
See also:
- Element | Click | isChecked | Uncheck | useHardwareInputEvents
©
2017 CodeCentrix Software. All rights reserved.