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:
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:
-project "<path>/myproject.nlp" "<path>/servers.yaml" "<path>/user_paths.yaml"
-project "<path>/myproject.nlp" -project "<path>/servers.yaml" -project "<path>/user_paths.yaml"
-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.
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 "Run a test" section of NeoLoad Web allows launching a YAML-based project.
The interface allows you to upload manually or through a GIT import:
The API allows you to upload:
Specify the YAML file(s) to load. If you do not specify any, then NeoLoad will load "default.yaml" if present.
In this use case, the user will use a YAML file describing the Scenario to use instead of the existing one in a NeoLoad project.
The YAML file to use for the scenario settings to apply is:
- name: MyScenario
- name: MyPopulation
When having the same name, the scenario included in the YAML file replaces the scenario existing in the NeoLoad project. Also, if the scenario available in the YAML file does not exist in the NeoLoad project, it is then added in the project. In this example, we consider that a "Myscenario" scenario already exists in the NeoLoad project, is then replaced by the scenario of the same name specified in the YAML file.
The same mechanism can be used to override Server host names and Test data:
- name: myapp
The user can then run the following command line:
NeoLoadCmd.exe -project "<neoload projects path>/MyProject/MyProject.nlp" "<neoload projects path>/myproject-scenarios.yaml" "<neoload projects path>/myproject-environment.yaml"-launch MyScenario
Or create a Zip archive with the content of the <neoload projects path> folder, upload it and run it from NeoLoad Web.
Here is an example of using only YAML files, for two different execution environments:
You should add top-level files that include the required files for each environment:
And a default file for example:
Then, zip the whole content and: