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
actorICanPerformThe actor that is performing.
webDriverIWebDriverThe Selenium WebDriver provided from the actor's abilities.
elementsLazy<SeleniumElementCollection>The single Selenium Element upon which this method should operate.
cancellationTokenCancellationTokenAn 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.