This commit is contained in:
louiscklaw
2025-02-01 01:59:56 +08:00
parent b3da7aaef5
commit 8719fe58b8
310 changed files with 6332 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
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