Ashish Anand has Published 213 Articles

How to use TestNG annotations in Java?

Ashish Anand

Ashish Anand

Updated on 17-Aug-2023 14:24:56

77 Views

TestNG is a powerful testing framework, an enhanced version of JUnit which was in use for a long time before TestNG came into existence. NG stands for 'Next Generation'. TestNG framework provides the following features − Annotations help us organize the tests easily. Flexible test configuration. Test cases can ... Read More

How to update IntelliJ Idea testng-plugin to testNG version 6.8 or latest version?

Ashish Anand

Ashish Anand

Updated on 17-Aug-2023 14:23:25

301 Views

TestNG is an open−source automation testing framework. It can be used along with build tool such as maven, Gradle, ant and even with snapshot. However, user can separately download the TestNG jar file and configure it with the project without using build tool. In this tutorial, we will see how ... Read More

How to test for mandatory exceptions in TestNG?

Ashish Anand

Ashish Anand

Updated on 17-Aug-2023 14:21:45

74 Views

TestNG provides an option of tracing the exception handling of code. User can test whether a code throws a desired exception or not. Here the expectedExceptions parameter is used along with the @Test annotation. This annotation is very useful in negative/exception testing. As per TestNG documentation: “The list of exceptions ... Read More

How to stop TestNG from running after a test fail?

Ashish Anand

Ashish Anand

Updated on 17-Aug-2023 14:18:41

497 Views

A TestNG class can have different tests like test1, test2, test3 etc. There could be some failure while running the test suite and user may get failures in between of @Test methods. Once a test method gets failed, it skip remaining code of the @Test method and moves to the ... Read More

How to set TestNG in classpath in Maven project?

Ashish Anand

Ashish Anand

Updated on 17-Aug-2023 14:17:03

198 Views

Maven is a project management and comprehension tool that provides a complete build lifecycle framework. User can automate the project's build infrastructure in almost no time as Maven uses a standard directory layout and a default build lifecycle. In case of multiple environments, Maven can set−up the way to work ... Read More

How to separate unit and integration tests in TestNG + Maven using Annotations?

Ashish Anand

Ashish Anand

Updated on 17-Aug-2023 14:15:27

99 Views

TestNG is a testing framework and can use Maven as build tool. It helps to maintain dependencies and their version at one place in pom.xml User can run test from testng.xml or pom.xml. To run tests from pom.xml, user need to mention the path of testng.xml and require maven−surefire−plugin to ... Read More

How to run single test in a TestNG class from IntelliJ IDE?

Ashish Anand

Ashish Anand

Updated on 17-Aug-2023 14:12:20

190 Views

TestNG allows to run the test suites from IntelliJ IDE as well as command line. Usually, IntelliJ IDE is handy to run testng.xml for development purpose while command line (cmd) for actual execution. Apart from this, IntelliJ supports to run only single TestNG class as well as single test method ... Read More

How to run Junit test in Maven?

Ashish Anand

Ashish Anand

Updated on 17-Aug-2023 14:10:55

392 Views

Maven is a project management and comprehension tool that provides a complete build lifecycle framework. User can automate the project's build infrastructure in almost no time as Maven uses a standard directory layout and a default build lifecycle. To summarize, Maven simplifies and standardizes the project build process. It handles ... Read More

How to run a TestNG class without using testng.xml with maven?

Ashish Anand

Ashish Anand

Updated on 17-Aug-2023 14:07:18

226 Views

TestNG is a testing framework and can use Maven as build tool. It helps to maintain dependencies and their version at one place in pom.xml Maven provides flexibility to run using surefire plugin. It allows user to run testng.xml as well as directly run a testng class without using a ... Read More

How to pass java code a parameter from Maven for testing?

Ashish Anand

Ashish Anand

Updated on 17-Aug-2023 14:03:07

782 Views

TestNG is a testing framework and can use Maven as build tool. It helps to maintain dependencies and their version at one place in pom.xml Maven provides flexibility to run using surefire plugin. Surefire plugin has feature to pass paramaeter from pom.xml to TestNG class or any java code. To ... Read More

Previous 1 ... 3 4 5 6 7 ... 22 Next
Advertisements