Skip to content
Sahi Pro Flowcharts is retired. These pages document the last release (v12) and are no longer updated. Go to the current documentation.Flowcharts is retired. Current docs
Get Free Trial
Sahi Pro Flowcharts is retired. These pages document the last release (v12) and are no longer updated. Go to the current documentation.

Repeatable Tests - Data Generator

We can create unique data for repeated execution using Data Generators.

We will find it fails if we run the user registration path we just created. It fails because the email ID was already registered (when we recorded it). To run the path repeatedly, we need to create a new email ID each time.

Let us add a data generator for the user’s email field.

  1. Click on any node of the flowchart > click on Automate > Go to Entities tab.

  2. Select $user entity on the left pane.

  3. Select email attribute on the left pane.

  4. Select the sub tab Data Generator
    Notice that Flowcharts has detected the value as an email and separated it into meaningful tokens like name, domain etc.
    You can add more names and domains to generate more emails.

  5. Of particular interest for us is the add-timestamp field. Let us set it to true.
    This will add a timestamp to the email and make it unique for each run.

    Email data generator

  6. Check the sample values by using the Refresh Preview button .

  7. Click on Save Entity.

Similarly, let us add a Text Data Generator to the user’s firstname.

  1. Select the attribute name: firstname

  2. Set the parameters as shown here :

    Text data generator for firstname

    • prefix: The text must start with the specified string
    • min-length: The minimum length of the text data
    • max-length: The maximum length of the text data
    • suffix: The text must end with the specified string
    • include-alphabet: Should the auto generated part of the data include alphabets or not
    • include-numeric: Should the auto generated part of the data include numeric values or not
    • add-timestamp: Should the auto generated part of the data include timestamp for uniqueness or not
    • is-encrypted: If true, the password will be generated in encrypted format. Otherwise, the generated password is in plaintext.
  3. Check the sample values by using the Refresh Preview button .

  4. Click on Save Entity button.

  1. Date: To generate date between the given range and in the desired format.

    Data generator: Date

    • From/To: Minimum and Maximum dates can be selected from the calendar icon.

    • Relative maximum and minimum dates can be set.

      • Example: To generate dates for next one year

      • From= today

      • To= tomorrow+365

        Similarly, ‘yesterday’ and ‘minus’ symbol can also be used.

    • format: Date format can be set such as dd-mm-yyyy.

  2. Number: To generate number based data/series with or without extra characters.

    Data generator: Number

    • prefix: Any alphabet, number or special character to put in the starting of the number
    • min-value/max-value: Range of the number
    • decimals: Number of decimal digits
    • separator: Character to use as a unit separator
    • decimal-separator: Character to use instead of dot for decimal numbers
    • suffix: Characters to add at the end of the number
  3. Boolean: To generate a value among true and false.

    Data generator: Boolean

    • default-value: Value can be chosen from the three options available in the list- random, false or true.
  4. Phone: To generate phone number with desired country or area code in given format.

    Data generator: Phone

    • formats: Type the phone number format along with the country/area code.
    • The symbol x can be used to generate random digit.
  5. Simple-text: To generate any text based data with an option to mask it.

    Data generator: Simple text

    • text: Provide a set of alphanumeric characters. The value gets hardcoded.
    • is-password: Set preference to mask the text on UI.
      • Once the is-password is set to true, the value in text field gets masked and can not be unmasked. If the is-password is changed back to false, the text field gets reset.
    • is-encrypted: If true, the given password will be stored in encrypted format. Otherwise, the password is stored in plaintext.
  6. List: To generate a list based on a given set. The list is generated based on the hierarchy of the other lists to which it is referring to. It can be understood with the help of an address entity. This entity consists of three attributes: country, state and city.

    1. Select country attribute and select Data Generator Type - list.

      • Type a few country names in values field.

      country attribute

    2. Select state attribute and select Data Generator Type - list.

      • Set the fields as follows:

      • sync-with: Select country

      • sync-items: Select a country name from the list.

      • values: Type few state names.

      • Enter few state names for each country.

      state attribute

    3. Select city attribute and select Data Generator Type - list.

      • Set the fields as follows:

      • sync-with: Select state

      • sync-items: Select a state name from the list. Select the state name from the next list.

      • values: Type a few city names.

      • Enter a few city names for each state under each country.

      city attribute

    4. Now, the data generator will generate a complete address where city, state and country are in sync.

Next: Positive Validations