测试运行结束时出现未指定的量角器错误

时间:2019-04-04 07:23:30

标签: selenium protractor

我已经升级到Protractor 6.0.0和Jasmine 3.3.1,并且不得不重做所有测试以异步运行。

当我的量角器测试完成运行时,最后出现无法解释的错误。没有任何测试失败,但是该过程似乎会异常终止。我正在最新的Webdriver中使用Chrome 73运行,由于74仍处于Beta中,因此我不得不专门降级到Chrome 73 Webdriver。

这是测试运行的快照:

  

测试套件1测试

√ should check first thing
√ should check second thing
√ should display another thing
     

执行了94个规格不完整的3个(跳过了89个)。   C:\ Users \ Joon \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ jasmine-core \ lib \ jasmine-core \ jasmine.js:3190           抛出参数[0];           ^

     

NoSuchSessionError:无效的会话ID(驱动程序信息:   chromedriver = 73.0.3683.68   (47787ec04b6e38e22703e856e101e840b65afe72),平台= Windows NT   10.0.17134 x86_64)       在Object.checkLegacyResponse(C:\ Users \ Joon \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ selenium-webdriver \ lib \ error.js:585:15)       在parseHttpResponse(C:\ Users \ Joon \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ selenium-webdriver \ lib \ http.js:533:13)       在Executor.execute(C:\ Users \ Joon \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ selenium-webdriver \ lib \ http.js:468:26)       在       在process._tickCallback(internal / process / next_tick.js:188:7)

没有其他错误消息,我发现的仅有的其他SO帖子具有相同的错误消息,之后也有其他的承诺被拒绝的错误。

如何调试/解决导致此错误的原因?

1 个答案:

答案 0 :(得分:1)

我知道了-有一些对browser.wait的调用在他们之前没有等待。

其中之一导致同步错误,导致在测试运行结束时出现未指定的状态管理错误。

对于从控制流升级到异步流后遇到WebDriver状态错误的其他任何人-请确保在所有Protractor浏览器交互调用之前放置等待调用。我错过的一个是browser.wait,但这可能是导致该问题的其他任何对Protractor的调用

相关问题