Function getText

Returns text from an element. For inputs use getValue instead.

const title = await getText(ctx, 'h1[id="title"]');
  • Parameters

    • ctx: Context

      Context object.

    • selector: string

      The element selector for which to return text.

    • Optionaloptions: GetValueOptions

    Returns Promise<null | string>

    Element text content as a string.