GenRocket Realtime Engine Request Payload
The GenRocket Realtime Engines will interpret different Request payloads based on the interfaceType parameter within a given request payload. Each interfaceType will cause the real-time engines to behave differently. There are currently two interfaceTypes the real-time engines can interpret:
- Auto - Tells the real-time engines to directly call the GenRocket runtime and run the given Scenario. The Auto options allow users to generate test data in real-time for white-box, black-box, load and performance testing by simply executing a GenRocket Scenario.
- Manual - Tells the real-time engines to use the GenRocket runtime API. The Manual option allows programmers to access the GenRocket runtime to directly create scenarios from their own programs.
Manual Interface Type
See, API Payload Formats for REST & Socket Engines.
Auto Interface Type
The Auto payload takes seven name/value parameters when making a request. The order if the parameters are insignificant.
Payload Parameters
- interfaceType: Defines type of request and the interface used to handle the request.
- path: Specifies the location of the Scenario on the local computer.
- scenario: Specifies the name of the Scenario to load.
- scenarioDomain: Specifies the name of the Domain within the Scenario to generate data for.
- loopCount: Specifies the number of iterations that will be taken over the Domain to generate data.
- inMemory: Specifies if the test data should be generated in Memory (see below for detail discussion).
- sfProfileName: Specifies a Salesforce profile for running Salesforce-specific Receivers.
Payload Format
{ "interfaceType": "Auto", "path": "/home/userName/someDirectory", "scenario": "UserScenario.grs", "scenarioDomain": "User", "inMemory": "true", "loopCount": "10", "sfProfileName": "" }
Parameter inMemory Behavior
When the inMemory value is true, the following actions take place:
- Locates and loads the Scenario
- Determines the Domain within the Scenario to generate data for
- Toggles off any Receivers associated to the Domain
- Adds the GenRocket SimpleMapReceiver to the Domain so it can produce the data in memory
- Sets the Domains loopCount to 1 or to a given number if the loopCount is greater than 1
- Executes the GenRocket Runtime Engine which generates the test data
- Converts the test data generated to JSON
- Passes the generated data back to the calling client of the connected socket
When the inMemorValue is false, the following actions take place:
- Locates and loads the Scenario
- Determines the Domain within the Scenario to generate data for
- Loads all Receivers
- Initializes all Domain loopCounts
- Executes the GenRocket Runtime Engine which generates the test data
GenRocket Realtime Engine Response Payload
When the GenRocket Realtime Server's inMemory parameter is set to true, the generated test data for the Domain specified by the scenarioDomain parameter is passed back to the calling client over the socket as JSON.
Example Payload Response
{ "responseType": "data", "response": [ { "id": "10000", "firstName": "Reina", "lastName": "Thiel", "username": "user10000", "emailAddress": "user10000@email.com", "accountName": "AccountWigit10000" }, { "id": "10001", "firstName": "Leona", "lastName": "Dow", "username": "user10001", "emailAddress": "user10001@email.com", "accountName": "AccountWigit10001" } ] }