{
  "slug": "k6-browser-page-adds-goback-and-goforward-8323f0867bd6",
  "title": "k6/browser Page adds goBack() and goForward()",
  "tools": [
    "k6"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-02-10T09:12:21.000Z",
  "announced_at": "2026-02-10T09:12:21.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a k6 browser script needs to test session history, use `page.goBack()` or `page.goForward()` after navigation; await the call and pass optional `{ timeout, waitUntil }` settings as needed.",
    "examples": [
      "import { browser } from 'k6/browser';\n\nexport const options = {\n  scenarios: { ui: { executor: 'shared-iterations', options: { browser: { type: 'chromium' } } } },\n};\n\nexport default async function () {\n  const page = await browser.newPage();\n  try {\n    await page.goto('<first-url>');\n    await page.goto('<second-url>');\n    await page.goBack({ timeout: 30000, waitUntil: 'load' });\n    await page.goForward();\n  } finally {\n    await page.close();\n  }\n}"
    ],
    "gotchas": [
      "Version: v1.6.0",
      "options: Options object for the history navigation call; defaults to null.",
      "options.timeout: Maximum operation time in milliseconds; defaults to 30000. Set to 0 to disable the timeout.",
      "options.waitUntil: Navigation success event; defaults to `load`. Allowed values: `domcontentloaded`, `load`, `networkidle`. Docs caution that `networkidle` may never fire on busy sites.",
      "Prerequisite: A browser scenario must specify an executor and set `options.browser.type` to `chromium`.",
      "Prerequisite: Install k6 and a Chromium-based browser, or use a Docker image with Chromium built in.",
      "The methods support optional timeout and `waitUntil` parameters."
    ]
  },
  "why_it_matters": "Test browser history navigation in a k6 browser script.",
  "sources": [
    "https://github.com/grafana/k6/releases/tag/v1.6.0",
    "https://grafana.com/docs/k6/latest/javascript-api/k6-browser/page/goback/",
    "https://grafana.com/docs/k6/latest/using-k6-browser/running-browser-tests/",
    "https://grafana.com/docs/k6/latest/using-k6-browser/"
  ],
  "rank": 0.96027,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2a-20261017",
    "verdict_id": "wave2a-20261017:wave2a-20261017-4d59ff63232066fe-4:gate",
    "evidence_hash": "214d637601ab12859a942e0dfb0964627863702fc979acbb4c496833c029e4b8"
  },
  "review": {
    "draft_hash": "8f73fca7608bf096bd87ced0cc0d907ff371301fe6114b206f6a1bfdc8a87452",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2a-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.96 >= 0.9; 2 needed) and Jev gave 0.78 (>= 0.6 needed)."
  }
}
