Class Frame

Hierarchy

  • Target
    • Frame

Implements

Properties

id: string

Methods

  • Parameters

    • s: string
    • options: SelectorOptions

    Returns Selector

  • Parameters

    • buttonText: string

    Returns Promise<void>

  • Type Parameters

    • Arg

    • R

    Parameters

    • jsCode: string | ((arg: Arg) => R | Promise<R>)
    • arg: Arg

    Returns Promise<R>

  • Parameters

    • selector: string | ISelector
    • options: GetFrameBySelectorOptions = {}

    Returns Promise<IFrame>

  • Returns the main resource response. In case of multiple redirects, the navigation will resolve with the first non-redirect response.

    The method will throw an error if:

    • there's an SSL error (e.g. in case of self-signed certificates).
    • target URL is invalid.
    • the timeout is exceeded during navigation.
    • the remote server does not respond or is unreachable.
    • the main resource failed to load.

    The method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not Found" and 500 "Internal Server Error".

    NOTE: The method either throws an error or returns a main resource response. The only exceptions are navigation to about:blank or navigation to the same URL with a different hash, which would succeed and return null. NOTE: Headless mode doesn't support navigation to a PDF document. See the upstream issue.

    Shortcut for main frame's frame.goto(url[, options])

    Parameters

    • url: string

      URL to navigate page to. The url should include scheme, e.g. https://. When a baseURL via the context options was provided and the passed URL is a path, it gets merged via the new URL() constructor.

    • Optional options: {
          referer?: string;
          timeout?: number;
      } & WaitUntilOption

    Returns Promise<null | Response>

  • Parameters

    • options: TimeoutOption

    Returns Promise<string>

  • Parameters

    • options: TimeoutOption

    Returns Promise<string>

  • Parameters

    • types: string | string[]
    • options: TimeoutOption

    Returns Promise<JSONObject>

  • Returns string

  • Returns string

  • Type Parameters

    • Arg

    • R

    Parameters

    • jsCode: string | ((arg: Arg) => R | Promise<R>)
    • arg: Arg
    • options: {
          polling?: number | "raf";
          timeout?: number;
      }
      • Optional polling?: number | "raf"
      • Optional timeout?: number

    Returns Promise<void>

  • Parameters

    • Optional state: "load" | "domcontentloaded" | "networkidle"
    • options: {
          timeout?: number;
      } = {}
      • Optional timeout?: number

    Returns Promise<void>

  • Parameters

    • options: WaitForNavigationOptions

    Returns Promise<void>

  • Parameters

    • selector: string | ISelector
    • options: WaitForSelectorOptions

    Returns Promise<Selector>

  • Parameters

    • n: number

    Returns Promise<void>

  • Parameters

    • __target: ITarget
    • url: string
    • options: WaitForUrlOptions

    Returns Promise<void>

  • Parameters

    • __target: ITarget
    • options: WaitForUrlOptions

    Returns Promise<void>