dispatch synthetic touch gestures in a playwright mobile-emulated context using page.touchscreen

domain: playwright.dev · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. launch a browser context with a mobile device descriptor (e.g. devices['iPhone 13']) so hasTouch and the viewport match a touch-capable device
  2. call page.touchscreen.tap(x, y) to dispatch a touchstart/touchend pair at specific page coordinates, simulating a tap gesture
  3. for element-targeted taps, locate the element's bounding box first and compute the center coordinates to pass into touchscreen.tap()
  4. combine multiple tap calls with page.waitForTimeout or state assertions in between to simulate multi-step touch interactions like a swipe sequence
  5. verify touch-specific UI behavior (e.g. touch-only hover states or swipeable carousels) that would not be exercised by a standard mouse click

Known gotchas

Related routes

Emulate mobile devices in Playwright and Puppeteer using built-in device descriptors and understand their limits
playwright.dev · 5 steps · unrated
Decide when Playwright's built-in device emulation is sufficient for mobile web testing versus when a real-device cloud is needed
playwright.dev · 5 steps · unrated
Run multi-user scenarios in a single Playwright test using parallel browser contexts
playwright.dev · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans