How to bypass CAPTCHA during Behat functional testing? We have a site that uses the CAPTCHA and CAPTCHA After modules to protect forms from invalid submissions. We're doing some functional and BDD testing using Behat and the tests are sometimes triggering the CAPTCHA After thresholds, causing the CAPTCHA to be displayed. Is there an easy way to bypass the CAPTCHA, when performing tests?

I realize that we can probably override the CAPTCHA After threshold settings in the database, if the tests are running on the same machine. However, it would be nice to also be able to run the tests from a different machine than the web server hosting the site. I think that something like an IP whitelist might work, but I haven't found anything along those lines yet. Before we start coding something like that, anyone have a better idea?

Thanks!
Using the API Driver you can, as you say, modify CAPTCHA After threshold and restore it at the end of test, but you need to execute tests in the same machine.

If you want to do it form another machine you have to set up a way to alter that variable from outside. You can define a hook menu that alters that variable, in a dev module that will not be enabled in production site. You can also set up a drush remote command that modifies the threshold in th remote machine and restores and the end of the test. You can add this drush command in the script that lauchhes behat tests or even inside behat in a behat hook.