navigation

What is End-to-End testing & how Selenium can help us

What is End-to-End testing & how Selenium can help us

by
August 2, 2022

In the software development life cycle, End-to-End testing (E2E) is an integral part of the QA process. It’s a testing methodology that verifies whether the application behaves as expected from start to end. The main idea of E2E testing is to replicate real user scenarios and validate the system under different kinds of processes. 

There are two types of E2E testing – vertical & horizontal and I will explain the difference between both below. I will also share my personal experience as a Middle 2 QA engineer at Dreamix using Selenium in my daily work life. This open-source automation testing suite helps me achieve great results, and that is why I’ll give you in-depth details of its main capabilities and advantages.

Vertical vs. horizontal end-to-end testing

In the vertical E2E test method, the QAs must validate every layer of the application in a hierarchical order (unit tests -> Integration tests -> UI tests) to ensure the quality of every component in the system – from start to end. In most cases, vertical E2E testing helps us test the most critical parts in the system that don’t face the end user. 


In the horizontal End-to-End test method, QA specialists must validate the positive and negative user scenarios of every functionality in the application. Let’s say we have a user scenario where the user needs to sign in and navigate to different pages to search for a specific product. At the end of their journey, the users need to make a purchase and pay for it. In this case, horizontal E2E testing should verify that the user can navigate through different pages, click on different buttons, enter data in different fields, etc.

The struggles of QAs with the regression testing

Unlike other QA tests, regression testing doesn’t try to find any errors in the code. Instead, it aims to ensure technical consistency. It also checks whether the unchanged parts of the software will still work the same way they did before the adjustments.  

But what will happen when the project becomes more complex? The QA team will have a tremendous Regression suite, and they will need a lot of time to execute every test. Let’s say at the beginning of the project, the QA team has only five regression tests, and their execution takes five or six hours. Later, the Regression suite is extended to a hundred tests and the required time to finish the execution of every single test is two days. So, what can we do to save time in the regression phase and spend the saved time in another QA direction? 
Well …the power of Selenium reveals itself here.

What is Selenium?

Selenium is a mighty suite of tools for cross-browser testing. A household name when it comes to automation testing, Selenium can validate web-based applications across different browsers and operating systems. Unfortunately, we can’t use Selenium to automate desktop applications. We can only use it for web-based applications. Selenium test suite represents a set of four main components:

  1. Selenium IDE
  2. Selenium RCF
  3. Selenium WebDriver
  4. Selenium Grid

Selenium IDE

Selenium IDE is a record & run tool. It is an extension in Firefox or Chrome that can record user interactions in the browser. Additionally, we can use the recorded script as much as we want to validate there are no regression issues.

Selenium RC

Selenium RC is a testing framework that allows the QAs or developers to write user scenarios in any programming language to validate all the user actions across the application. However, Selenium RC has its limitations. For instance, running tests with Selenium RC would result in slow test performance because the execution uses JavaScript commands sent to the browser. Also, Selenium RC doesn’t support headless execution. 

Selenium WebDriver

Selenium WebDriver’s architecture is entirely different from the Selenium RC, and it’s way simpler. In fact, Selenium WebDriver is one of the most used tools from the Selenium suite as it allows fast and headless test execution. In addition, it makes direct calls to the browser, unlike Selenium RC, which is server dependable. Compared to Selenium RC, Selenium WebDriver handles quite well the multi-browser testing, drag-and-drop functionalities, frames-into-frames and many other advanced functionalities.

Selenium Grid

Selenium Grid can help us execute different tests on different operating systems and different machines. Also, it can save us time in the execution phase. For example, if we have two suites, one suite of tests for Google Chrome and one suite of tests for Safari, we can run both suits simultaneously.

How can Selenium WebDriver help us with automation testing?

Selenium WebDriver can run automation testing on dynamic web-based applications where the content changes with every user action. Using Selenium WebDriver, we can automate every single user action as a real person. For example, we can start with invoking a specific browser with a specific URL to click on different buttons across the application and populate some fields with different data. Then, we can tell Selenium to simulate different keyboard actions and many more operations. 

Selenium WebDriver, along with Java, JUnit and BDD (Behavior-driven development) can build one very strong and fast automated Regression suite. One that is understandable both from a technical point of view and readable from a business perspective. Plus, we can automate every single UI regression test. 

Now, let’s take a deeper dive into the pros and cons of Selenium. 

Benefits and drawbacks of using Selenium

Benefits:

Here is why Selenium stands out from similar automation testing frameworks:

  1. It is open-source software.
  2. Selenium is compatible with almost all widely used browsers like Google Chrome, Internet Explorer, Mozilla Firefox, Opera, and Safari.
  3. The tool works with various operating systems such as Windows, Mac, and Linux.
  4. It’s compatible with various programming languages.
  5. It’s able to do parallel test executions.
  6. Supports integration with Maven, Jenkins, and Docker.
  7. Consumes less CPU and RAM.

Drawbacks: 

It’s natural for every tool to have its limitations. Here are Selenium’s:

  1. The tool supports web-based applications only and not desktop-based applications.
  2. It has limitations in image testing.
  3. Selenium requires higher expertise and more time to implement proper test cases.
  4. Some of its features may not work correctly.
  5. A built-in reporting is missing.

Conclusion

Throughout this article, I shared my opinion on why to choose Selenium instead of other test automation frameworks. Apart from having one of the biggest communities among the other common automation frameworks, it is also relatively easy to solve different test cases with Selenium. Plus, it is easily integratable with many other frameworks, encouraging seamless workflow. Last but not least, Selenium is highly scalable with parallel execution, data-driven testing, cloud testing & continuous integration.

As a next step, I encourage you to check out more of our curated content devoted to testing, such as our blog about the transition from manual to automated testing. Besides, seeing things from a different angle helps us fully grasp things, so make sure you also read about the value of software testing from a developer’s perspective! Stay tuned for more insightful content from our Dreamix tech and business community. 

Aleksandar Sergiev

Middle 2 QA engineer at Dreamix

More Posts

Do you want more great blogs like this?

Subscribe for Dreamix Blog now!