GMail 阻止通过自动化 (Selenium) 登录 [英] GMail is blocking login via Automation (Selenium)

查看:98
本文介绍了GMail 阻止通过自动化 (Selenium) 登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 selenium 在 Web 应用程序中自动执行邮件验证过程.我已经有一个脚本可以登录到 gmail 并阅读帐户上收到的激活邮件.脚本一直运行到昨天,但今天我遇到了一个问题.

I am using selenium to automate a mail verification process in a web application. I have a script already in place to login to gmail and read an activation mail received on the account. The script was perfectly working till yesterday but today I am facing a problem.

问题的附加屏幕截图

如果浏览器使用 selenium 启动,Gmail 将不允许登录.说,

Gmail is not allowing sign in if the browser is launched with selenium. Says,

您正在使用 Google 无法识别的浏览器或我们不支持的设置方式.

You're using a browser that Google doesn't recognize or that's setup in a way that we don't support.

  • 我尝试将 chromedriver 版本升级到 76.0.0,因为我正在使用铬版 76.0.3809.100(64 位).(以前使用的 chromedriver2.45) 尽管如此,问题仍然存在.
  • 已验证即使我使用 Firefox 而不是 Chrome 进行自动化也会出现此问题.
  • 验证浏览器是否启用了 Javascript
  • Gmail 不要求任何 OTP 或恢复邮件.简直就是阻止我尝试通过自动化登录.但是我能够手动登录同一帐户.
  • 使用的软件:"webdriverio": "^4.14.1", "wdio-cucumber-framework":^2.2.8"

    Software used: "webdriverio": "^4.14.1", "wdio-cucumber-framework": "^2.2.8"

    感谢任何帮助.

    推荐答案

    经过反复试验,发现此问题仅在已从同一 App/IP/设备创建多个 Gmail 帐户的情况下发生.如果这些帐户是由自动化框架/扩展程序启动的,Google 会以某种方式标记这些帐户并阻止它们.

    After some trial and error, found out that this issue happens only in a scenario when multiple gmail accounts have already been created from the same App/IP/Device. Google somehow is marking those accounts and blocks them if they are launched by automation frameworks/extensions.

    临时解决方案:

    • 使用来自另一台设备的不同手机号码(不推荐).
    • 我们应该使用像 nodemailer 这样的解决方法zeolearn.com/magazine/sending-and-receiving-emails-using-nodejs(如 Rahul L 提到的建议)
    • 自动化临时邮件提供商,例如 Guerilla Mail10 分钟邮件,如果您是担心只收到邮件
    • Create a fresh GMail account using a different mobile number from another device (Not recommended).
    • We should be using workarounds like nodemailer zeolearn.com/magazine/sending-and-receiving-emails-using-nodejs (as mentioned by Rahul L as a suggestion)
    • Automate temporary mail providers like Guerilla Mail or 10 Minute Mail if you are worried about only receiving mails

    我的拙见是完全避免使第三方邮件应用程序的 UI 自动化,因为您无法预测它们的 UI 和元素将如何变化.他们可能会出于安全目的阻止您启动,他们完全有权这样做!

    My humble opinion is to entirely avoid automating the UI of third party Mail applications as you cannot predict how their UI and elements will change. They might block you from launching for security purposes and they have every right to do so!

    这篇关于GMail 阻止通过自动化 (Selenium) 登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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