The Other Reason

Qualityholics
3 min readApr 27, 2021

Are you into Automation Testing? Do you spend hours trying to fix your failed test cases? As a newly joined QA intern I got to work in Test Automation. The tool I mainly worked with is Protractor. While automating certain tests, I encountered situations where my test cases failed.

Test cases can fail because of two main reasons. One can be an obvious defect in the system so you might want to raise a bug and inform the developer. This is in fact a successful test case because it found defects. The other reason a test case fails is an unknown reason that is not related to any functionality of the application. This article delves into the other reason your tests fail.

Sometimes these tests can pass or sometimes fail due to unreliable test cases. It’s always better to find the reason.

The other reason is comprised of many more reasons: -

1. Logical Issues

Many test cases fail due to the wrong logic that is used. These are code level errors such as assigning a value to the wrong variable, incorrect functions or small typos in the code.

A failed test case because of an undefined variable

2. Data issues

The test data used can be incorrect and the test case may not be updated with UI changes of the AUT. This may cause the test case to fail. It’s always better to check if the parameters and input data you are using are correct. Test cases may also fail because expected results are invalid. Sometimes the test passes only for one valid result but the AUT accepts multiple valid results.

A test case failing after duplicating test data

3. Environmental issues

Issues with the environment can occur when the server is not responding. Network issues can also result in a failed test. Another instance is when the application is too slow. This may be because of location specific settings, an incorrect browser version or not updating the tools used. Sometimes it’s, difficult to locate elements.

A test failing due to issues in web driver

4. Dependencies

Some test cases depend on the previously run tests. Having dependencies in pervious test cases can also result in a failed test.

5. Timing Issues

Timing using are very common for test cases to fail. Some heavy tests require more time to capture elements.

Error cause due to Jasmine timeout interval

You may have experienced all or some of the above issues. What is important is to quickly identify the reason and troubleshoot these issues. It’s always best to recheck the test script and update it with all recent UI changes of the AUT, input data and parameters. Make the test cases modular and independent if dependency issues arise. Finally ensure your browser, test tools and environment is ready and up to date to execute the tests. After all the other reason for your test to fail should not be as hard as finding the other man/woman your spouse is texting.

About the Author

Sanara Premaratne works as an
Intern Quality Assurance Engineer at 99x

--

--

Qualityholics

Sri Lanka's First Online Portal For The Quality Assurance Community