Skip to content

Checkboxes

Interactions with input with attribute type="checkbox".

Reading the element

Getting the right element class for the xpath

my_check = web.checkbox('//*[id="myCheckbox"]')
type(my_check)
Output
fastrpa.core.elements.CheckboxElement

Try to get a CheckboxElement

my_check = web.checkbox('//*[id="myCheckbox"]')
type(my_check)
Output
fastrpa.core.elements.CheckboxElement

Reference

Get if it's checked

my_check.is_checked
Output
False

Set as checked

Only set the checkbox as checked/active.

my_radio.check()

Set as unchecked

Only set the checkbox as unchecked/inactive.

my_radio.uncheck()

Switch the value

Just switch the checkbox value. If it's checked, it will be unchecked, and vice versa.

my_radio.switch()