CheckedHTML
Web function.
The CheckedHTML function retrieves the state of the specified check box or radio button in an HTML form. Not available in WinTask Lite.
Usage
Mainly used for testing purposes when you need to check that your Web site is displayed as expected.
Syntax
ret=CheckedHTML(<html_descriptor>)
Parameters
<html_descriptor>, HTML descriptor of the check box or radio button to check in the HTML form. See Remarks for finding this HTML descriptor.
Return value
Ret, numeric return code. When the specified check box or radio button is checked, the function returns 1 ; otherwise it returns 0. If the HTML object to test is not recognized as a check box or radio button, or the object is not there, or the descriptor is invalid or no UsePage is done before, the return code is -1. You can use ExistHTMLElement statement before in order to ensure that the object exists.
Remarks
For finding the <html_descriptor> for the checkbox/radio button, use Recording mode and record the action of checking the box. Stop Recording mode, the generated line ClickHTMLElement contains the html descriptor, copy and paste the generated html descriptor within the CheckedHTML statement and delete the ClickHTMLElement line.
CheckedHTML does not include any synchronization ; a UsePage must be used before to be sure that the checkbox is ready.
Examples
StartBrowser("IE","http://www.wintask.com/demos/form.htm",3)
UsePage("Form")
'Is the Urgent request checkbox checked?
ret=CheckedHTML("INPUT CHECKBOX[NAME= 'contactsoon']")
msgbox(ret)
'Now check the checkbox
ClickHTMLElement("INPUT CHECKBOX[NAME= 'contactsoon']")
'And check again its status using CheckedHTML
ret=CheckedHTML("INPUT CHECKBOX[NAME= 'contactsoon']")
msgbox(ret)
CloseBrowser()
StartBrowser("FF","http://www.wintask.com/demos/form.htm",3)
UsePage("Form")
'Is the Urgent request checkbox checked?
ret=CheckedHTML("INPUT CHECKBOX[NAME= 'contactsoon']")
msgbox(ret)
'Now check the checkbox
ClickHTMLElement("INPUT CHECKBOX[NAME= 'contactsoon']")
'And check again its status using CheckedHTML
ret=CheckedHTML("INPUT CHECKBOX[NAME= 'contactsoon']")
msgbox(ret)
CloseBrowser()