Tuesday, May 29, 2018

BeforeMethod, AfterMethod, BeforeClass and AfterClass annotations.

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

Java Program 5: How to reverse given string and each word of it?

Let us understand the problem with an example, suppose "Learn Core Java" is the given string then the expected output should be &...