helencousins.com

Navigating the Challenges of Automated Testing: My Year in Review

Written on

Chapter 1: My Journey into Automated Testing

In this section, I want to share my experiences with automated testing that I've encountered over the past year. The primary objective of test automation was to transition from manual pre-release testing to automated testing. Initially, I was tasked with converting over 1,300 test cases, which were documented across 27 spreadsheets, into automated tests.

Tools for Automated Testing: Katalon Studio

Katalon Studio is an Integrated Development Environment (IDE) that facilitates the execution of Selenium tests through a user-friendly interface. Even as someone without prior experience in automated testing, I found it straightforward to run tests with just a single click.

Idea 1: Using Data Attributes for Element Identification

To identify elements effectively, automated tests typically rely on various methods such as XPATH, CSS selectors, and element attributes. However, since these elements can change with updates to the product or UI, I opted to use data attributes for most test elements to ensure stability.

Idea 2: Integration with Xray

To manage test cases and results, we implemented Xray, a tool that allows us to automatically synchronize Katalon execution results with Xray. Each Katalon test case is assigned an Xray test case ID, enabling seamless reporting of test outcomes via Xray's API.

The Struggles of Automated Testing

Although the initial phase of automation went smoothly for about six months, I soon encountered several challenges.

Testing Across Multiple Browsers

Our automated tests were initially developed only for Chrome. However, as the number of test cases grew, we were also asked to conduct tests on Firefox and Edge. While Katalon allows for browser selection during test execution, running tests designed for Chrome on Firefox led to a significant number of failures—approximately half of the test cases. The discrepancies in browser behavior necessitated unique implementations for each browser, complicating test management.

Impact of Product Upgrades on Automated Tests

When a new version of the product was released, automated tests often failed due to specification changes or behavioral differences. Consequently, I had to revise the automated tests each time a new version was rolled out. To manage this, I created a structured directory for each product version to maintain previous tests.

Test Code Management Challenges

By the time I transitioned away from this project, I had successfully automated 15 out of the 27 test cases. However, the sheer volume of test cases, combined with the challenges previously mentioned, made management quite difficult. Minor changes in the test code before release often led to complex debugging processes to determine whether the issue stemmed from the product or the test code itself.

As I developed tests with intricate functions, I recognized the importance of minimizing changes. I aimed to consolidate duplicate code to simplify future modifications, but I should have been more strategic about which elements should remain distinct.

Katalon's Quirks

Katalon is user-friendly, but it comes with its own set of peculiarities that differ from traditional Selenium usage. For instance, issues arose when using wait functions for specific elements, leading to unexpected errors. Additionally, while Katalon provides features for handling Shadow DOM, I often found it more effective to revert to plain Selenium for these cases.

Data Attributes and Collaboration

While data attributes proved beneficial for element identification, I faced challenges when new features lacked these attributes. This underscored the need for closer collaboration with the product development team to ensure that data attributes were consistently implemented.

The Final Outcomes

Ultimately, I managed to automate 15 of the 27 test cases, representing 40-50% of the total. Automated testing was successfully carried out across Chrome, Firefox, and Edge (Chromium). However, the total execution time for tests exceeded three hours, primarily due to serial execution. This could be significantly improved by parallelizing the tests.

Reflecting on My Experiences

Throughout this journey, I learned that both manual and automated testing possess unique advantages and disadvantages. I realized that not all tests should be automated; complex behaviors are often better suited for manual testing, while simpler tests can benefit from automation.

The key takeaway is that the stability of automated tests should take precedence over merely increasing the number of tests. Given the propensity for automated tests to change, careful creation and maintenance are crucial.

In Conclusion

After a year of hands-on experience in automated testing, I regret that I left the process with some instability and incompleteness during my internship. Nevertheless, I hope to contribute positively to the team through this article.

Stackademic

Thank you for reading this account of my experiences. If you found this useful, please consider showing your support by clapping and following the writer! đź‘Ź You can also connect with us on Twitter (X), LinkedIn, and YouTube. To learn more about our mission to democratize free programming education worldwide, visit Stackademic.com.

Chapter 2: Resources for Further Learning

In this chapter, I will share valuable resources related to automated testing and best practices.

The first video, titled "Automated Testing Using GitHub Actions... Easier Than I Thought," provides insights into utilizing GitHub Actions for automating your testing workflow.

The second video, "5 Reasons Your Automated Tests Fail," highlights common pitfalls in automated testing and offers strategies to avoid them.

Share the page:

Twitter Facebook Reddit LinkIn

-----------------------

Recent Post:

Meditation: My Transformative 30-Day Evening Journey

Discover the profound changes I experienced after meditating every evening for 30 days, from improved sleep to increased creativity.

How to Captivate Readers by Applying Design Thinking in Writing

Explore how Design Thinking principles can enhance your writing and attract more readers in this insightful guide.

# Understanding Illogical Beliefs: A Deep Dive into Irrationality

Exploring irrational beliefs and their implications on society and personal opinions.

Harnessing Charisma for Business Success: Your Weekly Insights

Discover key messages for entrepreneurs this week, focusing on social media success, reputation management, and holistic healing.

Understanding Special Methods in Python: A Comprehensive Guide

Explore Python's special methods, their functions, and how to utilize them effectively in programming.

Exploring Bias in DNA Profiling and Its Implications

An examination of bias in forensic DNA profiling and recent advancements in biotechnology.

Unlocking the Secrets to Effective Social Media for IT Services

Discover key strategies to enhance social media engagement and convert leads into clients for IT managed services.

A Unique $1 Business Plan: Transforming Dollars into Dreams

Discover how a single dollar can kickstart your entrepreneurial journey and the importance of community support.