Selenium Automation Testing Tutorial and Benefits

Selenium Automation Testing Tutorial| The testing of software application is an important and essential part of the software development life cycle (SDLC).

In the current world scenario, the demand for delivery of software application on time is increasing day by day by maintaining the highest standards quality.

To fulfill these challenges, test automation plays an important role in SDLC by speeding up the testing process and increasing test coverage as well.

Test automation reduces the need of human interaction and helps a tester to carry out testing in a more effective manner by saving time from repetitive and boring tasks. So, let’s start to understand about automation testing in more detail. We will cover the following topics under this tutorial.

What is Automation Testing?


Automation means the execution of a program without interaction of human beings. The execution of the test cases by using an automation tool or third party tool is called automation testing or simply test automation.

Test automation is a process of automating the manual process to test an application or software. In automation testing, we use a separate testing tool in which the test script is created and executed repeatedly. It helps to check expected results and actual results obtained by running automation scripts.


Test automation mainly focuses on automating repetitive, tedious, and manual tasks. The main objective of test automation is to perform testing better, faster, reliable, time-saving, accuracy improvement, and reducing human-generated error ways.

Selenium Automation testing

Let us understand first why testing is necessary?

Why testing is necessary or Why should we do testing?


Testing is done/required in a system because we all make mistakes. Some of those mistakes are not important but some of them are expensive or dangerous.  Therefore, we need to check or identify bugs or defects in the software application after making a product or application because humans make mistakes all the time.

Trying to find defects or bugs is an essential part of any application or product development because we are currently unable to produce defect free-system.

Since we assume that our work may have mistakes or bugs, hence we all need to check our own work. However, bugs may happen due to wrong assumptions. The ultimate goal of testing is to provide improvement in the quality of products.

To achieve these test goals, every test process contains planning activities such as what is needed, what should be tested, and how should execute those test cases.

There is also a universal rule that it is not possible to find and identify all defects and to test everything due to enough time. Let’s take an example of testing of a very simple product – a ballpoint pen.

Suppose a company make ballpoint pens and want to sell them. Before to sell in the market, they give one to own working tester with an instruction to test it. This pen can be called as a test object.


Now tester will test many different things about the pen. They may be as follows:

1. Does the pen write in the right color and with right line thickness?
2. Is logo on the pen according to company standards?
3. Is the pen comfortable for people in writing?

We hope that you will have understood from the above example, why testing is required? and why should do testing?

Why Testing is important in Software development?


Testing is very important in software development or any application development because of the following factors. They are as follows:

1. To identify bugs, errors, issues, or defects for making a superior product. As a tester, if you identify the bugs as much as on the software application, you will have to report bugs to the software developer. The developer will come up with fixing bugs.

During this process, the application becomes stable. Once the application becomes stable, it will improve the quality of the application.

➲ By identifying and fixing bugs, the quality of application or software can be improved so that we can give Quality Assurance product to the client and leads to better customer satisfaction. It can indirectly lead to higher revenue.
➲ To cut down costs.
➲ To Optimize speed and efficiency.

The objective of the testing is to identify bugs or defects in the application for improving the quality of application. But quality cannot be added to application or any product only at the end by testing. It should be built-in right from start.

To check the quality at every development stage by testing is an essential and important part of the development of applications with desired quality.

How to test?


Testing an application or software can be done in the following ways. They are as follows:
1. Manually
2. Automation by using Selenium, WinRunner, LoadRunner, QTP.
3. Combination of both Manual and Automation.

Now we hope that you understand the importance of Testing but here, a question arises why Automation Testing is required and where we can also do manually?

Why is Automation Testing required?


Automation Testing is required due to the following reasons. They are as follows:
1. Manual Testing is not accurate at all times due to human-generated error. Hence, it is less reliable.

2. Manual Testing is time and money consuming. Automation testing reduces the overall testing cost and human effort.

3. Test automation does not require human intervention. We can run the automated test without attending. Unattended execution of test scripts saves time and human effort.

4. Automation testing improves accuracy and reduces the human-generated error.

5. Automation increases the speed of test execution. It can perform testing much faster than a human can.

6. It supports the execution of repeated and parallel test cases.
7. Automation testing is more reliable than manual testing.

Let’s understand with real-time examples of how automation testing saves time and human effort over manual testing.

Realtime Example 1:

Suppose you have to go from place A to place B which is 1 km apart. There are multiple ways to go from A to B. Manually, you can go by walk but it will take more time. Another way is by using some vehicles like a bike, car, bus, etc. It will save time. Here, the vehicle is nothing but an automation tool.

Realtime Example 2:

Suppose you are working for an IT company and you have to execute around 500 test cases manually then how many test cases can you execute manually? You can execute 50 to 60 test cases manually per day. Here, per day means 8 hours working in the company.

Thus, to execute all these 500 test cases will take time around 9 to 10 days. Now suppose Technical Lead came and says that you will have to execute all these 500 test cases in 4 to 5 days then what will you do?

In this case, you will have to go for automation testing but it is not possible to execute entire testing. Means 100% testing is not possible using automation but the majority of test cases can be executed.

Suppose 400 test cases can be automated and the remaining 100 test cases are not applicable for automation. In this case, we will use manual testing.

So, it will take around 2 days manually where 400 test cases will take time 0 days because once test scripts are ready and working fine then we will put all these test cases in run mode at any time (day or night) and leave them to execute all test cases.

When the execution process is completed, we will check results that how many test cases are passed or failed by taking screenshots? That’s why it will take 0 days but take some time to execute all test cases.

Thus, we have taken around two days to execute all test cases and have saved time.

Which test cases should be automated?


Automation testing is to support the manual testing process and not replace it. Achieving automation with 100% functionality cannot be done. 100% test automation is a myth, just like 100% test coverage.

There is the following criterion to consider in determining which test cases can be selected for automation. They are:

1. High risk and critical test cases.

2. When there is a repetition of test cases or a need to run test cases number of times in a test cycle. For example, regression test scenario.

3. Test cases which are very tedious and difficult to perform manually.

4. Test cases which are a lot of time-consuming then you should go to automate your test cases.

5. Automated testing is also the best way to complete the testing efficiently when it comes to load testing.

6. Automation testing plays an important role when you need to run the same test cases with multiple sets of input data. For example, testing the login page with different sets of input data. The Data-driven automation testing framework is the best way to use for minimizing your effort and time.

The test data is fetched from external sources such as an excel sheet and passes the multiple data to each test case. But in the manual test case, you get bored with testing the same functionality, and chances to get error will be increased.

7. When there is a requirement of running test cases in a different order. In this scenario, you can design scripts for getting the order but in manual testing, you will have to remember the order, or you will write the order in some other files (.doc, .txt, or excel).

8. Automation testing is very useful if you want to generate the test report. Mostly all automated testing tools generate test reports automatically when the test cycle completed. This will make the job easy for identifying defects or errors.

Keeping these key points in mind, you can find the best systematic approach in any given testing situation and can achieve the quality output in your project.

Now, look at the following types of test scripts that you can target for automation.

  • Functional regression test scripts
  • Sanity test scripts
  • Verification test scripts
  • Load testing scripts
  • Any script that is executed multiple times
  • New functionality scripts in which core features have to be tested.

Which test cases not to automate?


The test cases which are not suitable for automation they are as follows:
1. When test cases are newly designed and not executed manually at least once then it is not suitable for automation.
2. When the requirements of test cases are often changing then it is not suitable for automation.
3. Those test cases for which input data or expected data is not known, you should not go for automation.
4. Complex test cases which involve multiple steps unrelated to each other.

5. Test cases that need urgent bug fixes or deployment.
6. Test cases that take less time to execute manually rather than using automation.
7. Test scripts that produce unpredictable test results.

Benefits/advantages of Automation Testing over Manual Testing?


Test automation is essential for any software testing process and provides great benefits in improving the quality and reliability of the results. Some of the key benefits of automation testing over manual testing are as follows:

1. Automation Testing is 75% faster than manual testing. So, we can get better speed in the execution of test cases because it reduces test execution time. In short, automation testing increases test execution efficiency.

2. One of the main benefits of using test automation is that it supports the execution of repeated test cases. This is because a repetitive type of testing is very cumbersome and expensive to perform manually, but it can be automated easily by using automation tools.

3. Test automation supports parallel execution. We can run multiple tests in parallel with multiple sets of test data in different operating systems and browsers.

4. The advantage of using test automation is that it improves accuracy and reduces the human-generated error. It also helps to find defects early and fixing them as well.

5. Automated execution of test cases saves time and money. It reduces the cost of software maintenance. It helps to reduce wastages.

6. Human intervention is not required during the execution of test cases. Tests can be triggered without dependency on humans.

7. The test script for automation can be reused. Automation helps to create reusable test cases that facilitate the execution of a consistent set of test cases.

8. In automated testing, we can easily analyze test results at the end of execution by determining the number of test cases that passed or failed. If a test case is failed, we can easily analyze the reasons for its failure.

But in the case of manual testing, it may be difficult to reproduce test results because exact conditions at the time of failure may not be precisely known.

9. Test automation provides a testing team to have better test coverage for stability.

10. With test automation, a testing team can run the test cycle efficiently and plan the overall test strategy in an optimal manner.

Disadvantages/Risks of Automation Testing in Selenium


Automation testing provides better test execution efficiency and accuracy but we should also have aware of disadvantages/risks associated with automation. Let’s have a look at them.

1. The tester should have good programming skills because all the testing tools provide a scripting language to create test scripts.

2. 100% test automation cannot be achieved because all business scenarios or test cases cannot be automated. It requires lots of development efforts.

3. The initial cost to start an automation project is very high because we will have to purchase the automation tool for testing. If we purchase the license automation tool, we can use all the commands available in the tool. But we can not use all the commands in the trial version.

4. The cost of maintaining the test script and data can be expensive. Scripts require to be regularly updated as per the data changes in the application.

5. Automation testing tools cannot be used to rate and analyze the usability of the application.

6. Testing team must be required time for tool selection and framework design.

7. No single automation tool can support all applications and GUI objects.

Myths of Test Automation


Some myths about test automation are as follows:
1. 100% automation is possible but in reality, it is not possible and not recommended.
2. Test automation saves a lot of time but in reality, it depends on test automation strategy.
3. Test automation scripts are faster than manual testing but in reality, it is not always true.
4. Test automation eliminates needs for manual efforts but in reality, it is not true because scripts need regular maintenance.
5. It generates more defects than manual testing but it is not true.

Hope that this tutorial has covered all important points related to the basic concept of automation testing in Selenium with its benefits and disadvantages. I hope that you will have understood this topic and enjoyed it. In the next tutorial, we will learn the difference between automation and manual testing.

Thanks for reading!!!Next ⇒ Difference between Manual testing and Automation testing⇐ PrevNext ⇒

Leave a Comment