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,24 @@
Attribute VB_Name = "usage_frame"
Private Assert As New Selenium.Assert
Private Keys As New Selenium.Keys
Private Sub Handle_Frames()
Dim driver As New ChromeDriver
driver.Get "http://the-internet.herokuapp.com/nested_frames"
'switch to a child frame
driver.SwitchToFrame "frame-top"
Assert.Equals 3, driver.FindElementsByTag("frame").count
'switch to child frame of "frame-top"
driver.SwitchToFrame "frame-middle"
Assert.Equals "MIDDLE", driver.FindElementById("content").Text
'switch to the default content
driver.SwitchToDefaultContent
Assert.Equals 2, driver.FindElementsByTag("frame").count
'Stop the browser
driver.Quit
End Sub