18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
checkbox ticked or not?
Hello,
I have a question for checkboxes? How do I know if a checkbox is already ticked or checked? do we have any function for this?? I only saw a _checkbox function but not sure how to check if ticked or not?
Thanks! Hope someone could help me.
I have a question for checkboxes? How do I know if a checkbox is already ticked or checked? do we have any function for this?? I only saw a _checkbox function but not sure how to check if ticked or not?
Thanks! Hope someone could help me.
This discussion has been closed.
Comments
_assert(_checkbox("id").checked) will assert if _checkbox is checked.
I am using the latest build V3.5 and trying to uncheck a checkbox using the _uncheckbox api, but it doesnot seem to work.
On running the script I get the Error as -
ERROR
ReferenceError: "_uncheckbox" is not defined. at Nov 17, 2011 10:52:25 A
Here's my uncheckbox usage
_uncheckbox("ctl00\$cpRoot\$chklCompanyTypes\$0");
Please help me figure out the issue.
Thanks in advance and apologies if its a stupid issue.
Jasmine.
There is no API called _uncheckbox();
You can use: _uncheck(checkBoxElement); //Unchecks the given checkbox. If already unchecked, this API does not do anything.
Also, _check(_checbox("checkboxId")); // will check it
_click(_checkbox("checkboxId")); // will toggle checked state
If you have to uncheck the checkbox then we you can make use of:
_uncheck(checkBoxElement);
Let me know if you face any problem.
Regards
Sumitra
I figured that out after I posted the issue but thanks for the help.
Regards,
Jasmine
I am trying to generate a separate report indicating the script and it status. Based on some of the posts I am using this code
function onScriptEnd()
{
_writeToFile(_scriptName() + ": " + _scriptStatus() + "\n", "C:\\Documents and Settings\\iqureshi\\sahi\\userdata\\scripts\\allresults.txt", false);
}
onScriptEnd();
but the newline doesnot seem to work.
I even tried /r option but still eveything gets written in the same line.
Please help
Regards,
Jasmine
Try the following Scirpt,
let us know if the problem persists.
Regards
Theeran.
It works.
Regards,
Jasmine