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
Solved! Go to Solution.
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;
}
Un sourire et ça repart
Hi,
Examine this web element in the Object Browser and figure-out what property indicates the state.
This is because web page developers can use different web elements and techniques to output something that is rendered as a check-box.
Thanks Alex!
Hi @Amna ! Does this advice help?
Actually what I want that if the checkboxes already checked then we can display the message the its already checked you can modify your selection something like that
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;
}
Un sourire et ça repart
Subject | Author | Latest Post |
---|---|---|