我已经更新了节点,npm,webdriver-manager,chromedriver和量角器,但是当量角器尝试加载时,浏览器崩溃了。
此外,我已经尝试过从gitHub做部分解决方案,但在这个用例中没有任何帮助。
错误低于 -
节点控制台:
Idans-MacBook-Pro:tests idan$ ./node_modules/protractor/bin/protractor conf.js
[15:12:39] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[15:12:39] I/launcher - Running 1 instances of WebDriver
[15:13:51] E/launcher - session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"546.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2840.71)
(Driver info: chromedriver=2.22.397929 (fb72fb249a903a0b1041ea71eb4c8b3fa0d9be5a),platform=Mac OS X 10.12.0 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.12 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'Idans-MacBook-Pro.local', ip: '192.168.1.23', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.chrome.ChromeDriver
[15:13:51] E/launcher - SessionNotCreatedError: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"546.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2840.71)
(Driver info: chromedriver=2.22.397929 (fb72fb249a903a0b1041ea71eb4c8b3fa0d9be5a),platform=Mac OS X 10.12.0 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.12 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'Idans-MacBook-Pro.local', ip: '192.168.1.23', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at WebDriverError (/Users/idan/automation/tests/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:10)
at SessionNotCreatedError (/Users/idan/automation/tests/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:308:10)
at Object.checkLegacyResponse (/Users/idan/automation/tests/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:639:15)
at parseHttpResponse (/Users/idan/automation/tests/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:538:13)
at /Users/idan/automation/tests/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:472:11
at ManagedPromise.invokeCallback_ (/Users/idan/automation/tests/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1379:14)
at TaskQueue.execute_ (/Users/idan/automation/tests/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ (/Users/idan/automation/tests/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at /Users/idan/automation/tests/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2820:25
at /Users/idan/automation/tests/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:639:7
From: Task: WebDriver.createSession()
at Function.createSession (/Users/idan/automation/tests/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:329:24)
at Builder.build (/Users/idan/automation/tests/node_modules/protractor/node_modules/selenium-webdriver/builder.js:458:24)
at Hosted.DriverProvider.getNewDriver (/Users/idan/automation/tests/node_modules/protractor/built/driverProviders/driverProvider.js:37:33)
at Runner.createBrowser (/Users/idan/automation/tests/node_modules/protractor/built/runner.js:198:43)
at /Users/idan/automation/tests/node_modules/protractor/built/runner.js:285:30
at _fulfilled (/Users/idan/automation/tests/node_modules/protractor/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/Users/idan/automation/tests/node_modules/protractor/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/Users/idan/automation/tests/node_modules/protractor/node_modules/q/q.js:796:13)
at /Users/idan/automation/tests/node_modules/protractor/node_modules/q/q.js:556:49
at runSingle (/Users/idan/automation/tests/node_modules/protractor/node_modules/q/q.js:137:13)
[15:13:51] E/launcher - Process exited with error code 199
Idans-MacBook-Pro:tests idan$
Webdriver管理器控制台:
15:12:39.496 INFO - Executing: [new session: Capabilities [{count=1, browserName=chrome, chromeOptions={args=[--no-sandbox, --test-type, --memory-metrics, --console, --crash-on-failure], prefs={download={directory_upgrade=true, default_directory=./Users/idan/automation/tests/downloaded/, prompt_for_download=false}}}}]])
15:12:39.513 INFO - Creating a new session for Capabilities [{count=1, browserName=chrome, chromeOptions={args=[--no-sandbox, --test-type, --memory-metrics, --console, --crash-on-failure], prefs={download={directory_upgrade=true, default_directory=./Users/idan/automation/tests/downloaded/, prompt_for_download=false}}}}]
Starting ChromeDriver 2.22.397929 (fb72fb249a903a0b1041ea71eb4c8b3fa0d9be5a) on port 38520
Only local connections are allowed.
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
15:12:51.195 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'Idans-MacBook-Pro.local', ip: '192.168.1.23', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12', java.version: '1.8.0_111'
Driver info: driver.version: unknown
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:183)
at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:119)
at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:95)
at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:124)
at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:59)
at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:1)
at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:111)
at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:79)
at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:204)
at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:166)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:132)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:680)
at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:571)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:920)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:358)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:537)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'Idans-MacBook-Pro.local', ip: '192.168.1.23', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12', java.version: '1.8.0_111'
Driver info: driver.version: unknown
at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:113)
at org.openqa.selenium.remote.server.DefaultDriverProvider.newInstance(DefaultDriverProvider.java:97)
at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:60)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:222)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:103)
... 9 more
Caused by: org.openqa.selenium.SessionNotCreatedException: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"546.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2840.71)
(Driver info: chromedriver=2.22.397929 (fb72fb249a903a0b1041ea71eb4c8b3fa0d9be5a),platform=Mac OS X 10.12.0 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.12 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'Idans-MacBook-Pro.local', ip: '192.168.1.23', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:138)
... 14 more
15:13:21.516 WARN - Exception: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"546.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2840.71)
(Driver info: chromedriver=2.22.397929 (fb72fb249a903a0b1041ea71eb4c8b3fa0d9be5a),platform=Mac OS X 10.12.0 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.12 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'Idans-MacBook-Pro.local', ip: '192.168.1.23', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.chrome.ChromeDriver
答案 0 :(得分:0)
将chromedriver更新到最新版本(我相信它是在v2.25中)。 根据错误,您使用了Chrome浏览器v54的chromedriver 2.22并且它们不兼容。
答案 1 :(得分:0)
手动更新chromedriver后,您也应该执行以下步骤 -
将“chromedriver”:“2.22”改为“chromedriver”:“2.24”,在node_modules / webdriver-manager / built / config.json中
在node_modules / webdriver-manager / built / lib / binaries / chrome_driver.js中将mac32更改为mac64
现在它就像一个魅力。