Cross-browser testing

Cross-browser testing is checking that a website or web application works in each browser its users have, and in the rendering engine behind each one. The same pages are run in several browsers and versions to find features that are missing, drawn differently or behaving differently from one engine to the next.

The longer version

A browser is a product, and the part that turns HTML, CSS and other resources into a picture on the screen is its rendering engine, which MDN's glossary also calls a layout engine or browser engine. Blink is developed by Google as part of Chromium, and so runs Chrome, and Microsoft's documentation names Chromium as the engine that powers Edge. Gecko is Mozilla's engine and runs Firefox. WebKit runs Safari, and Apple's App Store rules require apps that browse the web to use WebKit unless the developer holds an entitlement, offered in the European Union and Japan, for another engine. A browser on an iPhone may therefore carry a familiar name and run on WebKit.

MDN's guide to cross-browser testing gives the causes of trouble: browsers have bugs or implement a feature differently, and they support new features at different times, so a recent CSS property or JavaScript interface can exist in one engine and be missing from another. To a user the result is a layout that collapses or a button that does nothing. The scope is narrower than that of its neighbours. Compatibility testing is the wide category, which also covers the operating system, the device, the screen and the network, and cross-browser testing is one axis of it. Cross-device testing keeps the engine steady and varies the hardware, and this practice does the reverse: one machine, several engines. MDN's own definition is looser and takes in devices as well.

Nobody can test every browser and version, so the list is chosen. MDN's advice is that the important browsers are the ones commonly used among the target audience, and that analytics from the site itself are a more accurate guide than public statistics, with one warning: a browser can be missing from the analytics because the site was already broken in it. The guide suggests grading browsers, with thorough testing and full support for the common modern ones and a more basic experience for older ones. Automation covers part of the list. Playwright, for example, runs the same tests on Chromium, WebKit and Firefox, which exercises the three engines from one machine.

A pass covers what a user does, in each browser on the list. Datadog's guide frames it as user journeys such as signing up, timed step by step, and the usual checks are layout and fonts at several viewport widths, forms and validation, navigation, media, and any recent CSS or JavaScript feature the page depends on. The work splits three ways. Manual testing in real browsers catches what looks wrong. Automated suites repeat the same journeys on every change, and Selenium Grid and Playwright are the free, open-source ways to run them across browsers. Cloud services such as BrowserStack, LambdaTest and Sauce Labs provide real browsers and devices on demand, which saves keeping a lab of old phones and Macs. Visual comparison tools, Applitools among them, take a screenshot of each page in each browser and flag the differences, which is the kind of fault a functional test passes straight over.

Common questions

What is cross-browser testing?

Cross-browser testing is running the same website or web application in several browsers and versions to confirm that it looks and works as intended in each. The aim is to catch features that one rendering engine lacks or handles differently before users of that browser find them.

Which browsers should a website be tested on?

The browsers the site's own audience uses, read from its analytics, are the ones to test. For a new site with no data, MDN suggests public usage statistics for the target region. A list that includes at least one browser on each of Blink, WebKit and Gecko covers the three engines.

What is the difference between a browser and a browser engine?

A browser is the whole application, with its address bar, tabs, settings and extensions. The engine is the component inside it that reads HTML and CSS and draws the page. Several browsers can share one engine: Chrome and Edge are both built on Chromium, whose rendering engine is Blink.

Is cross-browser testing still necessary?

Cross-browser testing is still needed, although the gaps are smaller than they were. MDN notes that browsers follow web standards much more closely than in the past and that differences and bugs still get through. New features also reach the engines at different times, so a page using recent CSS or JavaScript can work in one and fail in another.

Can cross-browser testing be automated?

Automated suites can run one set of tests against several engines. Playwright runs on Chromium, WebKit and Firefox, and can drive the branded Chrome and Edge builds. Its WebKit is built from WebKit's own source and is not Safari itself, so a final check in real Safari, on a Mac and on an iPhone, still has a place.

What is the best tool for cross-browser testing?

The best tool depends on the job. Playwright and Selenium Grid are free and run automated tests on several engines. BrowserStack, LambdaTest and Sauce Labs provide real browsers and devices in the cloud for manual and automated runs. Applitools and similar visual tools compare screenshots across browsers. Many teams combine an open-source runner with a cloud grid for the browsers they do not own.

Is there a free way to do cross-browser testing?

Free options exist. Every browser can be installed and checked by hand, and the developer tools in each have a responsive mode for viewport sizes. Playwright and Selenium Grid are open source and automate Chromium, Firefox and WebKit at no cost. Real Safari still needs Apple hardware, and most cloud grids offer a limited free trial.

How do you perform cross-browser testing in Selenium?

Write the test once against the WebDriver interface, then run it with a driver for each browser: ChromeDriver, GeckoDriver for Firefox, SafariDriver and the Edge driver. Selenium Grid spreads those runs across machines so the browsers test in parallel, and a cloud grid can stand in for the machines.

What is the difference between cross-browser testing and compatibility testing?

Compatibility testing is the wider category and checks a product against operating systems, devices, screen sizes, networks and browsers. Cross-browser testing is the browser part of it: one site run through several browsers and engines to find features that are missing or drawn differently in one of them.

Bug reports that arrive ready to triage.

Collect replay, console, network and browser context with the Free plan.

<script src="…/widget.js" data-key="pb_pub_…">