Can't launch selenium tests via selenese - selenium

When I launch selenese via this command :
java -jar selenese-runner.jar -d chrome --chromedriver chromedriver.exe -b http://localhost:8080 C:\Trunk\src\selenium\suiteTest
I get this error :
[2017-11-30 11:02:36.722 +01:00] [ERROR]jp.vmi.selenium.selenese.SeleneseRunnerRuntimeException: No such command: Build info: version: '3.5.3', revision: 'unknown', time: 'unknown' System info: host: 'WALOX', ip: '10.1.85.3', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version:'1.8.0_121'
I launch it in a folder that contains selenese-runner.jarv3.8.0 and a chromeDriver.exe v2.33.506120
This is all the stack just in case :
[2017-11-30 11:02:33.218 +01:00] [INFO] Start: Selenese Runner 3.8.0
Starting ChromeDriver 2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f) on port 12619
Only local connections are allowed.
[2017-11-30 11:02:36.293 +01:00] [INFO] Detected dialect: OSS
[2017-11-30 11:02:36.300 +01:00] [INFO] Initial window size: system default
[2017-11-30 11:02:36.300 +01:00] [INFO] Initialized: ChromeDriver
[2017-11-30 11:02:36.308 +01:00] [INFO] Override base URL: http://localhost:8080
[2017-11-30 11:02:36.313 +01:00] [INFO] Timeout: 30000 ms
[2017-11-30 11:02:36.674 +01:00] [INFO] Start: TestSuite[suiteTest] (C:\Trunk\src\selenium\suiteTest)
[2017-11-30 11:02:36.712 +01:00] [INFO] Existing driver found.
[2017-11-30 11:02:36.720 +01:00] [INFO] Current speed: 0 ms/command
[2017-11-30 11:02:36.722 +01:00] [ERROR] jp.vmi.selenium.selenese.SeleneseRunnerRuntimeException: No such command:
Build info: version: '3.5.3', revision: 'unknown', time: 'unknown'
System info: host: 'WALOX', ip: '10.1.85.3', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: driver.version: unknown
[2017-11-30 11:02:36.724 +01:00] [INFO] End(0,000sec): TestSuite[suiteTest] (C:\Trunk\src\selenium\suiteTest)
[2017-11-30 11:02:36.724 +01:00] [INFO] Exit code: 3
[2017-11-30 11:02:37.430 +01:00] [INFO] Quit: ChromeDriver
I've looked on the net. It seems that I am the only person with this error in the world. I have no clue!

RESOLVED
In fact it was so stupid! I am using Selenium IDE on firefox to write the test, and I ve added an empty command line at the end which generate an empty entry in the generated HTML :
<tr>
<td></td>
<td></td>
<td></td>
</tr>
Which made the script to fail on this error!

Related

Selenium ChromeDriver exception

