The environment I am running is Windows Server 2008 R2 with IIS 7
I am trying to follow the instructions on the Readme.md file:
https://github.com/facebook/php-webdriver/blob/community/README.md
"Unable to refresh session list."
and
"Unable to create new session"
I ran the Selenium server using this method:
CMD > Run-as Administrator
_java -jar selenium-server-standalone-3.5.0.jar_
The result from the command is:
_14:56:56.648 INFO - Selenium build info: version: '3.5.0', revision: '8def36e068'
14:56:56.648 INFO - Launching a standalone Selenium Server
2017-08-23 14:56:56.664:INFO::main: Logging initialized @341ms to org.seleniumhq.jetty9.util.log.StdErrLog
14:56:56.742 INFO - Driver class not found: com.opera.core.systems.OperaDriver
14:56:56.773 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 VISTA
14:56:56.804 INFO - Using the passthrough mode handler
2017-08-23 14:56:56.836:INFO:osjs.Server:main: jetty-9.4.5.v20170502
2017-08-23 14:56:56.851:WARN:osjs.SecurityHandler:main: [email protected]@5ce81285{/,null,STARTING} has uncovered http methods for path: /
2017-08-23 14:56:56.867:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@5ce81285{/,null,AVAILABLE}
2017-08-23 14:56:56.960:INFO:osjs.AbstractConnector:main: Started ServerConnector@9660f4e{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2017-08-23 14:56:56.960:INFO:osjs.Server:main: Started @639ms
14:56:56.960 INFO - Selenium Server is up and running_
So I assume everything is running OK. However, when I try to run the http://localhost/example.php file after following the steps in the readme file, I get this error on the browser:
"This page isn鈥檛 working
localhost is currently unable to handle this request.
HTTP ERROR 500"
to troubleshoot, I tried to go to the url: http://localhost:4444/wd/hub/
and at the top of the page I saw a red alert saying
"Unable to refresh session list."
the resulting log from the command prompt:
_2017-08-23 14:57:05.288:INFO:osjshC.ROOT:qtp405662939-23: org.openqa.selenium.remote.server.WebDriverServlet-28feb3fa: Initialising WebDriverServlet
14:57:05.444 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.Status@ed2556e
14:57:05.444 INFO - /status: Executing GET on /status (handler: Status)
14:57:05.475 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.NoHandler@7ee495af
14:57:05.475 INFO - /sessions: Executing GET on /sessions (handler: NoHandler)_
When I click to create a session, no matter which browser I select, I get "
"Unable to create new session"
the resulting log is:
_14:57:13.917 INFO - Binding default provider to: org.openqa.selenium.chrome.ChromeDriverService
14:57:13.917 INFO - Found handler: org.openqa.selenium.remote.server.BeginSession@41762efd
14:57:13.932 INFO - /session: Executing POST on /session (handler: BeginSession)
14:57:13.964 INFO - Capabilities are: Capabilities {browserName=firefox}
14:57:13.964 INFO - Capabilities {browserName=firefox} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.firefox.GeckoDriverService)
14:57:13.964 INFO - Capabilities {browserName=firefox} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
2017-08-23 14:57:13.995:WARN:osjs.HttpChannel:qtp405662939-38: /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.run(EatWhatYouKill.java:199)
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)_
Hi @asofan,
this error:
to troubleshoot, I tried to go to the url: http://localhost:4444/wd/hub/
and at the top of the page I saw a red alert saying
"Unable to refresh session list."
has been solved here:
https://github.com/SeleniumHQ/selenium/issues/4496
and was included in the Selenium 3.5.2 release.
I can't say if it'll help with your issue.
I guess it may be related. @asofan could you please try with latest Selenium server whether the problem still persist? If so, I would reopen the issue then.
Also please provide the exact source code you use to run the PHP test to help us debug the issue :).
Thanks!
Hey, I had the same issue with chrome/firefox55.0.3(latest) browser and standalone-selenium.
Tried standalone versions 3.0.0, 3.0.1, 3.0.2, 3.0.4, 3.5.2.
I thought the standalone jar incorporated the gecko driver (for firefox) but I was wrong.
Hence, I downloaded the driver (latest), added it to environment variables and it was fixed.
Hope it could help you, best wishes.
I can confirm that the issue of "Unable to refresh session list" is solved.
However, still getting the "Unable to create new session" error
this is the example.php file is the one included and can be found here:
https://github.com/facebook/php-webdriver/blob/community/example.php
the result when running http://127.0.0.1/example.php is this:
=============================================
Fatal error: Uncaught exception 'Facebook\WebDriver\Exception\SessionNotCreatedException' with message 'Unable to create new service: GeckoDriverService
Build info: version: '3.5.2', revision: '10229a9020', time: '2017-08-21T17:54:21.164Z'
System info: host: 'ADMIN', ip: '142.54.164.98', os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_144'
Driver info: driver.version: unknown' in C:\Program Files (x86)\PHP\v5.6\vendor\facebook\webdriver\lib\Exception\WebDriverException.php:154
Stack trace:
You were right fllprbt. I downloaded the browser driver and it now works. Thank you.
I have the same issue while executing example.php:
PHP Fatal error: Uncaught Facebook\WebDriver\Exception\SessionNotCreatedException: Unable to create new service: GeckoDriverService
Build info: version: '3.5.2', revision: '10229a9020', time: '2017-08-21T17:54:21.164Z'
System info: host: 'xxx', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-92-generic', java.version: '1.8.0_111'
Driver info: driver.version: unknown in ../vendor/facebook/webdriver/lib/Exception/WebDriverException.php:154
Stack trace:
#0 ../vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php(320): Facebook\WebDriver\Exception\WebDriverException::throwException(33, 'Unable to creat...', Array)
#1 ../vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php(126): Facebook\WebDriver\Remote\HttpCommandExecutor->execute(Object(Facebook\WebDriver\Remote\WebDriverCommand))
#2 ../Downloads/selenium_test.php(31): Facebook\WebDriver\Remote\RemoteWebDriver::create('http://localhos...', Object(Facebook\WebDriver\Remote\DesiredCapabilities in ../vendor/facebook/webdriver/lib/Exception/WebDriverException.php on line 154
any help will be appreciated
after adding the Gecko driver the example.php works perfect when running on the localhost on the IIS server.
so, http://localhost/example.php works perfect
However, when I moved it to another site on the same IIS server, I get a class not found error.
So, when I run it on http://www.mysite.com/example.php
_the file is located here: C:\inetpub\wwwroot\example.php_
I get this error:
Fatal error: Class 'Facebook\WebDriver\Remote\DesiredCapabilities' not found in C:\HostingSpaces\mysite.com\mysite.com\wwwroot\example.php on line 13
the file is located here:
_C:\HostingSpaces\mysite.com\mysite.com\wwwroot\example.php_
Can you help?
Thanks in advance
You are getting out of topic, please don't continue here. Your problem may be related to missing composer or priviliges or other things.
Best wishes,
Most helpful comment
Hey, I had the same issue with chrome/firefox55.0.3(latest) browser and standalone-selenium.
Tried standalone versions 3.0.0, 3.0.1, 3.0.2, 3.0.4, 3.5.2.
I thought the standalone jar incorporated the gecko driver (for firefox) but I was wrong.
Hence, I downloaded the driver (latest), added it to environment variables and it was fixed.
Hope it could help you, best wishes.