MTCaptcha supports automated browser UI/UX testing via tools like Selenium, without having to disable the captcha plugin.
There are two methods to enable automation test scripts to consistently solve the captcha:
Method 1:
mtcaptcha.enableTestMode(“<TestKey>”);
Method 2:
var mtcaptchaConfig = {
“sitekey”: “<SiteKey>”,
“enableTestMode” : “<TestKey>”
};
{
"success": true,
"tokeninfo": {
"code": 301,
"codeDesc": "valid-test:captcha-solved-via-testkey",
...
}
}
See our Developers Guide for more information on MTCaptcha JavaScript APIs, and Token Codes
NOTE:
The purpose of this feature is to support automated unit tests for user interface and interactions. It is not intended to support long running load or performance tests. The captcha may temporarily block test server IP(s) if it is load tested for long periods of time.
REFERENCES
Stack Overflow: How to call a JavaScript function from within Selenium
Stack Overflow: Selenium : Call javascript function on page.