Press
Hierarchy
Index
Methods
staticthe
Instantiates an interaction that instructs the actor to press a sequence of keys,
When no
field
is specified, the key sequence will be sent to the currently focused element, and if no element is focused - to thedocument.body
to handle.Parameters
Returns Activity & { in: (field: Answerable<PageElement<any>>) => Interaction }
instantiationLocation
Returns the location where this Activity was instantiated.
Returns FileSystemLocation
toString
Generates a human-friendly description to be used when reporting this Activity.
Note: When this activity is reported, token
#actor
in the description will be replaced with the name of the actor performing this Activity.For example,
#actor clicks on a button
becomesWendy clicks on a button
.Returns string
in
Send the key sequence to a specific element.
Parameters
field: Answerable<PageElement<any>>
Returns Interaction
performAs
Instructs the provided Actor to perform this Interaction.
Learn more
Parameters
actor: UsesAbilities & AnswersQuestions
Returns Promise<void>
Instructs an actor who has the ability to BrowseTheWeb to send a key press or a sequence of keys to a Web element.
Note: On macOS, some keyboard shortcuts might not work with the
devtools
protocol.For example:
C
, use Key.Control+Key.InsertX
, use Key.Control+Key.DeleteV
, use Key.Shift+Key.InsertExample widget
Lean Page Object describing the widget
Pressing keys
Learn more