在我的自动化脚本的 selenium 中,我必须从我的外部测试用户(something@gmail.com)那里检索 MFA 代码。我正在使用此代码与 IMAP gmail 传入服务器交谈
using (ImapClient client = new ImapClient(GmailHostName, 993, email, ClientEmailPassword, AuthMethod.Login, true))
当我在本地运行此测试时,它成功地从 gmail 帐户获取 MFA 代码。但在Azure Devops Pipeline中,相同的测试无法检索代码。这是来自 Azure 的错误:
System.Net.Sockets.SocketException : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 108.177.122.109:993
at S22.Imap.ImapClient.Connect(String hostname, Int32 port, Boolean ssl, RemoteCertificateValidationCallback validate)```
at S22.Imap.ImapClient..ctor(String hostname, Int32 port, String username, String password, AuthMethod method, Boolean ssl, RemoteCertificateValidationCallback validate)
Has anyone faced an issue like this? Any and all help will be highly appreciated.