Problem :
I am trying to develop some selenium tests which should run with headless firefox but the following error suddenly popped up in my server.log file when I was trying to connect to the webdriver via following command:
driver = webdriver.Firefox(firefox_profile = profile, log_path = logfile)
Please find below the error:
1518520162032 geckodriver::marionette INFO Starting browser /usr/bin/firefox with args ["-marionette"]
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused
Error: cannot open display: :1137
I have not done any changes in my code. It was working fine before this error came. How can I fix the above error???
My software spec as below:
python 2.7.12, Firefox: Mozilla Firefox 57.0.3, geckodriver: 0.19.1, selenium: 3.8.0