guides · automation & testing

Cloudflare Turnstile integration guides

How to deal with a Turnstile widget when it is standing between your test suite and the thing you are trying to test.

Start with the test keys

If the site is yours, you almost never need a solver in CI. Cloudflare publishes dummy sitekeys that always pass, always fail, or force an interactive challenge. Point your staging environment at one and the widget stops being a problem.

Solving is for the cases the test keys cannot cover: a staging environment you do not control the Turnstile configuration for, a third-party sandbox, or synthetic monitoring that has to exercise the real production path.

→

Solve only against properties you own or are explicitly authorised to test. That boundary is in our Acceptable Use Policy and we enforce it.

Where a tool's behaviour is genuinely contested — a measurement, or a change in Cloudflare's own documentation that moved under everyone — the working goes on the blog rather than into a guide, so these pages stay answers rather than arguments.

Browse Guides

17 of 17 articles

Frameworks and browser tools

Playwright and Cloudflare TurnstileStop Cloudflare Turnstile breaking Playwright tests: use Cloudflare's official test sitekeys on staging, or solve a real widget and inject the token.Puppeteer Turnstile bypassHow to handle Cloudflare Turnstile in Puppeteer: Cloudflare's official test sitekeys for pages you own, plus a runnable token-injection script.Selenium and Cloudflare Turnstile in PythonHandle Cloudflare Turnstile in Selenium 4 and Python: test sitekeys, explicit waits, execute_script token injection, and what changes in headless.curl_cffi and Turnstilecurl_cffi impersonates TLS and HTTP/2 fingerprints and has no JavaScript runtime. Its own FAQ says so. What that solves, what it cannot, and where the line is.Scrapy and TurnstileScrapy has no JavaScript engine, so a Turnstile page returns markup and no data. The three documented routes, and which one Scrapy's own docs recommend first.undetected-chromedriver and TurnstileIt binary-patches one string out of chromedriver. Its own README says it does not hide your IP and that headless is unfinished. What that means for Turnstile.SeleniumBase and TurnstileThe uc_gui captcha methods use PyAutoGUI and raise in headless mode — the check is in the source. solve_captcha uses CDP and does not. Which to use where.Camoufox and TurnstileCamoufox is a Firefox fork that patches fingerprints at the C++ level. It ships no Turnstile solver, and the issue asking for one was closed as not planned.nodriver and Turnstilenodriver's README documents a tab.cf_verify() that clicks the Cloudflare checkbox. It is not in the shipped code. What the library does do instead.Patchright and TurnstilePatchright is a drop-in Playwright that closes the Runtime.enable leak and reaches into closed shadow roots — which is exactly where a Turnstile checkbox lives.DrissionPage and TurnstileDrissionPage reaches into non-open shadow roots and switches between browser and HTTP mode. It also forbids commercial use, and its docs are Chinese-only.

Sources

Next step

Take the next integration step

Start with a sandbox request, then use a live key for targets you own or are authorized to test.