如何在守夜人测试中绕过recaptcha人工检查? [英] How to bypass recaptcha human check in nightwatch test?

查看:46
本文介绍了如何在守夜人测试中绕过recaptcha人工检查?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为包含 Google 的recaptcha"人类的 Backbone 视图编写夜视测试检查.显然,测试是一个机器人,所以它无法通过测试.所以我试图找出一种方法来绕过测试中的人工检查.谁能提出一种优雅的方法来做到这一点?

I'm writing a nightwatch test for a Backbone View that includes Google's "recaptcha" human check. Obviously, the test is a bot, and so it can't pass the test. So I'm trying to figure out a way to bypass the human check in the test. Can anyone suggest a way to do this that is elegant?

目前,我能看到的唯一可能性是在 nightwatch 用来加载页面的 url 上设置查询参数,然后在 Backbone 视图的逻辑中检查该查询参数,但这似乎很糟糕.我不想在代码本身中包含有关测试的逻辑.太乱了.

At the moment, the only possibility I can see is setting a query parameter on the url that nightwatch uses to load the page, and then checking for that query parameter within the logic of the Backbone view, but this seems bad. I don't want to have to include logic about testing in the code itself. It's just messy.

想法?

推荐答案

我看到上面 Raymond 的评论有相同的答案,但我仍然认为在这里添加一个答案应该更明显.

I see Raymond's comment above has the same answer, but I still think to add an answer here should be more visible.

Google 有关于如何在测试环境中绕过 reCAPTCHA 的文档,请查看:https://developers.google.com/recaptcha/docs/faq#id-like-to-run-automated-tests-with-recaptcha.-what-should-i-do

对于生产,我认为这是不可能的,除非你有一些像 endtest 提供的智能 OCR 工具:https://endtest.io/guides/docs/dealing-with-recaptcha/

For production, I think it's not possible unless you have some smart OCR tools like endtest offers: https://endtest.io/guides/docs/dealing-with-recaptcha/

这篇关于如何在守夜人测试中绕过recaptcha人工检查?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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