Sorry, we didn't find any relevant articles for you.

Send us your queries using the form below and we will get back to you with a solution.

How to update Domain loopCounts

Each Domain has a default Domain Variable titled global.domainname.loopCount, which is used to alter the amount of data generated (# of records) for the Domain. 
Use the instructions in this article to make the change at the Domain (Template) level, which cascades down to other levels (Scenarios, Test Data Cases, etc.).

This variable defaults to 1 when a Domain is created and can be altered in one of two ways at this level:

  1. Single Domain (Domain Dashboard)
  2. Bulk Update for Multiple Domains (Global Editing)

When should the loopCount value be changed?

  • Any time a user wants to generate more than 1 record of test data.

Where can the loopCount be changed?

Domain loopCounts can be changed at different levels based on needs. Choose the level that best matches your testing requirements for efficiency and flexibility.
  • Domain (Template) Level - Use this when you want to set a default number of records that will apply to all scenarios using the domain. This method is efficient when the record count should not change often across scenarios. Example: Generate 10 customer records every time data is generated.
     
  • Test Data Case Level (Recommended) - Select this level for the most flexibility. This is the preferred method for most testing workflows because you can define different test cases where Domains have their own loopCount values. Example: A unit test where the Domain needs to generate 50 records and a load test where the same Domain needs to generate 10,000 records.
     
  • Scenario Level - This level is specific to a single Scenario. Changing the loopCount at this level is best for specialized testing situations where Test Data Cases are not feasible. Example: Relationships have been changed at the Scenario level and unique record counts are needed for that particular Scenario. This is because relationships cannot be changed at the Test Data Case level. 

Steps for Changing Single Domain loopCount

For example, a tester needs to generate twenty-five user records. Since the User Domain defaults to ‘1’, they will need to change the loopCount to ‘25’ before generating the test data. The steps to do so are shown below:

Step 1: Click on the Domain within the Project Dashboard to access the Domain Dashboard.

Step 2: Click on the Pencil to change the value in the Domain Variables section of the Domain Dashboard.

Step 3: Enter the desired Value for the variable and click Save.

The new Value will appear in the Value column for the variable. In this example, the value has been changed from 1 to 25.

Steps for Domain loopCount Bulk Updates

Domain loopCounts can be updated from one location, eliminating the need to perform to select each Domain and perform the same repetitive steps to update each Domain's loopCount.  

Step 1: Expand the Global Editing menu in the Domain Dashboard.

Step 2: Select Edit Domains LoopCount

Step 3: loopCount updates can be performed in one of two ways:

(a) Use the Edit (Pencil) icon to make individual changes and select the Green Checkmark to save.

(b) Use the checkboxes to select multiple Domains, enter a value, and select Save.

Additional Helpful Articles

Link Description
Test Data Cases (or G-Cases) Shows how to change and randomize Domain loopCounts for Test Data Cases. These steps also apply when changing G-Questionnaire Domain loopCounts. 
Scenario Domains Explains what a Scenario Domain is in GenRocket. Use the Edit (Pencil) icon to make changes for a single Scenario Domain.
API Method DomainSetLoopCount Method for changing the loopCount via REST API call.
--api-file Override the Domain loopCount when running the Scenario. 
-api Override the Domain loopCount when running a Scenario using G-Repository.

Note: Certain Generators can also alter or set the loopCount at runtime. Here are some examples: