0

I'm running Selenium tests on CentOS 7 machine through Jenkins pipeline hence using Xvfb. When use screen argument with any valid value like following -

wrap([$class: 'Xvfb', autoDisplayName: true, screen: '1440x800x8']) { 
   <code to run Selenium test here>
}

It results into following error -

[testng] org.openqa.selenium.WebDriverException: chrome not reachable

   [testng]   (Session info: chrome=80.0.3987.132)

   [testng]   (Driver info: chromedriver=80.0.3987.16 (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185}),platform=Linux 3.10.0-862.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)

   [testng] Command duration or timeout: 0 milliseconds

   [testng] Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z'

 

If we run it without screen argument it runs successfully.

One more observation - with screen argument, it perfectly works on Ubuntu 18

Please help me how I can run Selenium tests with screen argument on CentOS 7.

Alpha
  • 13,320
  • 27
  • 96
  • 163

1 Answers1

0

After trying with different values for screen parameters, I realized this is not something which is wrong with Chrome browser or driver but with value passed to screen

When I changed depth value from 8 to 16, Selenium execution started successfully - screen: '1440x800x16'

wrap([$class: 'Xvfb', autoDisplayName: true, screen: '1440x800x16']) { 
   <code to run Selenium test here>
}

But technically, I did not understand why this error occurs and how depth value helped to resolve it.

Alpha
  • 13,320
  • 27
  • 96
  • 163