Modern QA2026Pattern 3: Multi-Page Flow — tiles
Log inJoin
78 / 168 · 01 Agent Skills for Browser Automation · Test Patterns for AI-Driven Browser Automation← prev⊞ allnext →☰ Read as one page

11.4Pattern 3: Multi-Page Flow

Tests that span multiple page navigations.

Example: E-Commerce Checkout

# Browse products
playwright-cli open https://shop.example.com
playwright-cli snapshot
# → link "Blue Widget" [ref=e7], price text "$29.99"
playwright-cli click e7

# Add to cart
playwright-cli snapshot
# → button "Add to cart" [ref=e12]
playwright-cli click e12
playwright-cli snapshot
# → Agent verifies: cart badge shows "1"

# Go to cart
playwright-cli goto https://shop.example.com/cart
playwright-cli snapshot
# → Agent verifies: "Blue Widget", total "$29.99"; button "Checkout" [ref=e9]

# Checkout
playwright-cli click e9
playwright-cli snapshot
# → textbox "Card number" [ref=e14], textbox "Expiry" [ref=e15],
#   textbox "CVV" [ref=e16], button "Pay now" [ref=e17]
playwright-cli fill e14 "4111111111111111"
playwright-cli fill e15 "12/29"
playwright-cli fill e16 "123"
playwright-cli click e17
playwright-cli snapshot
# → Agent captures: "Order #12345"

Key Considerations

  • State carries between pages (cart contents, session cookies) — a named session holds it
  • Refs do not carry between pages — re-snapshot after every navigation
  • Screenshot at each page for a debugging trail (files on disk; free until read)