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

  1. From the Simulator tab in your interactive channel, click Create an advanced scenario in the Scenario palette.
  2. On the General tab, add a name and description for the scenario.
  3. 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.
  4. Click Add API to select a startSession, getOffers, postEvent, getProfile, or endSession method to your scenario.
  5. Add a startSession method.
    1. Select an audience level from the drop-down list.
    2. Select an audience ID.

      You can either enter an audience ID manually or search for an audience ID.

      To use the search option to search your profile table for the audience ID, click . Click Add condition to specify search criteria. If you add more than one condition, your conditions are treated as AND conditions in your search results. Click Find to populate the results for your search criteria. From the Select display column tab, you can choose specific columns to see in your search results. When you select or deselect an attribute, the search results table is updated immediately. Highlight the record that matches your criteria and click Select. This audience ID is added to your scenario.

      The simulator uses the server and profile database defined in Campaign | partitions | partition[n] | Interact | serverGroups | [serverGroup set for Simulator] | prodUserDataSource property to load profile records and perform audience ID searches. This prodUserDataSource should be configured the same as Interact | general | serverGroups | prodUseDataSource, so the audience ID that is set during scenario definition exists when the simulation runs. The profile table mapped in the Interactive Channel Summary tab from design time database should be a subset of the profile table in runtime database.

    3. Select the check box to rely on an existing session or to turn the debug flag on if you want to enable either of these options for the startSession method.
    4. Add parameters for the API. Enter a name and value for the parameter. You can also select predefined parameters from the Name drop-down list. Choose a type from the drop-down list. Click the check mark to add this parameter.
  6. 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.
  7. 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.
  8. Add a getProfile method. You do not need to configure this API.
  9. Add a endSession method. You do not need to configure this API.
  10. You can arrange the order of the APIs using the up and down arrows. You can add getOffers and postEvent 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.
  11. 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

  1. Open a scenario.
  2. Click Run.

Viewing the results after running the advanced scenario

Procedure

  1. To view the results, select the Simulation results.
    The results are shown in the same order as your APIs on the Scenario definition tab.
  2. 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.