Executing YAML-based projects

YAML-based projects, either hybrid with a NeoLoad Controller project file and YAML file(s) or with only YAML file(s), can be executed through different ways via:

  • the NeoLoad Controller command line,

  • the NeoLoad Web "Run a test" section,

  • NeoLoad Web API.

NeoLoad Controller command line

Configuring a test with NeoLoad as-code can be carried out with the command line. The -project argument allows declaring the NeoLoad project (".nlp") to launch. For more information, see -project in List of arguments.

-project can be run in command line, then test elements can be declared by specifying the corresponding YAML file(s).

-project can also be used for each file as an alternative to putting all files after -project. For example, both examples below can be used:

Copy
-project "<path>/myproject.nlp" "<path>/servers.yaml" "<path>/user_paths.yaml"

or

Copy
-project "<path>/myproject.nlp" -project "<path>/servers.yaml" -project "<path>/user_paths.yaml"

Tip: Here is an example that allows declaring only YAML files in command line:

Copy
-project "<path>/servers.yaml" "<path>/user_paths.yaml" "<path>/populations.yaml" "<path>/scenarios.yaml"

-project can specify a folder that contains the default file "default.yaml" and the potential files referenced by the includes.

Project folder

NeoLoad needs a project folder where resources like JAR dependencies or CSV files for File variables when loading the project can be found.

The project folder is also used to store temporary files and the test result.

The project folder is:

  • The NeoLoad Controller Project folder when specified, or

  • The folder of the first YAML file when only YAML files are specified.

"Run a test" section from NeoLoad Web

The "Run a test" section of NeoLoad Web allows launching a YAML-based project.

  1. Upload the Project.
    The interface allows you to upload manually or through a GIT import:

    • A zipped NeoLoad Controller Project

    • A zipped NeoLoad Controller Project with YAML file(s). The "default.yaml" file will be loaded (it can contain includes).

    • Zipped YAML file(s) only, the "default.yaml" file will be loaded (it can contain includes).

    • A single YAML file, it cannot contain "includes" in that case.

  2. Set-up your test and launch the test.
    For more information about how to run a test in NeoLoad Web, see Run a test in NeoLoad Web documentation.

NeoLoad Web API

  1. Upload the Project with the endpoint "/ Projects" of the Runtime API.
    The API allows you to upload:

    • A zipped NeoLoad Controller Project

    • A zipped NeoLoad Controller Project with YAML file(s)

    • Zipped YAML file(s) only

    • A single YAML file (it cannot contain ‘includes’ in that case)

  2. Execute a scenario within the uploaded Project with the endpoint of the Runtime API.
    Specify the YAML file(s) to load. If you do not specify any, then NeoLoad will load "default.yaml" if present.