I'm attempting to run a headless (using xvfb) copy of selenium. I'm using the selenium standalone jar file to do this. I've attempted to do all of this manually and could not get the server to run. In this case, I run the following commands:
In the first terminal window: Xvfb -fp /usr/share/fonts/X11/misc/ :10 -screen 0 1024x768x16 2>&1 & export DISPLAY=:10
Once this is running without errors I open a new terminal window and run: java -jar /usr/lib/selenium/selenium-server-standalone-2.46.0.jar -port 4444
This attempts to boot up for a very, very long time and looks like:
While leaving both of these terminal windows open I attempt to connect to the selenium server on 127.0.0.1:4444 (using a golang selenium package) and I get a refused connection. From this I attempted to utilize a package called 'selenium-standalone' that I found in the npm repository. I've installed that per instructions here. I then attempted to run the server with: xvfb-run --server-args="-screen 0, 1366x768x24" selenium-standalone start -- -debug
Doing so gives me a more detailed output, but no resolution. I'm still getting refused connections. The output from the terminal for running the xvfb-run in combo with selenium-standalone is as follows (well, at least the tail end of it):
Any insight in how I could/should move forward with troubleshooting this would be greatly appreciated.
p.s. I have confirmed that the golang app and the selenium wrapper I'm using in my golang app are both working and can connect to a working selenium server. At one point it was running and everything was fine- no go code has changed and I just can't get this selenium server to start reliably.
I ran selenium headless following this guide and it ran flawlessly. If you try it, I would recommend removing selenium and and all associated files, and starting again from scratch. Good luck.
setup working headless selenium server by xvfb
is not easy. here's one good example which is used in building a standalone selenium server with chrome browser in a docker container: https://github.com/SeleniumHQ/docker-selenium/blob/master/StandaloneChrome/entry_point.sh
you should point your browser to http://localhost:4444/wd/hub
to verify if the selenium server is started successfully.