Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用phpunit测试输入验证码数据_Phpunit_Captcha_Selenium Ide - Fatal编程技术网

如何使用phpunit测试输入验证码数据

如何使用phpunit测试输入验证码数据,phpunit,captcha,selenium-ide,Phpunit,Captcha,Selenium Ide,是否可以通过phpunit测试输入验证码信息 差不多 $this->type(“重述应答字段”、“内部信息”) 我知道创建验证码是为了防止这种情况发生,但我确信有人曾经在提交表单之前自动测试过需要验证码信息的系统 谢谢 D~~~你不能这样做,除非你对验证码图像进行OCR。但这不再是一种考验:) 通常在服务器端实现某种旁路。在伪代码中,它看起来像: if ($config->bypass_captcha) { if ($recaptcha_response_field == 'corr

是否可以通过phpunit测试输入验证码信息

差不多

$this->type(“重述应答字段”、“内部信息”)

我知道创建验证码是为了防止这种情况发生,但我确信有人曾经在提交表单之前自动测试过需要验证码信息的系统

谢谢
D~~~

你不能这样做,除非你对验证码图像进行OCR。但这不再是一种考验:)

通常在服务器端实现某种旁路。在伪代码中,它看起来像:

if ($config->bypass_captcha) {
   if ($recaptcha_response_field == 'correct') {
       // do what normally happens after submit
   } else { 
       // do what normally happens on incorrect captcha
   }
} else {
  // call recaptcha API to perform the real check
}
然后,您需要确保在公共服务器上的任何服务器上都不会启用“绕过验证码”


当然,还有其他方法,比如禁用给定IP地址的验证码检查(该IP地址属于运行测试的主机)

除非您对验证码图像进行OCR,否则无法执行此操作。但这不再是一种考验:)

通常在服务器端实现某种旁路。在伪代码中,它看起来像:

if ($config->bypass_captcha) {
   if ($recaptcha_response_field == 'correct') {
       // do what normally happens after submit
   } else { 
       // do what normally happens on incorrect captcha
   }
} else {
  // call recaptcha API to perform the real check
}
然后,您需要确保在公共服务器上的任何服务器上都不会启用“绕过验证码”

当然,还有其他方法,比如禁用给定IP地址的验证码检查(该地址属于运行测试的主机)