Cross-browser testing

On this page 7

Cross-browser testing is the practice of verifying that a website or web application renders, behaves and performs acceptably across the browsers, rendering engines, devices and operating systems its audience actually uses. It checks layout, functionality, input handling and accessibility, not only whether a page loads.

In web testing, cross-browser testing exists because browsers implement web standards through different rendering engines, release on different schedules and run on hardware ranging from desktop workstations to low-end phones. Code that works perfectly in one browser can break silently in another, and those failures often affect a significant share of real visitors.

Why browsers behave differently

Differences between browsers come mainly from three independent rendering engines and from the platforms they run on. Most browsers share one of these engines, so testing by engine is more efficient than testing every browser brand separately.

EngineMain browsersTesting note
BlinkChrome, Edge, Opera, Samsung InternetLargest share, but versions and flags vary
GeckoFirefoxIndependent implementation of layout and JavaScript APIs
WebKitSafari on macOS, iOS and iPadOSOften lags or differs on newer features
Main rendering engines and their browsers

Beyond the engine, results depend on browser version, operating system, screen density, input method and user settings. Font rendering differs between Windows and macOS, touch input changes hover behavior, and settings such as larger default text or reduced motion alter layouts. On iOS, browsers have traditionally been required to use WebKit, so a page tested only in Chrome on desktop can still fail for iPhone users who prefer Chrome.

What cross-browser testing covers

A complete cross-browser test plan examines several layers of the experience, each with characteristic failure types. Visual checks alone miss many functional problems, and functional scripts alone miss layout defects.

LayerWhat is checkedTypical defect
Layout and stylingGrid, flexbox, fonts, spacingOverlapping elements or broken alignment
JavaScript featuresAPI availability and behaviorScript error stops the whole page
Forms and inputDate pickers, validation, autofillNative controls differ or fail to submit
MediaVideo codecs, image formatsUnsupported format shows nothing
AccessibilityFocus order, screen reader outputDifferent announcement of controls
PerformanceLoad and interaction speed on real devicesAcceptable on desktop, sluggish on low-end phones
Test layers and typical defects

Building a browser support matrix

No team can test every combination, so cross-browser testing starts with a browser support matrix that defines which browsers receive full support, which receive basic support, and which are out of scope. The matrix should be based on the site’s own analytics, not on global market share alone.

TierBrowsers includedExpected experienceTesting depth
Full supportCurrent and previous versions of major enginesAll features, pixel-level consistencyAutomated and manual on each release
Functional supportOlder versions with measurable trafficCore tasks work, visuals may differAutomated smoke tests
Best effortRare or legacy browsersContent readable, no guaranteesOccasional spot checks
Example support tiers

Many teams express the matrix as a Browserslist query shared by build tools, so the same definition drives CSS prefixing, JavaScript transpilation and the test plan. Compatibility references and the Baseline feature status help decide whether a newer feature can be used without a fallback.

Manual, automated and cloud approaches

Cross-browser testing combines automated checks for breadth with manual checks for judgment. Automation catches regressions on every commit, while human testers notice awkward interactions and visual issues that scripts do not describe.

ApproachStrengthLimitation
Manual testing on real devicesRealistic touch, performance and renderingSlow and hard to repeat consistently
Automated end-to-end testsRepeatable checks with WebDriver or PlaywrightMaintenance effort and flaky timing
Visual regression testingDetects pixel-level layout changes per browserNeeds baseline management and tolerance tuning
Cloud device farmsAccess to many browser and OS versionsCost and slower feedback than local runs
Emulation in browser DevToolsFast responsive checksDoes not reproduce another engine
Approaches compared

An important distinction is that device emulation is not cross-browser testing. Resizing Chrome to a phone viewport tests responsive CSS in Blink, but it does not reveal how WebKit on an iPhone will render the page. Tools that drive real Chromium, Firefox and WebKit builds close much of this gap during automated runs.

Reducing cross-browser defects in development

The cheapest cross-browser bug is the one prevented during development. Several engineering habits reduce the number of problems that testing has to catch later.

  • Use feature detection, not browser detection, for example CSS @supports or checking whether an API exists before calling it.
  • Apply progressive enhancement so core content and tasks work even when an advanced feature is missing.
  • Normalize default styles to reduce differences in margins, form controls and typography.
  • Transpile and polyfill deliberately based on the support matrix, not by bundling every polyfill for every visitor.
  • Run linting for compatibility that warns when code uses features outside the defined targets.

A frequent mistake is testing only in the developer’s own browser until shortly before release. Defects found late are expensive to fix, so cross-browser checks belong in the continuous integration pipeline from the start of a project.

The simple explanation

Different web browsers read the same website code in slightly different ways, much as different printers can produce the same document with small differences in color or spacing. Cross-browser testing means checking the website in several browsers and devices to make sure everyone gets a working, good-looking page.

The goal is not that every pixel looks identical everywhere. The goal is that every visitor can read the content and complete their task, whether they use an iPhone, an older laptop or a different browser than the developers.

How it is used in practice

An insurance company launches a new online claim form built and tested mainly in desktop Chrome. Within the first week, support receives complaints that the form cannot be submitted on iPhones. Analytics show that about a third of claim visits come from Safari on iOS, which the team had checked only through desktop device emulation.

The investigation finds that a date field relies on behavior that WebKit handles differently, and a validation script throws an error that blocks submission. The team fixes the code with feature detection, then adds automated end-to-end tests in Chromium, Firefox and WebKit to the pipeline and a short manual check on a real iPhone before each release. The claim completion rate on iOS returns to the level of desktop users.