任何人都使用任何想法在硒中捕获验证码

发布于 2024-09-29 03:22:58 字数 25 浏览 0 评论 0原文

任何人都使用任何想法在硒中捕获验证码

anyone used any idea for capturing captcha in selenium

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

鹿港巷口少年归 2024-10-06 03:22:58

如下所示,两者是互斥的。如果 Selenium 可以模拟验证码,那么它将允许机器人覆盖验证码机制(这意味着排除机器人)。

我使用的两种方法:

在代码中设置一个开关,禁止使用验证码进行 Selenium 测试。

自动化其余测试并手动输入验证码 - 好文章此处 使用“break”命令。

As below, the two are mutually exclusive. If Selenium could simulate a captcha, then it would allow robots to override the captcha mechanism (which is meant to exclude robots).

Two ways I've used:

Have a switch in the code to disallow captcha for Selenium testing.

Automate the rest of the test and enter the captcha manually - good article here using the "break" command.

你的笑 2024-10-06 03:22:58

验证码的全部要点是它不应该由应用程序来完成。

因此,您要么

  • 需要您的验证码提供程序的“后门”来告诉测试应用程序要输入什么,要么
  • 需要模拟您的验证码提供程序以返回众所周知的值,
  • 需要将您的应用程序配置为不实际测试输入的值并通过无论如何,测试。

The whole point of captcha is that it shouldn't be doable by an application.

So you either

  • need a "back door" to your captcha provider that can tell the test application what to enter, or
  • need to mock your captcha provider to return well-known values
  • need to configure your application to not actually test the entered values and pass the test anyway.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文