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

查看:37
本文介绍了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 不会要求任何一次性密码或恢复邮件.简直是阻止我尝试通过自动化登录.但是我能够手动登录同一帐户.
  • 使用的软件:webdriverio":^4.14.1"、wdio-cucumber-framework":"^2.2.8"

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

    感谢任何帮助.

    推荐答案

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

    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.

    临时解决方案:

    • 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天全站免登陆