远程执行抛出 "Unable to get reference to the document"

Remote Execution throws "Unable to get reference to the document"

突然之间,我的远程执行抛出了

"Initialization method TCS_Automation.CheckoutPaymentPage.CheckoutPaymentVeifyOrderCompleteForAllUsers.MyTestInitialize threw exception. Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: Unable to get reference to the document."

编码的 ui 测试链接到 TFS 工作项,并通过 Microsoft 测试管理器执行。没有对测试设置文件进行任何更改,也没有对我所知道的环境进行任何更改。 运行 VS2013 代理和控制器。重新启动所有代理,然后,当它不起作用时,重新启动代理 运行 所在的虚拟机。本地调试不会抛出错误。

根据我的测试日志,它在测试的不同部分都失败了,所以它不特定于特定网页。

抛出错误消息是因为代理无法与浏览器交互Window。在我的特殊情况下,放置在站点上的跟踪器正在执行 POST 请求并阻止页面加载直到完成,这会阻止交互。这仅出于某种原因远程发生(远程运行 > 15 秒,本地运行 < 1 毫秒秒)。