Forgive me if this is answered somewhere, I was not able to find it. I am very new to powershell. I am trying to check off a checkbox on a webpage but not having any luck. It seems like it should be straightforward. The code for the checkbox item I want to check is:
<input id="documentChkBx" type="checkbox" aria-label="Select all formats of all reports on this page, for download" onclick="cascadeCheckBox('documentChkBx',296)" checked="true"></input>
Clicking this checkbox selects a whole host of other checkboxes on the page for reports that I want. Even though the box is checked by default, the other reports are not checked, so I basically need to check the box twice, to deselect and then select.
What I have is:
$checkbx = $ie.Document.getElementsByTagName("input") |
where {$_.id -eq "documentChkBx"}
$checkbx.checked = $false
$checkbx.checked = $true
It just never seems to move off of the default no matter what I try. I have tried to use .click() but that hasn't worked for me either. Any help would be appreciated.