Table of Contents

Class SendKeys

Namespace
CSF.Screenplay.Selenium.Actions
Assembly
CSF.Screenplay.Selenium.dll

A ISingleElementPerformable which represents an actor pressing some keys whilst focussed upon a single HTML element.

public class SendKeys : ISingleElementPerformable, ICanReportForElement
Inheritance
SendKeys
Implements
Inherited Members

Remarks

This performable may be used to enter text into an element which supports it, such as an <input> or <textarea> element. It may also be used, with Selenium's Keys class, to send special keys such as the Enter key, directional Arrow keys and so on.

Constructors

SendKeys(string)

Initializes a new instance of the SendKeys class with the specified text.

public SendKeys(string text)

Parameters

text string

The text to enter into the element.

Methods

GetReportFragment(Actor, Lazy<SeleniumElement>, IFormatsReportFragment)

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

public ReportFragment GetReportFragment(Actor actor, Lazy<SeleniumElement> element, IFormatsReportFragment formatter)

Parameters

actor Actor

An actor for whom to write the report fragment

element Lazy<SeleniumElement>

The Selenium element 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<SeleniumElement>, CancellationToken)

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

public ValueTask PerformAsAsync(ICanPerform actor, IWebDriver webDriver, Lazy<SeleniumElement> element, CancellationToken cancellationToken = default)

Parameters

actor ICanPerform

The actor that is performing.

webDriver IWebDriver

The Selenium WebDriver provided from the actor's abilities.

element Lazy<SeleniumElement>

The single Selenium Element upon which this method should operate.

cancellationToken CancellationToken

An optional cancellation token by which to abort the performable.

Returns

ValueTask

A task which completes when the performable represented by the current instance is complete.