Documentation

Looking for something in particular?

Test Data Generation

Last Modified:

Requirements

A Salesforce OAuth connection (either Web Flow or JWT Flow) must be set up in the project.

Steps to Use

You can access this feature in Provar Automation

  1. Create a New Test Case using the OAuth Connection.
  1. Click on the Test Palette to access the Generate Test Data API located under the ProvarAI section.
  1. Drag and drop the API from the palette into the test case. The input parameters will then appear on the screen.

4. Select the OAuth Connection, the object for which the data will be generated, and the number of rows.

5. Users can select the fields from the “Configure the Test Step parameters” option.

6. A pop-up screen will appear, allowing you to select the fields you want to insert. After making your selections, click OK. If no fields are selected, then data will be generated for required fields by default.

NOTE: This dialog box shows all available fields from the fetched metadata. Some of these fields may not be visible in the UI. When selecting fields, be sure to pick only those visible in your UI.

7. You should be able to see the fields you selected in the Test Step parameters. Note: the fields can be left blank. If any value is entered, it will be ignored.

8. Run the test case. A test data file in .csv format will be generated within a few minutes. The file name will be displayed in the test runner logs.

9. To view the generated file, navigate to the Templates folder in the Navigator section. Right-click on the Templates folder and select Refresh.

10. Now, you will be able to see the generated files. Two files have been generated since two steps were added in the test case:

  • One file contains only the required fields (where the user did not select any fields).
  • The other file contains the selected fields.

You can refer to the file names in the test runner logs section for each test step.

11. This file can be used with the Apex Bulk API to upload bulk data to Salesforce. Since the file path is stored in the result variable, users can access it at runtime. First, generate the data, then use the result variable with the Apex Bulk API for data upload.

Note: This is an AI-powered feature, and the generated data may be incorrect in 5-10% of the cases.

  • By default, 10 rows of data will be generated if the user does not specify the number of rows.
  • A maximum of 1,000 rows can currently be generated.
  • If no fields are selected, data will be generated for the mandatory fields of the object.
  • The generated file will be stored in the Result Variable, with the file path set to templates\filename.csv.

The AI feature in Provar is disabled by default. You can enable or disable it using the -Dcom.provar.automation.ai.services.enabled flag by setting its value to either true or false. This flag can be configured in the Provar INI file or passed as an ANT argument for CI executions.

How to Configure the Flag in the Provar INI File:

For Windows:
  1. Navigate to the Provar installation folder: C:\Program Files\Provar
  2. Locate and open the provar.ini file using a text editor.
  3. Add the following entry to the file:arduinoCopy code
    -Dcom.provar.automation.ai.services.enabled=true (Replace true with false to disable the feature.)
  4. Save and close the file.
For MacOS:
  1. Navigate to the Provar application in the Applications folder.
  2. Right-click on the Provar application and select Show Package Contents.
  3. Open the Contents folder, then locate the provar.ini file inside the Eclipse folder.
  4. Open the provar.ini file using a text editor.
  5. Add the following entry to the file:arduinoCopy code
    -Dcom.provar.automation.ai.services.enabled=true (Replace true with false to disable the feature.)
  6. Save and close the file.

Example : 

If you experience any issues editing the provar.ini file, refer to this article.


Feedback

Was this article helpful for you?

2 people found this article helpful.

Documentation library

Trying to raise a case with our support team?

We use cookies to better understand how our website is used so we can tailor content for you. For more information about the different cookies we use please take a look at our Privacy Policy.

Scroll to Top