Table of Contents

Class ElementCollectionQuery<TResult>

Namespace
CSF.Screenplay.Selenium.Questions
Assembly
CSF.Screenplay.Selenium.dll

An implementation of IElementCollectionPerformableWithResult<TResult> which gets the value from an IQuery<T> upon each item within a collection of Selenium elements and returns their results.

public class ElementCollectionQuery<TResult> : IElementCollectionPerformableWithResult<TResult>, ICanReportForElements

Type Parameters

TResult

The type of the result returned by the query.

Inheritance
ElementCollectionQuery<TResult>
Implements
Inherited Members

Constructors

ElementCollectionQuery(IQuery<TResult>)

Initializes a new instance of the ElementCollectionQuery<TResult> class with the specified query.

public ElementCollectionQuery(IQuery<TResult> query)

Parameters

query IQuery<TResult>

The query to be used for retrieving the value from each Selenium element.

Methods

GetReportFragment(Actor, Lazy<SeleniumElementCollection>, IFormatsReportFragment)

Counterpart to GetReportFragment(Actor, IFormatsReportFragment) except that this method also offers a Selenium element collection.

public ReportFragment GetReportFragment(Actor actor, Lazy<SeleniumElementCollection> elements, IFormatsReportFragment formatter)

Parameters

actor Actor

An actor for whom to write the report fragment

elements Lazy<SeleniumElementCollection>

The Selenium elements for which the report is being written

formatter IFormatsReportFragment

A report-formatting service

Returns

ReportFragment

A human-readable report fragment.

Remarks

Please see the documentation for GetReportFragment(Actor, IFormatsReportFragment) for more information.

PerformAsAsync(ICanPerform, IWebDriver, Lazy<SeleniumElementCollection>, CancellationToken)

Counterpart to PerformAsAsync(ICanPerform, CancellationToken) except that this method also offers a Selenium WebDriver and element.

public ValueTask<IReadOnlyList<TResult>> PerformAsAsync(ICanPerform actor, IWebDriver webDriver, Lazy<SeleniumElementCollection> elements, CancellationToken cancellationToken = default)

Parameters

actor ICanPerform

The actor that is performing.

webDriver IWebDriver

The Selenium WebDriver provided from the actor's abilities.

elements Lazy<SeleniumElementCollection>

The single Selenium Element upon which this method should operate.

cancellationToken CancellationToken

An optional cancellation token by which to abort the performable.

Returns

ValueTask<IReadOnlyList<TResult>>

A task which exposes a strongly-typed 'result' value when the performable represented by the current instance is complete.