I am attempting to automate class registration.
The relevant section of HTML for the page displays as such:
<form id="SearchClasses" name="selectedStatusForm" action="/more/SearchClasses.action" method="post" class="checkboxButtonForm">
<input type="checkbox" name="enrollmentStatuses" value="E" checked="checked" id="enrolledCheckBox"/><input type="hidden" id="__checkbox_enrolledCheckBox" name="__checkbox_enrollmentStatuses" value="E" />
<script type="text/javascript">
var enrolledCheckBox = function()
{
var updateHiddenFields = function()
{
hiddenCheckbox.checked = button.get("checked");
}
var params = { label: "Enrolled", name : "enrollmentStatuses", type : "checkbox", value : "E" };
var onclick = function(){
updateHiddenFields();
YAHOO.mis.student.Topics.onEnrollmentFilterChangedEnrolledValue.fire();
};
params.onclick = {};
params.onclick.fn = onclick;
params.onclick.obj = null;
params.onclick.scope = false;
var button = new YAHOO.widget.Button("enrolledCheckBox", params );
var originalCheckedStatus = button.get("checked");
button.set("checked", true);
var hiddenCheckbox = button.createHiddenFields();
button.set("checked", originalCheckedStatus);
updateHiddenFields();
return button;
}();
</script>
There are also buttons under the same form with other values, but I am trying to select value "E". Given that each registration needs to be personalized to each student, the button is seen this way when logged into the page:
<tr id = "StudentCartList_classSectionListRow_0_header" class = "classRow">
<td class = "classSelection">
<input type = "hidden" name= "enrollmentRequestItems[0].classNumber" value="2000">
<input type = "hidden" name= "enrollmentRequestItems[0].waitList" class="waitListHidden" value= "false">
<div class = "enrollmentMenu Div">
<span id = "yui-gen26" class= "yui-button yui-menu-button enrollmentButton">
<span class = "first-child">
<button type= "button" id= "yui-gen26-button"> E </button>
</span>
</span>
<div id ="yui-gen27" class = "yui-module yui-overlay yuimenu yui-button-menu yui-menu-button-menu yui-overlay-hidden" style= "z-index: 1; position: absolute; visibility: hidden;">
</div>
</td>
<td id ="classNumber_2000" class= "classSection" onclick = "YAHOO.mis.student.Topics.showClassDetailPanel.fire({classNumber : '2072', termCode : '0955', hideAddToCartButton : 'false'})">
</td>
I don't know how to select the button. I've tried
driver.find_element_by_css_selector("input.checkboxButtonForm[value= 'E']").click();
I've also tried
selector = driver.find_element_by_name("enrollmentStatuses");
selector.click();
In the first case, the element was not found. In the second case, an "ElementNotInteractableException" was thrown.
I also thought that I might have to use the Javascript Executor, but in order to do that I'd have to select my "E" value from the button element first.
How should I proceed to successfully click the button? Thank you.