Create a Simulation
Generate new Gatling simulations with guided configuration
The Create Simulation feature provides an interactive wizard that generates complete, ready-to-run Gatling simulations. Answer a few questions about your test scenario, and the wizard generates properly structured code in your chosen language.
How to use Create Simulation
Option 1: Command Palette
- Open the Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Type and select “Gatling: Create Simulation”
- Follow the wizard prompts
Option 2: Welcome Page
- Open the Command Palette and run “Gatling: Show Welcome Page”
- Click the “Create New Simulation” button
- Follow the wizard prompts
Option 3: Activity Bar
- Click the Gatling icon in the Activity Bar (left sidebar)
- Click the “Create Simulation” quick action button
- Follow the wizard prompts
The wizard workflow
The wizard guides you through 7 steps to configure your simulation:
Step 1: Simulation Name
Enter a name for your simulation (must start with uppercase).
Example: MyApiLoadTest
Step 2: Target URL
Enter the base URL of the system you want to test.
Example: https://api.example.com
Step 3: Injection Profile
Choose how users will be injected into the simulation:
| Profile | Description | Use Case |
|---|---|---|
| constantUsersPerSec | Constant rate of users per second | Sustained load testing |
| rampUsers | Gradually increase users over time | Realistic traffic growth |
| atOnceUsers | All users start at once | Spike testing |
| stressPeak | Peak stress pattern | Find breaking points |
Step 4: Number of Users
Specify how many virtual users to simulate.
Example: 100
Step 5: Duration (if applicable)
For constantUsersPerSec and stressPeak profiles, specify test duration in seconds.
Example: 60 (1 minute)
Step 6: Ramp Duration (if applicable)
For rampUsers profile, specify how long to ramp up in seconds.
Example: 30 (30 seconds to reach full load)
Step 7: Data Feeders
Choose whether to include data feeders:
- No: Simple simulation without external data
- Yes - CSV: Load test data from CSV file
- Yes - JSON: Load test data from JSON file
- Yes - Array: Use in-memory array for data
What gets generated
The wizard creates a complete, runnable Gatling simulation with:
Basic structure
- Imports: All necessary Gatling DSL imports
- HTTP protocol: Configured with your target URL and standard headers
- Scenario: A basic scenario with a sample GET request
- Load injection: Your chosen injection profile configured
- Status check: Basic 200 OK assertion
Optional additions
- Feeder setup: Pre-configured feeder code if you selected data feeders
- Comments: Helpful documentation about your configuration
Example output (TypeScript with rampUsers)
Wizard inputs:
- Name:
MyApiLoadTest - URL:
https://api.example.com - Profile:
rampUsers - Users:
100 - Ramp:
60seconds - Feeders: No
Generated code:
import { simulation, scenario, exec, rampUsers } from '@gatling.io/core';
import { http, status } from '@gatling.io/http';
/**
* MyApiLoadTest - Gatling Load Test Simulation
*
* Target: https://api.example.com
* Users: 100
* Duration: n/a
* Profile: rampUsers
*/
// HTTP Protocol Configuration
const httpProtocol = http
.baseUrl('https://api.example.com')
.acceptHeader('application/json')
.contentTypeHeader('application/json')
.userAgentHeader('Gatling');
// Scenario Definition
const scn = scenario('MyApiLoadTest Scenario')
.exec(
http('Request')
.get('/')
.check(status().is(200))
);
// Simulation Configuration
export default simulation((setUp) => {
setUp(
scn.injectOpen(rampUsers(100).during(60))
).protocols(httpProtocol);
});
Automatic file placement
The wizard automatically places your simulation in the correct directory based on your project structure and language:
JavaScript/TypeScript projects
javascript/src/ortypescript/src/- Falls back to
src/if language-specific folder doesn’t exist
Java/Scala/Kotlin projects
The wizard detects your build tool and uses the appropriate structure:
| Build Tool | Default Location |
|---|---|
| Maven | src/test/{language}/simulations/ |
| Gradle | src/test/{language}/simulations/ |
| sbt | src/test/scala/simulations/ |
Note: sbt only supports Scala. The wizard will warn you if you try to create non-Scala simulations in an sbt project.
Custom directories
Configure custom simulation directories in VS Code settings:
File → Preferences → Settings → Extensions → Gatling AI Assistant → Simulation Directory
Set per-language directories:
gatling.simulationDirectory.javascriptgatling.simulationDirectory.typescriptgatling.simulationDirectory.javagatling.simulationDirectory.scalagatling.simulationDirectory.kotlin
Next steps
The wizard creates a foundation for your simulation. Customize it using resources from the Gatling documentation:
| Task | Reference |
|---|---|
| Update requests, add query parameters, set request bodies | HTTP requests |
| Add multiple requests to your scenario | Scenarios |
| Load test data from CSV, JSON, or other sources | Feeders |
| Validate responses with checks and assertions | Checks & Assertions |
| Configure different load injection strategies | Load injection |
| Extract values from responses for use in subsequent requests | Session |
| Add think times and pauses between requests | Pauses |
Using AI Chat for advanced scenarios
While the wizard creates basic simulations, you can use the AI Chat feature to develop more complex scenarios:
When to use the wizard
- ✅ Quick start with basic structure
- ✅ Standard load patterns
- ✅ Single scenario simulations
- ✅ Learning Gatling syntax
When to use AI Chat
- ✅ Complex user journeys with multiple paths
- ✅ Custom authentication flows
- ✅ Advanced correlation and data extraction
- ✅ Multi-scenario simulations
- ✅ Performance tuning advice
Troubleshooting
“Could not determine target directory”
Cause: Your project doesn’t have a recognizable structure for the selected language.
Solutions:
- Download Gatling SDK: Click “Download Gatling SDK” to get proper project structure
- Manual directory: Create
src/test/java,src/test/scala, etc., manually - Custom path: Set a custom directory in VS Code settings
“sbt projects only support Scala simulations”
Cause: You’re trying to create a Java or Kotlin simulation in an sbt project.
Solutions:
- Switch to Scala: The wizard offers to switch automatically
- Use Maven/Gradle: Convert your project to Maven or Gradle for Java/Kotlin support
- Create anyway: You can create the file, but you won’t be able to run it with sbt
File already exists
Cause: A simulation with that name already exists in the target directory.
Solutions:
- Choose a different name
- Delete or rename the existing file
- Manually edit the existing simulation