When comparing Selenium vs Browsersync, 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 Selenium is ranked 5th. 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 Actively supported
The open source community behind Selenium has a very large & engaged developer base. This ensures a stable support channel for the tool. In addition, various companies also provide support for Selenium. This active and multi-channel support provides a much more lucrative option for developers looking to implement Selenium in their workflow.
Pro Cross-browser
Supports many browsers and a solid platform for adding future browsers to selenium (WebDriver)
Pro Cross-platform
Selenium is based on Java and can be run on Windows, Mac, Linux, Unix, etc.
Pro Ability to imitate a real user using the application
Testing is analogous to a human being using the web application which is not possible with a solution which runs headless and claims to run faster than Selenium.
Pro Integrates with any CI tool
Selenium, with its ability to interact with different testing frameworks, like NUnit or xUnit, makes it easy to get Selenium working with practically any Continuous Integration services.
Pro Uses an approved WC3 standard - WebDriver
The WebDriver protocol is standardized by the World Wide Web Consortium which makes it easy for third-parties to get involved and contribute to Selenium.
WebDriver has been the foundation of many additional automation projects besides core selenium and has become the de-facto standard for UI automation.
Pro You can use the same IDE you use for coding to debug
Pro Integrates well with existing testing frameworks
Pro Support for many languages
Selenium supports a variety of languages including Java, Python, PHP, C#, Ruby and JavaScript ensuring that the tool is easily accessible to a wide variety of developers.
Pro Use the very minimum amount of code required to run
Selenium tries to inject into the page only the bare minimum of code needed to run the tests.
Pro Easy to set preconditions for the tests
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.
Cons
Con Requires installation of drivers
Con The IDE for recording isn't too powerful
Con Issues with locators
Locators that support common attributes like: name
, id
, XPATH
, javascriptDOM
, etc. have to be found through firebugs.
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.