量角器测试无法在Safari Sierra上启动并抛出driver.version:unknown,SessionNotCreatedError错误

时间:2017-08-18 06:00:35

标签: selenium protractor safaridriver

量角器版本:5.1.2 Safari版本:10.1.2

我已启用Safari中的“允许远程自动化” - >使用以下命令从cmd开发并启动safari驱动程序: / usr / bin / safaridriver -p 8844

现在,尝试使用量角器conf.js运行量角器测试。测试无法从以下日志开始:

Build info: version: '3.5.1', revision: '9c21bb67ef', time: '2017-08-16T21:10:06.092Z'

System info: host: 'dyn-49-127-9-116.its.monash.edu.au', ip: 'fe80:0:0:0:479:1a15:751b:51d6%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_144'

Driver info: driver.version: unknown
[15:28:40] E/launcher - SessionNotCreatedError: Could not create a session: You must enable the 'Allow Remote Automation' option in Safari's Develop menu to control Safari via WebDriver. (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 32 milliseconds

Build info: version: '3.5.1', revision: '9c21bb67ef', time: '2017-08-16T21:10:06.092Z'

System info: host: 'dyn-49-127-9-116.its.monash.edu.au', ip: 'fe80:0:0:0:479:1a15:751b:51d6%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_144'

Driver info: driver.version: unknown

    at WebDriverError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:5)

    at SessionNotCreatedError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:214:5)

    at Object.checkLegacyResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:505:15)

    at parseHttpResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)

    at doSend.then.response (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:440:13)

    at process._tickCallback (internal/process/next_tick.js:109:7)

From: Task: WebDriver.createSession()

    at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:777:24)

    at createDriver (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:167:33)

    at Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:632:14)

    at Hosted.getNewDriver (/usr/local/lib/node_modules/protractor/lib/driverProviders/driverProvider.ts:60:29)

    at Runner.createBrowser (/usr/local/lib/node_modules/protractor/lib/runner.ts:225:39)

    at q.then.then (/usr/local/lib/node_modules/protractor/lib/runner.ts:391:27)

    at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:834:54)

    at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:863:30)

    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:796:13)

    at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:556:49

[15:28:40] E/launcher - Process exited with error code 19

2 个答案:

答案 0 :(得分:1)

我想出了这个问题。由于内置的​​safari驱动程序一次只有一个浏览器窗口的限制,我退出所有正在运行的safari窗口并再次运行测试。工作得非常好:))

参考: https://webkit.org/blog/6900/webdriver-support-in-safari-10/

答案 1 :(得分:0)

有点棘手,因为目前由于webdriver / selenium不兼容而无法正常工作。我们希望,通过新的webdriver版本,它可以正常工作。请参阅here