Service Simulation Steps
Two steps let you drive simulated servers from automation: Service Simulation – Control (start/stop) and Service Simulation – Update Data (swap responses mid-run).
Service Simulation – Control
Display name: Service Simulation - Control. Starts or stops a simulated server as part of a test.
When to Use
- Starting a mock server before testing a client that depends on it.
- Stopping a mock server after tests to free ports.
- Testing behavior when a dependency becomes unavailable.
Configuration
| Field | Description |
|---|---|
| Simulation Server | The simulated server to control (from the Service Simulation configuration; AvailableServers). |
| Selected Server Description | Read-only description of the chosen server. |
| Action | Start or Stop. |
| Use Custom Parameters | When on, the simulation uses the listed Service Parameters; when off, it uses the server's current parameters from settings. |
| Service Parameters | Parameter list used when starting the simulation service. |
remarque
The Use Custom Parameters info bar warns: "If Use Custom Parameters is set to false, Simulation service will use parameters from your settings. Simulation behavior may vary from one computer to another."
Parameter Reference
| Property | Description |
|---|---|
ServerId | Full name of the server (AbstractServer.FullName). |
InstanceId | Instance Id for non-singleton servers. |
Action | ServiceSimulationControlAction.Start or .Stop. |
UseCustomizedParameters | Whether to override the server's default parameters. |
ServiceParameters | ObservableCollection<Parameter> applied when starting. |
Service Simulation – Update Data
Display name and step name: Service Simulation - Update Data. Replaces or merges the mock server's responses during a run.
When to Use
- Simulating different response scenarios in sequence (success → error → timeout).
- Testing retry and fallback logic.
- Simulating transient failures.
Configuration
| Field | Description |
|---|---|
| Responses | The SavedResponse collection to apply (matched by OperationId / URL prefix). |
| Update Strategy | How responses are applied to the automation context: FullReplace (default) or merge. |
Responses can be imported from a .mockconfig.json file or exported back to one.
Parameter Reference
| Property | Description |
|---|---|
Responses | ObservableCollection<SavedResponse> to update into the simulation context. |
UpdateStrategy | ImportStrategy used when applying (FullReplace by default). |
attention
Both steps are not supported in Load Test and Data-Driven contexts.
Example: Dependency Availability Test
Step 1: Service Simulation - Control
Action: Start Server: "PaymentGateway"
Step 2: Send Request (POST /orders) → calls simulated payment gateway
Step 3: Assert (Status Code = 200)
Step 4: Service Simulation - Control
Action: Stop Server: "PaymentGateway"
Step 5: Send Request (POST /orders) → payment gateway now unavailable
Step 6: Assert (Status Code = 502)