WebDriverSwitchToAlert Method
Switch focus to an alert on the page.

Namespace: Selenium
Assembly: Selenium (in Selenium.dll) Version: (
VB Usage
Dim instance As WebDriver
Dim timeout As Integer
Dim raise As Boolean
Dim returnValue As Alert

returnValue = instance.SwitchToAlert(timeout, 


timeout (Optional)
Type: SystemInt32
Optional timeout in milliseconds
raise (Optional)
Type: SystemBoolean
Optional - Raise an exception after the timeout when true

Return Value

Type: Alert
Focused alert
See Also