Skip to content

Quick Start Guide

kishansharma80 edited this page Jan 21, 2026 · 6 revisions

This is a smock-it’s quick guide to help you generate test data in just four simple steps.

Directory Structure

Before jumping into data generation, it's important to understand the directory structure that smock-it uses.

When you create a template, smock-it automatically generates the following directories where all related files and data are stored:

├── data_gen/ 
│   ├── templates/                # Stores your test data templates  
│   │   └── createAccount.json 
│   ├── output/                   # Stores the generated data output 
│   │   ├── CreateAccount_DI_Output.json  
│   │   ├── CreateAccount_CSV_Output.csv  
│   │   └── CreateAccount_JSON_Output.json

data_gen/ : This is the main directory where all smock-it ‘s configuration files will reside.

  • templates/ : Contains all your JSON templates for data generation.
  • output/ : Contains the output files in different formats (JSON, CSV, etc.) after data generation.

Step 1. Setting Up smock-it

Prerequisites

Make sure you have the following installed on your system before installing smock-it:

  • Salesforce CLI

  • Node.js (version 18.0.0 or later)

Install smock-it

To install the smock-it CLI plugin, run the following command in your terminal:

sf plugins install smock-it 

Verify the Installation

To confirm smock-it was installed successfully, run:

sf plugins

This command will list all installed plugins. You should see smock-it listed there.

Step 2. Create a Template

Templates are essential for generating test data, as they define the type of data Smock-it should generate. You can also set specific conditions within the template to tailor the output to your testing needs.

Creating a template is quick and straightforward. You can either build a template from scratch or generate a default one.

With the v4 release, Smock-it supports default templates for Health Cloud, TaskRay, CPQ, and Sales Process use cases.

Try Out a Default Template

You can generate default templates using the full flag.

sf smockit template init --default
sf smockit template init --salesprocess
sf smockit template init --taskray
sf smockit template init --cpq
sf smockit template init --healthcloud

To initialize all default templates at once, use:

sf smockit template init --all

These commands will skip the questionnaire and generate all default templates directly.

Create a Template from Scratch

To create customized templates using a questionnaire, use:

sf smockit template init

For more details on customized template creation, refer to the template init command.

Step 3. Authenticate your org.

After saving your template, the next step is to authenticate your Salesforce org. This allows smock-it to connect with your environment for validation and direct data insertion.

Run the following command to begin authentication:

sf org login web

This will open Salesforce’s login page, where you can securely log in with your credentials.

Note: smock-it never accesses your data. All authentication is handled securely through Salesforce.

Confirm Authentication Status

To confirm if the org is authenticated and and listed in your org list, run the following command:

sf org list

This will display a list of all the orgs you've authenticated, along with their status, in a box format.

Note: Org authentication is a mandatory step and cannot be skipped.

Step 4. Generate data.

With your org authenticated and the template configured, you're ready to generate data. Run the following command to begin the data generation process:

sf smockit data generate -t <template_name> -a <username_alias>

Data will be generated in the selected format (CSV, JSON, or DI).

In case you selected DI (Direct Insert) as the output format, the data will populate the fields directly in your Salesforce org.

The generated data will be saved in data_gen/output/ directory folder.

To learn more, check the Data Generate Command Guide.

Clone this wiki locally