Spending Less Time on Cross-Browser Testing and Making It More Efficient
By: Ranorex Webtestit
Tags: Cross Browser Testing, Test Automation, Automated Testing, Software Development, Ranorex Webtestit

Spending Less Time on Cross-Browser Testing and Making It More Efficient

When testing websites, it is important not to forget to test them across multiple browsers and their versions with cross-browser testing. Many developers forget or ignore this type of testing because it takes too much time. With the right tools, however, we can speed it up and make more efficient. Ranorex Webtestit Follow Feb 20, 2020 · 6 min read

Different browsers behave in different ways. For example, font size may appear differently from browser to browser, a behavior of CSS, HTML or JavaScript can also vary, page alignment, div size or image orientation may differ, some browsers might not be compatible with the operating system (OS), and so on.

All this can affect the way our website is displayed to our users. While a website may display correctly in some browsers, it could appear broken in others.

Users unable to access your website or view its layout properly won’t hesitate. They will move on and find another website that offers the same functionalities.

To avoid losing users, we need to make sure that our website works on every browser and device. The automated cross-browser testing is the best way to test our website across multiple browsers.

What is cross-browser testing?

Cross-browser testing, also known as browser compatibility testing, is the practice in which we run the same set of test cases multiple times on different browsers, browser versions, and devices to make sure that our website works for all our users, regardless of the technology or tools they may use.

When testing across different browsers, we shouldn’t only include the most popular browsers, such as Google Chrome, Mozilla Firefox or Microsoft Edge, but less popular ones as well. We also need to include older browser versions that may still be in use by some users.

Cross-browser testing should also cover different devices with different capabilities, from desktop computers and laptops to tablets and mobile phones to smart TVs.

Some suggest that cross-browser testing should also include web accessibility testing to make sure that people with various disabilities, who use the web with the aid of assistive technologies, can access your website.

Which browsers are important for cross-browser testing?

The best strategy would be to include all browsers. However, there are more than hundreds of browsers that people use worldwide. Moreover, each browser has multiple versions, and some browsers, such as Google Chrome and Mozilla Firefox, are frequently updated — at least once a month. This means it would take a lot of time to test a website across all these browsers.

There are several things that can help us prioritize the browsers before we start testing.

First, we can track our user browser usage and make a list of browsers based on user preferences.

If we cannot get a report or make a list, we can use the stats on the major usage share, stating that Chrome, Safari, Firefox, and Samsung Internet are the most used browsers worldwide at the time of writing of this article. So, these four could be our starting point.

Next, we should start testing from the most used browser to the least used. Also, we should start testing from higher-priority compatibility issues to lower ones.

The best way to carry out cross-browser testing

Executing the same test cases in multiple browsers is a time-consuming task. Due to its repetitive nature, cross-browser testing is best suited for automation.

With automation testing tools, we don’t only reduce the amount of time it takes to carry out cross-browser testing, but we also do it more systematically and effectively. The automation allows us to test across multiple device, browser and OS combinations using the same test script, only changing the environments.

The choice of automation tool is also important to perform efficient cross-browser testing.

Ranorex Webtestit is the automation toolset for web testing in Python, Java, and TypeScript. The biggest advantage of using Ranorex Webtestit is that once we create a project, it takes care of the entire test setup process by scaffolding the test framework, setting up required drivers, and creating boilerplate code for the programming language chosen.

Thanks to this feature, we can focus on what matters the most — actual testing. So, after Ranorex Webtestit completed the setup for us, we can proceed and create the Page Objects, add the selectors for web elements with the help of free Ranorex Selocity extension, create Page Object actions, and finally, write our test.

Before the test execution in Ranorex Webtestit, we need to set endpoints. This is where cross-browser testing comes into play.

Here, in the endpoint settings, we define a platform, OS, browser, and browser’s version. Ranorex Webtestit allows us to run our test against all popular browsers or a headless browser on Windows, macOS, Linux, as well as Android and iOS mobile devices.

We can set local, remote or custom endpoints. However, for the efficient cross-browser testing, setting the remote endpoint with Sauce Labs or Selenium Grid is the best solution.

Tools like Sauce Labs are perfect because they allow us to run multiple tests simultaneously and execute them across different operating systems, browsers, system configurations, to ensure the best possible coverage.

We need to register a Sauce Labs account to connect with Ranorex Webtestit.

Another solution is to set custom endpoint and test a wide range of devices and browsers with Browserstack. This method also requires users to have a registered account and to provide the capabilities to the endpoint. We can use the Browserstack’s Capabilities Generator to find the values for specific OS, browser name, browser version and other parameters for our test and copy them into the ‘Capabilities’ field in Ranorex Webtestit.

Many developers use Browserstack as one of the best tools to test older browser versions.

It should be noted, however, that the cross-browser testing using custom endpoint with Browserstack in Ranorex Webtestit is a bit slower than remote test execution with Sauce Labs.

Even if you don’t have Sauce Labs or Browserstack account, cross-browser testing in Ranorex Webtestit is still possible, though not as easily or effectively as with the two previous solutions. We won’t discuss this method here, because it is useful when testing browser versions one at a time. However, if you want to test against several browsers at once, it might not be the most suitable solution.

Conclusion

Cross-browser testing is often ignored or given lower priority in web development due to its monotonous and repetitive nature, especially when schedules are tight. Some teams perform this task partially, limiting it to specific browsers, typically the most popular ones. However, such practice is not recommended, because users expect web sites to work in any browser, on any operating system, and on any device.

The solution for this is to choose a tool that has the capabilities to efficiently perform web testing across multiple browsers, OS, and devices. One such tool is Ranorex Webtestit that simplifies this task thanks to the integration with popular cross-browser testing solutions.

You can download a free, full-featured trial of Ranorex Webtestit here.