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:

  1. Create a new project in IntelliJ and select:

    • Maven as the build system

    • Java SDK 21 or 11, depending on your NeoLoad version

  2. Update pom.xml dependencies.
    Open your pom.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>
  3. 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())

  4. Add a custom icon (optional):

    • Save a 20x20 px icon in the resources/{your.package.name} directory

    • Implement the getIcon() method:

    Copy
    @Override
    public Icon getIcon() {
        return new ImageIcon(Objects.requireNonNull(getClass().getResource("icon.png")));
    }
  5. 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

  6. 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), or project-dir/lib/extlib (project-specific use)

For more information on Maven usage, check out their official documentation (opens in new tab).