Amna
4 years agoOccasional Contributor
How to check the state of the checkbox?
In my test script there is a screen from which I have to check that either the checkbox is being checked or unchecked . If the checkbox state is checked then it should display the message that state is enabled otherwise checkbox have to be select through test script
See attached image for reference
Sorry but this is not clear for me.
You want to examine the value of a checkbox
And if the value is checked (true) then allow user to change the value.
That's what you need ?
To ask user to set a value you can use (quick and dirty code) :
let checkboxValue = myWebObject.checked; if (checkboxValue) { let result = MessageDlg("Choose value of the checkbox by hitting the Yes for true or No for False", mtConfirmation, MkSet(mbYes, mbNo), 0); myWebObject.checked = result == mrYes; }