GMail禁止通过Automation(Selenium)登录 [英] GMail is blocking login via Automation (Selenium)

查看:443
本文介绍了GMail禁止通过Automation(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.

问题的其他屏幕截图

Additional Screenshot of issue

如果使用硒启动浏览器,则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,因为我正在使用 chrome版本76.0.3809.100(64位). (以前使用的chromedriver 2.45)问题仍然存在.
  • 已验证即使我使用Firefox而不是Chrome进行自动化,也会发生此问题.
  • 确认已在浏览器中启用Javascript
  • Gmail不需要任何OTP或恢复邮件.简直就是 阻止了我通过自动化登录的尝试.但是我能够 手动登录到同一帐户.
    • I have tried upgrading chromedriver version to 76.0.0 as I am using chrome version 76.0.3809.100(64 bit). (Previously used chromedriver 2.45) Still, the problem persists.
    • Verified that this issue occurs even if I use Firefox instead of Chrome for automation.
    • Verified that Javascript is enabled in the browser
    • Gmail is not asking for any OTP or recovery mail. It is simply blocking my attempt to login via automation. However I am able to login to the same account manually.
    • 使用的软件:"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.

      临时解决方案:

      • 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

      我的拙见是完全避免自动化第三方Mail应用程序的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禁止通过Automation(Selenium)登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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