How to know the status of a checkbox

The way to detect if a checkbox is checked or not is different depending if you automate a process or if you test an application.

 

Task Automation

If the checkbox has the standard Window class "button", Recording mode records correctly the status of the checkbox, for instance in NotePad, in Find dialog box :

UseWindow("NOTEPAD.EXE|#32770|Find",1)

Click(Check,"Match &case",ON)

 

If the class is not the standard one , if you know well the application, you can see in Registry, in an .INI file what is the default value for the status of this checkbox, and so the status is known that way.

Another way to know the status of the checkbox is when the application reacts in a different way depending if the checkbox is checked or not (for instance, the window which is displayed after is different) : you test which window is displayed and so you know the status of the checkbox.

If none of this technique works, you can still use the one for a testing approach as described below.

 

Test

Since WinTask 2.6, use CheckedW function.