Create a simulation in Postman Simulator
When you create a simulation, you can apply failure scenarios to one or more mocks. Make sure you have at least one mock set up and deployed as a mock server before you configure a simulation.
To create a simulation, do the following:
-
Open a workspace and select Tools >
Simulations in the footer.
-
Click Create simulation.
-
Enter a name for the simulation.
-
(Optional) Customize the URL for the simulation or keep the auto-generated one. The customized URL must be unique and can only have lowercase letters, numbers, and hyphens.
-
Select the mocks you’d like to add to the simulation.
-
Choose how requests access mocks in the simulation:
- URL path — Route requests to a mock using a unique path in the request URL. For example:
https://<my-simulation>.sim.<team>.postman.dev/<mock-slug>/<endpoint> - Header — Route requests to a mock using a request header while sharing the same simulation URL. For example:
x-mock-slug: <mock-slug>
- URL path — Route requests to a mock using a unique path in the request URL. For example:
-
Click Create simulation.
Once you’ve created the simulation, you can apply scenarios to the simulation to simulate specific conditions.
In Local View, a simulation file is created in your local Git repository with the configuration for the simulation. In Cloud View, the simulation configuration is synced to the Postman Cloud.
About the simulation file
When you create a simulation in Local View, Postman creates a simulation file in your local Git repository with the configuration for the simulation, including the mocks and scenarios. This file is used to start the mocks with the selected scenarios when you start a simulation.
The simulation file is located at postman/simulations/<simulation-name>.sim.yaml. You can edit this file directly to update the mocks and scenarios included in the simulation. You can also use Agent Mode to quickly update the simulation file.
To change the conditions that apply to a simulation, see Apply scenarios to a simulation.