Iam currently trying to automate a installing process, which I am doing with pywinautogui. I would like to check if a checkbox was checked (which is actually a button), because in some cases the checkbox is alreay checked and it would uncheck it if i pressed it again. is there any way i can figure the state?
app = Application().Start(cmd_line=u'installer.exe')
windowsformswindowappbarad = app[u'Installer']
windowsformswindowappbarad.wait('ready')
windowsformsbuttonappbarad = windowsformswindowappbarad.Button4
#print(checkbox.get_click_state())
windowsformsbuttonappbarad.click()
this is how the Checkbox looks like
Edit:
app = Application().Start(cmd_line=u'installer.exe')
windowsformswindowappbarad = app[u'Installer']
windowsformswindowappbarad.set_focus()
windowsformswindowappbarad.wait('ready')
checkbox_object = windowsformswindowappbarad.Button4()
if checkbox_object.get_toggle_state() == 0:
print("not set")
elif checkbox_object.get_toggle_state() == 1:
print("ein")