Run a collection with a simulation
Postman Simulator is available on Postman Solo, Team, and Enterprise plans. For more information, see the pricing page.
With a code mock, you can simulate your API’s dependencies and test how your service behaves without calling real services. You can use Postman Simulator to apply scenarios like latency, errors, and rate limits to your code mock, reproducing real-world conditions. This enables you to observe how your service responds to disruptions and performance constraints.
Configure a collection run with a simulation
Run a collection with a simulation to test how your service behaves under real-world conditions. When you start the run, Postman applies the selected simulation as requests run. In Local View, Postman automatically starts the code mock for the duration of the collection run and stops it when the run completes. In Cloud View, the code mock is always running, so you can send requests to it without needing to start it.
Before you run a collection with a simulation, make sure the base URL for requests is set to the code mock URL.
To run a collection with a simulation, do the following:
- Click
Items in the left sidebar.
- Click Collections and select the collection you want to run against a simulation.
- Select Run manually.
- Configure the collection run settings as needed, such as the number of iterations, delay, or test data file.
- Select a simulation configuration from the dropdown menu. You can also click
Create new simulation to create a simulation.
- (Optional) Click the Simulator tab in the left pane to edit the simulation.
- Click Start run.
With the Postman CLI, you can also run a collection with a simulation using the postman collection run --simulate command.
View simulation events
After running a collection with a simulation, you can review the results in the collection run results. All standard run details are available as usual, including test results, errors, and request metrics.
In the collection run results, click the Simulation events tab to show how the applied scenarios affected each request during the run. This tab includes a timeline of events with details such as the time, event, scenario applied, and additional context. You can also view how many tests passed or failed for each event.
Click the Simulation events tab to understand when and how failure conditions were triggered, and how your service responded to them.
Learn more about viewing collection run results.