Skip to main content
No Result Found
Connect & Get help from 6000+ developers on our Discord community. Ask the CommunityAsk the Community

Modules

Learn how to create and reuse common test steps across multiple tests using modules in Salesforce Test Automation.

Modules allow you to encapsulate and reuse common test steps across multiple tests in Salesforce Test Automation. By creating modules, you can build reusable workflows that streamline test creation and maintenance.

Key benefits of using modules:

  • Reusability: Create once, use across multiple tests
  • Efficiency: Reduce test creation time by importing existing modules
  • Consistency: Ensure uniform execution of common workflows

Example use cases

Modules are ideal for repetitive workflows that appear across multiple tests:

  • Navigation sequences: Navigate through multiple pages or screens to reach a specific state
  • Form filling: Complete standard forms with common field values

Create a module

You can create modules from existing test steps during test creation or editing.

To create a module:

  1. In the test recorder, record or add the steps you want to include in the module.
  2. Select the steps you want to convert into a module by checking the checkbox next to each step.
  3. Click Create Module in the toolbar.

    The Create Module button in the test recorder toolbar

  4. In the Create module dialog, enter a descriptive name for your module.

    The Create module dialog showing module name input and selected steps

  5. Review the selected steps displayed in the dialog (for example, “2 steps selected”).
  6. Click Create.

The selected steps are now converted into a module and can be reused across other tests. The module appears in your test with a module icon, indicating it contains reusable steps.

Add new action to your module

When building your test, you can add new test steps either within your main test flow or inside an imported module.

To add new action to you module:

  1. In the test recorder, click the + Add action icon where you want to insert an action.
  2. Click Add action inside module. A text editor appears. Enter the new step in plain language to update the module. The action menu showing options to add new action, add action inside module, and import module

Import a module

You can import existing modules into your tests to reuse common workflows.

To import a module:

  1. In the test recorder, click Enter new command below or click the + Add action icon where you want to insert the module.

    The action menu showing options to add new action, add action inside module, and import module

  2. Select Import module from the options menu.
  3. In the Import Module dialog, browse the list of available modules or use the search bar to find a specific module by name.

    The Import Module dialog showing available modules with search functionality

  4. Select the module you want to import. The dialog displays the module name and the number of steps it contains.
  5. Click the module to add it to your test at the selected position.

The imported module appears in your test steps with a module icon. You can expand the module to view its individual steps.

Edit or delete a module

You can only edit a module’s name and description from the Modules tab. You cannot modify the actions or steps inside a module from this tab. To update the steps within a module, open a test that uses the module and edit the steps there.

To edit or delete a module:

  1. You can open the test and edit the module directly within the test editor. Remember that any changes made to a module applies to all other tests that use the same module.
  2. Alternatively, go to the Modules section on the left bar of Salesforce Test Automation. It displays all the modules. It shows it is used in how many tests.
  3. Locate the module you want to edit or delete in the modules list.
  4. Click the three-dot menu (⋮) next to the module. The modules list in Salesforce Test Automation showing the three-dot menu open with Edit module and Delete module options.
  5. Choose from the following options:
    • Edit module: Opens the Module details dialog where you can update the module name and description. After making your changes, click Save. The Edit module dialog showing module name and description fields
    • Delete module: Removes the module. Confirm the deletion when prompted.

You cannot delete a module that is currently used in other tests. Before you can delete a module, ensure that no tests reference it. Check the USED IN column to see which tests use the module.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle