JMeter Test Plan Generator is a Visual Studio extension that allows you to automatically generate Apache JMeter test plans from ASP.NET Core Web API projects. This tool streamlines the process of creating performance and load tests for your APIs by leveraging your project's Swagger/OpenAPI specification.
- Generate JMeter Test Plans directly from your ASP.NET Core Web API projects.
- Integrates into the Visual Studio Tools menu for easy access.
- Automatically launches your API, retrieves the Swagger/OpenAPI spec, and generates a ready-to-use JMeter test plan.
- Output is placed in a
JMeter
folder within your project directory. - Supports .NET Core and .NET Standard projects.
- Select your ASP.NET Core Web API project (.csproj) in Solution Explorer.
- Use the Tools Menu:
- Go to
Tools
>Generate JMeter Test Plan
.
- Go to
- The extension will:
- Launch your API project on a random port.
- Retrieve the Swagger/OpenAPI specification from
/swagger/v1/swagger.json
. - Use the rapicgen tool to generate a JMeter test plan.
- Place the generated test plan in a
JMeter
folder in your project.
- Visual Studio 2022 (17.0+) on Windows
- .NET SDK installed (required to build and run your API project)
- Your project must expose a Swagger/OpenAPI endpoint (e.g., using Swashbuckle)
- Download and install the extension from the Visual Studio Marketplace or build from source.
- Restart Visual Studio after installation.
- Open your ASP.NET Core Web API solution in Visual Studio.
- Right-click the
.csproj
file or select it in Solution Explorer. - Go to
Tools
>Generate JMeter Test Plan
. - The generated JMeter test plan will appear in a new
JMeter
folder in your project directory.
- The extension uses a combination of process automation and HTTP requests to:
- Launch your API project using
dotnet run
on a random port. - Poll the Swagger endpoint until the OpenAPI spec is available.
- Save the spec to a temporary file.
- Run
rapicgen jmeter
to generate the JMeter test plan. - Clean up temporary files after generation.
- Launch your API project using
- Clone this repository.
- Open
src/All.sln
in Visual Studio 2022. - Build the solution.
- Deploy or debug the extension as needed.
JMeterCodeGen.Core/
- Core logic for launching projects, retrieving Swagger, and generating JMeter scripts.JMeterCodeGen.Extension/
- Visual Studio extension implementation (Tools menu integration, command handling).JMeterCodeGen.VSIX/
- VSIX packaging for deployment.JMeterCodeGen.Core.Tests/
- Unit tests for core logic.
Contributions, issues, and feature requests are welcome! Please open an issue or submit a pull request.
This project is licensed under the GNU GENERAL PUBLIC LICENSE Version 3. See LICENSE for details.