无法在Safari中运行量角器测试

时间:2019-05-11 09:05:12

标签: angular safari protractor

我有Angular7项目和少量的E2E测试,在Chrome中一切正常(所有测试均为“ OK”)。但是我需要在Safari中运行测试,并且量角器因错误而崩溃。

首先,我的protractor.conf.js与:

multiCapabilities: [{ 'browserName': 'safari' }],
directConnect: true,

但是我得到: Error: browserName safari is not supported with directConnect.

然后我将其更改为: directConnect: false

但是现在量角器因错误而崩溃:

E/launcher - Error: Error: Server terminated early with status 1
    at earlyTermination.catch.e (...node_modules/selenium-webdriver/remote/index.js:252:52)
    at process._tickCallback (internal/process/next_tick.js:68:7)
[10:52:05] E/launcher - Process exited with error code 100
An unexpected error occurred: undefined

1 个答案:

答案 0 :(得分:0)

在任何论坛上都没有针对此问题的答案,但我终于找到了解决方案。该错误是由于直接连接而发生的。它不支持Safari。解决方案是给出seleniumServerJar路径

seleniumServerJar:“ / usr / local / lib / node_modules / protractor / node_modules / webdriver-manager / selenium / selenium-server-standalone-3.141.59.jar”,

它看起来像下面的配置文件:

Click the image below