Function waitForSelector

  • Waits for a selector to become visible.

    Parameters

    • ctx: Context

      Context object.

    • selector: string

      the selector to wait for.

    • Optionaloptions: WaitForSelectorOptions

      Wait for selector options.

    Returns Promise<null | ElementHandle<Node>>

    await waitForSelector(ctx, '#save-button');
    await waitForSelector(ctx, '//button[@id="save-button"]'); // Supports XPath