I’m looking for a way to test our company’s web app that uses a lot of AJAX. We need to run tests without people watching all the time. Right now, we’re doing load tests, but we want to use the same scripts for checking if everything works right too.
We’ve tried a few things:
- The Grinder: It works, but the scripts are hard to keep up with as we develop.
- Firefox in a headless setup: Uses too much computer power.
- HTMLUnit: Keeps showing JavaScript errors that don’t happen in real browsers.
I’ve heard about other options like envjs and zombie.js, but I’m not sure if they’re good enough.
What I really want is a browser that doesn’t need a screen but works just like a real one. Has anyone made something like this? Maybe by changing Firefox or Webkit? I’m surprised it doesn’t exist already.
If we had a real headless browser that doesn’t use too much power, it would solve our problem. Any ideas?
have u tried PhantomJS? it’s a headless browser built on webkit. pretty lightweight and handles javascript well. we use it for our testing and it’s been solid. might be worth checking out if u haven’t already. good luck with your search!
I’d recommend looking into Puppeteer. It’s a Node library developed by Google that provides a high-level API to control Chrome or Chromium over the DevTools Protocol. It’s fully headless, handles JavaScript and AJAX well, and is quite lightweight compared to full browser setups.
We’ve been using Puppeteer for similar enterprise testing needs and it’s been a game-changer. The API is intuitive, making script maintenance easier as your app evolves. It also integrates well with most testing frameworks.
One caveat: there can be a learning curve if you’re not familiar with Node.js. But the documentation is comprehensive and the community support is strong. Given your requirements, it might be worth the investment to explore.
I’ve been in a similar situation, and our team found Selenium with headless Chrome to be a solid solution. It’s versatile, supports AJAX, and integrates well with various testing frameworks.
The key advantage is its compatibility with real browser behavior. We’ve run into fewer false positives compared to other headless options. Plus, the WebDriver protocol it uses is quite stable, which helps with script maintenance as your app evolves.
One tip: we pair Selenium with Docker to manage resource usage and ensure consistent environments across our CI/CD pipeline. This combo has significantly improved our test reliability and speed.
It does have a steeper learning curve than some alternatives, but the robust ecosystem and extensive documentation make it worth considering for enterprise-level testing needs.