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.
Hi Mark,
thanks for this info. I just had this problem and was wondering what went wrong. Now it’s working :).
Regards,
Andreas.
thank you very much, it works.
Hi Mark,
Thanks for the info and its working fine