I want to check the (SELECT ALL)
checkbox from the input dropdown menu. How could I do that? Here is the screenshot of the dropdown menu. The field's id next to the dropdown icon is rvrMain_ctl00_ctl09_ctl00
.
So far here is my code, but gave me no good result.
checkboxes = browser.find_elements_by_xpath("//input[@id='rvrMain_ctl00_ctl09_ctl00']")
for checkbox in checkboxes:
if not checkbox.is_selected():
checkbox.click()
Another try, but still no good result.
browser.find_element_by_xpath("//input[@id='rvrMain_ctl00_ctl09_ctl00']").click()
Any help will be much appreciated. Thanks and regards,
Arnold
EDIT
If I try to inspect the element of the field, here is the HMTL code:
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td nowrap="nowrap"><span style="font-family:Verdana;font-size:8pt;"><input id="rvrMain_ctl00_ctl09_ctl03_ctl00" name="rvrMain$ctl00$ctl09$ctl03$ctl00" onclick="MVClassrvrMain_ctl00_ctl09.SetAutoPostBackOnHide();MultiValidValuesSelectAll(this, 'rvrMain_ctl00_ctl09_ctl03');" type="checkbox"><label for="rvrMain_ctl00_ctl09_ctl03_ctl00">(Select All)</label></span></td>
</tr>
<tr>
<td nowrap="nowrap"><span style="font-family:Verdana;font-size:8pt;"><input id="rvrMain_ctl00_ctl09_ctl03_ctl01" name="rvrMain$ctl00$ctl09$ctl03$ctl01" onclick="MVClassrvrMain_ctl00_ctl09.SetAutoPostBackOnHide();OnClickMultiValidValue(this, document.getElementById('rvrMain_ctl00_ctl09_ctl03_ctl00'));" type="checkbox"><label for="rvrMain_ctl00_ctl09_ctl03_ctl01">148950 - PT. CATUR SENTOSA ADIPRANA - KOTABUMI</label></span></td>
</tr>
<tr>
<td nowrap="nowrap"><span style="font-family:Verdana;font-size:8pt;"><input id="rvrMain_ctl00_ctl09_ctl03_ctl02" name="rvrMain$ctl00$ctl09$ctl03$ctl02" onclick="MVClassrvrMain_ctl00_ctl09.SetAutoPostBackOnHide();OnClickMultiValidValue(this, document.getElementById('rvrMain_ctl00_ctl09_ctl03_ctl00'));" type="checkbox"><label for="rvrMain_ctl00_ctl09_ctl03_ctl02">148961 - PT. CATUR SENTOSA ADIPRANA - BANDAR LAMPUNG</label></span></td>
</tr>
--- the list keeps go on and on---
<tr>
<td nowrap="nowrap"><span style="font-family:Verdana;font-size:8pt;"><input id="rvrMain_ctl00_ctl09_ctl03_ctl203" name="rvrMain$ctl00$ctl09$ctl03$ctl203" onclick="MVClassrvrMain_ctl00_ctl09.SetAutoPostBackOnHide();OnClickMultiValidValue(this, document.getElementById('rvrMain_ctl00_ctl09_ctl03_ctl00'));" type="checkbox"><label for="rvrMain_ctl00_ctl09_ctl03_ctl203">320864 - PT. LIQUID KENCANA ABADI - NIAS</label></span></td>
</tr>
</tbody>
</table>
I want to select the checkbox with label (Select All)
.
EDIT
As suggested by Dillanm, I revised my code and it worked. Basically I have to click on the dropdown menu icon first, and then click on the one of the checkboxes. So here is the code:
browser.find_element_by_id('rvrMain_ctl00_ctl09_ctl01').click() # this one click on the dropdown menu icon
browser.find_element_by_id('rvrMain_ctl00_ctl09_ctl03_ctl00').click() # this one click on the checkbox, either uncheck or check