我正在自动化Web应用程序。该应用程序正在启动,但随后的步骤未执行,并且测试保持静止而没有失败。
在此期间,控制台显示以下消息:
A parser-blocking, cross-site script, "URL of application", is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
我想 document.write
函数失败。请提出是网络还是应用程序问题。
答案 0 :(得分:-1)
此错误消息...
A parser-blocking, cross-site script, "URL of application", is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message.
...表示当应用程序( AUT )调用 document.write()
方法以编写 HTML表达式时或 JavaScript代码到文档中,调用了 parser-blocking 或跨站点脚本。
根据Intervention: Blocking the load of cross-origin, parser-blocking:
对于连接速度较慢的用户(例如2G),通过
document.write
加载的第三方脚本的性能损失通常非常严重,以至于导致主页内容的显示延迟了数十秒。如果出现,此功能将阻止通过document.write
插入的跨域,解析器阻止脚本的加载2G连接上的用户的HTTP缓存未命中。该功能仅适用于主机中的此类脚本。
根据Blocking the load of cross-origin, parser-blocking scripts inserted via document.write for users on 2G,此问题仍然是 Chromium团队的正在进行中。
显然,如果您使用的是将 2G 连接转换为 3G 或 4G 连接,则似乎可行的解决方案可以解决您的问题。
一些参考文献:
一些重要的相关讨论: