0

Trying to run some Selenium tests locally using Selenium 3.0 but get the following error:

org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{marionette=true, screen-resolution=1680x1050, commandTimeout=300, record-video=true, version=50.1.0, platform=MAC, tags=[Ljava.lang.String;@1ac4da8f, build=jgilmore-12291406, idleTimeout=120, name=homePageSmokeTest, browserName=firefox, seleniumVersion=null, maxDuration=360}], required capabilities = Capabilities [{}]
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700

Currently running the Selenium Hub as follows:

java -jar /Users/jgilmore/Selenium/selenium-server-standalone-3.0.1.jar -role hub -timeout 15

And the Node (trying to run Firefox 50.1.0 with Geckodriver first):

java -Dwebdriver.gecko.driver=/Users/jgilmore/Selenium/geckodriver -jar selenium-server-standalone-3.0.1.jar -port 5557 -role node -hub http://localhost:4444/grid/register -browser "browserName=firefox, browserVersion=50.1.0, maxInstances=10"

The Grid and Node startup just fine (see them in the Grid Console), but I can't create a WebDriver instance when trying to run my test(s). This used to work for me with Selenium 2.x, so I am assuming I'm missing something here. Any help is appreciated!

jaredgilmore
  • 657
  • 8
  • 17
  • Could you also please share how you're running the tests? – gsaslis Dec 29 '16 at 22:41
  • Sure, through maven, so for instance: `mvn clean install -Dthreading=cooperative -DCONFIGFILE=/Users/jgilmore/Selenium/localautomation.properties` The configfile is storing other properties I use to create the WebDriver, such as the browser and version, site url, etc. – jaredgilmore Dec 29 '16 at 22:43
  • Ok thanks. I presume you get this error when running the tests. Could you also please check if you have any error logs in a. the Grid Hub, b. the Node? – gsaslis Dec 29 '16 at 22:48
  • No errors in the Node, but I do see the request to start a WebDriver in the Hub: `14:30:58.867 INFO - Got a request to create a new session: Capabilities [{marionette=true, screen-resolution=1680x1050, commandTimeout=300, record-video=true, version=50.1.0, platform=MAC, tags=[HomePageTest, m07s2m8j], build=jgilmore-12291430, idleTimeout=120, name=homePageSmokeTest, browserName=firefox, seleniumVersion=null, maxDuration=360}]` – jaredgilmore Dec 29 '16 at 22:50
  • Ok so problem looks like is with the hub not being able to match a node with the request... i spotted a difference between 'version' (on the request) and 'browserVersion' on the node... maybe that could be the issue? – gsaslis Dec 29 '16 at 23:02
  • Don't think so.... the browser version in all instances is set to Firefox version 50.1.0, unless you're seeing something I am not? – jaredgilmore Dec 29 '16 at 23:05
  • Yes, if you look closely, the DesiredCapabilities have 'version'. You use 'browserVersion' on the node. I'm not sure if this is on purpose...? – gsaslis Dec 29 '16 at 23:07
  • Ah, that was an accident. Changed it `browserVersion` to `version`, but still no change to the overall problem. :( – jaredgilmore Dec 29 '16 at 23:12
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/131873/discussion-between-gsaslis-and-diieu). – gsaslis Dec 30 '16 at 07:25

1 Answers1

0

So with the help of gasalis, I think we figured out my issue:

  1. Change browserVersion to version on both the Node and my local configuration.
  2. For whatever reason, I have to set the browser version for Firefox and Chrome to ANY -- I can't explicitly state the browser version such as "50.1.0" for Firefox or "55" for Chrome. Probably something I'm missing, but that's an issue for another question.

By changing those two things, I can now successfully create the WebDriver(s) necessary to run my local Selenium scripts.

Thanks for your help gsaslis!

jaredgilmore
  • 657
  • 8
  • 17