Switch
Hierarchy
- Interaction
- Switch
Index
Methods
staticto
Instructs the Actor to switch the context for future activities to a Switchable, such as a Page or a PageElement.
Parameters
switchable: Answerable<Switchable>
Returns Switch
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
and
Instructs the Actor to switch the context for future activities to a Switchable, such as a Page or a PageElement, perform a sequence of
activities
, and then switch the context back.Parameters
rest...activities: Activity[]
A sequence of activities to perform
Returns Task
performAs
Parameters
actor: UsesAbilities & AnswersQuestions
Returns Promise<void>
Instructs an actor who has the ability to BrowseTheWeb to switch the context for future activities to a Switchable, such as a Page or a PageElement.
Please note that when the PageElement implementing Switchable represents an iframe, using Switch will result in switching the top-level browsing context to that iframe.
When the PageElement represents any other HTMLElement, using Switch sets
HTMLElement#focus
on the specified element. Assuming it can be focused.Note: The focused element is the element which will receive keyboard Press events by default.
Perform activities in the context of an iframe
Perform activities in the context of another page
Perform activities in the context of a focused page element
Learn more