Selenium Grid/Hub and Standalone Server are returning different responses for the same command

89 views
Skip to first unread message

Ricardo Machado

unread,
Dec 5, 2017, 9:45:55 PM12/5/17
to Selenium Users
Hi all,

First of all thanks for the awesome work you guys have been doing and thank you for these wonderful tools.

Now, onto the problem...

In my company we've set up a Selenium Grid (in Linux, for Chrome and Firefox)... As a framework, we're using NightwatchJS.

We were now in the process of updating our Selenium versions (both local/standalone and the Grid's versions) to 3.8.1. However we noticed that our tests were passing locally, but failing to execute in the Grid.

The error we got was:


So, we started analyzing the reason behind it and found out that the response coming from the Grid differs from the one locally on the Standalone server, when creating the session.


Here's the response to the POST to /wd/hub/session, on the Standalone:


{
  status: 0,
  sessionId
: 'c005bbef-c6ea-7240-ba27-20d3f2a9e774',
  value
: {
    'moz:profile': '/var/folders/v1/c0dtv_8s5c9dgws85x1s4pww0000gp/T/rust_mozprofile.FbUYSJlbNf5Y',
    rotatable: false,
    timeouts
: { implicit: 0, pageLoad: 300000, script: 30000 },
    pageLoadStrategy
: 'normal',
   
'moz:headless': false,
   
'moz:accessibilityChecks': false,
    acceptInsecureCerts
: false,
    browserVersion
: '57.0.1',
    platformVersion
: '15.6.0',
   
'moz:processID': 96619,
    browserName
: 'firefox',
    platformName
: 'darwin',
   
'moz:webdriverClick': false
 
}
}



And this is the response of the same comand, but on the Grid:


{
  value
: {
    sessionId
: 'a139d764-e1a9-4312-b8ff-a24601611ba6',
    capabilities
: {
     
'moz:profile': '/tmp/rust_mozprofile.fW8CDJwT8w3Y',
      rotatable
: false,
      timeouts
: { implicit: 0, pageLoad: 300000, script: 30000 },
      pageLoadStrategy
: 'normal',
     
'moz:headless': false,
     
'moz:accessibilityChecks': false,
      acceptInsecureCerts
: false,
      browserVersion
: '57.0.1',
      platformVersion
: '4.4.64+',
     
'moz:processID': 1799,
      browserName
: 'firefox',
      platformName
: 'linux',
     
'moz:webdriverClick': false
   
}
 
}
}






And, like this, many other commands are being returned without the status property which is a base for the commands' execution on Nightwatch.



Did you ever experience this?
If so, did you fix it? If you did, how?


Kind regards,

Ricardo Machado

Ricardo Machado

unread,
Dec 6, 2017, 3:19:54 AM12/6/17
to Selenium Users
Oh, by the way, forgot to mention that this only happens with FIrefox.

Could it be something specific to the Geckodriver? But then why'd the payload be different from one to another since both use the same gecko ?

Kind regards,
Ricardo Machado

Ricardo Machado

unread,
Dec 6, 2017, 7:21:31 AM12/6/17
to Selenium Users
Hi all,

So, I found the solution after a while of battling with this =).

Basically, as I suspected, the Grid (or more exactly the nodes) were not being compliant with the standalone-server's behaviour. The solution was to pass the following argument to the node's java command:

$ java -jar ./node_modules/selenium-server-standalone-jar/jar/selenium-server-standalone-3.8.1.jar -port 4445 -role node -hub http://localhost:4444/grid/register -enablePassThrough false

This way, the Selenium responses go back to normal and NightwatchJS starts working again flawlessly with Geckodriver and latest Firefox =).

However, since we're using selenium/docker-selenium image, via the selenium/node-firefox docker image, we got a different problem, where - by using the environment variable SE_OPTS - we're unable to override the default -enablePassThrough value. Why? you may ask... That's because the image ships with their default config JSON file which is passed via the -nodeConfig attribute. And apparently, the system does not recognize the last argument - -enablePassThrough false - as an override of the default definition.

Which leads us to create our own image based on that one but with our default config, which is theirs + that definition =/ ...

Hope this helps anyone struggling with this =).

Kind regards,
Ricardo Machado

Anil Bheema

unread,
Dec 14, 2017, 12:18:38 PM12/14/17
to Selenium Users
You are awesome Ricardo, saved my time to run selenium standalone 3.8.1. but it only running on Chrome latest version, but failing on Firefox latest version (57.0.2). do you have any solution for this below is the command I'm using to start seleniumServer
java -jar -Dwebdriver.chrome.driver=chromedriver.exe -Dwebdriver.ie.driver=IEDriverServer.exe -Dwebdriver.gecko.driver=geckodriver.exe selenium-server-standalone-3.8.1.jar -enablePassThrough false
Reply all
Reply to author
Forward
0 new messages