I am trying to verify the state of a toggle button but I’m not sure how to. Let me know if you need more information.
Hi there, and thanks for posting in the Katalon community!
To help you faster, please review our guide on Katalon Recorder here: Katalon Recorder overview | Katalon Docs. Double-checking the steps and configurations might resolve the issue.
If the doc doesn’t help, feel free to provide more details, and a community member will assist you soon. Thanks for being a part of our community!
Best,
Albert Le
when you said state of the button you meant toggle button enabled/disabled?
@daric.tan WebUI.getAttribute(testObject,‘enabled’)
or
WebUI.verifyElementAttributeValue(testObject, ‘enabled’, ‘true’, 0)
Yes that is correct
So i would need to write a script for this
What part of Katalon recorder do i put this script
This instruction is applicable only to Katalon Studio. It does not apply to Katalon Recorder.
Can you review the HTML of the toggle button and see if there is an attribute of “checked”? If so, maybe:
Command: verifyChecked
Target: id=...
Edit: to review the HTML, you can right click on the toggle button and choose “Inspect” from the pop-up (do this a second time to get the specific object’s code), or use the F12 key to Open Dev-Tools and select the top left icon to do your inspection.
Then, look at the various attributes of your object. There may be an attribute is True or False, or On or Off, Checked or blank (not checked).