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
Clipboardy is a popular Node.js library that provides a cross-platform solution for interacting with the system clipboard. It supports both synchronous and asynchronous operations, and it can be used to copy, paste, and read the clipboard contents. Features of Clipboardy: 1. Cross-platform compatibility: It works on macOS, Windows, Linux, OpenBSD, FreeBSD, Android with Termux, and modern browsers. 2. Synchronous and asynchronous operations: It provides both synchronous and asynchronous methods for clipboard operations, making it suitable for a variety of use cases. 3. Copy, paste, and read operations: It supports copying, pasting, and reading the clipboard contents, making it a versatile tool for interacting with the clipboard. 4. Promise-based API: It is an asynchronous method that returns promises, making it easy to handle asynchronous operations in a clean and concise way. 5. Easy to use: It has a simple and intuitive API that is easy to learn and use. How to Use Clipboardy: To...


Comments
Post a Comment