TestNG provides us with number annotations to customize the test execution flow or process as per our requirement. And some of the annotations will help us to avoid code duplication and achieve code re-usability in the framework.
In this post we will learn about code reusability using the annotations @BeforeMethod, @AfterMethod, @BeforeClass and @AfterClass. Checkout the functionalities below.
@BeforeMethod: A method associated with this annotation will always be executed before every @Test annotated method. Application launch, Login and etc. functionalities can be put in this methods
In this post we will learn about code reusability using the annotations @BeforeMethod, @AfterMethod, @BeforeClass and @AfterClass. Checkout the functionalities below.
@BeforeMethod: A method associated with this annotation will always be executed before every @Test annotated method. Application launch, Login and etc. functionalities can be put in this methods