Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Firefox is basically the first port of call for running web tests on buildservers. Run Firefox headlessly in xvfb, then throw Selenium or similar at it. It's a pretty mature setup.


Even better, selenium has preconfigured containers for Firefox and Chrome and that use Xvfb. At the start of a web automation project I worked on, I spent a lot of time trying to get various versions of browser, selenium and pyvirtualbuffer installed and running with mixed results. These containers are well tested and work very well.


I would think PhantomJS, being a headless, scriptable browser (plus built on WebKit so closer rendering to the most popular browser), would be the "first port of call."


I have used phantomjs (with casperjs) for scrapping a website, it was complete nightmare.

1. It use javascript to script so writting sequential code wasn't possible so the code ended up using continuation passing style.

2. The very first example snippet on the front page don't work in the repl (https://github.com/ariya/phantomjs/issues/11180). So the repl is useless.

3. When an error occur in your script (not the one on the webpage) there is no message anywhere no matter what you do.

My mistake was to continue with phantomjs the hype around made me think others options would have been worst.

I have used selenium+firefox+php to do a quick test it was wayyyy better, just for n°1 using sequential php remove a lot headaches.


Why use a fake browser when you can use a real one? It's also harder to inspect the actual rendering of an invisible browser.

Near the top of a google search for 'phantomjs vs selenium', we have folks on HN complaining about phantomjs https://news.ycombinator.com/item?id=8418071




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: