18 January 2026:


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.

How to select all the checkboxs

SSSS Members
edited November -1 in Sahi - Open Source
I want to check all the checkboxes on the page for that ... `I tried
< browser >
function SetAllCheckBoxes()
{
checkboxes = document.getElementsByTagName('checkbox');
for(var i in checkboxes)
checkboxes[ i ].checked = true;
}
< / browser >
_call(SetAllCheckBoxes());

but checkboxes are not changing its state. please correct me where ever I am wrong

Comments

  • Hi SS,

    You can use this:
    <browser>
    function checkAll(){
    var $checkbxs = document.getElementsByTagName('input');
    for(var $i=0; $i<$checkbxs.length; $i++){
    if($checkbxs[$i].type=="checkbox")
    _check($checkbxs[$i]);
    }
    }
    </browser>
    _call(checkAll());
    

    Regards
    Sumitra
Sign In or Register to comment.