Selenium No Display Specified

Post image for Selenium No Display Specified

by Mark Shead on June 2, 2010

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 (34)
  • selenium Error: no display specified (24)
  • selenium no display specified (11)
  • no display specified (9)
  • error no display specified selenium (6)
  • selenium cron (5)
  • selenium display (4)
  • error no display specified (2)
  • NO DISPLAY (2)
  • mvn selenium Error: no display specified (2)

Leave a Comment

Previous post:

Next post: