When comparing Browsersync vs CasperJS, the Slant community recommends Browsersync for most people. In the question“What are the best multi-browser testing tools with synchronized interactions?” Browsersync is ranked 1st while CasperJS is ranked 4th. The most important reason people chose Browsersync is:
It is not constrained to a single device, it works across desktop and mobile devices at the same time. It will update code changes, synchronize scroll positions and form inputs automatically across all browsers and devices.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Works concurrently across multiple devices
It is not constrained to a single device, it works across desktop and mobile devices at the same time. It will update code changes, synchronize scroll positions and form inputs automatically across all browsers and devices.
Pro Synchronized form field input
When filling out a form in one browser, same information will be repeated in other browsers.
Pro Works with basically every desktop and mobile browser
Browser-Sync has been tested to work with desktop (Chrome, Firefox, IE 7-10, Safari, Opera) and mobile (Android, iOS, Windows Phone, Opera Mobile, Firefox Mobile) browsers.
Pro Cross-platform
Works on Windows, Linux and OS X.
Pro CSS injection
Once the monitored .css file is saved, changes are implemented without a refresh.
Pro Free and open source
Licensed under MIT.
Pro Remembers scroll position
Remembers scroll position and synchronize it across all browsers so you don't have to move to the appropriate part of the page after each reload.
Pro Works as a standalone npm package or as a Grunt plugin
To install as a standalone npm package
npm install -g browser-sync
To install as a grunt-plugin
npm install grunt-browser-sync
Pro Synchronized navigation
When navigating in one browser, other browsers will automatically follow to the same place.
Pro Doesn't require a browser plugin
BrowserSync does not require a browser plugin to be installed. This is because it serves the files directly itself, and uses a script which opens a socket between the browser and the server.
Pro Works with older versions of IE
Browser-Sync works with all supported IE versions - IE7 and up.
Pro Allows screenshots (either the full page or parts of it) if performing UI testing
There are times where you don't want to open up a browser for screencaps, that is where CasperJS comes to use, it can render the page using its own rendering engine and take and save a screenshot for you, all via the commandline
Pro Easy to understand
Pro Written in JavaScript
Since all webdevs know JS, the start-up time of learning the framework will be reduced to zero, as your team can be productive from day one.
Pro Easily integrates with other applications
Due to the simplicity of the framework, not only other libraries can be built with it, but it can be integrated with any web application as well.
Pro Can run javascript code inside pages being tested
Can execute arbitrary javascript or load external JS into the page being tested. This feature is possible due to the presence of a rendering engine, and helps you see the effects of any client side scripting during your tests.
Cons
Con Setting up in Windows can be a little tricky
Sometimes when setting up BrowserSync in Windows some errors will pop up. Most of the time this is because npm throws errors when trying to compile BrowserSync and some of the dependencies need Visual C++ runtime libraries.
This is easily solvable by installing Visual Studio. Once it's installed, there should not be any more problems.
Con Not for unit testing but rather UI testing
These are two extremely different concepts. CasperJS should be removed from this list
Con Cannot guarantee 100% accurate Webkit-based browser screenshots
QtWebKit is the rendering engine used by CasperJS. Keep in mind this is NOT the same rendering engine as Chrome; hence, if you want to be 100% sure of the results, you must run a Webkit browser (such as Chrome) yourself.