1

I have this configuration for selenium testing in phpuni-environment.conf file

[program:selenium]
command=xvfb-run java -Dwebdriver.firefox.bin=/usr/bin/firefox -jar /usr/share/selenium/selenium-server-standalone.jar
autostart=false ; selenium

[program:python-webserver]
command=python -m SimpleHTTPServer 8080
directory=. ; python-webserver
autostart=false ; python-webserver

[program:php-webserver]
command=php -S localhost:8080
directory=. ; php-webserver
autostart=false ; php-webserver

I do the testing via vagrant. Whenever I run any kind of test, I always get this error

xvfb-run: error: Xvfb failed to start

I found several solutions for this error and I tried this

command=xvfb-run --auto-servernum --server-num=1 java -Dwebdriver.firefox.bin=/usr/bin/firefox -jar /usr/share/selenium/selenium-server-standalone.jar

but still I get the same error. What am I missing here?

asdfkjasdfjk
  • 3,784
  • 18
  • 64
  • 104
  • Is there maybe already a xvfb-instance running? See [this SO answer](https://stackoverflow.com/a/25610678/3054219) or [this issue](https://github.com/plotly/orca/issues/131). – Sonic78 Mar 16 '21 at 22:17

1 Answers1

0

Below code to start XVFB server and test in headless mode written for java perspective.

should run below command in CENTOS

DISPLAY=:99 sudo java -jar /root/Seleniumfolder/selenium-server-standalone-2.50.0.jar -log /root/Seleniumfolder/SeleniumServer.log -host 127.0.0.1 -port 4444 -Dwebdriver.firefox.bin="/usr/bin/firefox"