layout | title | permalink |
---|---|---|
docs |
Test Websites That Use reCAPTCHA |
/documentation/recipes/integrations/test-websites-that-use-recaptcha.html |
TestCafe does not implement mechanisms that circumvent CAPTCHA challenges. However, many CAPTCHA providers allow you to disable or mock the verification in test environments.
This topic describes how to configure reCAPTCHA so that TestCafe tests pass through it.
Create a separate key for testing environments in the reCAPTCHA admin console. Then follow the instructions on the page to use this key when you build the site for testing.
Scores may not be accurate in testing environments as reCAPTCHA v3 relies on seeing real traffic.
Alternatively, you can change the score
threshold or disable the reCAPTCHA check completely in your development build.
Use the following test keys that generate the No CAPTCHA
response and make all verification requests pass:
Site key: 6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
Secret key: 6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe
With these keys, the reCAPTCHA widget shows a warning message that indicates reCAPTCHA is not used for production traffic.