I want to integrate JSTestDriver with jenkins-CI. problem is that the build server does not have display. is there a way to run browsers headlessly?
Thanks
Google Chrome now (Chrome 59 for Mac and Linux, Chrome 60 for Windows) has a headless mode built-in. It works cross-platform, and doesn't require any messing around with display devices, virtual machines, or anything like that. You can find a great Getting Started article by Eric Bidelman here, but here are the most key points:
You must launch the Chrome binary (on macOS it is located inside the Google Chrome.app
bundle in the the Contents/MacOS
directory) using --headless
flag. It is currently also necessary to add the --disable-gpu
flag, because GPU acceleration does not work properly in headless mode.
chrome --headless --disable-gpu [url/path/flags...]
As with standard non-headless Chrome, your test runner can communicate with Chrome using the dev tools interface if it's enabled by the --remote-debugging-port=[SOME_PORT]
flag. However, if you'd just like to test it quickly by yourself you can use the --screenshot
or --dump-dom
flags to check out the contents of the page after loading.
chrome --headless --disable-gpu --dump-dom https://stackoverflow.com/
If your server is Linux, as mentioned, you can't run IE. But you can run other browsers like Firefox. The trick is to install XVFB on your Jenkins server which allows Firefox to run headless. I've used this setup and it works well.
http://www.alittlemadness.com/2008/03/05/running-selenium-headless/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With