mozilla / geckodriver

WebDriver for Firefox
https://firefox-source-docs.mozilla.org/testing/geckodriver/
Mozilla Public License 2.0
7.03k stars 1.51k forks source link

returns unknown error, when Error: no DISPLAY environment variable specified #2142

Closed runephilosof-abtion closed 7 months ago

runephilosof-abtion commented 7 months ago

System

Testcase

From https://github.com/SeleniumHQ/selenium/issues/12779#issuecomment-1797966160

Error: no DISPLAY environment variable specified
2023-11-07 07:27:26 DEBUG Selenium [:command] <- {"value":{"error":"unknown error","message":"Process unexpectedly closed with status 1","stacktrace":""}} 

Selenium maintainer says it should be fixed in geckodriver: https://github.com/SeleniumHQ/selenium/issues/12779#issuecomment-1798331115

Expected

{"value":{"error":"no display","message":"no DISPLAY environment variable specified","stacktrace":""}} 
whimboo commented 7 months ago

If you are running tests on a system that needs a specific DISPLAY then you have to tell it geckodriver via the environment variable. And as it looks like your system doesn't define one. There is nothing that we can fix in geckodriver.

runephilosof-abtion commented 6 months ago

@whimboo I don't understand why you think it cannot be fixed in geckodriver. I ask for geckodriver to respond with a different error message. Does that request belong to some dependency of geckodriver?

whimboo commented 6 months ago

As what I've already said in my last comment geckodriver doesn't know about the window manager etc setup of the system it runs on. It's just a proxy that converts HTTP requests to internal socket messages for Firefox. Starting Firefox will fail in such a situation and it's Firefox that is crashing due to a missing display, but not geckodriver.