froglogic / All / Squish tip of the week: How to determine if a checkbox is checked?

Squish tip of the week: How to determine if a checkbox is checked?

You can check the state of a checkbox, radio button, or the property of any other object or widget using Squish.

Using a Verification Point

The line below looks at the object :Controls.My_CheckBox and indicates if the verification point passed or failed: passed if the checkbox is checked, and failed if the checkbox isn’t checked:":Controls.My_CheckBox").checked, True)

Using <object>.<property>

You can also save an object’s properties to a variable, and access the properties in your script. The example below saves the object’s properties to checkBoxToVerify, after which it logs a message indicating if the checkbox is checked or unchecked:

checkBoxToVerify = waitForObject(":Controls.My_CheckBox")
if checkBoxToVerify.checked:
    test.log("Checkbox already checked")
    test.log("Checkbox not checked")


What “” to check if a radio button is selected or not

    In the case of Qt, it is the same property, checked.


Using above script, I m getting an error.

Detail AttributeError: ‘void’ Squish object has no attribute ‘checked’

Which package i need to import OR how to resolve that?


Just wondering how to go about verifying tri-state check boxes? From what I can see the checkState is not a property so I’m unsure how to query it in Squish.

Leave a Reply

Your email address will not be published. Required fields are marked *

Copy link
Powered by Social Snap