What is Test Automation?

Test automation is a testing method where test scenarios are automatically executed by a computer through software and the results are reported using specific tools. It eliminates the need for manual execution and monitoring of individual steps by a human.

Both manual testing and test automation have their advantages and disadvantages. It is important to understand when to apply each approach in order to maximize the efficiency of testing. Let's briefly compare automation testing and manual testing.

Automation Testing:

  • Automation testing is suitable for repetitive tests and increases efficiency.
  • With automation, the output of each test is automatically generated, and regular reports can be maintained.
  • Automation only checks the coded part.
  • Automation testing is fast.
  • Since the test is executed by a computer, it cannot provide user experience.
  • Automation testing has a higher error detection rate compared to manual testing.

Manual Testing:

  • Manual testing can lead to workforce loss for repetitive tests.
  • In manual testing, the test report needs to be recorded by the person conducting the test.
  • Manual testing allows for testing even the smallest details, making it more comprehensive.
  • Manual testing is slower.
  • It provides user experience.
  • Manual testing can also uncover errors based on user experience.

Although test automation is rapidly advancing, it is believed that manual testing, which provides different efficiencies in terms of quality and assurance, will not lose its importance as it involves the human factor.

What are the Advantages of Test Automation?

  • It enables more frequent execution of all test types suitable for automation (Regression, Smoke, Performance, Load, etc.).
  • It increases the speed of test execution.
  • It does not require a specific time frame to execute tests. Since it does not require human involvement, you can schedule it to run at any time, even at night.
  • It enhances confidence in the application.
  • It increases test coverage.
  • It saves time and costs.
  • It helps detect stability issues.

Which Scenarios Should We Automate in Test Automation?

Let's assume that your test runs are at a certain standard, and you have decided to transition to automation for your test processes. Although automation sounds appealing in many ways, it is not possible to automate all test processes. Therefore, you need to make choices among test scenarios. Let's examine together which test scenarios you should prioritize for automation.

  1. Repeated Test Scenarios To automate a test scenario, it needs to be a scenario that is repeated at certain intervals. The most important reason for this is that automating the test requires a certain development effort. The development effort you will spend for test automation should not exceed the cumulative effort you would spend to run the test manually.

  2. Matured Test Scenarios The tests you want to automate should have reached a certain level of maturity. These tests should have been run for a certain period, and no recent changes should have been made to the scenario. Trying to automate constantly changing scenarios and modifying automation code would require extra effort and reduce the efficiency of automation.

  3. Consistent Test Scenarios with Reliable Results The test scenarios you want to automate should consist of consistent steps. Tests should always produce the same result for the same scenario. Otherwise, you may not get the desired efficiency when automating the test.

Which Cases Should Be Automated in Test Automation? Which Ones Should Not?
Just as not every test type is suitable for automation, not every case is suitable to be automated. Cases that may be suitable for automation testing should have the following characteristics:

  • Cases that require continuous test repetition (e.g., testing a module that displays available rooms for a hotel reservation system)
  • Cases that are laborious and time-consuming to perform manually
  • Cases that cannot tolerate critical human errors (e.g., testing the money transfer feature for a banking application)

On the other hand, cases that are not suitable for automation testing can be exemplified as follows:

  • Cases with a new design that has never been tested manually
  • Test cases for constantly changing features
  • Test cases for a feature that needs to go live quickly

What is a Test Case? A test case is a document written by test engineers that contains the steps and controls to be performed in the application in a sequential manner. If we examine the test case in bullet points:

  • A well-prepared test case signifies customer satisfaction.
  • A test case can be written for both manual and automation testing.
  • At least one test case is prepared for each user story.
  • The test case document should include test case number, test environment, test steps, test data, expected result, and actual result sections.

How Should an Ideal Test Scenario Be Written?

  • Each test scenario should test only one module and one function within the module. This requirement is important to avoid complex and lengthy scenarios.
  • If a scenario changes any data, creates new data, or deletes data on the site according to the function it tests, the scenario should end by restoring the site to its initial state (default) when it entered the site. This can affect the operation of other scenarios and cause failures in automation due to code-related factors.
  • It is important for test cases not to have dependencies on other tests, allowing the specific desired test to be run regardless of the order in which the tests were run previously. Therefore, writing interdependent scenarios is not desirable for the sustainability and tracking of the test.
  • Long scenario steps should be avoided. Keeping an average scenario under 50 steps will benefit code readability, understandability, and maintenance costs.
  • Previously validated checks should not be repeated within the same scenario. This only extends the test scenario and increases maintenance costs, which is an undesirable situation.