GMail禁止通过Automation(Selenium)登录

编程入门 行业动态 更新时间:2024-10-08 13:31:09
本文介绍了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.

      临时解决方案:

      • 使用 与另一台设备使用不同的手机号码(不推荐).
      • 我们应该使用 nodemailer 之类的解决方法 zeolearn/magazine/sending-and-receiving-emails- using-nodejs (正如Rahul L所建议的那样)
      • 自动化临时邮件提供商,例如 Guerilla Mail 或 10分钟邮件 担心只接收邮件
      • Create a fresh GMail account using a different mobile number from another device (Not recommended).
      • We should be using workarounds like nodemailer zeolearn/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)登录

本文发布于:2023-11-09 23:28:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1573738.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:GMail   Automation   Selenium

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!