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

11.7Pattern 6: Multi-Session Testing

Tests that require multiple browser contexts — two users, two roles, two environments. Named sessions (-s=name) replace the tab juggling of older CLI tools: each session is an isolated browser context, and one agent orchestrates all of them.

Example: Admin Changes a Price, Customer Sees It

playwright-cli -s=admin open https://app.example.com/admin
playwright-cli -s=customer open https://app.example.com/shop
playwright-cli list                       # both sessions visible

# Admin updates the price
playwright-cli -s=admin snapshot          # → textbox "Price" [ref=e8], button "Save" [ref=e9]
playwright-cli -s=admin fill e8 "24.99"
playwright-cli -s=admin click e9

# Customer refreshes and verifies
playwright-cli -s=customer reload
playwright-cli -s=customer snapshot
# → Agent verifies: "$24.99"

Example: Compare Two Environments

playwright-cli -s=staging open https://staging.example.com
playwright-cli -s=prod open https://production.example.com
playwright-cli -s=staging eval "document.querySelector('.version').textContent"
playwright-cli -s=prod eval "document.querySelector('.version').textContent"
# Agent compares the two outputs