### Simulation Connection Example Source: https://docs.tricentis.com/tosca-cloud/en-us/content/api_simulation/simulation_connection_properties.htm An example of how to define connection templates and reference them in services within a simulation configuration. ```yaml schema: SimV1 name: my simulation templates: connections:  - name: myConnection01 port: 8080 - name: myConnection02 port: 8081 services: - name: service01 steps: - direction: In connection: basedOn: myConnection01 ``` -------------------------------- ### Unattended Launcher Installation Source: https://docs.tricentis.com/tosca-cloud/en-us/content/admin_guide/downloads_and_installations.htm Use this command for unattended installation of the Launcher. Ensure you add the --silent parameter to your installation command. ```bash LauncherSetup.exe --silent ``` -------------------------------- ### Launcher Installation to Custom Path Source: https://docs.tricentis.com/tosca-cloud/en-us/content/admin_guide/downloads_and_installations.htm Run this command to install Launcher to a specific directory. Use the --installto parameter and provide the full path. ```bash LauncherSetup.exe --installto "C:\\Program Files\\Tosca\\Launcher" ``` -------------------------------- ### Example of Resource Configuration Source: https://docs.tricentis.com/tosca-cloud/en-us/content/api_simulation/simulation_resources_properties.htm This example demonstrates how to reference a resource, specify its type and file path, and configure simulation steps to interact with it. It includes setting a custom list entry separator and defining buffer values for insertion. ```yaml schema: SimV1 name: Service01 resources: - name: user type: Table file: ../../resources/db.sqlite listEntrySeparator: "|" services: - name: insert steps: - trigger: - uri: /user - property: Method value: POST buffer: - jsonPath: id name: id - jsonPath: name name: name - jsonPath: age name: age - resource: insert: - ref: user value: ["{b[id]}", "{b[name]}", "{b[age]}"] message: payload: Inserted successfully ``` -------------------------------- ### Example Virtual Service Configuration Source: https://docs.tricentis.com/tosca-cloud/en-us/content/api_simulation/simulation_message_properties.htm This example demonstrates a virtual service named Service01. It is configured to listen for incoming messages and send a 'Hello world!' response. The connection port is specified. ```yaml schema: SimV1 name: default services: - name: Service01 steps: - direction: In trigger: - uri: '*' - direction: Out message: payload: Hello world! connections: - port: 54545 ``` -------------------------------- ### BrowserStack Capability Example Source: https://docs.tricentis.com/tosca-cloud/en-us/content/references/supported_parameters.htm Example of a JSON string for BrowserStack capabilities, demonstrating nested structures and escaping. ```json { "userName": "", "accessKey": "", "browserVersion": "136", "os": "OS X", "osVersion": "Monterey", "acceptInsecureCerts": true, "timeouts": { "implicit": 10000, "pageLoad": 30000 } } ``` -------------------------------- ### Example: Generate 7-Digit Integer Source: https://docs.tricentis.com/tosca-cloud/en-us/content/references/values_random.htm This example demonstrates generating a random integer that is exactly 7 digits long. ```plaintext {RND[7]} ``` -------------------------------- ### Example: Generate 5-Digit Number with 2 Decimal Places Source: https://docs.tricentis.com/tosca-cloud/en-us/content/references/values_random.htm This example generates a random number with 5 total digits and 2 digits after the decimal point. ```plaintext {RNDDECIMAL[5][2]} ``` -------------------------------- ### Example: Generate String Matching Regex Pattern Source: https://docs.tricentis.com/tosca-cloud/en-us/content/references/values_random.htm This example generates a string that starts with an uppercase letter (A-E), followed by lowercase letters, and ends with exactly four digits (0-5). ```plaintext {RANDOMREGEX["^[A-E][a-z]+[0-5]{4}$"]} ``` -------------------------------- ### Reading Data with the 'one' Property (SQLite) Source: https://docs.tricentis.com/tosca-cloud/en-us/content/api_simulation/resource_rules_properties.htm This example demonstrates reading a single record from an SQLite resource using the 'one' property with an SQL WHERE clause. It shows how to buffer an ID from an incoming GET request and use it to query the resource. ```yaml schema: SimV1 connections:   - name: http     port: 8080 resources:   - name: user     file: user.sqlite services:   - name: get     steps:       - trigger:           - property: Method             value: GET         buffer:           - type: Path             value: "user/{xb[id]}"       - resource:           read:             - ref: user               name: result               one: "id == '{b[id]}'"         insert:           - value: "{b[result.name]}" ``` -------------------------------- ### Generate Random Text with Regular Expressions Source: https://docs.tricentis.com/tosca-cloud/en-us/content/references/regular_expressions.htm Specify random text generation using regular expressions enclosed in double quotation marks. This example generates a value starting with a capital letter, followed by lowercase letters, and exactly four digits. ```Tosca {RANDOMREGEX["^[A-Z][a-z]+[0-9]{4}$"]} ``` -------------------------------- ### API Simulation Configuration Example Source: https://docs.tricentis.com/tosca-cloud/en-us/content/api_simulation/simulation_rules_properties.htm Demonstrates how to configure API simulation with inbound and outbound steps. The inbound step triggers on any URI, and the outbound step inserts a 'Hello world!' value into the payload. ```yaml schema: SimV1 name: default services: - name: Service01 steps: - direction: In trigger: - uri: '*' - direction: Out insert: - value: 'Hello world!' ``` -------------------------------- ### Hello World Simulation (In) Source: https://docs.tricentis.com/tosca-cloud/en-us/content/api_simulation/simulation_file_examples.htm A simulation that listens for any incoming request on port 17071 and always responds with 'Hello world!'. Demonstrates handling any request path and sending a predefined message. ```yaml schema: SimV1 name: default connections: - name: hello port: 17071 services: - steps: - direction: In trigger: - uri: '*' - direction: Out message: payload: Hello world! ``` -------------------------------- ### Hello World Simulation (Out) Source: https://docs.tricentis.com/tosca-cloud/en-us/content/api_simulation/simulation_file_examples.htm A basic simulation that sends a request to the /hello endpoint and verifies the response contains 'Hello world!'. Useful for understanding basic service and step interactions. ```yaml schema: SimV1 name: default includes: - hello_world services: - steps: - direction: Out insert: - uri: /hello - verify: - value: Hello world! ``` -------------------------------- ### Example: Generate Integer within Range Source: https://docs.tricentis.com/tosca-cloud/en-us/content/references/values_random.htm This example shows how to generate a random integer between -789 and 123, inclusive. ```plaintext {RND[-789][123]} ``` -------------------------------- ### Run Agent Command with RDP Argument Source: https://docs.tricentis.com/tosca-cloud/en-us/content/admin_guide/run_agent_rdp.htm Use this command in the Command Prompt to initiate the agent setup with RDP enabled. You will be prompted to enter the Client secret. ```bash agent-setup.exe --useRdp ``` -------------------------------- ### Configure Forward Connection with Learning Mode Source: https://docs.tricentis.com/tosca-cloud/en-us/content/api_simulation/create_sim_from_learning.htm Set up a connection to enable learning mode for API simulation. This configuration captures requests and forwards them to a real service, learning new behaviors to update simulation files. Ensure the 'to' endpoint is defined separately. ```yaml schema: SimV1 connections: - forward: learning: patterns: - type: Path - xPath: /*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='getCar']/*[local-name()='make'] mode: Learning to: realCarService name: theCarServiceSimLearnings port: 54345 - endpoint: http://localhost:51002/carservice listen: false name: realCarService ``` -------------------------------- ### Example: Generate 8-Character Random String Source: https://docs.tricentis.com/tosca-cloud/en-us/content/references/values_random.htm This example demonstrates generating a random string that is exactly 8 characters long. ```plaintext {RANDOMTEXT[8]} ``` -------------------------------- ### Example: Generate Decimal Number within Range Source: https://docs.tricentis.com/tosca-cloud/en-us/content/references/values_random.htm This example generates a random number between 130 and 200, with four decimal places. ```plaintext {RNDDECIMAL[4][130][200]} ``` -------------------------------- ### JSON Formatting - Complete Test Data File Source: https://docs.tricentis.com/tosca-cloud/en-us/content/ai_integration/agentic_test_automation/generate_testcase.htm A comprehensive JSON example combining credentials, organizational data, sales order details, and outbound delivery information for a complete test case. ```json {   "Credentials": {     "User": "xxx",     "Password": "xxx"   },   "Test Organizational Data": {     "Order Type": "OR",     "Sales Organization": "1000",     "Distribution Channel": "10",     "Division": "00"   },   "Test Sales Order Data": {     "Sold-To Party": "1175",     "Ship-To Party": "1175",     "Cust. Reference": "Customer Test",     "All Items Table": [       {         "Item": 1,         "Material": "M-09",         "Order Quantity": 5       },       {         "Item": 2,         "Material": "M-09",         "Order Quantity": 10       }     ]   },   "Outbound Delivery Data": {     "Shipping Point": 1201,     "Selection Date": "11/21/2026"   } } ``` -------------------------------- ### JSON Data Example Source: https://docs.tricentis.com/tosca-cloud/en-us/content/data_integrity/di_json_xml_into_caching_db.htm Example JSON data structure used to illustrate how data is loaded into the caching database and how different value types are represented. ```json { Items: [ { "Id" : 1, "Name" : "Bill", "Position" : "Manager" }, { "Id" : 2, "Name" : "Kirsten", }, { "Id" : 3. "Name" : "Jeff", "Position" : null ] } ```