Rod Michael, director of global market access strategy and channels at Rockwell Automation, famously said,

“If you automate a mess, you get an automated mess.”

A meaningful and therefore effective automated test system is created with intelligent design. It is not something that just happens.

As we all know, testing processes are important in order to deliver a bug-free application. Amplifying its impact, automated testing is beneficial in saving build validation time and effort, as well as helpful in demystifying crucial performance hurdles in the application. Eventually, this paves the way to deliver outstanding softwares.

Hence, it is crucial for a test engineer to create an effective road map and choose the right tools to build a robust test automation framework. Besides the test engineers, developers also play a vital role in the successful implementation of the automation framework.

There are several guidelines/principles available online to guide a test engineer to effectively strategise and implement the test automation framework. However, in this post, we would like to shed some light on the contribution that is required from fellow developers.

Some development practices that set the foundation to naturally drive the automation are:

  1. Make sure the app is CI/CD ready (can be deployed anywhere).
  2. Use APIs to help automation with quick setup/cleanup.
  3. Follow naming conventions/standards to intuitively allow automation engineers/tools to determine the element ID.
  4. Write design documents for new features, involve at least 1 automation engineer to review the same and actively involve in test case review processes.
  5. Have a centralise repository (that is easily accessible) to check-in/check-out development source codes.
  6. Move towards Behavioural Driven Development (BDD) - product owner/developers to come up with the set of user stories for the feature to be developed. That would help test engineers to map it to their Cucumber feature file.
  7. Write unit test cases to ensure the first hand validation of the feature and provide a baseline for automation engineers to improvise further.

Some of the immediate action items for developers to contribute towards effective software automation are:

1. Always assign unique locators for page elements in a single view

How:

blog test automation2

i. As shown above, every element in application view have identifiers to locate from backend.

  1. For iOS apps, it is the Accessibility ID
  2. For Android apps, it is the ID

ii. It is always a best practice to have a unique value to such identifiers (or at least try to have it unique across the same page/view).

Why: Unique locators allow better navigation.

2. Avoid creating dynamic IDs for page elements, which keeps changing with view/session reload

How: Dynamic IDs are worse than non-unique locators, as that serves as anti-automation practice. Use static locators (such as IDs instead of Xpath).

Why: Static locators contributes to robust automation framework.

3. Always provide a proper title to window or screen

How: Follow standard naming conventions for element IDs and locators.

Why: For automation engineers to be able to intuitively determine the element locators in future, allowing:
i. feature development and automation to work in parallel,
ii. minimal dependency and work efficiently in agile.

Conclusion

Hence, the developers has the important responsibility to make object identifications easy and make application behaviour predictable. These pointers, if taken care of, will help test automation to be more efficient, and the test automation framework to be more robust. Otherwise no matter how good the test automation architecture or tool is, it can not help much and will not be effective.