I've written a script using vba with selenium. Firstly it gets to the main page then placing the word "pump" in the search input and finally select them all by ticking in the checkbox. It is working fine until it comes to select the checkbox. However, upon reaching that line, it throws an error "element not visible". Apparently, it seems that I did nothing wrong. I would be very happy if somebody points out what I'm missing here:
Sub table_data()
Dim driver As New WebDriver
With driver
.Start "chrome", "http://apps.tga.gov.au/Prod/devices"
.get "/daen-entry.aspx"
.Wait 3000
.FindElementById("disclaimer-accept").Click
.Wait 3000
.FindElementById("medicine-name").SendKeys ("pump")
.Wait 5000
.FindElementById("medicines-check-all").Click ''element not visible here
.Wait 3000
End With
End Sub
Html elements for the section where element should be stored:
<span id="medicine-widget-header-wrapper">
<span id="medicine-widget-header">
<label title="Select all">
<input type="checkbox" class="medicines-check-all">
<span id="medicines-header-text">Devices found for 'pump...'</span>
</label>
<span id="medicine-selected-count">None selected</span>
</span>
</span>
Here is the link:
"medicines-check-all"is not an ID, but class name