How to Run Java Test Cases in IntelliJ

Learn 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 your system, you can use the following process to get a demo test suite up and running in 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 pane, ensure you have selected the ‘Projects’ tab.

  2. On the top right of the window, click 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 imported tests can be run in IntelliJ in headless browser mode. Go to the package com.xceptance.xlt.samples.tests, right-click, and select ‘Run All Tests’.

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

Last modified June 5, 2025