View all web browser and mobile devices available in our cloud-based test lab.
Many teams use Selenium cross-browser testing to test on multiple browsers at once for their responsive or traditional websites. Here, we cover what it is and how to do it.
Selenium cross browser testing is a way to test web apps in parallel across different browsers, such as IE, Chrome, and Firefox. Cross browser testing determines the ability of a website or application to perform across different browsers or operating systems.
Selenium releases frequently, and it is always improving. You can also integrate Selenium with other tools as part of your cross-browser testing effort. Selenium is the main test automation framework for web, but there are also Selenium alternatives.
You can do multiple browser testing with Selenium on Chrome, Safari, Edge, and Firefox browsers. Selenium frameworks provides a built-in grid capability. This enables parallel testing and testing across browsers through various web drivers and language binding support.
Testing across multiple browser permutations as well as mobile devices is quite difficult. It requires a lab configuration that is always up to date. That’s why testing web apps across platforms involves leveraging Selenium to automate the effort.
You can do this using tools, such as Perfecto, to execute test cases on different browsers and mobile devices at the same time.
Here’s a walkthrough of how to perform cross-browser testing Selenium with Perfecto.
A standard Selenium project requires a local grid configuration. But when you’re working with Selenium and Perfecto, there’s a minimal setup that needs to be done.
You can also watch the video below to see how it works. Or keep reading for a quick introduction.
You’ll need to ensure the following are configured.
All of the POM.XML maven file dependencies are in place:
<!-- Reportium SDK -->
Perfecto unique user configuration:
And you’ll also need the target platform under test configured in a testNG.xml file. This file specifies on which desktop browsers and mobile devices to execute the tests.
case "Firefox 64":
device = false;
fast = true;
capabilities.setCapability("location", "US East");
To get started, you’ll need to have Perfecto set up that you’ll need for cross-browser testing with Selenium execution.
You’ve configured the Selenium project in the IntelliJ IDEA environment and built the testNG file. Now, the only thing that a user needs to do is to execute the testNG.XML file.
Selenium developers can use testNG to also pass many of the above-mentioned configurations as parameters (including cloud URL, Selenium address, username are examples). This creates much cleaner test code.
After triggering the execution from the IDE, you can login to the cloud to see the execution happening within the Perfecto live stream. In this view, you can track the execution progress. You can also zoom into a specific platform that is running.
In our execution, we tested the Boston Globe responsive website across 14 different web and mobile configurations in the Perfecto cloud.
In the demo video, you’ll see the devices and device capabilities are defined. So are the characteristics of the device for that test.
Once the testing is done, Perfecto will release the browser and mobile devices. Perfecto then can do a quick clean-up — and generate the subsequent report for you.
In our example, we’ve entered a couple of variables for a website — homepage, zip code, and more. The Selenium test will run on the site — and the reporting capabilities will capture what happens.
Finally, you may have encountered a failure that is not a real defect. The failure reason tab within the reporting is the first step for analyzing the root cause — and deciding how to move forward.
There could either be a test coding issue, a platform specific configuration issue, or an environment issue. The initial analysis helps you improve the stability of your Selenium scripts and keep a healthy testing pipeline.
This is just the beginning of what you can do for cross-browser testing using Selenium WebDriver, Java, and Perfecto. Watch the full demo video above to go into more advanced Selenium test automation.
To ensure scalability, reliability and advanced reporting and productivity, it’s recommended to move the execution to the cloud. And the best way to automate cross-browser testing with Selenium in the cloud, is to use Perfecto.
Perfecto and Selenium are seamlessly integrated. That means you can:
Get started for free with a 14-day trial.