I was using Selenium to automate some tasks beyond testing and needed to set it up to run with a cron job. A shell script calls the appropriate Maven command, but I kept getting the error:
Error: no display specified
The fix was to add this to the script before calling Maven:
export DISPLAY=:0
Evidently when Selenium is started from cron, it doesn’t know what display to use. This code tells it to use display 0 and it runs normally.
People Found This When Looking For:
- Error: no display specified (337)
- selenium Error: no display specified (117)
- selenium no display specified (53)
- error no display specified (42)
- no display specified (41)
- Error: no display specified selenium (27)
- selenium cron (18)
- selenium error no display specified (17)
- error no display specified selenium (15)
- selenium no display (11)