2

This answer Will the DOM structure vary for same HTML based on the browser made me think that if DOM renders the same for all browser then why do I need cross-browser functional testing.
For example,

  1. Checking Login Functionality on all popular browsers (Chrome, Firefox, Safari).
  2. or Verifying whether a link is 404 or not, it navigates to a new tab or same window?

After searching more on the internet I found this article How is Cross Browser Testing Done?, supports the same. However, they seem to contradict what they are saying.

Here, in picture-1 they say that cross-browser testing is non-functional and later in (second picture) they suggest using Selenium (a functional testing tool) to automate cross-browser testing.

enter image description here

enter image description here

My question is, how do functional automation testing across different browsers, using Selenium make sense?

3 Answers 3

2

Tl;DR: I think with the right tools and practises you could create a situation where automaticaly testing cross-browser is not really needed.


It depends on the risks, for most situations it probably does not make sense anymore. I use anymore because a couple of years back browsers where not consistent in their implementation. During the browser wars they might even break features on purpose to keep their market share. Sometimes developers needed to add a seperate CSS or Javascript implementation for each different browser, which broke on newer versions of the same browser.

I think today most cross-browser issues can be found by Application Monitoring Tools like New Relic. Observing the behavior, worksflows and errors of the end-users for each browser. This is sometimes called "Testing in production, the safe way".

There are differences in rendering between the major browsers, for example in the CSS defaults. That is why the developers probably should use a CSS Reset. Just assuming everything will look and feel the same in all browsers is a myth, even if the DOM is probably the same it might look different or even cut off parts.

Personally I have been making business software for a couple of years, most companies standardize on a single browser. My teams have been testing versus a single browser for years, even if some users might use a different browser. Can't remember it breaking, but users have a fallback use our main supported browser and report a bug.

I would check what browsers my userbase is using. Then check if there are known issues with those browsers currently.

Asking the developers to use a webbased UI and CSS framework (one that is tested cross-browser) should lower the risk even more. Try to make the cross-browsers testing someone elses problem.

1

Why to use Selenium (a functional testing tool) for non functional cross browser testing:?

Selenium is not a testing tool , its an automation tool .

Selenium is an umbrella project for a range of tools and libraries that enable and support the automation of web browsers.

Source: Selenium Introduction

You use it with other test frameworks to use it as a testing tool ( Where you asserts something is as expected)

Why to automate if DOM is rendered the same?

DOM is the final rendered state, to reach this state it has to execute many CSS functions, JavaScript and other things for example each JavaScript function has browser compatibility, the Array.prototype.sort() function doesn't have stable sort in IE so that will fail in IE browser.

Developers captures these exception and runs different functions for different browsers by detecting the browser in use. This ensures same application works in different browsers

So why we need cross browser testing?

To ensure the site works and rendering works properly in all browsers

7
  • 1
    Noone uses IE anymore, or do they? :) Nov 3, 2020 at 19:18
  • @NielsvanReijmersdal that was an example , old is still gold in some old organizations :D
    – PDHide
    Nov 3, 2020 at 19:19
  • To ensure the site works and rendering works properly in all browsers. We mostly run test cases via CI/CD tools. There is no person/human intervention to verify rendering. So how Selenium can verify that it renders properly or not? It reads DOM and clicks on the web element. For example, if a checkbox enables an image to appear left but in the browser, it is appearing right. It will pass because Selenium verifies that <img left=true> is present in DOM. So why I need to test a different browsers when at last I am reading DOM only?
    – paul
    Nov 3, 2020 at 19:57
  • @paul selenium access only rendered elements , sometimes browser fails to properly render things because of the mentioned reasons . In that case selenium fails to do what it is meant do and you know page was not rendered properly
    – PDHide
    Nov 3, 2020 at 20:00
  • Does this rendering problem happen with the latest browsers too? Per @NielsvanReijmersdal it used to happen a couple of years ago but it is gone now.
    – paul
    Nov 3, 2020 at 20:12
0

Selenium is an automation tool, not a functional testing tool. You can use Selenium (Appium for mobile) to automate scenarios. These scenarios can be functional tests, even some networking tests and/or instrumentation checks.

Cross-browser testing primarily focuses on checking the sanity of the web application across various browsers and platform. Browsers render DOM and javascript, however there can be possible altercations for the same model. You may find the below software testing services links helpful,

https://blog.qasource.com/how-to-test-your-app-for-compatibility-and-user-experience https://blog.qasource.com/the-role-of-continuous-testing-for-effective-devops https://blog.qasource.com/software-development-and-qa-tips/what-is-the-difference-in-writing-regression-test-cases-and-sanity-test-cases-for-sign-up-of-any-website https://blog.qasource.com/resources/pros-and-cons-of-selenium-automation-testing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.