Function getElementByText

  • Returns an element based on its text content.

    Parameters

    • ctx: Context

      Context object.

    • text: string

      Text to search for.

    • Optional options: FilterOptions

      Options for filtering.

    Returns Promise<ElementHandle<Node>>

    The selescted element as an element handle.

    Example

    const $el = await getElementByText(ctx, 'Save and Submit');
    

    Example

    const $el = await getElementByText(ctx, 'Last Name', {filterElementWithTag: 'div'});
    

Generated using TypeDoc