externalBy
Index
Constructors
Methods
Constructors
externalconstructor
Returns By
Methods
staticexternalcss
Locates a
PageElement
using a CSS selector.Parameters
externalselector: Answerable<string>
Returns Question<Promise<ByCss>>
staticexternalcssContainingText
Locates a
PageElement
with a giveninnerText
using a CSS selector.Parameters
externalselector: Answerable<string>
externaltext: Answerable<string>
Returns Question<Promise<ByCssContainingText>>
staticexternaldeepCss
Locates a
PageElement
using a CSS selector capable of piercing shadow DOM-piercingParameters
externalselector: Answerable<string>
Returns Question<Promise<ByCss>>
staticexternalid
Locates a
PageElement
using its id.Parameters
externalselector: Answerable<string>
Returns Question<Promise<ById>>
staticexternaltagName
Locates a
PageElement
using the name of its HTML tag.Parameters
externalselector: Answerable<string>
Returns Question<Promise<ByTagName>>
staticexternalxpath
Locates a
PageElement
using an XPath selector.Parameters
externalselector: Answerable<string>
Returns Question<Promise<ByXPath>>
By
produces aSelector
used to locate aPageElement
orPageElement
on a web page. Selectors can be defined using a static value or aQuestion
to be resolved at runtime.Defining a selector using a static value
Defining a selector using a Question
Each method on this class accepts an
Answerable
to allow for dynamic resolution of the selector. This can be useful when the selector is not known at the time of writing the test, or when the selector needs to be calculated based on the state of the system under test.The example below demonstrates how to use
q
to define a selector that includes a dynamic value.Learn more
PageElement
PageElement
q