World’s largest virtual agentic engineering & quality conference

WHENAUG 19-21
WHEREVirtual · Global
Register Now
AutomationCross Browser Testing

Automated Cross Browser Testing

Automated cross browser testing verifies your site works across Chromium, Gecko, and WebKit. Learn the frameworks, cloud grids, and a hands-on Selenium example.

Author

Deeksha Agarwal

Author

Last Updated on: November 27, 2023

Automated cross browser testing is the practice of using automation scripts to verify that a web application looks and behaves the same across different browsers, browser engines, operating systems, and devices, without a person clicking through each combination by hand. You write a test once and run it everywhere, instead of manually opening Chrome, Firefox, Safari, and Edge one at a time.

It matters because the same code renders differently across the three major browser engines: Chromium (Chrome and Edge), Gecko (Firefox), and WebKit (Safari). A layout or script that passes in Chrome can break in Safari. Automated cross browser testing catches those differences early and across many environments in parallel, so you ship a consistent experience.

This guide starts with the concept, the leading frameworks, and how modern cloud grids run these tests at scale, then walks through a hands-on Selenium and Java example you can adapt. For the fundamentals, see our guide to cross browser testing.

Overview

Automated cross browser testing uses scripts to verify that a web application looks and behaves the same across different browser engines, operating systems, and devices, without checking each combination by hand.

Why Does It Matter?

The same code renders differently across the three major engines, Chromium (Chrome and Edge), Gecko (Firefox), and WebKit (Safari), so a layout that passes in Chrome can break in Safari. Automating the checks catches those differences early and in parallel.

Which Frameworks Are Used?

  • Selenium: the widest language and browser coverage through WebDriver.
  • Playwright: fast, with built-in auto-waiting and native WebKit/Safari-engine support.
  • Cypress: a developer-centric choice for frontend and component testing.

How Do You Cover Safari and Mobile?

Safari only runs on Apple hardware, so covering WebKit and mobile means testing on real devices. TestMu AI's real device cloud runs your tests on real browsers and devices, including Safari on macOS, with no local hardware to maintain.

What Is Automated Cross-Browser Testing?

Automated cross-browser testing uses scripts to check that a web application renders and functions consistently across different browser engines, operating systems, and devices, with no manual intervention. A test framework drives a real browser through the same steps a user would take, then asserts the result, and repeats that across every target environment.

The reason it exists is that browsers are not identical. There are three major rendering engines, and each interprets HTML, CSS, and JavaScript slightly differently:

  • Chromium: powers Google Chrome and Microsoft Edge (and Opera, Brave, and others).
  • Gecko: powers Mozilla Firefox.
  • WebKit: powers Apple Safari on macOS and iOS.

Manual cross-browser testing means opening each of these by hand, which does not scale. Automating it lets you write a test once and execute it across dozens of browser and OS combinations in parallel, catching layout breaks, broken scripts, and functional bugs before users do.

Top Automation Frameworks: Selenium vs. Playwright vs. Cypress

Three open-source frameworks dominate automated cross-browser testing. They overlap in purpose but differ in speed, language support, and browser-engine coverage. The table below compares them at a glance.

