6 TIPS FOR SUCCESSFUL TEST AUTOMATION

Arine Baghdasaryan
Fintegro Company Inc
5 min readFeb 6, 2019

Who doesn’t dream about successful automation? We think everyone does! That’s why today we present you some useful tips for your test automation, enjoy!

TIPS FOR SUCCESSFUL TEST AUTOMATION

1) Keep test data always “fresh”

Test data should be as fresh as the vegetables in your salad. At every test, iteration reusing one and the same user is not required, because in this case, you can not be sure that a new given, for example, the feature will work efficiently on its own.

What can you do? At every new iteration, you should generate a new user and fulfill tests on him. Then you can confirm that the system works in accordance with technical documentation.

2) Do not Drive Testing Only through UI Test Automation

The most common mistake is the decision to do test automation exceptionally through UI.

Sometimes it can be quite sufficient if the product is already in the support stage and no longer develops. But, as a rule, in the long term and actively developing projects this is not the best approach, because there are 2 nuances:

-UI tests are not stable. They are unstable because the tests depend on the “layout” of the application interface. If you change the order of the buttons on the screen or add/remove an element, the tests may break. The automation tool cannot find the item you need, or it may press a completely wrong button and the test logic will change.

The more such tests you have, the more time you have to spend on their correction and support.

-UI tests are slow. Slow these tests because the application interface is slow, it requires redrawing, resource loading, waiting for the appearance of some data, etc. The test script spends most of the time waiting.

When running a UI script takes two days, even when running independent groups of tests simultaneously on multiple servers, it is very difficult to use such automation in everyday practice as a quality indicator.

What can you do?

Stabilize: The first thing that needs to be done in general is to negotiate with the developers so that they do not forget to prescribe unique attributes for the elements, according to which the automation tool can uniquely identify them. That is, you need to abandon the five-story xPath expressions or CSS selectors to the maximum, and, if possible, use unique id, name, etc. throughout.

/html/body/div[1]/div[4]/div[1]/span INCORRECT

//span[@id=’root’] CORRECT

If everything is simple enough with instability, then the problem of slow tests should be solved in a complex way, as it affects the development process as a whole.

Speed Up:

The first and simplest thing that can speed up the process is to deploy an application and run tests on faster hardware, avoid situations where network interaction is affected by network delays, etc. That is, “solve” the problem due to the iron and architecture of the test bench. This alone can provide significant time savings, up to two or more times.

The second thing to do is to initially lay in the test framework and the design of test cases the possibility of independent and parallel launch. Parallelization of test runs can significantly reduce the execution time. True, there are also limitations. First, the logic of the application being tested does not always allow testing it in several threads. Such situations are quite specific and rare, but they happen. Secondly, here, too, everything rests on iron: it is impossible to parallel to infinity.

The third and most radical is to create a few UI tests as possible. Fewer tests — before we get the result of their run.

3) Do not check in tests within outputting to the information console

With writing autotests, clear methods for data validation are required. It is a bad practice when test data is compared in any method and the information is placed to the console. (e.g. “test is successful”, “test fails”). For preventing these relevant mechanisms for data validation are used.

HOW YOU SHOULDN’T DO

4) Git. Keep your release branch always in working and relevant condition

In old workflows, the Continuous Integration (CI) server commonly ran tests on the master branch only. Developers had to ensure their code did not break the master branch. When using GitLab flow developers create their branches from this master branch so it is essential it is green. If your master branch is not in the working condition your system will never display the system in real condition.

5) Fast integrate the new employees into the project

When new employees arrive, you should, at the shortest possible time, begin the working process. If an employee needs to perform a lot of configuration settings to get started, this increases the time for integration of a new specialist into a work environment.

Your project is preferably quickly and easily deployed, if it so, the process of involving the new employee is speeding up.

But how to make it? One of the contemporary solutions is using Docker “containers”. In such case, there is no need for an employee to sit all day long figuring out the new code. You can download Docker Images and both faster engage our newbie in work and faster launch the project.

6) Do not hope for 100% automation

100% Test Automation is a big task. Not that it is impossible, but it requires proper planning and monitoring and of course; some time. There are lots of permutations and combinations of data, the number of environments with the number of authentication and authorization attributes which needs to be validated and hence requires a strategy to automate.

Before starting automation you should expertise this project and decide if the automation is useful and possible at all. It is also preferable to create metrics in order to understand the expediency one or other modules.

And finally, catch 6 more common tips for your successful automation:

  1. Decide what Test Cases to Automate
  2. Test Early and Test Often
  3. Select the Right Automated Testing Tool
  4. Divide your Automated Testing Efforts
  5. Create Good, Quality Test Data
  6. Create Automated Tests that are Resistant to Changes in the UI

I hope these tips were useful for you! By the way, for successful Test Automation, the team of Fintegro Company Inc. can always come to the aid and make your project perfect!

Keep tuned to our updates!

Share your thoughts with us in comments or via our social media:

LinkedIn: https://www.linkedin.com/company/fintegro-company-inc

Twitter: https://twitter.com/fintegro

Facebook: https://www.facebook.com/fintegro

--

--

Arine Baghdasaryan
Fintegro Company Inc

Research Specialist at Fintegro Company Inc. Interested in QA, Startups, travelling, books and learning foreign languages ;)