The core of every automation project should include the principle that duplication of anything should not happen at any cost whether it's a duplication of code or data or for that matter anything in fact.
Take this example (see pic 1), where we need to execute every method say 5 times each- we all know that it is easily achievable through the TestNG invocation count attribute of the Test annotation. Plus, we want all tests to be re-tried on failure so we can add one more attribute of Test annotation of TestNG i.e. retry analyzer.
I truly believe this is a case of duplication where each method @Test annotation is using 2 attributes: invocation count and retry analyzer.
Did you know that TestNG allows annotations to be used at the test class level to fix this duplication issue? I agree that it's not required always at class level but in case you need it, please follow.
Here, the methods do not have any annotation or attributes because it's getting inherit from the class.
In this case (see pic 2), when you execute the Example class, all its tests run 5 times and are retried in case of any failure.
seleniumautomation testNG automationtesting easier tipsandtricks testing apiautomation avoidDuplication
As API testing becomes more central to modern software development, the tools we use to test, automate, and debug APIs can make a big difference. For years, Postman has been the go-to API client for developers and testers alike. But now, Bruno , a relatively new open-source API client, is making waves in the community. Let’s break down how Bruno compares to Postman and why you might consider switching or using both depending on your use case. ✨ What is Bruno? Bruno is an open-source, Git-friendly API client built for developers and testers who prefer simplicity, speed, and local-first development. It stores your API collections as plain text in your repo, making it easy to version, review, and collaborate on API definitions. 🌟 What is Postman? Postman is a full-fledged API platform that offers everything from API testing, documentation, and automation to mock servers and monitoring. It comes with a polished UI, robust integration, and support for collaborati...


Comments
Post a Comment