Aller au contenu principal

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​

FieldDescription
Simulation ServerThe simulated server to control (from the Service Simulation configuration; AvailableServers).
Selected Server DescriptionRead-only description of the chosen server.
ActionStart or Stop.
Use Custom ParametersWhen on, the simulation uses the listed Service Parameters; when off, it uses the server's current parameters from settings.
Service ParametersParameter 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​

PropertyDescription
ServerIdFull name of the server (AbstractServer.FullName).
InstanceIdInstance Id for non-singleton servers.
ActionServiceSimulationControlAction.Start or .Stop.
UseCustomizedParametersWhether to override the server's default parameters.
ServiceParametersObservableCollection<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​

FieldDescription
ResponsesThe SavedResponse collection to apply (matched by OperationId / URL prefix).
Update StrategyHow 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​

PropertyDescription
ResponsesObservableCollection<SavedResponse> to update into the simulation context.
UpdateStrategyImportStrategy 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)

See Also​