OS: Windows 10
Selenium Version: 3.5.0
Browser: Chrome 60.0.3112.90 + ChromeDriver 2.31.488763
At start the test falls without opening a window with a log:
WebDriverException: JSON decoding of remote response failed.
Error code: 4
The response: ''
/home/bazleva/projects-acceptance-tests/vendor/facebook/webdriver/lib/remote/HttpCommandExecutor.php:241
In the driver launch console is:
2017-08-15 12:22:45.137:WARN:osjs.HttpChannel:qtp1562557367-13: /wd/hub/session
java.lang.NullPointerException
And on Selenium Version: 3.4.0 - everything works well without errors.
Can you advise something?
For issues please provide a concise reproducible test case and describe what results you are seeing and what results you expect.
See CONTRIBUTING.md
@barancev , pardon me. Tried to describe in more detail:
We tried to start selenium and run test.
Expected running test and noexceptions,
Got as result error in test running:
WebDriverException: JSON decoding of remote response failed.
Error code: 4
The response: ''
/home/projects/vendor/facebook/webdriver/lib/remote/HttpCommandExecutor.php:241
and exception in cmd:
C:\Users\Desktop\selenium>java -Dwebdriver.chrome.driver="drivers\chromedriver_new.exe" -jar "drivers\selenium-server-standalone-3.5.0.jar"
15:50:07.080 INFO - Selenium build info: version: '3.5.0', revision: '8def36e068'
15:50:07.081 INFO - Launching a standalone Selenium Server
2017-08-15 15:50:07.096:INFO::main: Logging initialized @206ms to org.seleniumhq.jetty9.util.log.StdErrLog
15:50:07.139 INFO - Driver class not found: com.opera.core.systems.OperaDriver
15:50:07.163 INFO - Driver provider class org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform WIN10
15:50:07.184 INFO - Using the passthrough mode handler
2017-08-15 15:50:07.203:INFO:osjs.Server:main: jetty-9.4.5.v20170502
2017-08-15 15:50:07.223:WARN:osjs.SecurityHandler:main: [email protected]@32be31{/,null,STARTING} has uncovered http methods for path: /
2017-08-15 15:50:07.227:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@32be31{/,null,AVAILABLE}
2017-08-15 15:50:07.270:INFO:osjs.AbstractConnector:main: Started ServerConnector@bb307a{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2017-08-15 15:50:07.270:INFO:osjs.Server:main: Started @379ms
15:50:07.270 INFO - Selenium Server is up and running
2017-08-15 15:50:12.043:INFO:osjshC.ROOT:qtp3207616-11: org.openqa.selenium.remote.server.WebDriverServlet-1aeed2f: Initialising WebDriverServlet
15:50:12.091 INFO - Binding default provider to: org.openqa.selenium.chrome.ChromeDriverService
15:50:12.092 INFO - Found handler: org.openqa.selenium.remote.server.BeginSession@384249
15:50:12.095 INFO - /session: Executing POST on /session (handler: BeginSession)
15:50:12.115 INFO - Capabilities are: Capabilities {browserName=chrome, chromeOptions={mobileEmulation={deviceMetrics={width=360.0, height=null, pixelRatio=3.0, }, userAgent=Mozilla/5.0 (Linux; Android..., }, binary=, }, }
15:50:12.116 INFO - Capabilities {browserName=chrome, chromeOptions={mobileEmulation={deviceMetrics={width=360.0, height=null, pixelRatio=3.0, }, userAgent=Mozilla/5.0 (Linux; Android..., }, binary=, }, } matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
15:50:12.116 INFO - Capabilities {browserName=chrome, chromeOptions={mobileEmulation={deviceMetrics={width=360.0, height=null, pixelRatio=3.0, }, userAgent=Mozilla/5.0 (Linux; Android..., }, binary=, }, } matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
15:50:12.117 INFO - Capabilities {browserName=chrome, chromeOptions={mobileEmulation={deviceMetrics={width=360.0, height=null, pixelRatio=3.0, }, userAgent=Mozilla/5.0 (Linux; Android..., }, binary=, }, } matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Starting ChromeDriver 2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8) on port 8152
Only local connections are allowed.
2017-08-15 15:50:12.943:WARN:osjs.HttpChannel:qtp3207616-11: /wd/hub/session
java.lang.NullPointerException
at com.google.gson.JsonPrimitive.isPrimitiveOrString(JsonPrimitive.java:278)
at com.google.gson.JsonPrimitive.setValue(JsonPrimitive.java:101)
at com.google.gson.JsonPrimitive.
at org.openqa.selenium.remote.server.ExceptionHandler.lambda$execute$0(ExceptionHandler.java:82)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.collect(Unknown Source)
at org.openqa.selenium.remote.server.ExceptionHandler.execute(ExceptionHandler.java:88)
at org.openqa.selenium.remote.server.WebDriverServlet.handle(WebDriverServlet.java:247)
at org.openqa.selenium.remote.server.WebDriverServlet.doPost(WebDriverServlet.java:151)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.openqa.selenium.remote.server.WebDriverServlet.service(WebDriverServlet.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:841)
at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.seleniumhq.jetty9.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.seleniumhq.jetty9.server.Server.handle(Server.java:564)
at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:317)
at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:110)
at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.seleniumhq.jetty9.util.thread.Invocable.invokePreferred(Invocable.java:128)
at org.seleniumhq.jetty9.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:126)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
at java.lang.Thread.run(Unknown Source)
Same issue with .NET 3.5 version.
var driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), DesiredCapabilities.Chrome());
driver.Manage().Window.Maximize();
driver.Quit();
Throws exception:
OpenQA.Selenium.WebDriverException : Unexpected error.
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities)
at Example.Class1.x() in C:\git\Unickq.SeleniumHelper\Example\Class1.cs:line 20
Selenium server 3.5 logs:
java.io.IOException: org.openqa.grid.common.exception.GridException: Cannot extract a capabilities from the request: {"desiredCapabilities":{"browserName":"chrome","version":"","platform":"ANY","javascriptEnabled":true,"YOUR CAP":"CAP Value"},"capabilities":{"firstMatch":[{"browserName":"chrome","javascriptEnabled":true,"YOUR CAP":"CAP Value"}]}}
...
Caused by:
java.lang.IllegalArgumentException: W3C payload contained keys that do not comply with the spec: [javascriptEnabled]
Duplicate of #4443
I've missed the fact this is PHP bindings, so re-opening.
https://github.com/SeleniumHQ/selenium/issues/4461#issuecomment-322465357 is a separate issue, to do with the way that the .Net bindings have set up the w3c payload to New Session.
I've landed 88e08c8ae0b65970fda25b4b7e28bb862a73155e to address the NPE being thrown.
@shs96c created issue for that - https://github.com/SeleniumHQ/selenium/issues/4465
Version 3.5.3 released that should fix this NPE.