IWebDriverExtensionsCloseAlert Method
Instructs to close the current alert modal dialog window present in the current IWebDriver.
Namespace: DevCase.ThirdParty.Selenium.Extensions.IWebDriverExtensionsAssembly: DevCase.net48.ThirdParty.Selenium (in DevCase.net48.ThirdParty.Selenium.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[EditorBrowsableAttribute(EditorBrowsableState.Always)]
public static void CloseAlert(
this IWebDriver drv,
bool acceptAlert
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Sub CloseAlert (
drv As IWebDriver,
acceptAlert As Boolean
)
Dim drv As IWebDriver
Dim acceptAlert As Boolean
drv.CloseAlert(acceptAlert)
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static void CloseAlert(
IWebDriver^ drv,
bool acceptAlert
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member CloseAlert :
drv : IWebDriver *
acceptAlert : bool -> unit
No code example is currently available or this language may not be supported.
- drv IWebDriver
-
The source IWebDriver.
- acceptAlert Boolean
-
Instructs to accept or dismiss the alert.
In Visual Basic and C#, you can call this method as an instance method on any object of type
IWebDriver. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
No code example is currently available or this language may not be supported.
Using svc As FirefoxDriverService = FirefoxDriverService.CreateDefaultService(),
drv As New FirefoxDriver(svc)
drv.Navigate().GoToUrl("https://www.domain.com/")
Dim isAlertPresent As Boolean = drv.isAlertPresent()
Console.WriteLine($"{NameOf(isAlertPresent)}: {isAlertPresent}")
If (isAlertPresent) Then
drv.CloseAlert(acceptAlert:=False)
End If
End Using
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.