I am getting following error for my ChromeDriver, and I cannot figure out why. Chrome is 68 version and chromedriver is 2.41. This throws following error and does not even open the Chrome browser.
Aug 08, 2018 5:08:23 PM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
Starting ChromeDriver 2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e) on port 9090
Only local connections are allowed.
geb.driver.DriverCreationException: failed to create driver from callback 'script1533762503012124154837$_run_closure1#2fb69ff6'
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:85)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy)
at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:32)
at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:84)
at geb.Configuration.createDriver(Configuration.groovy:382)
at geb.Configuration.getDriver(Configuration.groovy:371)
at geb.Browser.getDriver(Browser.groovy:111)
at geb.report.PageSourceReporter.getPageSource(PageSourceReporter.groovy:42)
at geb.report.PageSourceReporter.writePageSource(PageSourceReporter.groovy:38)
at geb.report.PageSourceReporter.writeReport(PageSourceReporter.groovy:29)
at geb.report.CompositeReporter.writeReport(CompositeReporter.groovy:31)
at geb.Browser.report(Browser.groovy:927)
at geb.spock.GebReportingSpec.report(GebReportingSpec.groovy:59)
at geb.spock.GebReportingSpec.cleanup(GebReportingSpec.groovy:46)
> Caused by: org.openqa.selenium.WebDriverException: unknown error:
> cannot parse capability: chromeOptions from unknown error:
> unrecognized chrome option: class (Driver info:
> chromedriver=2.41.578737
> (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT
> 10.0.163 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 12 milliseconds Build info:
> version: '3.13.0', revision: '2f0d292', time:
> '2018-06-25T15:24:21.231Z' System info: host: 'CL-', ip:
> '10', os.name: 'Windows 10', os.arch: 'amd64', os.version:
> '10.0', java.version: '1.8.0_121' Driver info: driver.version:
> ChromeDriver
Here I am not even using any desired Capabilities and I have no idea from where it is getting it.
driver = {
System.setProperty('webdriver.chrome.driver', System.getProperty("user.dir")+'\\src\\test\\resources\\chromedriver.exe')
new ChromeDriver()
}
<seleniumVersion>3.4</seleniumVersion>
What am I doing wrong?
I added Guava jar files and it fixed that issue.
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>22.0</version>
</dependency>

Protractor tests fail to start on Safari Sierra and throwing driver.version: unknown, SessionNotCreatedError error

Protractor version: 5.1.2
Safari version: 10.1.2
I have enabled 'Allow Remote Automation' from Safari -> Develop and started the safari driver from cmd using the following command:
/usr/bin/safaridriver -p 8844
Now, trying to run the protractor tests using protractor conf.js. The tests fail to start with the following logs:
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
I figured out the issue. Since built in safari driver has a limitation of only one browser window at a time, I quit all the running safari windows and ran the tests again. Worked perfectly fine :)
Reference:
https://webkit.org/blog/6900/webdriver-support-in-safari-10/
Kinda tricky, because currently it's not quite working due webdriver/selenium incompatibilities. We are hoping that, with the new webdriver release, it will work. See here.

Unable to work with Chrome browser using Selenium webdriver in codeception

Starting selenium + chrome driver with this is command
java -Dwebdriver.chrome.driver=chromedriver.exe -jar selenium.jar
It start the server
This is my acceptance.suite.yml file
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
url: ''
browser: chrome
window_size: 1280x768
curl:
CURLOPT_TIMEOUT: 60
This is what i am receiving as error when i try to execute the test case
[Facebook\WebDriver\Exception\UnknownServerException]
unknown error: cannot parse capability: proxy
from unknown error: must be a dictionary
(Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.2 x86_64) (WARNING: The server d
id not provide any stacktrace information)
Command duration or timeout: 518 milliseconds
Build info: version: '2.52.0', revision: '4c2593c', time: '2016-02-11 19:06:42'
System info: host: 'FR301-216', ip: '172.16.102.106', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.8.0_65'
Driver info: org.openqa.selenium.chrome.ChromeDriver
This is an existing bug in the new codeception version (2.1.5 and above). The solution is to downgrade your codeception version to 2.1.4.

Selenium tests fail on remote machine for chrome and ie drivers

I am using selenium grid with testng for distributed testing.
I want to run tests on remote machine on chrome and IE browsers. But the tests fail with exception on these two browsers. When tests are run on Firefox, the run is successful.
Here is the code used for initializing browsers:
DesiredCapabilities cap = new DesiredCapabilities();
cap.setBrowserName("chrome");
cap.setPlatform(Platform.WINDOWS);
driver = new RemoteWebDriver(new URL(URL),cap);
driver.get(myURL);
The browsers are successfully initialized. The tests fail while finding element and sending keys.
The code which finds element is :
driver.findElement(By.xpath(Xpath_Username)).sendKeys("abc");
I am using my machine as hub and another machine as node. Node is connected to hub using below command :
java -jar selenium-server-standalone-2.47.1.jar -role webdriver -hub http://*myip*:4444/grid/register -port 8989 -browser browserName="chrome",version=ANY,platform=VISTA,maxInstances=5 -Dwebdriver.chrome.driver=D:\chromedriver.exe -browser browserName="internet explorer",version=ANY,platform=VISTA,maxInstances=2 -Dwebdriver.ie.driver=D:\IEDriverServer.exe
I am executing tests parallel using testng on different machines and browsers.
The output of the tests :
Running TestSuite
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 7.068 sec <<< FAILURE! - in TestSuite
remoteTest(testproject.testclass) Time elapsed: 2.313 sec <<< FAILURE!
org.openqa.selenium.NoSuchWindowException: Unable to find element on closed window (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 13 milliseconds
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: hostname, ip: 'ip', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_51'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version
ntCacheCleanup=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=dismiss}]
Session ID: f3667158-1a65-4c24-866a-3d1c5444918b
*** Element info: {Using=xpath, value=//input[#id='login']}
Command duration or timeout: 214 milliseconds
Build info: version: '2.47.1', revision: 'unknown', time: '2015-07-30 11:02:44'
System info: host: 'hostname', ip: 'ip', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_51'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version
criptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=dismiss}]
Session ID: d93bfa55-13b2-427f-b11d-fca5417a0d91
*** Element info: {Using=xpath, value=//input[#id='login']}
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:138)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:348)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:445)
at org.openqa.selenium.By$ByXPath.findElement(By.java:358)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:340)
at testproject.Browser.login(Browser.java:44)
at testproject.testclass.remoteTest(testclass.java:10)
Caused by: org.openqa.selenium.NoSuchWindowException: Unable to find element on closed window (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 13 milliseconds
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'hostname', ip: 'ip', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_51'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version
ntCacheCleanup=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=dismiss}]
Session ID: f3667158-1a65-4c24-866a-3d1c5444918b
*** Element info: {Using=xpath, value=//input[#id='login']}
Build info: version: '2.47.1', revision: 'unknown', time: '2015-07-30 11:02:44'
System info: host: 'hostname', ip: 'ip', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_51'
Driver info: driver.version: EventFiringWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
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:595)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:348)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:445)
at org.openqa.selenium.By$ByXPath.findElement(By.java:358)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:340)
at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver$2.invoke(EventFiringWebDriver.java:102)
at com.sun.proxy.$Proxy3.findElement(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver.findElement(EventFiringWebDriver.java:185)
at org.openqa.selenium.remote.server.handler.FindElement.call(FindElement.java:48)
at org.openqa.selenium.remote.server.handler.FindElement.call(FindElement.java:1)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Results :
Failed tests:
testclass.remoteTest:10->Browser.login:44 ? NoSuchWindow Unable to find elemen...
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.
Please refer to D:\svn_workspace\SeleniumGrid\target\surefire-reports for the individual test results.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11 seconds
[INFO] Finished at: Tue Sep 08 14:45:39 IST 2015
[INFO] Final Memory: 38M/260M
[INFO] ------------------------------------------------------------------------
Please provide any solution to this.
The issue got solved by adding below code :
cap.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
Also, Protected mode must be enabled in Internet Explorer and it should be same for all zones.
element = findElement(By.xpath("//*input[#id='login'"));

Intern 2.0 fails with local Selenium Grid

I'm new to the Intern framework and I'm trying to get a simple functional test running using a local Selenium Grid. It runs perfectly when I run Selenium as a standalone server, but when I try to use a Selenium Grid it fails. The browser launches, but only shows about:blank in the address bar. I'm using OS X 10.9.4 and running the tests in Chrome. I followed the instructions here to set up the grid, namely:
$ java -jar selenium-server-standalone-2.41.0.jar -role hub
$ java -jar selenium-server-standalone-2.41.0.jar -role node -hub http://localhost:4444/grid/register
$ node node_modules/intern/runner.js config=tests/intern
Here's my test:
registerSuite({
name: 'index',
"sample test": function () {
return this.remote
.get("http://www.google.com");
}
});
Here's the output I'm seeing from Intern:
$ node node_modules/intern/runner.js config=tests/intern
Listening on 0.0.0.0:9000
Starting tunnel...
Initialised chrome 36.0.1985.143 on MAC
Test main - index - sample test FAILED on chrome 36.0.1985.143 on MAC:
JavaScriptError: [POST http://localhost:4444/wd/hub/session/61150cc5-2cf0-42e4-adc7-bf27b4751ed2/execute / {"script":"return (function getCoverageData() {\n\t\t/*global __internCoverage:false */\n\t\treturn typeof __internCoverage !== 'undefined' && JSON.stringify(__internCoverage);\n\t}).apply(this, arguments);","args":[]}] Session [61150cc5-2cf0-42e4-adc7-bf27b4751ed2] was terminated due to FORWARDING_TO_NODE_FAILED
at Server._post <node_modules/intern/node_modules/leadfoot/Server.js:62:9>
at ProxiedSession._post <node_modules/intern/node_modules/leadfoot/Session.js:57:30>
at ProxiedSession.Session.execute <node_modules/intern/node_modules/leadfoot/Session.js:580:15>
at ProxiedSession.lang.mixin.get <node_modules/intern/lib/ProxiedSession.js:77:17>
at CompatCommand.<anonymous> <node_modules/intern/node_modules/leadfoot/Command.js:617:19>
at <node_modules/intern/node_modules/leadfoot/node_modules/dojo/Promise.js:256:37>
at runCallbacks <node_modules/intern/node_modules/leadfoot/node_modules/dojo/Promise.js:13:18>
at <node_modules/intern/node_modules/leadfoot/node_modules/dojo/Promise.js:204:17>
at Object.run [as _onImmediate] <node_modules/intern/node_modules/leadfoot/node_modules/dojo/Promise.js:143:29>
at processImmediate [as _immediateCallback] <timers.js:336:15>
at new CompatCommand <node_modules/intern/runner.js:195:14>
at <CompatCommand.target.(anonymous function) [as get] (/Users/myuser/intern-test-example/node_modules/intern/node_modules/leadfoot/Command.js:592:11)>
at Test.registerSuite.sample test [as test] <tests/functional/index.js:11:18>
at Test.run <node_modules/intern/lib/Test.js:154:19>
at <node_modules/intern/lib/Suite.js:212:13>
at signalListener <node_modules/intern/node_modules/dojo/Deferred.js:37:21>
at Promise.then.promise.then <node_modules/intern/node_modules/dojo/Deferred.js:258:5>
at <node_modules/intern/lib/Suite.js:211:46>
at process._tickCallback <node.js:419:13>
No unit test coverage for chrome 36.0.1985.143 on MAC
chrome 36.0.1985.143 on MAC: 1/1 tests failed
TOTAL: tested 1 platforms, 1/1 tests failed
Output from the Selenium hub:
$ java -jar selenium-server-standalone-2.41.0.jar -role hub
Aug 19, 2014 4:32:29 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a selenium grid server
2014-08-19 16:32:29.925:INFO:osjs.Server:jetty-7.x.y-SNAPSHOT
2014-08-19 16:32:29.958:INFO:osjsh.ContextHandler:started o.s.j.s.ServletContextHandler{/,null}
2014-08-19 16:32:29.965:INFO:osjs.AbstractConnector:Started SocketConnector#0.0.0.0:4444
Aug 19, 2014 4:32:59 PM org.openqa.grid.web.servlet.handler.RequestHandler process
INFO: Got a request to create a new session: Capabilities [{idle-timeout=60, browserName=chrome, name=tests/intern, selenium-version=2.41.0}]
Aug 19, 2014 4:33:04 PM org.openqa.grid.web.servlet.handler.RequestHandler process
INFO: Got a request to create a new session: Capabilities [{idle-timeout=60, browserName=chrome, name=tests/intern, selenium-version=2.41.0}]
Aug 19, 2014 4:33:04 PM org.openqa.grid.internal.ProxySet getNewSession
INFO: Available nodes: [host :http://X.X.X.X:5555]
Aug 19, 2014 4:33:04 PM org.openqa.grid.internal.BaseRemoteProxy getNewSession
INFO: Trying to create a new session on node host :http://X.X.X.X:5555
Aug 19, 2014 4:33:04 PM org.openqa.grid.internal.TestSlot getNewSession
INFO: Trying to create a new session on test slot {seleniumProtocol=WebDriver, platform=MAC, browserName=chrome, maxInstances=5}
Aug 19, 2014 4:33:06 PM org.openqa.grid.web.servlet.handler.RequestHandler process
SEVERE: cannot forward the request null
org.apache.http.client.ClientProtocolException
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:867)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:115)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at org.openqa.grid.internal.TestSession.sendRequestToNode(TestSession.java:370)
at org.openqa.grid.internal.TestSession.forward(TestSession.java:227)
at org.openqa.grid.web.servlet.handler.RequestHandler.forwardRequest(RequestHandler.java:96)
at org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:129)
at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:83)
at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:67)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.seleniumhq.jetty7.servlet.ServletHolder.handle(ServletHolder.java:565)
at org.seleniumhq.jetty7.servlet.ServletHandler.doHandle(ServletHandler.java:479)
at org.seleniumhq.jetty7.server.session.SessionHandler.doHandle(SessionHandler.java:225)
at org.seleniumhq.jetty7.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
at org.seleniumhq.jetty7.servlet.ServletHandler.doScope(ServletHandler.java:406)
at org.seleniumhq.jetty7.server.session.SessionHandler.doScope(SessionHandler.java:186)
at org.seleniumhq.jetty7.server.handler.ContextHandler.doScope(ContextHandler.java:965)
at org.seleniumhq.jetty7.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.seleniumhq.jetty7.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.seleniumhq.jetty7.server.Server.handle(Server.java:349)
at org.seleniumhq.jetty7.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
at org.seleniumhq.jetty7.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
at org.seleniumhq.jetty7.server.AbstractHttpConnection.messageComplete(AbstractHttpConnection.java:903)
at org.seleniumhq.jetty7.server.AbstractHttpConnection$RequestHandler.messageComplete(AbstractHttpConnection.java:960)
at org.seleniumhq.jetty7.http.HttpParser.parseNext(HttpParser.java:897)
at org.seleniumhq.jetty7.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.seleniumhq.jetty7.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
at org.seleniumhq.jetty7.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
at org.seleniumhq.jetty7.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
at org.seleniumhq.jetty7.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.http.ProtocolException: Transfer-encoding header already present
at org.apache.http.protocol.RequestContent.process(RequestContent.java:92)
at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:131)
at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:165)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:484)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
... 31 more
Output from the Selenium node:
$ java -jar selenium-server-standalone-2.39.0.jar -role node -hub http://localhost:4444/grid/regter
Aug 19, 2014 4:32:45 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a selenium grid node
16:33:00.598 INFO - Java: Oracle Corporation 24.60-b09
16:33:00.599 INFO - OS: Mac OS X 10.9.4 x86_64
16:33:00.603 INFO - v2.39.0, with Core v2.39.0. Built from revision ff23eac
16:33:00.654 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match with current platform: MAC
16:33:00.673 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:5555/wd/hub
16:33:00.674 INFO - Version Jetty/5.1.x
16:33:00.674 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
16:33:00.675 INFO - Started HttpContext[/selenium-server,/selenium-server]
16:33:00.675 INFO - Started HttpContext[/,/]
16:33:00.681 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#511533be
16:33:00.681 INFO - Started HttpContext[/wd,/wd]
16:33:00.683 INFO - Started SocketListener on 0.0.0.0:5555
16:33:00.683 INFO - Started org.openqa.jetty.jetty.Server#2461e285
16:33:00.684 INFO - using the json request : {"class":"org.openqa.grid.common.RegistrationRequest","capabilities":[{"platform":"MAC","seleniumProtocol":"Selenium","browserName":"*firefox","maxInstances":5},{"platform":"MAC","seleniumProtocol":"Selenium","browserName":"*googlechrome","maxInstances":5},{"platform":"MAC","seleniumProtocol":"Selenium","browserName":"*iexplore","maxInstances":1},{"platform":"MAC","seleniumProtocol":"WebDriver","browserName":"firefox","maxInstances":5},{"platform":"MAC","seleniumProtocol":"WebDriver","browserName":"chrome","maxInstances":5},{"platform":"MAC","seleniumProtocol":"WebDriver","browserName":"internet explorer","maxInstances":1}],"configuration":{"port":5555,"register":true,"host":"X.X.X.X","proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy","maxSession":5,"role":"node","hubHost":"localhost","registerCycle":5000,"hub":"http://localhost:4444/grid/register","hubPort":4444,"url":"http://X.X.X.X:5555","remoteHost":"http://X.X.X.X:5555"}}
16:33:00.685 INFO - Starting auto register thread. Will try to register every 5000 ms.
16:33:00.685 INFO - Registering the node to hub :http://localhost:4444/grid/register
16:33:04.989 INFO - Executing: [new session: Capabilities [{idle-timeout=60, browserName=chrome, name=tests/intern, selenium-version=2.41.0}]] at URL: /session)
16:33:04.996 INFO - Creating a new session for Capabilities [{idle-timeout=60, browserName=chrome, name=tests/intern, selenium-version=2.41.0}]
Starting ChromeDriver (v2.10.267517) on port 17126
Only local connections are allowed.
16:33:06.089 INFO - Done: /session
16:33:06.175 INFO - Executing: [get: about:blank] at URL: /session/61150cc5-2cf0-42e4-adc7-bf27b4751ed2/url)
16:33:06.323 INFO - Done: /session/61150cc5-2cf0-42e4-adc7-bf27b4751ed2/url
16:33:06.337 INFO - Executing: [get local storage size] at URL: /session/61150cc5-2cf0-42e4-adc7-bf27b4751ed2/local_storage/size)
16:33:06.337 INFO - Executing: [get location context] at URL: /session/61150cc5-2cf0-42e4-adc7-bf27b4751ed2/location)
16:33:06.337 INFO - Executing: [take screenshot] at URL: /session/61150cc5-2cf0-42e4-adc7-bf27b4751ed2/screenshot)
16:33:06.339 INFO - Executing: [execute async script: arguments[0](true);, []] at URL: /session/61150cc5-2cf0-42e4-adc7-bf27b4751ed2/execute_async)
16:33:06.340 WARN - Exception thrown
org.openqa.selenium.UnsupportedCommandException: driver (org.openqa.selenium.chrome.ChromeDriver) does not support org.openqa.selenium.html5.LocationContext
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:11:15'
System info: host: 'myhost', ip: 'X.X.X.X', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.4', java.version: '1.7.0_60'
Driver info: driver.version: unknown
at org.openqa.selenium.remote.server.handler.html5.Utils.convert(Utils.java:81)
at org.openqa.selenium.remote.server.handler.html5.Utils.getLocationContext(Utils.java:42)
at org.openqa.selenium.remote.server.handler.html5.GetLocationContext.call(GetLocationContext.java:31)
at org.openqa.selenium.remote.server.handler.html5.GetLocationContext.call(GetLocationContext.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:170)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
16:33:06.340 WARN - Exception thrown
org.openqa.selenium.UnsupportedCommandException: driver (org.openqa.selenium.chrome.ChromeDriver) does not support org.openqa.selenium.html5.WebStorage
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:11:15'
System info: host: 'myhost', ip: 'X.X.X.X', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.4', java.version: '1.7.0_60'
Driver info: driver.version: unknown
at org.openqa.selenium.remote.server.handler.html5.Utils.convert(Utils.java:81)
at org.openqa.selenium.remote.server.handler.html5.Utils.getWebStorage(Utils.java:52)
at org.openqa.selenium.remote.server.handler.html5.GetLocalStorageSize.call(GetLocalStorageSize.java:31)
at org.openqa.selenium.remote.server.handler.html5.GetLocalStorageSize.call(GetLocalStorageSize.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:170)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
16:33:06.344 WARN - Exception: driver (org.openqa.selenium.chrome.ChromeDriver) does not support org.openqa.selenium.html5.LocationContext
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:11:15'
System info: host: 'myhost', ip: 'X.X.X.X', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.4', java.version: '1.7.0_60'
Driver info: driver.version: unknown
16:33:06.345 WARN - Exception: driver (org.openqa.selenium.chrome.ChromeDriver) does not support org.openqa.selenium.html5.WebStorage
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:11:15'
System info: host: 'myhost', ip: 'X.X.X.X', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.4', java.version: '1.7.0_60'
Driver info: driver.version: unknown
16:33:06.618 INFO - Done: /session/61150cc5-2cf0-42e4-adc7-bf27b4751ed2/screenshot
16:33:06.631 INFO - Done: /session/61150cc5-2cf0-42e4-adc7-bf27b4751ed2/execute_async
I know that the FORWARDING_TO_NODE_FAILED error is supposed to mean there's a network issue, but I don't see how that could be the case as everything is running locally. I've tried other Selenium versions (2.39, 2.40, 2.41, and 2.42.2) and other browsers (Firefox, Safari) with no luck. Any help would be appreciated here.
Selenium Grid is buggy and requires a Content-Length header on all non-GET requests (Selenium server standalone does not). Intern 2.0.3 works around this issue, so if you update to 2.0.3, things should just work.