By
Index
Constructors
Methods
Constructors
constructor
Returns By
Methods
staticcss
Locates a PageElement using a CSS selector.
Parameters
selector: Answerable<string>
Returns Question<Promise<ByCss>>
staticcssContainingText
Locates a PageElement with a given
innerText
using a CSS selector.Parameters
selector: Answerable<string>
text: Answerable<string>
Returns Question<Promise<ByCssContainingText>>
staticdeepCss
Locates a PageElement using a CSS selector capable of piercing shadow DOM-piercing
Parameters
selector: Answerable<string>
Returns Question<Promise<ByCss>>
staticid
Locates a PageElement using its id.
Parameters
selector: Answerable<string>
Returns Question<Promise<ById>>
statictagName
Locates a PageElement using the name of its HTML tag.
Parameters
selector: Answerable<string>
Returns Question<Promise<ByTagName>>
staticxpath
Locates a PageElement using an XPath selector.
Parameters
selector: Answerable<string>
Returns Question<Promise<ByXPath>>
By
produces a Selector used to locate a PageElement or PageElements on a web page. Selectors can be defined using a static value or a Question 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