How to combine IF statement with Get Attribute?


I’m trying to set up my script to click on a checkbox if it’s not already selected, otherwise we ignore the box.

How do I set up the syntax for my IF condition to read from the ‘Get attribute’ activity above so that the IF statement will select the check box ONLY if it’s unchecked? Capture

Thank you

Assign the output of the get attribute as a variable, say checkStatus. In the If condition, you can write if checkStatus = false, then do something.

Hey @Jerry_Jiang

The output of the checked attribute from get attribute will be a boolean value. So, for get attribute, add a boolean variable for the output. Then in the if condition, use the boolean variable only if you are looking for a true condition. If you are looking for a false condition use below

Check for false
Not booleanVariable

Check for true