What is a Scenario?

A Scenario contains instructions that tell the GenRocket engine what synthetic data to generate and how much. Domains, Attributes, Generators, and Receivers are the building blocks for a Scenario. 


A Scenario allows you to define instructions for generating test data. These instructions are defined by doing the following:

  • Selecting one or more Domains to generate data.
  • Specifying how much data each Domain will generate.
  • Determining the sequence in which the Domains will generate their data.
  • Downloading the Scenario to a computer.
  • Executing the Scenario using the GenRocket Runtime Engine.


Note: Two or more Scenarios can be linked together (i.e., Scenario Chain), which is helpful when building data for complex data models. 


In This Article


Video Training

For a quick video tutorial, please take a second to watch the video provided below:


Scenario Example 1 - Domains with No Relationships

In this example, a Scenario has been created for a User Domain with no defined relationships. This will generate test data for that Domain only. 



Scenario Example 2 - Domains with Parent/Child Relationships

In this example, a Scenario has been created for an Address Domain. However, there are two more Domains. 

  • Department Domain - Parent of User Domain
  • User Domain - Parent of Address Domain
The Scenario will generate data for the Address Domain (Primary Domain) but will also have the Department and User Domains to maintain referential integrity. 



Primary Domain vs. Root Domain

  • Primary Domain - This is the Domain for which the Scenario has been createdThe Scenario will generate data for the Primary Domain. In the example below, the Scenario has been created for the Student Domain.


  • Root Domain - This is the very first parent in the hierarchy of the Domain for which the Scenario is created. In the example below, the Subject Domain is the Root Domain because it is the first parent in the hierarchy. 



    Note: If there is only one Domain in the Scenario, it will also be the Root Domain. 


No, but you can easily create different Scenarios for generating data for each of your Domains. 


Let's suppose you have two Domains that are related: User and Address. A user can have one to many addresses. If you want to generate data for both Domains while maintaining referential integrity, you will have to create two scenarios:

  1. UserScenario
  2. AddressScenario


Once you create your Scenarios you can use a Scenario Chain to generate all of the data with one Scenario file. Scenario Chains can also be combined into Scenario Chain Sets for generating more complex data. 

Do I need to create a Scenario for every Domain? 

It is best practice to create a Scenario for every Domain. This ensures a Scenario is available to generate test data for that Domain. 

However, sometimes a Parent Domain is only being used in the Child Domain's Scenario as a helping Domain to generate a required pattern. In this case, a Scenario is not needed for the helper Domain. It is only needed for the actual Domain that is being used to generate test data.


Are the number of Scenarios limited per Project Version? 

Technically, there are no limitations to the number of Scenarios, Scenario Chains, and Scenario Chain Sets you can have
within a given Project Version.


What sounds like limits are not truly limits; it's just a matter of packaging Scenarios in the following way:

  • A Scenario Chain may contain a maximum of 25 Scenarios.
    • That's 25 Scenarios that may be downloaded as one set of Scenarios and run in the sequence from the first
      entered Scenario to the last entered Scenario.

  • A Scenario Chain Set may contain a maximum of 25 Scenario Chains. 
    • That's 625 Scenarios that may be downloaded as one set of Scenarios and run in the sequence from the first
      entered Scenario Chain to the last entered Scenario Chain. 


Can relationships be defined at the Scenario level? 

When setting up the Project, Domain relationships should be defined at the Domain (Template) level. 

This can be done via the Domain Referencing Wizard or Manually through the Domain Dashboard.

Sometimes, the relationship defined at the Domain (Template) level does not precisely meet the needs of one or more 
Scenarios. Changing the relationship at the Template level affects all other Scenarios unless they are locked. 


You can modify the defined relationship at the Scenario level for a specific Scenario. This does not impact what has been set 
up at the Template level and only applies to that Scenario.

To do so, you may need to add other Domains as Scenario Domains and modify the parent (add/remove) for one or more of 
those Scenario Domains.
 

You can do this for one or multiple Scenarios. In the case of multiple Scenarios, you can chain them together to create a 
Scenario Chain for generating the test data. To see step-by-step instructions, click here


Once finished, you can also set up Test Data Cases for generating different volumes and data variations based on the 

defined relationships in the Scenario(s).


Can I map more than one output path per Scenario? 

Yes, you can achieve this by adding multiple Receivers to accommodate multiple output directories within a Domain. 

The Scenario will then execute these Receivers accordingly. 

Concepts and Additional Information

TopicDescription
Scenario DashboardLearn more about the Scenario Dashboard user interface.
Why can't I update the Loop Count Value from the Scenario?Learn more about why the loop count cannot be updated from a Scenario.
What are Scenario Variables?Learn more about Scenario Variables. 
What are Scenario Level Locks?Learn more about Scenario Level Locks
What is the Scenario Thread Engine?Learn more about the Scenario Thread Engine. 
What is a Scenario Chain?Learn more about Scenario Chains.
What is a Scenario Chain Set?Learn more about Scenario Chain Sets. 


Scenario "How-To" Articles

TopicDescription
How do I create a Scenario?Learn about the different ways a Scenario can be created. 
How do I use the Scenario Assignment Wizard?Learn how to create Scenarios for multiple Domains at one time. 
How to Define Parent/Child Relationships at the Scenario LevelLearn how relationships can be defined at the Scenario level to meet specific testing needs. 
How do I download multiple Scenarios at once?Learn how to batch-download Scenarios to your local machine.
How do I run a GenRocket Scenario?Learn how to generate test data with a basic Scenario. 
Terminate batch job (Y/N)?Learn how to terminate a batch job on Windows, Mac OSx, or Linux.
Managing Scenario StateLearn more about managing a Scenario's state. 
Windows: How to set Java Default Character Encoding to UTF-8Learn how to set Java Default Character Encoding for Windows.

Note: This is sometimes necessary when generating test data with special symbols.
Mac OS/Linux: How to set Java Default Character Encoding to UTF-8Learn how to set Java Default Character Encoding for Mac OSx or Linux.

Note: This is sometimes necessary when generating test data with special symbols.
Windows: How Do I Run GenRocket Scenarios via Jenkins?See a Windows example of running GenRocket Scenarios via Jenkins.
Mac OS/Linux: How Do I Run GenRocket Scenarios via Jenkins?See a Mac OSx/Linux example of running GenRocket Scenarios via Jenkins.