FrameworkBrowser enginesLanguagesBest for
SeleniumChromium, Firefox, WebKit (Safari), Edge, via WebDriverJava, Python, C#, JavaScript, Ruby, and moreBroad language and browser coverage with a mature ecosystem
PlaywrightChromium, Firefox, WebKit (Safari's engine)JavaScript/TypeScript, Python, Java, .NETSpeed, built-in auto-waiting, and native WebKit/Safari-engine testing
CypressChromium-family, Edge, Firefox (WebKit/Safari is experimental)JavaScript/TypeScriptDeveloper-centric frontend and component testing

Selenium remains the default when you need many languages and the widest browser reach. Playwright is often the fastest and ships WebKit out of the box, making it strong for Safari-engine coverage. Cypress runs inside the browser and appeals to frontend teams, though its Safari support is still experimental.

The Challenges of Local Script Automation (And Why Grids Matter)

Running these frameworks on your own machine works for a demo, but it breaks down as coverage grows. The common local-execution pain points are:

  • Driver and browser upkeep: Older Selenium setups meant manually downloading and matching ChromeDriver and GeckoDriver to each browser version. Selenium Manager (4.6+) now automates this, but you still have to keep the browsers themselves installed and updated across machines.
  • No Safari on Windows or Linux: Safari only runs on macOS, so a Windows or Linux machine cannot test the WebKit/Safari engine natively. Covering Apple browsers means maintaining Apple hardware.
  • Resource and scale limits: One laptop can run only a handful of browsers at once. Testing hundreds of browser, OS, and version combinations sequentially turns a few-minute suite into hours.

A cloud-based testing platform, or cloud grid, solves all three. It hosts real browsers and operating systems (including Safari on macOS) so you run the same scripts remotely and in parallel. TestMu AI's Automation Cloud runs your existing Selenium, Cypress, and Playwright tests across 3,000+ browser and OS combinations at once, with video, network, and console logs captured on every run, and no local drivers to manage.

Note

Note: Run your automated cross-browser tests in parallel across 3,000+ real browser and OS combinations, no local grid required. Try TestMu AI free.

Key Metrics to Measure in Cross-Browser Tests

A cross-browser run should report more than a single pass or fail. Track these signals to know whether your app truly behaves consistently:

  • Functional correctness: Does every flow (login, search, checkout) complete successfully on each browser and OS? This is the baseline every test should assert.
  • Visual regression: Does the UI layout render the same across engines? Visual regression testing compares screenshots at the pixel or component level to catch shifted elements, clipped text, and broken styles that a functional test passes over.
  • Performance across engines: Page load and render times can differ significantly between Chromium, Gecko, and WebKit. Tracking them per engine surfaces browser-specific slowdowns.
  • JavaScript error logs: Console and network logs reveal scripts that throw only in certain browsers, a frequent cause of features that silently fail in Safari or Firefox.

Installing Maven

Step 1: Go to Marketplace and install Maven.

Go to help → Eclipse Marketplace → search for Maven→ confirm → confirm → Finish

...............

Restart Eclipse

Step 2: Restart the Eclipse to make changes effective. Once you restart the eclipse, it’s time to start with creating the project.

...

Create a Maven Project

Step 3: To create project, go to File→ New→ Other→ Maven→ Project You are now all set to create a maven project.

............

Here you need to enter the group ID and artifact ID. Let’s say group ID is com.browsers1 and artifact ID is crossbrowser.

After entering the IDs click on Finish and your maven project will be created.

...

On the left hand side, you’ll find two folders namely src/main/java and src/test/java. Under src/test/java you’ll find com.browsers1.crossbrowser. Right click on com.browsers1.crossbrowser select new and then create a class.

......

Enter the name as CrossbrowserTest and click on finish.

Note: Make sure you start your class name with uppercase and end it with test.

Download drivers

The next step is to install drivers for browsers. Since you are going to control your browsers using automated softwares so you need to make sure that the browsers that you’re going to use in your script should have their drivers installed.

For firefox you need to install Geckodriver. For chrome, chromedriver and for opera install operachromiumdriver. Since we are going to use these three browsers in our script so we’ll need to install these. However, if you plan to add more browsers to your script make sure to have their drivers installed.

After you download and install drivers, let’s start with adding dependency files. It is necessary to have dependency files for every framework that you are making use of. So we need to download dependency files for Selenium, Testng in pom.xml file.

Select pom.xml and delete the lines between to and add your dependency files using:

org.testng
   testng
   6.14.3
   test

<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin -->

   org.apache.maven.plugins
   maven-surefire-plugin
   2.19.1

<!-- https://mvnrepository.com/artifact/javax.mail/mail -->
        
            javax.mail
            mail
            1.5.0-b01
        


        
            org.seleniumhq.selenium
            selenium-htmlunit-driver
            2.52.0
        

        
            junit
            junit
            4.12
        

        
            info.cukes
            cucumber-java
            1.2.5
            test
        

        
            info.cukes
            cucumber-picocontainer
            1.2.5
            test
        

        
            info.cukes
            cucumber-junit
            1.2.5
            test
        

        
            org.seleniumhq.selenium
            selenium-java
            3.11.0
        

        
            org.seleniumhq.selenium
            selenium-firefox-driver
            3.5.3
        

        
            org.seleniumhq.selenium
            selenium-chrome-driver
            3.5.3
        

        
            org.seleniumhq.selenium
            selenium-ie-driver
            3.5.3
        

        
            org.seleniumhq.selenium
            selenium-edge-driver
            3.5.3
        

        
            org.apache.maven.plugins
            maven-resources-plugin
            3.0.2
        

        
            org.seleniumhq.selenium
            selenium-support
            3.5.3

This code will add all your dependency files to your project.

Write Final Code

Now save this and move to creating a script for final step.

Again go to src/test/java select crossbrowsertest.java and then copy the code to its workplace.

package com.browsers.Cross_Browser;

	import org.testng.annotations.Test;
    import org.testng.AssertJUnit;
	import org.openqa.selenium.WebDriver;
	import org.openqa.selenium.chrome.ChromeDriver;
	import org.openqa.selenium.firefox.FirefoxDriver;
    import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.opera.OperaDriver;
	//comment the above line and uncomment below line to use Chrome
	//import org.openqa.selenium.chrome.ChromeDriver;
	public class BrowserTest {
	    WebDriver driver;
	    
	    @Test
	    public void AmazonTitleTest() {
	        // declaration and instantiation of objects/variables
	        System.setProperty("webdriver.gecko.driver","C:\Users\Admin\Downloads\geckodriver.exe");
	        driver = new FirefoxDriver();
	        //comment the above 2 lines and uncomment below 2 lines to use Chrome
	        //System.setProperty("webdriver.chrome.driver","G:\chromedriver.exe");
	        //WebDriver driver = new ChromeDriver();s
	        
	        String baseUrl = "https://www.amazon.com/";
	        String expectedTitle = "Amazon.com: Online Shopping for Electronics, Apparel, Computers, Books, DVDs &amp; more";
	        String actualTitle = "";
	        // launch Chrome and direct it to the Base URL
	        driver.get(baseUrl);
	        // get the actual value of the title
	        actualTitle = driver.getTitle();
	        /*
	         * compare the actual title of the page with the expected one and print
	         * the result as "Passed" or "Failed"
	         */
	        AssertJUnit.assertEquals(expectedTitle, actualTitle);
	            
	        //close Fire fox
	        driver.close();
	       
	    }
	    
	    @Test
	    public void AmazonTitleTest1() {
	        // declaration and instantiation of objects/variables
	       
	        //comment the above 2 lines and uncomment below 2 lines to use Chrome
	        System.setProperty("webdriver.chrome.driver","C:\Users\Admin\Downloads\chromedriver_win32\chromedriver.exe");
	        WebDriver driver = new ChromeDriver();
	        
	        String baseUrl = "https://www.amazon.com/";
	        String expectedTitle = "Amazon.com: Online Shopping for Electronics, Apparel, Computers, Books, DVDs &amp; more";
	        String actualTitle = "";
	        // launch Chrome and direct it to the Base URL
	        driver.get(baseUrl);
	        // get the actual value of the title
	        actualTitle = driver.getTitle();
	        /*
	         * compare the actual title of the page with the expected one and print
	         * the result as "Passed" or "Failed"
	         */
	        AssertJUnit.assertEquals(expectedTitle, actualTitle);
	            
	        //close Fire fox
	        driver.close();
	       
	    }
	    
	    @Test
	    public void AmazonTitleTest2() {
	        // declaration and instantiation of objects/variables
	       
	        //comment the above 2 lines and uncomment below 2 lines to use Chrome
	    	System.setProperty("webdriver.ie.driver", "C:/Users/Admin/Downloads/IEDriverServer.exe");
			driver = new InternetExplorerDriver();
	        String baseUrl = "https://www.amazon.com/";
	        String expectedTitle = "Amazon.com: Online Shopping for Electronics, Apparel, Computers, Books, DVDs &amp; more";
	        String actualTitle = "";
	        // launch Chrome and direct it to the Base URL
	        driver.get(baseUrl);
	        // get the actual value of the title
	        actualTitle = driver.getTitle();
	        /*
	         * compare the actual title of the page with the expected one and print
	         * the result as "Passed" or "Failed"
	         */
	        AssertJUnit.assertEquals(expectedTitle, actualTitle);
	            
	        //close Fire fox
	        driver.close();
	       
	    }
	
	}

Once you paste this code,you now need to convert it to testng.xml.

To proceed with that Right click on Crossbrowsertest.java click on testng→ convert to testng→ next→ click the checkbox→ finish.

Now a new file, testng.xml will be created.

Run testng.xml as a testng suite and you’re all set to perform automated cross browser test.

This code will run amazon.com on chrome, mozilla, and opera and test if the website opens or not. If it opens, it will show pass else will show fail.

You’ll soon see an automation software controlling your three browsers and you’ll also see the test being performed on your screen.

You can also add more browsers and change the URL you want to perform the test on.

You do not have to run this suite locally. TestMu AI runs the same Selenium, Cypress, and Playwright tests on its cloud grid across 3,000+ real browser and OS combinations in parallel, including Safari on macOS, so you get full cross-browser coverage without maintaining drivers or devices. Point your WebDriver at the cloud endpoint and your local test becomes a scalable, parallel run.

Till then stay tuned and Happy Testing!

Test across 3000+ browser and OS environments with TestMu AI

Author

...

Deeksha Agarwal

Blogs: 34

  • Twitter
  • Linkedin

Deeksha is a Senior Product Manager at The Economic Times and a Community Evangelist with 8+ years of experience. She is followed by 6,000+ QA professionals, software testers, tech leaders, and enthusiasts across global communities. Deeksha has authored 40+ expert bios for TestMu AI, focusing on cross-browser testing, mobile app testing, regression testing, usability testing, and automation. Previously at TestMu AI, she drove product growth in native app testing and responsive browser features, combining product leadership with deep QA expertise.

Open in ChatGPT Icon

Open in ChatGPT

Open in Claude Icon

Open in Claude

Open in Perplexity Icon

Open in Perplexity

Open in Grok Icon

Open in Grok

Open in Gemini AI Icon

Open in Gemini AI

Copied to Clipboard!
...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free
...
TestMu Conf 2026

World's largest virtual agentic engineering & quality conference

...

AUG 19-21, 2026

REGISTER NOW

Did you find this page helpful?

More Related Blogs

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests