← Back Published on

Handy Tips For A Robust Test Framework

After choosing a right automation tool and incorporating the necessary plugins required for the framework, the main challenge is to make the framework Robust, Reliable, Re-usable  and the list continues based on individual priorities.

  • The most important factor that plays a role in non-flaky front-end automation is web element locator strategy. 

While Automation strategies are discussed with the team, the Quality Engineer has to bring to attention about Web Element Attributes to make the tests non flaky. The test attributes have to be included in the front end objects, which stays consistent every time a new release has been made. It is always a good practice to locate objects using test-id attributes and steer away from css-locators that change frequently.

  • Another factor to keep on top of priorities is, Re-usability of custom commands/functions to reduce repeated implementation of code. 

Re-usability of common functions will make the test framework easily maintainable and allows the changes to be done in just one place, the generic method/function. This can be implemented differently based on the automation tool chosen; For example, in Selenium, we inherit the parent classes and re-use it's methods. Whereas in Cypress, we write custom commands in commands.js file, which will be automatically imported by Cypress when we call the commands.

  • Reporting the test results in good format will also make stakeholders to get a nice impression on automation team. Suitable plugins can be imported to generate amazing HTML reports for the status of test executions.

Accessibility of the test reports must be planned in such a way, it has to be shared to the entire team/organization, rahe