How to Run Java Test Cases in intelliJ

How to import a demo test suite and execute its java test cases in IntelliJ.

Execution of Java Test Cases using IntelliJ IDE

After downloading and installing IntelliJ on a system you can use the following process to get a demo test suite up and running on your IDE.

Obtaining the Test Suite

Clone the demo test suite from Github to a local directory, e.g. <posters-simple-loadtest-suite>.

Importing the Posters Test Suite into IntelliJ

Once IntelliJ has started, do the following:

  1. On the left pan make sure you have selected the ‘Projects’ tab.

  2. On the top right of the window click on the ‘Open’ button.

  3. Select the root directory and point to your cloned test suite, e.g. <posters-simple-loadtest-suite>.

  4. After clicking ‘OK’ the test suite should open as a Maven project in the IDE.

Executing Java Test Cases in IntelliJ

The tests imported can be run in IntelliJ in headless browser mode. Go to package com.xceptance.xlt.samples.tests, right click and select select ‘run all tests’.

Per default, the test cases will run against the demo application you started already (if you modified the ports there, you might have to change them in <project>/config/project.properties accordingly, just look for the property store-url).

Last modified March 4, 2022