Home > Devanand Tripathi

How to use @Parameters and @Optional annotations in the TestNG

TestNG @Parameters One of the important features of TestNG is parameterization. This annotation allows the user to pass parameter values to test methods through the testng.xml file. @Parameters({"param-name"}) Let's write a simple example of passing parameters to test methods through the XML configuration file. Steps to Perform: Open chrome and enter the Demo

This Article is TAGGED in , , , . Read more

TestNG: Use of Before and After annotations with sample code

Exmaples for @BeforeMethod and @AfterMethod in TestNG. @BeforeMethod allows the method to execute before the execution of each Test methods, whereas @afterMethod is executed after the execution of each Test methods.  [crayon-6736407c60198690793255/] Output: First Method:Before Method starts!Test with Default priorityAfter Method starts In the above output, we can observe for every Test first @BeforeMethod is

This Article is TAGGED in , , , , , . Read more

How to use Annotations in TestNG Framework

Annotations in TestNG Annotation is a feature introduced in Java 5 and is used to add a piece of code to the java source code.  Annotations are easy to use, maintain and understand. Annotations provide many useful attributes to use in the code. It is easier to find where the error

This Article is TAGGED in , , , , . Read more

TestNG Test Annotation with attributes and sample code

Test Annotation with attributes in detail with example. @Test: The @Test attribute is the most important and commonly used annotation of TestNG. It is used to mark a class or a method as part of the test. We write code/business logic in the @Test method. If we want to automate something, that particular

This Article is TAGGED in , , , . Read more

How to Create Configure TestNG project

Setting up a new TestNG project In the previous topic, we have discussed the installation of TestNG in the Eclipse. Let's create a TestNG project in the eclipse and Name it as "TestNGProject". Step 1. Click on File > New > Java project. Step 2. Type "TestNGProject" as the Project Name then click Next. Step

This Article is TAGGED in , , , . Read more

Best Selenium Automation framework TestNG

TestNG: Powerful and easy to use framework/tool over JUnit and NUnit. Extensively used by all automation testers due to its reporting feature. What are the features of TestNG? Annotations are widely used in the TestNG framework. Annotation is used to describe a piece of code that is inserted into the program or

This Article is TAGGED in , , , , . Read more

Install TestNG Framework

What is TestNG FrameWork? 1. TestNG is the most widely used testing framework in the software testing industry. It is an open source automated Testing framework. 2. TestNG is an automation testing framework in which NG stands for "Next Generation". 3. TestNG is used for different kinds of testing like unit, functional, integration

This Article is TAGGED in , , , , , , . Read more