是否可以使用Selenium Webdriver自动执行验证码? [英] Is it possible to automate captcha code using selenium webdriver?

查看:81
本文介绍了是否可以使用Selenium Webdriver自动执行验证码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在自动化这个 irctc 网站,作为硒Webdriver上的工具.

I'm automating this irctc site as hands on selenium webdriver.

它要求我提供验证码以及用户名和密码.反正有自动进行验证码的代码吗?

It is asking me for captcha code along with username and password. Is there anyway to automate the captcha code?

推荐答案

您显然不了解什么是验证码;来自WikiPedia :

You obviously failed to understand what CAPTCHA is; from WikiPedia:

CAPTCHA(完全自动化的公共Turing测试以区分计算机和人类"的反义词)是一种用于计算以确定用户是否为人类的质询-响应测试.

A CAPTCHA (a backronym for "Completely Automated Public Turing test to tell Computers and Humans Apart") is a type of challenge-response test used in computing to determine whether or not the user is human.

正如其他答案和评论中已经提到的那样,有几种可能的攻击方法可以克服这一问题.您可以从同一 WikiPedia页面中获得指向其他几个选项的链接.但是请注意,所有这些都是更多的概念证明,而不是即用型的解决方案.

As was already mentioned in other answers and comments, there are several possible attacks to defeat this. You can get links to several other options from the same WikiPedia page. But note that all of these are more of a proof-of-concept, rather than an out-of-the-box solution.

由于您使用Selenium标记了问题,因此有可能在您控制的环境中使用此问题,例如您的工作环境.在这种情况下,最简单的解决方案是要求您的开发人员为任何非生产部署引入测试"标志.当此标志处于活动状态时,预定义的短语将始终通过CAPTCHA以进行测试.但是,您仍然应该进行全通测试,所有功能都像真实产品一样打开.

Since you tagged your question with Selenium, it is possible that you may be using this in an environment that you control, such as test environment at your work. In such a scenario, the easiest solution is to ask your developers to introduce a "test" flag for any non-production deployments. When this flag is active, a predefined phrase will always pass the CAPTCHA for testing purposes. However, you should still have a full-pass test, with everything turned on as if real production.

这篇关于是否可以使用Selenium Webdriver自动执行验证码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