

The benefit of this solution is that you only have to fill out this secret form once per automated browser session before running your existing UI tests. Wherever you validate your captcha on the server, check if this boolean is present and is 'true'. When the UI test submits the secret key, the website can use a session cookie to keep track of the automated browser session and store a boolean 'true' in the session state.

The form can request a pre-shared key beknownst only to your website and your UI tests.
Node recaptcha bypass update#
This would work, but you would have to update all your UI tests with some JavaScript to insert the additional hidden fields.Īlternatively, you could create an additional form hosted at a different path on your website. Your website can then validate those extra parameters like a pre-shared key beknownst only to your website and your UI tests. One way of establishing that trust between UI tests and your website would be to have your UI tests add extra hidden fields to your form to pass additional parameters as part of your form submission. Yes? Great! In that case, you can extend your website and captcha validation to somehow trust your UI tests and bypass the captcha. If you can't update the website, there's no way to distinguish your UI test from any other bot.

No? Then you're going to have a tough time. Well, it depends, are you able to update the server captcha validation code? So how do you keep captchas on your form but also have passing UI tests? But if you have UI tests verifying your forms and a captcha protecting those same forms, your UI tests will no longer function. You'll catch almost all of the spam if you employ multiple of these techniques.
