Configure API tests
This topic explains which test configuration parameters you can use for API tests and how to view log information.
Logging
Create the test configuration parameter WebserviceEngineLogRequestResponse to save log requests and responses as HTTP messages in text files. You can review these text files to help you identify errors.
When you set the test configuration parameter to True, the engine saves each request and response as a text file in the directory that you specify in the Request/Response log directory setting. The default directory is: %APPDATA%\Tricentis\Tosca Testsuite\7.0.0\logs\Automation\WSE. Each text file uses the name format <yyyyMMdd_hhmmssfff>_<Request|Response>.txt and displays the time of sending or receiving, the HTTP header, and the message content.
After a test run, the ExecutionList in the Execution section shows the log file path in the Detail column for the Send and Receive ExecutionEntry.
Use the Save Request and Save Response modules in the TestStepValues Transform request and Transform response to save requests and responses in their original format.
Setting timeout
Create the test configuration parameter WebserviceEngineResponseTimeout to set the response timeout, in milliseconds, for an ExecutionList. The timeout specifies how long the engine waits for a webservice to respond. To change the timeout globally, use the ResponseTimeout setting.
Auto pretty printing API message payloads
Create the test configuration parameter ApiEngineAutoPrettyPrint to use automatic pretty printing for API messages in your test case. This ensures that Tosca formats request and response payloads consistently during verification, which prevents false test failures that might occur when Tosca compares pretty-printed and non-pretty-printed JSONs.
To set this configuration globally, use the Auto pretty print setting.
Log API message details
Create the test configuration parameter ApiEngineLogMessageDetails to log complete API message details during test runs and display them in the Detail column of your ExecutionLists. When you set this parameter to True, Tosca stores all relevant request and response information, such as headers, properties, payload, status codes, and timing data, in a structured format. This offers a reliable way to analyze, debug, and reuse full API interactions beyond the standard request/response logging.
Include disabled TestStepValues in the payload
By default Tosca removes disabled TestStepValues from the API module payload. Create the test configuration parameter ApiEngineTreatDisabledNodesAsInactive and set it to false to retain disabled TestStepValues in the payload.