How to Run 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:
-
On the left pane, ensure you have selected the ‘Projects’ tab.
-
On the top right of the window, click the ‘Open’ button.
-
Select the root directory and point to your cloned test suite (e.g.,
<posters-simple-loadtest-suite>
). -
After clicking ‘OK,’ the test suite should open as a Maven project in the IDE.
Before executing the tests, ensure that the demo application is running.
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).