Table of Contents

Interface IAlert

Namespace
OpenQA.Selenium
Assembly
WebDriver.dll

Defines the interface through which the user can manipulate JavaScript alerts.

public interface IAlert

Properties

Text

Gets the text of the alert.

string Text { get; }

Property Value

string

Methods

Accept()

Accepts the alert.

void Accept()

Dismiss()

Dismisses the alert.

void Dismiss()

SendKeys(string)

Sends keys to the alert.

void SendKeys(string keysToSend)

Parameters

keysToSend string

The keystrokes to send.

SetAuthenticationCredentials(string, string)

Sets the user name and password in an alert prompting for credentials.

void SetAuthenticationCredentials(string userName, string password)

Parameters

userName string

The user name to set.

password string

The password to set.