Table of Contents

Class UnhandledAlertException

Namespace
OpenQA.Selenium
Assembly
WebDriver.dll

The exception that is thrown when an unhandled alert is present.

public class UnhandledAlertException : WebDriverException, ISerializable
Inheritance
UnhandledAlertException
Implements
Inherited Members

Constructors

UnhandledAlertException()

Initializes a new instance of the UnhandledAlertException class.

public UnhandledAlertException()

UnhandledAlertException(SerializationInfo, StreamingContext)

Initializes a new instance of the UnhandledAlertException class with serialized data.

protected UnhandledAlertException(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

The SerializationInfo that holds the serialized object data about the exception being thrown.

context StreamingContext

The StreamingContext that contains contextual information about the source or destination.

UnhandledAlertException(string)

Initializes a new instance of the UnhandledAlertException class with a specified error message.

public UnhandledAlertException(string message)

Parameters

message string

The message that describes the error.

UnhandledAlertException(string, Exception)

Initializes a new instance of the UnhandledAlertException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public UnhandledAlertException(string message, Exception innerException)

Parameters

message string

The error message that explains the reason for the exception.

innerException Exception

The exception that is the cause of the current exception, or null if no inner exception is specified.

UnhandledAlertException(string, string)

Initializes a new instance of the UnhandledAlertException class with a specified error message and alert text.

public UnhandledAlertException(string message, string alertText)

Parameters

message string

The message that describes the error.

alertText string

The text of the unhandled alert.

Properties

Alert

Gets the IAlert that has not been handled.

[Obsolete("Use the AlertText property to get the alert of an already dismised alert, or use SwitchTo().Alert() to handle an unhandled alert.")]
public IAlert Alert { get; }

Property Value

IAlert

AlertText

Gets the text of the unhandled alert.

public string AlertText { get; }

Property Value

string

Methods

GetObjectData(SerializationInfo, StreamingContext)

Populates a SerializationInfo with the data needed to serialize the target object.

public override void GetObjectData(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

The SerializationInfo that holds the serialized object data about the exception being thrown.

context StreamingContext

The StreamingContext that contains contextual information about the source or destination.