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 Check a checkbox present inside listbox

SandhyaSandhya Members
edited May 2014 in Sahi Pro
Hi,

I am trying to record and playback using Sahi Pro. In my application there are a set of checkboxes present inside the listbox. Kindly let me know how to click them. In Playback clicking of the check boxes is not working.

Source Code:

<td class="adminData">

<div id='os' class="ExpandTableContent" style="line-height: 21px; width: 248px;">
<div><input type="checkbox" name="SelectedRoleId" id="SelectedRoleId_7" value="7" /><label for="SelectedRoleId_7">Chairman</label><br/><input type="checkbox" name="SelectedRoleId" id="SelectedRoleId_3" value="3" checked="checked" /><label for="SelectedRoleId_3">DepartmentHead</label><br/><input type="checkbox" name="SelectedRoleId" id="SelectedRoleId_1" value="1" /><label for="SelectedRoleId_1">Employee</label><br/><input type="checkbox" name="SelectedRoleId" id="SelectedRoleId_5" value="5" /><label for="SelectedRoleId_5">Finance</label><br/><input type="checkbox" name="SelectedRoleId" id="SelectedRoleId_4" value="4" /><label for="SelectedRoleId_4">HR</label><br/><input type="checkbox" name="SelectedRoleId" id="SelectedRoleId_6" value="6" /><label for="SelectedRoleId_6">MD</label><br/><input type="checkbox" name="SelectedRoleId" id="SelectedRoleId_2" value="2" checked="checked" /><label for="SelectedRoleId_2">Supervisor1</label><br/><input type="checkbox" name="SelectedRoleId" id="SelectedRoleId_8" value="8" /><label for="SelectedRoleId_8">Supervisor2</label><br/></div>
</div>
</td>


Thanks

Answers

  • SadanaSadana Members
    What kind of code did you got while recording the execution?

    When trying to click checkbox you have to know what is the preconditions of the checkbox. If it's already in the condition "checked", then you have to use _uncheck to remove the checking.
    If the condition is not checked, then you have to use _check to add checking.
    If you are trying to use _check to the checkbox which has already condition "checked" then nothing happens.
Sign In or Register to comment.