typescript - 如何修复“browser.takeScreenshot”代理错误?
问题描述
我在黄瓜量角器中进行了一些自动化测试,但是从今天早上开始,“browser.takeScreenshot”方法突然失败,并出现以下错误:
WebDriverError: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>502 Proxy Error</title>
</head><body>
<h1>Proxy Error</h1>
<p>The proxy server received an invalid
response from an upstream server.<br />
The proxy server could not handle the request <em><a
href="/wd/hub/session/29068642-008c-4e84-9f12-
e2896a9c6b3e/screenshot">GET /wd/hub/session/29068642-008c-4e84-
9f12-e2896a9c6b3e/screenshot</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p>
</p>
</body></html>
更新:它在本地工作,只有当我在 selenium 服务器上运行测试时才会出现问题。
解决方案
可能的原因
您的浏览器已更新,不再使用您的测试驱动程序版本使用的协议。
使固定
- 更简单的选择:更新测试框架。
- 更难的选择:回滚您正在测试的浏览器版本并将其固定。
推荐阅读
- reactjs - this.props.navigation 在 React Native 中不起作用
- powershell - 您可以在 Powershell 中更改 ODBC DSN 驱动程序吗?
- model-view-controller - 未存储 Webhook C# MVC 控制器值
- r - 通过数据框解析以在 R 中创建字符串
- google-apps-script - Google 电子表格单元格中的 App Script 公式无效,需要强制重新加载
- laravel - stripe.confirmCardPayment 意图密钥的缺失值:值应该是形式为 ${id}_secret_${secret} 的客户端密钥
- javascript - 使用显示错误的 JS 在 ASP.NET 中自动注销
- java - 如何在SqlSessionFactory加载mybatis mapper xml(java配置)
- asp.net-core - 如何从不需要用户身份验证的 Azure AD B2C 获取 SPA 应用程序的 api 访问令牌?
- machine-learning - UndefinedMetricWarning:精度定义不明确,由于没有预测样本而被设置为 0.0