isChecked - web automation property
Web automation property that retrieves the state of a check box or radio button web control.
Applies to:
- Element
var checked = elementObj.isChecked;
Arguments:
- None.
Remarks:
-
Returns true if the checkbox or radio HTML element is checked, false otherwise.
This web automation property is useful when testing the value of a check-box or radio.
It can only be applied to automate <input type=radio> and <input type=checkbox> web controls, 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 | Check | Uncheck | nativeElement | tagName
©
2017 CodeCentrix Software. All rights reserved.