Skip to main content

Using Claude Code, Cursor, or another coding agent? Paste this into your prompt to run cross-browser and real-device tests, debug sessions, and wire up CI on the TestMu AI cloud:
Cookie assertions let you verify browser cookies: check existence, values, and security attributes like httpOnly, secure, and sameSite.

How Capture Works

Cookies are captured as a point-in-time snapshot when the checkpoint triggers:
  • On-demand capture: Cookies are read from the browser context at the moment the assertion runs, not accumulated over time
  • Current state only: You see exactly what cookies exist right now, including any set by the page’s JavaScript or server responses
  • All cookies visible: Unlike document.cookie in JavaScript, KaneAI can see httpOnly cookies too
  • Domain-scoped: Cookies are captured for all domains the browser has visited in this session

Planning for Multi-Step Tests

Because cookies are captured at assertion time:
  • If you need to check cookies set by a specific page, assert on the same page or after you’ve visited it
  • If cookies are needed in a later step (e.g., after navigating away), extract and store them first
  • Cookies persist in the browser across steps (unlike network/console which reset), but asserting on a different domain may show different cookies

What You Can Query

Example Assertions

Example Extractions

Example If/Else