Table of Contents

Interface IElementCollectionPerformableWithResult<TResult>

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

Similar to IPerformableWithResult<TResult> but provides access to a Selenium WebDriver and a collection of Selenium elements.

public interface IElementCollectionPerformableWithResult<TResult> : ICanReportForElements

Type Parameters

TResult
Inherited Members

Remarks

This interface is specialised for performables which interact with collections of Selenium elements. It allows for the provision of some of the boilerplate to set up such a performable.

See IPerformableWithResult<TResult> for more information about how this interface would be used in general terms. In order to actually use implementations of this interface as performables, they should be wrapped in an SingleElementPerformableWithResultAdapter<TResult>.

Methods

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

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

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.