Table of Contents

Class CssSelector

Namespace
CSF.Screenplay.Selenium.Elements
Assembly
CSF.Screenplay.Selenium.dll

Concrete implementation of Locator which locates elements by a CSS selector value.

public class CssSelector : Locator, ITarget, IHasName
Inheritance
CssSelector
Implements
Inherited Members
Extension Methods

Constructors

CssSelector(string, string)

Initializes a new instance of the CssSelector class.

public CssSelector(string cssSelector, string name = null)

Parameters

cssSelector string

The CSS selector by which to locate elements.

name string

An optional human-readable name of the locator which describes the elements it matches.

Fields

AnyElement

Gets a CSS-based locator which matches all/any descendent elements.

public static readonly CssSelector AnyElement

Field Value

CssSelector

Remarks

This locator is equivalent to the CSS selector *, which matches any & all descendent elements.

BodyElement

Gets a CSS-based locator which matches the HTML body element.

public static readonly CssSelector BodyElement

Field Value

CssSelector

Remarks

This locator is equivalent to the CSS selector body, which matches the root of the rendered page.

Methods

GetDefaultName()

Gets a value for Name if none has been specified.

protected override string GetDefaultName()

Returns

string

A default name

GetLocator()

Gets the Selenium locator instance for finding HTML elements.

public override By GetLocator()

Returns

By

A Selenium By object used to locate elements.