Files
louiscklaw 8719fe58b8 update,
2025-02-01 01:59:56 +08:00

23 lines
519 B
QBasic

Attribute VB_Name = "usage_checkbox"
Private Assert As New Selenium.Assert
Private Sub Handle_Checkbox()
Dim driver As New ChromeDriver
driver.Get "http://the-internet.herokuapp.com/checkboxes"
'Get the 2 second checkbox
Dim cs As WebElement
Set cb = driver.FindElementByCss("#checkboxes input:nth-of-type(2)")
'Assert the checkbox is checked
Assert.True cb.IsSelected
'Uncheck the checkbox
cb.Click
'Assert the checkbox is unchecked
Assert.False cb.IsSelected
driver.Quit
End Sub