Extremely Popular
Go to Latest
method Page.prototype.emulateNetworkConditions
import { Page } from "https://dotland.deno.dev/x/fresh@1.5.2/tests/deps.ts";

Examples

Example 1

const puppeteer = require('puppeteer');
const slow3G = puppeteer.networkConditions['Slow 3G'];

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.emulateNetworkConditions(slow3G);
  await page.goto('https://www.google.com');
  // other actions...
  await browser.close();
})();

Parameters

networkConditions: NetworkConditions | null
  • Passing null disables network condition emulation.

Returns

Promise<void>