Table of Contents

Class SeleniumElementCollection

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

An implementation of ITarget which represents a collection of native Selenium HTML elements.

public class SeleniumElementCollection : ITarget, IHasName, IReadOnlyList<SeleniumElement>, IReadOnlyCollection<SeleniumElement>, IEnumerable<SeleniumElement>, IEnumerable
Inheritance
SeleniumElementCollection
Implements
Inherited Members
Extension Methods

Remarks

It is perfectly acceptable for this collection to contain only a single element, or even to contain zero elements.

Constructors

SeleniumElementCollection(IReadOnlyCollection<IWebElement>, string)

Initializes a new instance of the SeleniumElementCollection class.

public SeleniumElementCollection(IReadOnlyCollection<IWebElement> elements, string name = null)

Parameters

elements IReadOnlyCollection<IWebElement>

A collection of native Selenium elements.

name string

An optional human-readable name which describes the collection of elements.

SeleniumElementCollection(IReadOnlyList<SeleniumElement>, string)

Initializes a new instance of the SeleniumElementCollection class.

public SeleniumElementCollection(IReadOnlyList<SeleniumElement> elements, string name = null)

Parameters

elements IReadOnlyList<SeleniumElement>

The list of elements.

name string

An optional human-readable name which describes the collection of elements.

Properties

Count

public int Count { get; }

Property Value

int

this[int]

public SeleniumElement this[int index] { get; }

Parameters

index int

Property Value

SeleniumElement

Name

Gets the human-readable name of the current object.

public string Name { get; }

Property Value

string

Remarks

null is strongly discouraged here. All types which implement IHasName should return a non-null response from this property.

Methods

GetEnumerator()

public IEnumerator<SeleniumElement> GetEnumerator()

Returns

IEnumerator<SeleniumElement>

ToString()

public override string ToString()

Returns

string