Cloudflare Turnstile in Playwright: Why Your Tests Stall and How to Solve It in 8 Lines

If you're running Playwright or Selenium against any site behind Cloudflare, you've already met Turnstile. It's the new "managed challenge" widget Cloudflare started shipping in 2023, and it now appears in front of login flows, contact forms, signup pages, and increasingly the entire site root.

Here's the part most teams miss: Turnstile doesn't always show a checkbox. A lot of the time it just sits invisible, runs its scoring loop, and either issues a token silently or stalls forever. Your test doesn't crash. It just times out at the next page.click("button[type=submit]"). The CI log says "element not interactable." Nobody knows why.

I work on CaptchaAI. I'm going to show you exactly what's happening, then drop in 8 lines that fix it.

The real scenario