Skip to main content

PageElements <Native_Element_Type>

Uses the actorโ€™s ability to BrowseTheWeb to identify a group of Web elements located by Selector.

Learn more

Hierarchy

Implements

Index

Methods

staticlocated

as

  • as<O>(mapping: (answer: PageElement<Native_Element_Type>[]) => O | Promise<O>): QuestionAdapter<O>
  • Maps this question to one of a different type.

    Question.about('number returned as string', actor => '42')   // returns: QuestionAdapter<string>
    .as(Number) // returns: QuestionAdapter<number>

    Type parameters

    • O

    Parameters

    • mapping: (answer: PageElement<Native_Element_Type>[]) => O | Promise<O>

    Returns QuestionAdapter<O>

eachMappedTo

  • eachMappedTo<Mapped_Item_Type>(question: MetaQuestion<PageElement<Native_Element_Type>, Mapped_Item_Type | Promise<Mapped_Item_Type>>): List<Mapped_Item_Type>
  • Type parameters

    • Mapped_Item_Type

    Parameters

    • question: MetaQuestion<PageElement<Native_Element_Type>, Mapped_Item_Type | Promise<Mapped_Item_Type>>

    Returns List<Mapped_Item_Type>

forEach

  • forEach(callback: (current: CurrentItem<PageElement<Native_Element_Type>>, index: number, items: PageElement<Native_Element_Type>[]) => void | Promise<void>): Task
  • Parameters

    • callback: (current: CurrentItem<PageElement<Native_Element_Type>>, index: number, items: PageElement<Native_Element_Type>[]) => void | Promise<void>

    Returns Task

where

  • where<Answer_Type>(question: MetaQuestion<PageElement<Native_Element_Type>, Answer_Type | Promise<Answer_Type>>, expectation: Expectation<Answer_Type>): PageElements<Native_Element_Type>
  • Type parameters

    • Answer_Type

    Parameters

    • question: MetaQuestion<PageElement<Native_Element_Type>, Answer_Type | Promise<Answer_Type>>
    • expectation: Expectation<Answer_Type>

    Returns PageElements<Native_Element_Type>

count

  • count(): QuestionAdapter<number>
  • Returns QuestionAdapter<number>

first

  • first(): QuestionAdapter<PageElement<Native_Element_Type>>
  • Returns QuestionAdapter<PageElement<Native_Element_Type>>

last

  • last(): QuestionAdapter<PageElement<Native_Element_Type>>
  • Returns QuestionAdapter<PageElement<Native_Element_Type>>

nth

  • nth(index: number): QuestionAdapter<PageElement<Native_Element_Type>>
  • Parameters

    • index: number

    Returns QuestionAdapter<PageElement<Native_Element_Type>>

answeredBy

  • answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<PageElement<Native_Element_Type>[]>
  • Parameters

    • actor: AnswersQuestions & UsesAbilities

    Returns Promise<PageElement<Native_Element_Type>[]>

describedAs

  • describedAs(subject: string): PageElements<Native_Element_Type>
  • Parameters

    • subject: string

    Returns PageElements<Native_Element_Type>

toString

  • toString(): string
  • Returns string

of

  • Parameters

    Returns PageElements<Native_Element_Type>

Constructors

constructor

  • new PageElements<Native_Element_Type>(locator: Answerable<Locator<Native_Element_Type, any>>): PageElements<Native_Element_Type>
  • Type parameters

    • Native_Element_Type = any

    Parameters

    • locator: Answerable<Locator<Native_Element_Type, any>>

    Returns PageElements<Native_Element_Type>