StrictModeViolationException Class

A locator finds more than one element where the action or the assertion needs exactly one (the strict mode of Playwright). Make the locator more specific, or use Locator.First, Locator.Last or Locator.Nth.

public sealed class StrictModeViolationException : Exception
Inheritance
Exception StrictModeViolationException

Constructors

NameDescription
StrictModeViolationException()Initializes a new instance of the StrictModeViolationException class.
StrictModeViolationException(string)Initializes a new instance of the StrictModeViolationException class.
StrictModeViolationException(string, Exception)Initializes a new instance of the StrictModeViolationException class.

StrictModeViolationException overloads

StrictModeViolationException()

StrictModeViolationException.cs

Initializes a new instance of the StrictModeViolationException class.

public StrictModeViolationException()

StrictModeViolationException(string)

StrictModeViolationException.cs

Initializes a new instance of the StrictModeViolationException class.

public StrictModeViolationException(string message)
Parameters
message string
The message.

StrictModeViolationException(string, Exception)

StrictModeViolationException.cs

Initializes a new instance of the StrictModeViolationException class.

public StrictModeViolationException(string message, Exception innerException)
Parameters
message string
The message.
innerException Exception
The inner exception.