I'm attempting to check a checkbox on a website.
Checkbox HTML:
<input name="ApplicationSearchGroupsSelect_0" title='Select "Basic Access - Computer Logon"' type="checkbox" value="1">
HTML Above Checkbox:
<form name="main" id="main" onkeypress="return imOnKeyPress(event)" action="?facesViewId=/app/page/screen/standard_search.jsp" method="post">
Code:
Set objinputs = aExplorer.document.getElementsByTagName("form")
For Each ele In objinputs
If ele.Name Like "ApplicationSearchGroupsSelect_0" And ele.Title Like "Select "Basic Access - Computer Logon"" Then
ele.Focus
ele.Click
ele.Selected = True
ele.Checked = True
ele.FireEvent "onkeypress"
End If
Next
Do While aExplorer.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
aExplorer.document.getElementById("main").FireEvent ("onkeypress")
Do While aExplorer.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Nothing happens when I try to run this code (no error message, code completes running and nothing is checked). Beyond firing the javascript event, trying to click the button, check the checkbox, make selected=true, I don't know how to click this checkbox and hours of scouring the web hasn't returned anything. I've also tried changing the value to 0,1,2 and nothing occurs.
Any ideas on how to check a checkbox outside of what I've tried? Thanks!
And ele.Title Like "Select "Basic Access - Computer Logon""would even compile. Double quotes within a string need to be escaped by putting two double quotes in a row, like this:And ele.Title Like "Select ""Basic Access - Computer Logon""" Then