Create a custom action with IntelliJ
You can create a custom action in NeoLoad using IntelliJ Integrated Development Environment (IDE) and Maven as the build system. This topic will help you build, annotate, and package a custom action that can be reused in your NeoLoad projects. For more information about IntelliJ, check out their documentation (opens in new tab).
Before you start
Choose the correct Java Development Kit (JDK) based on your NeoLoad version:
-
JDK 21 for NeoLoad 2025.1 or later.
-
JDK 11 for earlier versions.
Create a Maven project for your custom action
To create a Maven project for your NeoLoad custom actions, follow these steps:
-
Create a new project in IntelliJ and select:
-
Maven as the build system
-
Java SDK 21 or 11, depending on your NeoLoad version
-
-
Update
pom.xml
dependencies.
Open yourpom.xml
file and add the following dependencies:Copy<dependencies>
<dependency>
<groupId>com.neotys.actions</groupId>
<artifactId>neotys-custom-action-api</artifactId>
<version>2.16.2</version>
</dependency>
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>1.1.1</version>
<scope>compile</scope>
</dependency>
</dependencies> -
Implement the Action class:
-
Create a new Java class that implements
com.neotys.extensions.action.Action
-
Add the
@AutoService(Action.class)
annotation -
Implement all required methods, including:
getType()
,getDefaultParameters()
,getDescription()
,getMinimumNeoLoadVersion()
,(return Optional.absent())
,getMaximumNeoLoadVersion()
,(return Optional.absent())
-
-
Add a custom icon (optional):
-
Save a
20x20 px
icon in theresources/{your.package.name}
directory -
Implement the
getIcon()
method:
Copy@Override
public Icon getIcon() {
return new ImageIcon(Objects.requireNonNull(getClass().getResource("icon.png")));
} -
-
Create and link the ActionEngine class:
-
Create a class that implements
com.neotys.extensions.action.engine.ActionEngine
-
Fill in the execute method to define behavior and result
-
Link the engine to your Action class using
getEngineClass()
or relevant binding
-
-
Install the custom action in NeoLoad:
-
Run Maven > install from the IntelliJ UI
-
Copy the generated JAR from the target folder
-
Place the JAR in
<NeoLoad install dir>/extlib
(global use), orproject-dir/lib/extlib
(project-specific use)
-
For more information on Maven usage, check out their official documentation (opens in new tab).