Not able to run selenium using ssh, getting chrome crashed error

61 Views Asked by At

I am trying to run Selenium using SSH but getting Chrome crashed error.

Command used over ssh :-

  ssh -tt -o 'StrictHostKeyChecking=no' <ip-address> 'Xvfb :89 -ac -noreset \&;export DISPLAY=:89;./gradlew clean test --tests "testName" '

When tried to run on actual machine its working.

Command used in actual m/c :-

    ./gradlew clean test --tests "testName"

Chrome Version :- 122

Error :-

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.
  (session not created: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) 
Host info: host: 'xxxx', ip: 'xxxx'
Build info: version: '4.13.0', revision: 'ba948ece5b*'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-1015-aws', java.version: '17.0.10'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [start-maximized, --log-level=3, --disable-logging, --remote-allow-origins=*], extensions: [], prefs: {download.default_directory: /, download.directory_upgrade: true, download.prompt_for_download: false, plugins.always_open_pdf_externally: true, profile.content_settings.exceptions.automatic_downloads.*.setting: 1, profile.default_content_settings.popups: 0}}}]}]

Tried to launch Chrome from SSH, getting error :-

<user>@ip:~$ Xvfb :89 -ac -noreset &
[1] 2150856
<user>@ip:~$ export DISPLAY=:89
<user>@ip:~$ /opt/google/chrome/chrome
[0328/044551.812046:WARNING:chrome_main_linux.cc(80)] Read channel 
stable from /opt/google/chrome/CHROME_VERSION_EXTRA
[2151074:2151074:0328/044552.418390:ERROR:viz_main_impl.cc(196)] 
Exiting GPU process due to errors during initialization
[2151036:2151036:0328/044552.718182:ERROR:object_proxy.cc(576)] 
Failed to call method: org.freedesktop.ScreenSaver.GetActive: 
object_path= /org/freedesktop/ScreenSaver: 
org.freedesktop.DBus.Error.NotSupported: This method is not part 
of the idle inhibition specification: 
https://specifications.freedesktop.org/idle-inhibit-spec/latest/
[2151181:2151181:0328/044553.044279:ERROR:viz_main_impl.cc(196)] 
Exiting GPU process due to errors during initialization

[2151097:7:0328/044553.295640:ERROR:command_buffer_proxy_impl
.cc(131)] ContextResult::kTransientFailure: Failed to send 
GpuControl.CreateCommandBuffer.
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
0

There are 0 best solutions below