Advanced scenario to test API combination for a single audience
Advanced scenarios can test startSession
, getOffers
,
postEvent
, getProfile
, and endSession
APIs. You can set a run sequence and add multiple getOffers
and
postEvent
APIs in a scenario. From the Simulation
results tab, you can view the run results for the APIs you added to your
scenario.
Creating an advanced scenario
Create an advanced scenario to test multiple API methods in design time to make sure they return the expected results.
Procedure
- From the Simulator tab in your interactive channel, click Create an advanced scenario in the Scenario palette.
- On the General tab, add a name and description for the scenario.
- On the Scenario definition tab, enter a session ID for the advanced scenario. The session ID is shared for all APIs. If you do not define a session ID, on is created in runtime and used in the API batch execution.
-
Click Add API to select a
startSession
,getOffers
,postEvent
,getProfile
, orendSession
method to your scenario. -
Add a
startSession
method. -
Add a
getOffers
method. Select a Zone from the drop-down list and add the Number of offers. If you do not add Number of offers, by default all offers assigned in strategy are returned. -
Add a
postEvent
method. Add an event name and parameters for this method. You can also select predefined parameters from the Name drop-down list. -
Add a
getProfile
method. You do not need to configure this API. -
Add a
endSession
method. You do not need to configure this API. -
You can arrange the order of the APIs using the up and down arrows. You can
add
getOffers
andpostEvent
more than once in a scenario and arrange them accordingly. You can also delete an API if you decide you do not want to include it in the scenario simulation. - Click Save to add this scenario to your saved scenarios. From Saved scenarios you can also edit, copy, or delete previously saved scenarios.
Running the advanced scenario
After saving the created scenario, you can test it by running the scenario.
About this task
- When a scenario is running, you can still browse or edit simulation scenarios, but you cannot run another scenario till the previous run is completed.
- You cannot run an unsaved scenario. If you create or edit a scenario, save the updates before you run the scenario. If you run an unsaved scenario, the system runs the previously saved scenario.
To run a scenrio, complete the following steps:
Procedure
- Open a scenario.
- Click Run.
Viewing the results after running the advanced scenario
Procedure
-
To view the results, select the Simulation
results.
The results are shown in the same order as your APIs on the Scenario definition tab.
-
To view the log results for your scenario run, select the
Log tab.
Only the log entries for the last scenario run is displayed. The logs displayed on this tab are the as same as those logged in interact.log, but this tab filters the logs by the session ID and the start timestamp of your simulation run. The level of logging is determined by interact_log4j.properties.