Intellij Articles

Found 25 articles

How to Run Your First Spring Boot Application in IntelliJ?

Adeeba Khan
Adeeba Khan
Updated on 20-Oct-2023 666 Views

IntelliJ is simple and very convenient to use in building reliable as well as scalable systems with Spring Boot, and it has become tremendously famous among Java developers. It also offers a convention-over-configuration approach by obviating the demand for bulky boilerplate code and enabling designers to concentrate on business logic. This potent web tool aims in generating a basic project structure with the necessary dependencies. The second method focuses on importing a pre-existing Spring Boot project into IntelliJ IDEA so that one can work on an existing codebase. To execute this code in IntelliJ one must ensure that they have ...

Read More

How to Download the Latest TestNG Jar File?

Ashish Anand
Ashish Anand
Updated on 21-Aug-2023 4K+ 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 article, we will see how to download latest TestNG jar. Download latest TestNG jar Following steps should be followed to download the latest/specific version of TestNG jar. Open the browser and navigate to https://testng.org. Once page opens, click on Download present at top. Following screenshot displays testing.org page and download button. ...

Read More

Why to use Selenium with TestNG?

Ashish Anand
Ashish Anand
Updated on 21-Aug-2023 396 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. Multiple test cases can be grouped more easily. Parallelization of tests can be achieved using TestNG. Support for data− driven testing. Inbuilt reporting as well as supported by Extent Reporting and other reporting tools. Selenium by default doesn’t generate any report. Easily configured for Cross Browser testing. TestNG framework can easily integrate ...

Read More

Why does TestNG Allow Several Expected Exceptions?

Ashish Anand
Ashish Anand
Updated on 21-Aug-2023 391 Views

TestNG supports multiple exceptions in single @Test method. It is similar to the catch exception in Java where user can mention multiple exception class those are possible to be thrown. Ex: Syntax in catch exception is: catch(IOException | InterruptedException ex) { Similarly, syntax in TestNG is: @Test(expectedExceptions={NullPointerException.class, IllegalArgumentException.class }) public void throwsNullPointer() { throw new NullPointerException(); } One point to note that, in such scenarios, TestNG expects the one of the exceptions must be thrown from the list. If exception is different from the list or no exception, in such cases it fails the method. ...

Read More

How to do Cross Browsing Testing in Selenium with TestNG?

Ashish Anand
Ashish Anand
Updated on 21-Aug-2023 244 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'. A website should be tested across multiple browsers like IE, Chrome, Firefox, Safari to validate the compatibility of website and functionality. Since the HTML, CSS and java scripts are unique across all browsers, it is always recommended to do cross browser testing to ensure the compatibility of website. Selenium supports cross browser testing so does the TestNG. In this article, we will analyze how to perform cross browser testing in Selenium ...

Read More

How to Run Specific TestNG Suite with Maven from Command Line?

Ashish Anand
Ashish Anand
Updated on 18-Aug-2023 5K+ 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. If a user has multiple testng.xml files (please note one testng files contains only one test suite), he/she may run the specific suite based on the requirement. Maven provides the flexibility to define suiteXMLFiles as variable and pass the value of variable at run time using command line. In this article we will illustrate how to run specific TestNG suite with maven from command line. Approach/Algorithm to ...

Read More

Mix TestNG and Junit Assertions Together within the Same Test?

Ashish Anand
Ashish Anand
Updated on 18-Aug-2023 354 Views

JUnit and TestNG are the most popular testing frameworks for Java applications. Both frameworks are easy to use. But, they are different with each other. Their import libraries are different so the identifying the code is also different. In this article, we will discuss whether it is possible to mix TestNG and Junit assertions together in same Test. Let’s analyse how these two frameworks work. TestNG When user writes any @Test or other annotations, it needs to import a library as import org.testng.annotations.Test; Here, testng is the key to identify the @Test or any other code execution is based on ...

Read More

How to write a TestNG Listener that can List all Groups of a Test Method?

Ashish Anand
Ashish Anand
Updated on 18-Aug-2023 290 Views

A TestNG class can have different tests like test1, test2, test3 etc. and these tests can be grouped based on different groups like unit, integration or both or any bug number. User may want to run the @Test method based on groups. And, it is always convenient to know which test method belongs to which group so that these details can be included into report. TestNG supports multiple ways to get group name at run time such as injection dependency and Listeners are most popular. Even in Listeners it can be achieved using ITestListener or IInvokedMethodListener. In this article, let’s ...

Read More

How to Write a TestNG Listener that can Fetch Name of Executing Test Method?

Ashish Anand
Ashish Anand
Updated on 18-Aug-2023 302 Views

A TestNG class can have different tests like test1, test2, test3 etc. and these tests can be grouped based on different groups like unit, integration or both or any bug number. User may want to run the @Test method based on groups. And, it is always convenient to know which test method belongs to which group so that these details can be included into report. TestNG supports multiple ways to get test name at run time such as injection dependency and Listeners are most popular. Even in Listeners it can be achieved using ITestListener or IInvokedMethodListener. In this article, let’s ...

Read More

How to Stop Suite Execution after First Failure in TestNG?

Ashish Anand
Ashish Anand
Updated on 18-Aug-2023 442 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 next @Test method. However, user may want to skip remaining all @Test methods after getting 1st failure. There are 2 most popular solution for such use cases: Write dependsOnMethods annotation – But this solution works only if user knows exact dependent method/s otherwise in large suite it would be ...

Read More
Showing 1–10 of 25 articles
« Prev 1 2 3 Next »
Advertisements